onnxruntime/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.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

108 lines
3.3 KiB
YAML

parameters:
- name: buildConfig
displayName: Configuration to build
type: string
default: 'Release'
- name: buildSettings
displayName: Path to the build setting file
type: string
default: ''
- name: includedOpsConfig
displayName: Path to the included ops config file
type: string
default: ''
- name: artifactName
displayName: Artifact Name
type: string
default: ''
- name: job_name_suffix
displayName: Job name
type: string
default: ''
- name: publish_executables
# The executables will only be published if the publish_executables is set to "1"
displayName: Publish executables such as onnxruntime_perf_test, ...
type: string
default: '0'
- name: pool_name
displayName: Pool name
type: string
default: 'Linux-CPU'
- name: packageName
# now we can build onnxruntime or onnxruntime-mobile for Android, need specify it here
displayName: Package Name
type: string
default: 'onnxruntime-android'
jobs:
- job: Android_Java_API_AAR_Packaging_${{ parameters.job_name_suffix }}
timeoutInMinutes: 120
workspace:
clean: all
pool: ${{parameters.pool_name}}
variables:
artifacts_directory: $(Build.BinariesDirectory)/.artifacts
steps:
- checkout: self
clean: true
submodules: recursive
- task: CmdLine@2
displayName: Create artifacts directory
inputs:
script: |
# Create a folder for artifacts
mkdir -p $(artifacts_directory)
workingDirectory: $(Build.BinariesDirectory)
- template: 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
- template: set-version-number-variables-step.yml
- template: use-android-ndk.yml
- task: CmdLine@2
displayName: Build Android AAR Packages
inputs:
script: |
set -e -x
NDK_HOME=$(realpath $ANDROID_NDK_HOME)
mkdir $(Build.BinariesDirectory)/.build_settings
cp ${{parameters.buildSettings}} $(Build.BinariesDirectory)/.build_settings/build_settings.json
[ -f "${{parameters.includedOpsConfig}}" ] && \
cp ${{parameters.includedOpsConfig}} $(Build.BinariesDirectory)/.build_settings/include_ops_and_types.config
docker run --rm \
--volume $(Build.SourcesDirectory):/onnxruntime_src \
--volume $(Build.BinariesDirectory):/build \
--volume $ANDROID_HOME:/android_home \
--volume $NDK_HOME:/ndk_home \
--volume $(artifacts_directory):/home/onnxruntimedev/.artifacts \
--volume $(Build.BinariesDirectory)/.build_settings:/home/onnxruntimedev/.build_settings \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
-e BUILD_CONFIG=${{parameters.buildConfig}} \
-e ORT_VERSION=$(OnnxRuntimeVersion) \
-e PUBLISH_EXECUTABLES=${{parameters.publish_executables}} \
-e PACKAGE_NAME=${{parameters.packageName}} \
onnxruntimecpubuild \
/bin/bash /onnxruntime_src/tools/ci_build/github/android/build_aar_and_copy_artifacts.sh
workingDirectory: $(Build.SourcesDirectory)
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(artifacts_directory)'
artifactName: '${{parameters.artifactName}}'