mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-19 19:00:47 +00:00
104 lines
3.4 KiB
YAML
104 lines
3.4 KiB
YAML
# calls tools/ci_build/get_docker_image.py
|
|
|
|
parameters:
|
|
- name: Dockerfile
|
|
type: string
|
|
- name: Context
|
|
type: string
|
|
- name: DockerBuildArgs
|
|
type: string
|
|
default: ""
|
|
- name: Repository
|
|
type: string
|
|
- name: UseImageCacheContainerRegistry
|
|
type: boolean
|
|
default: true
|
|
- name: UsePipelineCache
|
|
type: boolean
|
|
default: false
|
|
- name: CheckOutManyLinux
|
|
type: boolean
|
|
default: false
|
|
- name: ScriptName
|
|
type: string
|
|
default: "tools/ci_build/get_docker_image.py"
|
|
- name: UpdateDepsTxt
|
|
type: boolean
|
|
default: true
|
|
- name: IMAGE_CACHE_DIR
|
|
type: string
|
|
default: $(Agent.TempDirectory)/docker
|
|
|
|
steps:
|
|
|
|
- ${{ if eq(parameters.UpdateDepsTxt, true)}}:
|
|
- template: download-deps.yml
|
|
|
|
- ${{ if eq(parameters.CheckOutManyLinux, true) }}:
|
|
- checkout: manylinux
|
|
- script: |
|
|
set -e -x
|
|
mv manylinux onnxruntime
|
|
mv onnxruntime ..
|
|
cd ..
|
|
rmdir $(Build.SourcesDirectory)
|
|
mv onnxruntime $(Build.SourcesDirectory)
|
|
displayName: "Move Manylinux source code to ORT folder"
|
|
# It makes the files in context keep consistent before and after docker build step.
|
|
- task: PythonScript@0
|
|
inputs:
|
|
scriptPath: $(Build.SourcesDirectory)/tools/ci_build/patch_manylinux.py
|
|
arguments: --dockerfile "${{ parameters.Dockerfile }}" --context "${{ parameters.Context }}"
|
|
pythonInterpreter: /usr/bin/python3
|
|
displayName: patch manylinux
|
|
|
|
- script: |
|
|
docker version
|
|
docker image ls
|
|
docker system df
|
|
docker info |grep '^\s* Docker Root'
|
|
df -h
|
|
displayName: Check Docker Images
|
|
|
|
- ${{ if eq(parameters.UseImageCacheContainerRegistry, true) }}:
|
|
- template: with-container-registry-steps.yml
|
|
parameters:
|
|
Steps:
|
|
- script: |
|
|
${{ parameters.ScriptName }} \
|
|
--dockerfile "${{ parameters.Dockerfile }}" \
|
|
--context "${{ parameters.Context }}" \
|
|
--docker-build-args "${{ parameters.DockerBuildArgs }}" \
|
|
--container-registry onnxruntimebuildcache \
|
|
--repository "${{ parameters.Repository }}"
|
|
displayName: "Get ${{ parameters.Repository }} image for ${{ parameters.Dockerfile }}"
|
|
ContainerRegistry: onnxruntimebuildcache
|
|
- ${{ if eq(parameters.UseImageCacheContainerRegistry, false) }}:
|
|
# the difference is no --container-registry
|
|
- template: with-container-registry-steps.yml
|
|
parameters:
|
|
Steps:
|
|
- script: |
|
|
${{ parameters.ScriptName }} \
|
|
--dockerfile "${{ parameters.Dockerfile }}" \
|
|
--context "${{ parameters.Context }}" \
|
|
--docker-build-args "${{ parameters.DockerBuildArgs }}" \
|
|
--repository "${{ parameters.Repository }}"
|
|
displayName: "Get ${{ parameters.Repository }} image for ${{ parameters.Dockerfile }}"
|
|
ContainerRegistry: onnxruntimebuildcache
|
|
|
|
- script: |
|
|
docker version
|
|
docker image ls
|
|
docker system df
|
|
df -h
|
|
displayName: Check Docker Images
|
|
|
|
- ${{ if and(eq(parameters.UpdateDepsTxt, true), or(eq(variables['System.CollectionId'], 'f3ad12f2-e480-4533-baf2-635c95467d29'),eq(variables['System.CollectionId'], 'bc038106-a83b-4dab-9dd3-5a41bc58f34c'))) }}:
|
|
- task: PythonScript@0
|
|
displayName: 'Update deps.txt'
|
|
inputs:
|
|
scriptPath: $(Build.SourcesDirectory)/tools/ci_build/replace_urls_in_deps.py
|
|
arguments: --new_dir /build/deps
|
|
workingDirectory: $(Build.BinariesDirectory)
|
|
pythonInterpreter: /usr/bin/python3
|