onnxruntime/tools/ci_build/github/azure-pipelines/binary-size-checks-pipeline.yml
Changming Sun 7b4ce0c1e1
Delete the build scripts that were copied from manylinux project (#12358)
1. Delete the build scripts that were copied from manylinux project. Use "git checkout" instead.
2. Update manylinux version to get python 3.11. Related issue: Python 3.11 support #12343
3. Change the cuda version of linux gpu build job of nuget packaging pipeline from cuda 11.4 to cuda 11.6 to match the TRT job within the same pipeline.. (A lot other places need be updated as well, but I'd prefer to put them in another PR)
4. Make dockerfile names static. For example, replace tools/ci_build/github/linux/docker/$(DockerFile) to tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cpu . The former one relies on a runtime variable $(DockerFile), Template Parameters are expanded early in processing a pipeline run when most variables are not available. It like C++ macros vs variables.
2022-07-29 18:24:19 -07:00

120 lines
4.6 KiB
YAML

# steps in this build:
# 1a. Android minimal baseline build (arm64-v8a, including no kernels, with exceptions disabled)
# 1b. Android minimal baseline build with debug info
parameters:
- name: DoBuildWithDebugInfo
displayName: Create additional build with debug information?
type: boolean
default: false
resources:
repositories:
- repository: manylinux
type: Github
endpoint: Microsoft
name: pypa/manylinux
ref: a8099af1b3e25f0489717ad9c4f9a2e25a8c5b36
jobs:
- job: BinarySizeChecks
timeoutInMinutes: 30
workspace:
clean: all
pool: Linux-CPU-2019
steps:
- checkout: self
clean: true
submodules: recursive
- template: templates/get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cpu
Context: tools/ci_build/github/linux/docker
DockerBuildArgs: "--build-arg BUILD_UID=$( id -u )"
Repository: onnxruntimecpubuild
- task: CmdLine@2
displayName: 1a. Build onnxruntime minimal baseline for Android arm64-v8a
inputs:
script: |
NDK_HOME=$(realpath $ANDROID_NDK_HOME)
BINARY_SIZE_THRESHOLD_IN_BYTES=1306224
docker run --rm \
--volume $(Build.SourcesDirectory):/onnxruntime_src \
--volume $(Build.BinariesDirectory):/build \
--volume $ANDROID_HOME:/android_home \
--volume $NDK_HOME:/ndk_home \
-e ALLOW_RELEASED_ONNX_OPSET_ONLY=1 \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
-e BUILD_SOURCEVERSION=$(Build.SourceVersion) \
-e BUILD_ID=$(Build.BuildId) \
-e BUILD_REASON=$(Build.Reason) \
-e BUILD_BRANCH=$(Build.SourceBranch) \
onnxruntimecpubuild \
/bin/bash /onnxruntime_src/tools/ci_build/github/linux/ort_minimal/build_minimal_ort_android_baseline_and_report_bin_size.sh \
-b /build/1a \
-t ${BINARY_SIZE_THRESHOLD_IN_BYTES}
workingDirectory: $(Build.SourcesDirectory)
- task: AzureCLI@2
displayName: 1a. Publish binary size data
# only publish size data for CI builds on master
condition: and(succeededOrFailed(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
azureSubscription: AIInfraBuild
scriptLocation: inlineScript
scriptType: bash
inlineScript: |
BINARY_SIZE_DATA_FILE="$(Build.BinariesDirectory)/1a/MinSizeRel/binary_size_data.txt"
if [[ ! -f "${BINARY_SIZE_DATA_FILE}" ]]; then
echo "File not found: ${BINARY_SIZE_DATA_FILE}"
exit 1
fi
/usr/bin/python3 -m pip install -r $(Build.SourcesDirectory)/tools/ci_build/github/windows/post_to_dashboard/requirements.txt && \
/usr/bin/python3 $(Build.SourcesDirectory)/tools/ci_build/github/windows/post_binary_sizes_to_dashboard.py \
--commit_hash=$(Build.SourceVersion) \
--size_data_file="${BINARY_SIZE_DATA_FILE}" \
--build_project=onnxruntime \
--build_id=$(Build.BuildId)
workingDirectory: '$(Build.BinariesDirectory)'
- task: PublishPipelineArtifact@1
displayName: 1a. Publish binary artifact
inputs:
targetPath: $(Build.BinariesDirectory)/1a/MinSizeRel/libonnxruntime.so
artifactName: AndroidMinimalBaselineBinary
- ${{ if parameters.DoBuildWithDebugInfo }}:
- task: CmdLine@2
displayName: 1b. Build onnxruntime minimal baseline for Android arm64-v8a with debug info
inputs:
script: |
NDK_HOME=$(realpath $ANDROID_NDK_HOME)
docker run --rm \
--volume $(Build.SourcesDirectory):/onnxruntime_src \
--volume $(Build.BinariesDirectory):/build \
--volume $ANDROID_HOME:/android_home \
--volume $NDK_HOME:/ndk_home \
-e ALLOW_RELEASED_ONNX_OPSET_ONLY=1 \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
-e BUILD_SOURCEVERSION=$(Build.SourceVersion) \
-e BUILD_ID=$(Build.BuildId) \
-e BUILD_REASON=$(Build.Reason) \
-e BUILD_BRANCH=$(Build.SourceBranch) \
onnxruntimecpubuild \
/bin/bash /onnxruntime_src/tools/ci_build/github/linux/ort_minimal/build_minimal_ort_android_baseline_and_report_bin_size.sh \
-b /build/1b \
-d
workingDirectory: $(Build.SourcesDirectory)
- task: PublishPipelineArtifact@1
displayName: 1b. Publish binary artifact
inputs:
targetPath: $(Build.BinariesDirectory)/1b/MinSizeRel/libonnxruntime.so
artifactName: AndroidMinimalBaselineDebugBinary
- template: templates/clean-agent-build-directory-step.yml