mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-28 03:20:58 +00:00
This PR adds infrastructure to automatically cache docker images used in CI builds in a container registry. Currently, build images are pulled from a container registry for some builds and built every time for others. The container registry requires maintenance to keep the images up to date and building images every time wastes build agent resources. With this change, a given build image can be looked up in a cache container registry and if present, pulled, and otherwise, built and pushed. The uniqueness of a build image is determined by a hash digest of the dockerfile, docker build context directory, and certain "docker build" options. This digest is part of the image tag in the cache container repository. The cache container registry will need to be cleaned up periodically. This is not automated yet.
71 lines
2.8 KiB
YAML
71 lines
2.8 KiB
YAML
parameters:
|
|
AgentPool : 'Linux-CPU'
|
|
JobName : 'Linux_CI_Dev'
|
|
SubmoduleCheckoutMode: ''
|
|
RunDockerBuildArgs: '-o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -x "--use_tvm --build_wheel"'
|
|
DoNodejsPack: 'false'
|
|
DoNugetPack: 'false'
|
|
NuPackScript: ''
|
|
ArtifactName: 'drop-linux'
|
|
TimeoutInMinutes: 120
|
|
# Controls whether unreleased onnx opsets are allowed. Default is set to 1
|
|
AllowReleasedOpsetOnly: '1'
|
|
# to inject strategy, you need to pass in the whole yaml structure -
|
|
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#strategies
|
|
# see example in orttraining-linux-gpu-ci-pipeline.yml
|
|
Strategy: ''
|
|
|
|
jobs:
|
|
- job: ${{ parameters.JobName }}
|
|
workspace:
|
|
clean: all
|
|
timeoutInMinutes: ${{ parameters.TimeoutInMinutes }}
|
|
variables:
|
|
ALLOW_RELEASED_ONNX_OPSET_ONLY: ${{ parameters.AllowReleasedOpsetOnly }}
|
|
pool: ${{ parameters.AgentPool }}
|
|
${{ if ne(parameters.Strategy, '') }}:
|
|
strategy:
|
|
${{ parameters.Strategy }}
|
|
steps:
|
|
- checkout: self
|
|
${{ if ne(parameters.SubmoduleCheckoutMode, '') }}:
|
|
submodules: ${{ parameters.SubmoduleCheckoutMode }}
|
|
- template: linux-set-variables-and-download.yml
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: '12.16.3'
|
|
- template: run-docker-build-steps.yml
|
|
parameters:
|
|
RunDockerBuildArgs: '${{ parameters.RunDockerBuildArgs }}'
|
|
- task: PublishTestResults@2
|
|
displayName: 'Publish unit test results'
|
|
inputs:
|
|
testResultsFiles: '**/*.results.xml'
|
|
searchFolder: '$(Build.BinariesDirectory)'
|
|
testRunTitle: 'Unit Test Run'
|
|
condition: succeededOrFailed()
|
|
- ${{ if eq(parameters['DoNugetPack'], 'true') }}:
|
|
- script: |
|
|
${{ parameters.NuPackScript }}
|
|
displayName: 'Create Artifacts'
|
|
- task: PublishPipelineArtifact@0
|
|
displayName: 'Publish Pipeline Artifact'
|
|
inputs:
|
|
artifactName: ${{ parameters.ArtifactName }}
|
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
|
- ${{ if eq(parameters['DoNodejsPack'], 'true') }}:
|
|
- script: |
|
|
npm pack
|
|
cp $(Build.SourcesDirectory)/nodejs/onnxruntime-*.tgz $(Build.ArtifactStagingDirectory)
|
|
cp -R $(Build.SourcesDirectory)/nodejs/prebuilds $(Build.ArtifactStagingDirectory)/prebuilds
|
|
workingDirectory: '$(Build.SourcesDirectory)/nodejs'
|
|
displayName: 'Create NPM Package'
|
|
- task: PublishPipelineArtifact@0
|
|
displayName: 'Publish Pipeline Artifact: ${{ parameters.ArtifactName }}'
|
|
inputs:
|
|
artifactName: ${{ parameters.ArtifactName }}
|
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
|
- template: component-governance-component-detection-steps.yml
|
|
parameters :
|
|
condition : 'succeeded'
|
|
- template: clean-agent-build-directory-step.yml
|