Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (55 sloc) 2.49 KB
# Build CI pipeline for ML.NET model, its trainer app and end-user WebAPI service
- master
# Microsoft hosted agent
vmImage: 'windows-2019'
# Custom self-hosted agent (Azure VM with Azure DevOps Agent)
# name: Default
buildConfiguration: 'Release'
- script: 'if not exist X:\ (net use X: \\\datasets /u:mlnetfilestorage $(mlnetfilestorage.key))'
displayName: 'Map disk drive to Azure Files share folder'
- script: dotnet build MLModel.Train/SentimentModel/SentimentModel.ConsoleApp/SentimentModel.ConsoleApp.csproj --configuration $(buildConfiguration)
displayName: 'Build Trainer Console App (dotnet build) $(buildConfiguration)'
- script: dotnet run --project MLModel.Train/SentimentModel/SentimentModel.ConsoleApp/SentimentModel.ConsoleApp.csproj --configuration $(buildConfiguration)
displayName: 'Train ML model (dotnet run)'
# Train running .dll instead of using 'dotnet run'
#- task: DotNetCoreCLI@2
# displayName: 'Train ML model (Task)'
# inputs:
# command: custom
# custom: SentimentModel.ConsoleApp.dll
# workingDirectory: MLModel.Train/SentimentModel/SentimentModel.ConsoleApp/bin/Release/netcoreapp2.1
- script: dotnet build MLModel.Train/UnitTests/UnitTests.csproj --configuration $(buildConfiguration)
displayName: 'Build Test project for ML Model (dotnet build) $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests using trained ML model'
command: test
projects: '**/UnitTests.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: CopyFiles@2
displayName: 'Copy ML model file from Trainer app to WebAPI app'
SourceFolder: 'MLModel.Train/SentimentModel/SentimentModel.Model'
Contents: ''
TargetFolder: 'Scalable.WebAPI/ML'
OverWrite: true
- script: dotnet build Scalable.WebAPI/Scalable.WebAPI.csproj --configuration $(buildConfiguration)
displayName: 'Build WebAPI service (dotnet build) $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Generate WebAPI binaries (dotnet publish)'
command: publish
publishWebProjects: false
projects: Scalable.WebAPI/Scalable.WebAPI.csproj
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
modifyOutputPath: false
- task: PublishPipelineArtifact@0
displayName: 'Publish WebAPI as pipeline artifact'
artifactName: MLNETWebAPI
targetPath: '$(Build.ArtifactStagingDirectory)'
You can’t perform that action at this time.