-
Notifications
You must be signed in to change notification settings - Fork 89
74 lines (74 loc) · 2.87 KB
/
custom-script-ci.yml
File metadata and controls
74 lines (74 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Custom script notebooks
# This workflow is triggered on pull request to the repository.
on:
pull_request:
branches:
- master
paths:
- 00_Setup_AML_Workspace.ipynb
- 01_Data_Preparation.ipynb
- Custom_Script/**
env:
SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}
RESOURCE_GROUP: ${{ secrets.RESOURCE_GROUP }}
WORKSPACE_PREFIX: "github-ci-ws"
WORKSPACE_REGION: ${{ secrets.WORKSPACE_REGION }}
AZUREML_SERVICE_PRINCIPAL_TENANT_ID: ${{ secrets.AZUREML_SERVICE_PRINCIPAL_TENANT_ID }}
AZUREML_SERVICE_PRINCIPAL_ID: ${{ secrets.AZUREML_SERVICE_PRINCIPAL_ID }}
AZUREML_SERVICE_PRINCIPAL_PASSWORD: ${{ secrets.AZUREML_SERVICE_PRINCIPAL_PASSWORD }}
PR_NUMBER: ${{ github.event.number }}
jobs:
setup-and-train:
name: Run custom script python notebooks
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade azureml-sdk azureml-opendatasets \
azureml-pipeline-steps jupyter matplotlib numpy pandas \
seaborn
- name: Convert notebooks to python
run: |
jupyter nbconvert --to script 00_Setup_AML_Workspace.ipynb
jupyter nbconvert --to script 01_Data_Preparation.ipynb
jupyter nbconvert --to script Custom_Script/02_CustomScript_Training_Pipeline.ipynb
jupyter nbconvert --to script Custom_Script/03_CustomScript_Forecasting_Pipeline.ipynb
- name: Login via Az module
uses: azure/login@v1.1
with:
creds: ${{secrets.AZURE_CREDENTIALS}}
enable-AzPSSession: true
- name: Setup workspace
uses: azure/powershell@v1
with:
inlineScript: |
$Env:WORKSPACE_NAME = "$Env:WORKSPACE_PREFIX-$Env:PR_NUMBER"
echo "************************************"
echo "Using workspace: $Env:WORKSPACE_NAME"
echo "************************************"
python 00_Setup_AML_Workspace.py
$resource = Get-AzResource -Name $Env:WORKSPACE_NAME -ResourceGroupName $Env:RESOURCE_GROUP
$expirationTime = (Get-Date).AddHours(24).ToUniversalTime()
New-AzTag -ResourceId $resource.id -Tag @{"expiresOn"=$expirationTime}
azPSVersion: 'latest'
- name: Data preparation
run: |
ipython 01_Data_Preparation.py
- name: Run training
run: |
cd Custom_Script
python 02_CustomScript_Training_Pipeline.py
- name: Run prediction
run: |
cd Custom_Script
python 03_CustomScript_Forecasting_Pipeline.py