Skip to content

Instantly share code, notes, and snippets.

@julie-ng
Created July 2, 2019 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julie-ng/975439ec0b8c98a2b8f6e8e0b49f7329 to your computer and use it in GitHub Desktop.
Save julie-ng/975439ec0b8c98a2b8f6e8e0b49f7329 to your computer and use it in GitHub Desktop.
ML Azure Pipelines
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
versionSpec: 3.6
- script: |
pip install flake8
pip install flake8_formatter_junit_xml
flake8 --format junit-xml --output-file $(Build.BinariesDirectory)/flake8_report.xml --exit-zero --ignore E111
displayName: 'Check code quality'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '$(Build.BinariesDirectory)/*_report.xml'
testRunTitle: 'Publish test results'
- task: AzureCLI@1
inputs:
azureSubscription: 'ML'
scriptLocation: 'inlineScript'
inlineScript: 'az extension add -n azure-cli-ml'
workingDirectory: 'model-training'
- task: AzureCLI@1
inputs:
azureSubscription: 'ML'
scriptLocation: 'inlineScript'
inlineScript: 'az ml folder attach -w sahilWorkspace -g ML'
workingDirectory: ''
- task: AzureCLI@1
inputs:
azureSubscription: 'ML'
scriptLocation: 'inlineScript'
inlineScript: 'az ml computetarget create amlcompute -n mycomputetarget --min-nodes 1 --max-nodes 1 -s STANDARD_D3_V2'
workingDirectory: 'model-training'
- task: AzureCLI@1
inputs:
azureSubscription: 'ML'
scriptLocation: 'inlineScript'
inlineScript: 'az ml run submit-script -c sklearn -e test -d training-env.yml train-sklearn.py'
workingDirectory: 'model-training'
- task: AzureCLI@1
inputs:
azureSubscription: 'ML'
scriptLocation: 'inlineScript'
inlineScript: 'az ml model register -n mymodel -p sklearn_regression_model.pkl -t model.json'
workingDirectory: 'model-deployment'
- task: AzureCLI@1
inputs:
azureSubscription: 'ML'
scriptLocation: 'inlineScript'
inlineScript: 'az ml computetarget delete -n mycomputetarget'
workingDirectory: ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment