onnxruntime/tools/ci_build/github/azure-pipelines/orttraining-linux-gpu-perf-test-ci-pipeline.yml
Edward Chen 71e7c2b423
Cache build docker images in container registry. (#5811)
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.
2020-11-17 17:02:24 -08:00

74 lines
2.7 KiB
YAML

trigger: none
jobs:
- job: Onnxruntime_Linux_GPU_Training_Perf_Test
timeoutInMinutes: 120
variables:
- group: 'ortperf' # variable group
steps:
- checkout: self
clean: true
submodules: recursive
- template: templates/run-docker-build-steps.yml
parameters:
RunDockerBuildArgs: >
-o ubuntu16.04 -d gpu -r $(Build.BinariesDirectory)
-t onnxruntime_perf_test_image
-x "
--config RelWithDebInfo
--enable_training
--update --build
"
DisplayName: 'Build performance tests'
- script: >
docker run --gpus all --rm --name onnxruntime-gpu-perf
--volume $(Build.SourcesDirectory):/onnxruntime_src
--volume $(Build.BinariesDirectory):/build
--volume /bert_ort/bert_models:/build/bert_models:ro
--volume /bert_data:/build/bert_data:ro
-e NIGHTLY_BUILD onnxruntime_perf_test_image
/usr/bin/python3.6 /onnxruntime_src/orttraining/tools/ci_test/run_bert_perf_test.py
--binary_dir /build/RelWithDebInfo
--training_data_root /build/bert_data
--model_root /build/bert_models
displayName: 'Run bert performance tests'
- script: >
docker run --gpus all --rm --name onnxruntime-gpu-perf
--volume $(Build.SourcesDirectory):/onnxruntime_src
--volume $(Build.BinariesDirectory):/build
--volume /bert_ort/gpt2_models:/build/gpt2_models:ro
--volume /bert_data/gpt2_data:/build/gpt2_data:ro
-e NIGHTLY_BUILD onnxruntime_perf_test_image
/usr/bin/python3.6 /onnxruntime_src/orttraining/tools/ci_test/run_gpt2_perf_test.py
--binary_dir /build/RelWithDebInfo
--training_data_root /build/gpt2_data
--model_root /build/gpt2_models
displayName: 'Run gpt-2 performance tests'
# generate jdbc.properties
- script: >
mkdir -p $(Build.SourcesDirectory)/tools/perf_util/src/main/resources &&
printf "url=jdbc:mysql://onnxruntimedashboard.mysql.database.azure.com/onnxruntime?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8\nuser=powerbi@onnxruntimedashboard\npassword_env=ORT_PERF_PASSWORD"
> $(Build.SourcesDirectory)/tools/perf_util/src/main/resources/jdbc.properties
displayName: 'Create resource file'
- script: >
mvn package
displayName: 'Maven build'
workingDirectory: $(Build.SourcesDirectory)/tools/perf_util
# process json files
- script: >
java -cp target/send_perf_metrics-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.msft.send_perf_metrics.App "$(Build.SourcesDirectory)/orttraining/tools/ci_test/results"
env:
ORT_PERF_PASSWORD: $(ortperf)
displayName: 'Populate perf metrics'
workingDirectory: $(Build.SourcesDirectory)/tools/perf_util
- template: templates/clean-agent-build-directory-step.yml