diff --git a/.pipelines/ci.yml b/.pipelines/ci.yml index 3fd4da7b4..90632866f 100644 --- a/.pipelines/ci.yml +++ b/.pipelines/ci.yml @@ -619,10 +619,10 @@ stages: overwriteExistingFiles: true displayName: Unpack ONNXRuntime package. - - template: ../tools/ci_build/github/azure-pipeline/templates/get-docker-image-steps.yml + - template: templates/get-docker-image-steps.yml parameters: - Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6 - Context: tools/ci_build/github/linux/docker + Dockerfile: tools/ci_build/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6 + Context: tools/ci_build/docker DockerBuildArgs: "--build-arg BUILD_UID=$( id -u )" Repository: onnxruntime-extensionscuda11build UpdateDepsTxt: false diff --git a/tools/ci_build/github/azure-pipeline/templates/get-docker-image-steps.yml b/.pipelines/templates/get-docker-image-steps.yml similarity index 99% rename from tools/ci_build/github/azure-pipeline/templates/get-docker-image-steps.yml rename to .pipelines/templates/get-docker-image-steps.yml index 80c63755c..4d5fdf615 100644 --- a/tools/ci_build/github/azure-pipeline/templates/get-docker-image-steps.yml +++ b/.pipelines/templates/get-docker-image-steps.yml @@ -66,4 +66,4 @@ steps: command: logout addPipelineData: false displayName: Log out of container registry - condition: and(always(), ne(variables['System.PullRequest.IsFork'], 'True')) + condition: and(always(), ne(variables['System.PullRequest.IsFork'], 'True')) \ No newline at end of file diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6 b/tools/ci_build/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6 similarity index 97% rename from tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6 rename to tools/ci_build/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6 index dadfc3ab3..fb0545798 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6 +++ b/tools/ci_build/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6 @@ -25,7 +25,7 @@ RUN apt-get install -y --no-install-recommends \ ln -s /usr/bin/python3 python &&\ ln -s /usr/bin/pip3 pip; -RUN pip install --upgrade pip +RUN pip install --upgrade pip RUN pip install setuptools>=68.2.2 RUN pip3 install cmake==3.28.4 @@ -46,5 +46,4 @@ FROM base as final ARG BUILD_USER=onnxruntimedev ARG BUILD_UID=1000 RUN adduser --gecos 'onnxruntime Build User' --disabled-password $BUILD_USER --uid $BUILD_UID -USER $BUILD_USER - +USER $BUILD_USER \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipeline/android_packaging.yml b/tools/ci_build/github/azure-pipeline/android_packaging.yml deleted file mode 100644 index 5c7ada404..000000000 --- a/tools/ci_build/github/azure-pipeline/android_packaging.yml +++ /dev/null @@ -1,110 +0,0 @@ -# packaging pipeline for onnxruntime-extensions Android AAR package - -trigger: none - -resources: - repositories: - - repository: 1esPipelines - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release - -extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - parameters: - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - sdl: - sourceAnalysisPool: - name: onnxruntime-Win-CPU-2022 - os: windows - policheck: - enabled: true - break: true # always break the build on policheck issues. You can disable it by setting to 'false' - exclusionsFile: '$(Build.SourcesDirectory)\.config\policheck_exclusions.xml' - stages: - - stage: Stage - jobs: - - job: AndroidPackaging - timeoutInMinutes: 150 - variables: - buildConfig: Release - templateContext: - outputs: - - output: pipelineArtifact - path: '$(Build.ArtifactStagingDirectory)' - artifact: onnxruntime-extensions-android-aar - steps: - - task: UsePythonVersion@0 - inputs: - disableDownloadFromRegistry: true - versionSpec: "3.12" - addToPath: true - architecture: "x64" - displayName: "Use Python 3.12" - - - task: JavaToolInstaller@0 - displayName: Use jdk 17 - inputs: - versionSpec: "17" - jdkArchitectureOption: "x64" - jdkSourceOption: "PreInstalled" - - - script: brew install coreutils ninja - displayName: Install coreutils and ninja - - - template: tools/ci_build/github/azure-pipeline/templates/install-appcenter.yml@self - - - script: | - python ./tools/gen_selectedops.py ./tools/android/package_ops.config - displayName: "Generate selected ops CMake file" - - - bash: | - set -e -x - - python ./tools/android/build_aar.py \ - --output_dir $(Build.BinariesDirectory)/android_aar \ - --config $(buildConfig) \ - -- \ - --one_cmake_extra_define OCOS_ENABLE_SELECTED_OPLIST=ON - - VERSION=$(cat ./version.txt) - AAR_PATH="$(Build.BinariesDirectory)/android_aar/aar_out/$(buildConfig)/com/microsoft/onnxruntime/onnxruntime-extensions-android/${VERSION}/onnxruntime-extensions-android-${VERSION}.aar" - - # Do not output ##vso[] commands with `set -x` or they may be parsed again and include a trailing quote. - set +x - echo "##vso[task.setvariable variable=ORT_EXTENSIONS_AAR_PATH]${AAR_PATH}" - displayName: Build onnxruntime-extensions AAR package - - - template: tools/ci_build/github/azure-pipeline/templates/run-with-android-emulator-steps.yml@self - parameters: - steps: - - - bash: | - set -e -x - - cp -r $(Build.SourcesDirectory)/java/src/test/android $(Build.BinariesDirectory)/android_test - - cd $(Build.BinariesDirectory)/android_test - - ./gradlew connectedDebugAndroidTest --no-daemon -DortExtensionsAarLocalPath="${ORT_EXTENSIONS_AAR_PATH}" - displayName: Build and run onnxruntime-extensions Android test with Android Emulator - - - bash: | - set -e -x - - AAR_DIR=$(dirname "${ORT_EXTENSIONS_AAR_PATH}") - ARTIFACTS_STAGING_DIR="$(Build.ArtifactStagingDirectory)" - - cp ${ORT_EXTENSIONS_AAR_PATH} ${ARTIFACTS_STAGING_DIR} - cp ${AAR_DIR}/*-javadoc.jar ${ARTIFACTS_STAGING_DIR} - cp ${AAR_DIR}/*-sources.jar ${ARTIFACTS_STAGING_DIR} - cp ${AAR_DIR}/*.pom ${ARTIFACTS_STAGING_DIR} - - displayName: "Assemble artifacts" - - - template: tools/ci_build/github/azure-pipeline/templates/component-governance-component-detection-steps.yml@self - parameters : - condition : 'succeeded' diff --git a/tools/ci_build/github/azure-pipeline/ios_packaging.yml b/tools/ci_build/github/azure-pipeline/ios_packaging.yml deleted file mode 100644 index 497a74265..000000000 --- a/tools/ci_build/github/azure-pipeline/ios_packaging.yml +++ /dev/null @@ -1,218 +0,0 @@ -# packaging pipeline for iOS CocoaPods package - -parameters: -- name: IsReleaseBuild - displayName: "Is this a release build?" - type: boolean - default: false - -trigger: none - -resources: - repositories: - - repository: 1esPipelines - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release - -extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - parameters: - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - sdl: - sourceAnalysisPool: - name: onnxruntime-Win-CPU-2022 - os: windows - policheck: - enabled: true - break: true # always break the build on policheck issues. You can disable it by setting to 'false' - exclusionsFile: '$(Build.SourcesDirectory)\.config\policheck_exclusions.xml' - - stages: - - stage: Stage - jobs: - - job: IosPackaging - displayName: "iOS Packaging" - timeoutInMinutes: 180 - templateContext: - outputs: - - output: pipelineArtifact - path: '$(Build.ArtifactStagingDirectory)' - artifact: ios_packaging_artifacts - steps: - - task: InstallAppleCertificate@2 - inputs: - certSecureFile: '$(ios_signing_certificate_name)' - certPwd: '$(ios_signing_certificate_password)' - keychain: 'temp' - name: installSigningCertificate - displayName: "Install ORT Mobile Test Signing Certificate" - - - task: InstallAppleProvisioningProfile@1 - inputs: - provProfileSecureFile: '$(ios_provision_profile_name)' - removeProfile: true - name: installProvisioningProfile - displayName: "Install ORT Mobile Test Provisioning Profile" - - - template: tools/ci_build/github/azure-pipeline/templates/use-xcode-version.yml@self - - - task: UsePythonVersion@0 - inputs: - disableDownloadFromRegistry: true - versionSpec: "3.12" - addToPath: true - architecture: "x64" - - - script: | - python -m pip install cmake - displayName: "Install CMake" - - - template: tools/ci_build/github/azure-pipeline/templates/set-package-version-variable-step.yml@self - parameters: - IsReleaseBuild: ${{ parameters.IsReleaseBuild }} - PackageVersionVariableName: ORT_EXTENSIONS_POD_VERSION - - - script: | - python ./tools/gen_selectedops.py ./tools/ios/package_ops.config - displayName: "Generate selected ops CMake file" - - - script: | - python ./tools/ios/build_xcframework.py \ - --output_dir $(Build.BinariesDirectory)/xcframework_out \ - --config Release \ - -- \ - --one_cmake_extra_define OCOS_ENABLE_SELECTED_OPLIST=ON - displayName: "Build xcframework" - - - script: | - cat $(Build.BinariesDirectory)/xcframework_out/xcframework_info.json - displayName: 'List xcframework_info.json file contents' - - - script: | - python ./tools/ios/assemble_pod_package.py \ - --staging-dir $(Build.BinariesDirectory)/pod_staging \ - --xcframework-output-dir $(Build.BinariesDirectory)/xcframework_out \ - --pod-version ${ORT_EXTENSIONS_POD_VERSION} - displayName: "Assemble pod" - - - script: | - pod lib lint - displayName: "Lint pod" - workingDirectory: $(Build.BinariesDirectory)/pod_staging - - - script: | - ORT_EXTENSIONS_LOCAL_POD_PATH=$(Build.BinariesDirectory)/pod_staging \ - pod install - displayName: "Install pods for OrtExtensionsUsage" - workingDirectory: $(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage - - - script: | - xcrun xcodebuild \ - -configuration Debug \ - -parallel-testing-enabled NO \ - -workspace $(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/OrtExtensionsUsage.xcworkspace \ - -scheme OrtExtensionsMacOSUsage \ - -destination "platform=macos" \ - test CODE_SIGNING_ALLOWED=NO - displayName: "Build and test OrtExtensionsUsage for MacOS" - - # Xcode tasks require absolute paths because it searches for the paths and files relative to - # the root directory and not relative to the working directory - - task: Xcode@5 - inputs: - actions: 'build-for-testing' - configuration: 'Debug' - xcWorkspacePath: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/OrtExtensionsUsage.xcworkspace' - sdk: 'iphoneos' - scheme: 'OrtExtensionsUsage' - signingOption: 'manual' - signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)' - provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)' - args: '-derivedDataPath $(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/DerivedData' - workingDirectory: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/' - useXcpretty: false # xcpretty can hide useful error output so we will disable it - displayName: 'Build OrtExtensionsUsage' - - - script: | - zip -r --symlinks $(Build.ArtifactStagingDirectory)/package_tests.zip OrtExtensionsUsageUITests-Runner.app - workingDirectory: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/DerivedData/Build/Products/Debug-iphoneos' - displayName: "Create .zip file of the tests" - - - script: | - python $(Build.SourcesDirectory)/test/ios/generate_ipa_export_options_plist.py \ - --dest_file "exportOptions_iphoneos.plist" \ - --apple_team_id $(APPLE_TEAM_ID) \ - --provisioning_profile_uuid $(APPLE_PROV_PROFILE_UUID) - workingDirectory: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/' - displayName: "Generate .plist file for the .ipa file" - - # Task only generates an .xcarchive file if the plist export options are included, but does - # not produce an IPA file. - # Source code: https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/XcodeV5/xcode.ts - - task: Xcode@5 - inputs: - actions: 'archive' - xcWorkspacePath: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/OrtExtensionsUsage.xcworkspace' - packageApp: true - archivePath: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/' - exportOptions: 'plist' - exportOptionsPlist: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/exportOptions_iphoneos.plist' - configuration: 'Debug' - sdk: 'iphoneos' - scheme: 'OrtExtensionsUsage' - args: '-derivedDataPath $(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/DerivedData' - workingDirectory: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/' - useXcpretty: false - displayName: 'Create archive for the .ipa file' - - # Use script step because exporting the .ipa file using the Xcode@5 task was too brittle (Xcode@5 is designed - # to handle both the .xcarchive step and the .ipa step in the same step -- ran into countless issues with signing - # and the .plist file) - - script: | - xcodebuild -exportArchive \ - -archivePath OrtExtensionsUsage.xcarchive \ - -exportOptionsPlist exportOptions_iphoneos.plist \ - -exportPath $(Build.ArtifactStagingDirectory)/test_ipa - workingDirectory: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/' - displayName: "Create .ipa file" - - - script: | - set -e -x - pip install requests - python $(Build.SourcesDirectory)/tools/upload_and_run_browserstack_tests.py \ - --test_platform xcuitest \ - --app_path "$(Build.ArtifactStagingDirectory)/test_ipa/OrtExtensionsUsage.ipa" \ - --test_path "$(Build.ArtifactStagingDirectory)/package_tests.zip" \ - --devices "iPhone 15-17" - displayName: Run E2E tests using Browserstack - workingDirectory: '$(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage/' - timeoutInMinutes: 15 - env: - BROWSERSTACK_ID: $(browserstack_username) - BROWSERSTACK_TOKEN: $(browserstack_access_key) - - - script: | - set -e -x - - POD_STAGING_DIR="$(Build.BinariesDirectory)/pod_staging" - ARTIFACTS_STAGING_DIR="$(Build.ArtifactStagingDirectory)" - POD_NAME="onnxruntime-extensions-c" - POD_ARCHIVE_BASENAME="pod-archive-${POD_NAME}-${ORT_EXTENSIONS_POD_VERSION}.zip" - PODSPEC_BASENAME="${POD_NAME}.podspec" - - pushd ${POD_STAGING_DIR} - - # assemble the files in the artifacts staging directory - zip -vry ${ARTIFACTS_STAGING_DIR}/${POD_ARCHIVE_BASENAME} * --exclude ${PODSPEC_BASENAME} - cp ${PODSPEC_BASENAME} ${ARTIFACTS_STAGING_DIR}/${PODSPEC_BASENAME} - - popd - displayName: "Assemble artifacts" - - - template: tools/ci_build/github/azure-pipeline/templates/component-governance-component-detection-steps.yml@self - parameters : - condition : 'succeeded' diff --git a/tools/ci_build/github/azure-pipeline/java_packaging.yml b/tools/ci_build/github/azure-pipeline/java_packaging.yml deleted file mode 100644 index 9e8e6234c..000000000 --- a/tools/ci_build/github/azure-pipeline/java_packaging.yml +++ /dev/null @@ -1,212 +0,0 @@ -parameters: -- name: JavaPackagingandPublishing - displayName: Package and Publish Java Package - type: boolean - default: true - -trigger: none - -resources: - repositories: - - repository: 1esPipelines - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release - -extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - parameters: - sdl: - sourceAnalysisPool: - name: onnxruntime-Win-CPU-2022 - os: windows - policheck: - enabled: true - break: true # always break the build on policheck issues. You can disable it by setting to 'false' - exclusionsFile: '$(Build.SourcesDirectory)\.config\policheck_exclusions.xml' - stages: - - stage: Java_Packaging_and_Publishing - jobs: - - job: Windows_CPU_Java_Packaging - pool: - name: onnxruntime-Win-CPU-2022 - os: windows - workspace: - clean: all - templateContext: - outputs: - - output: pipelineArtifact - path: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native' - artifact: WindowsBinaries - - steps: - - template: /.pipelines/templates/setup-maven-feed.yml@self - - - task: PowerShell@2 - displayName: 'Set version' - inputs: - targetType: 'inline' - script: | - $_ExtVersion=(cat version.txt) - echo "##vso[task.setvariable variable=OrtExtVersion;]$_ExtVersion" - workingDirectory: '$(Build.SourcesDirectory)' - - - script: | - call .\build.bat -DOCOS_BUILD_JAVA=ON - displayName: build the extensions java package - - - task: CopyFiles@2 - displayName: 'Copy Java Files for Windows Arch to Artifact Staging Directory' - inputs: - SourceFolder: 'out\Windows\java\build\libs' - TargetFolder: '$(Build.ArtifactStagingDirectory)' - - - script: | - cd $(Build.ArtifactStagingDirectory) - jar xvf onnxruntime-extensions-$(OrtExtVersion).jar - tree $(Build.ArtifactStagingDirectory) /f - displayName: Unpack JAR to sign DLL - - - template: tools/ci_build/github/azure-pipeline/templates/win-esrp-dll.yml@self - parameters: - FolderPath: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/win-x64' - DisplayName: 'Sign DLL' - DoEsrp: 'true' - - - template: tools/ci_build/github/azure-pipeline/templates/component-governance-component-detection-steps.yml@self - parameters : - condition : 'succeeded' - - - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 - displayName: 'Clean Agent Directories' - condition: always() - - - job: Linux_CPU_Java_Packaging - workspace: - clean: all - pool: - name: 'onnxruntime-Ubuntu2204-AMD-CPU' - os: 'linux' - templateContext: - outputs: - - output: pipelineArtifact - path: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native' - artifact: LinuxBinaries - - steps: - - template: /.pipelines/templates/setup-maven-feed.yml@self - - - task: PowerShell@2 - displayName: 'Set version' - inputs: - targetType: 'inline' - script: | - $_ExtVersion=(cat version.txt) - echo "##vso[task.setvariable variable=OrtExtVersion;]$_ExtVersion" - workingDirectory: '$(Build.SourcesDirectory)' - - - script: | - sh ./build.sh -DOCOS_BUILD_JAVA=ON - displayName: build the extensions java package - - - task: CopyFiles@2 - displayName: 'Copy Java Files for $(Agent.OS) Arch to Artifact Staging Directory' - inputs: - SourceFolder: 'out/$(Agent.OS)/RelWithDebInfo/java/build/libs' - TargetFolder: '$(Build.ArtifactStagingDirectory)' - - - script: | - cd $(Build.ArtifactStagingDirectory) - echo $(OrtExtVersion) - jar xvf onnxruntime-extensions-$(OrtExtVersion).jar - # tree $(Build.ArtifactStagingDirectory) /f - displayName: Unpack JAR - - - template: tools/ci_build/github/azure-pipeline/templates/component-governance-component-detection-steps.yml@self - parameters : - condition : 'succeeded' - - - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 - displayName: 'Clean Agent Directories' - condition: always() - - - job: MacOS_CPU_Java_Packaging - dependsOn: - - Windows_CPU_Java_Packaging - - Linux_CPU_Java_Packaging - workspace: - clean: all - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - templateContext: - inputs: - - input: pipelineArtifact - artifactName: WindowsBinaries - targetPath: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native' - - input: pipelineArtifact - artifactName: LinuxBinaries - targetPath: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native' - outputs: - - output: pipelineArtifact - path: '$(Build.ArtifactStagingDirectory)/drop' - artifact: drop-onnxruntime-extensions-java-cpu - - steps: - - template: /.pipelines/templates/setup-maven-feed.yml@self - - - task: PowerShell@2 - displayName: 'Set version' - inputs: - targetType: 'inline' - script: | - $_ExtVersion=(cat version.txt) - echo "##vso[task.setvariable variable=OrtExtVersion;]$_ExtVersion" - workingDirectory: '$(Build.SourcesDirectory)' - - - script: | - sh ./build.sh -DOCOS_BUILD_JAVA=ON - displayName: build the extensions java package - - - task: CopyFiles@2 - displayName: 'Copy Java Files for $(Agent.OS) Arch to Artifact Staging Directory' - inputs: - SourceFolder: 'out/$(Agent.OS)/RelWithDebInfo/java/build/libs' - TargetFolder: '$(Build.ArtifactStagingDirectory)' - - - script: | - cd $(Build.ArtifactStagingDirectory) - echo $(OrtExtVersion) - jar xvf onnxruntime-extensions-$(OrtExtVersion).jar - brew install tree - tree $(Build.ArtifactStagingDirectory) - displayName: Unpack JAR to view contents - - - script: | - brew install tree - tree $(Build.ArtifactStagingDirectory) - displayName: Print contents - - - script: | - cd $(Build.ArtifactStagingDirectory) - rm onnxruntime-extensions-$(OrtExtVersion).jar - jar cmf0 META-INF/MANIFEST.MF onnxruntime-extensions-$(OrtExtVersion).jar * - displayName: Combine and pack JAR with Windows, Linux and MacOS Binaries - - - script: | - cd $(Build.ArtifactStagingDirectory) - mkdir drop - cp onnxruntime-extensions-$(OrtExtVersion).jar drop/onnxruntime-extensions-$(OrtExtVersion).jar - cp onnxruntime-extensions-$(OrtExtVersion)-javadoc.jar drop/onnxruntime-extensions-$(OrtExtVersion)-javadoc.jar - cp onnxruntime-extensions-$(OrtExtVersion)-sources.jar drop/onnxruntime-extensions-$(OrtExtVersion)-sources.jar - cp META-INF/maven/com.microsoft.onnxruntime/onnxruntime-extensions/pom.xml drop/onnxruntime-extensions-$(OrtExtVersion).pom - displayName: Move files to a drop folder for publishing - - - template: tools/ci_build/github/azure-pipeline//templates/component-governance-component-detection-steps.yml@self - parameters : - condition : 'succeeded' - - - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 - displayName: 'Clean Agent Directories' - condition: always() diff --git a/tools/ci_build/github/azure-pipeline/nuget.yml b/tools/ci_build/github/azure-pipeline/nuget.yml deleted file mode 100644 index f8f0ae7f9..000000000 --- a/tools/ci_build/github/azure-pipeline/nuget.yml +++ /dev/null @@ -1,69 +0,0 @@ -parameters: -- name: DoCompliance - displayName: Run Compliance Tasks? - type: boolean - default: true - -- name: DoEsrp - displayName: Run code sign tasks? Must be true if you are doing an OnnxRuntime extensions release. - type: boolean - default: true - -- name: IsReleaseBuild - displayName: Is this a release build? Set it to true if you are doing an OnnxRuntime extensions release. - type: boolean - default: false - -- name: IsDummyPackage - displayName: Is this a build of Microsoft.ML.OnnxRuntime.Extensions.Dummy package that has no operators? - type: boolean - default: false - -- name: NugetVersionSuffix - displayName: Update nuget version suffix (e.g. alpha/beta/rc, only if publishing to nuget.org, otherwise leave as "none"). - type: string - default: none - -trigger: none - -resources: - repositories: - - repository: 1esPipelines - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release - -extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - parameters: - sdl: - sourceAnalysisPool: - name: onnxruntime-Win-CPU-2022 - os: windows - policheck: - enabled: true - break: true # always break the build on policheck issues. You can disable it by setting to 'false' - exclusionsFile: '$(Build.SourcesDirectory)\.config\policheck_exclusions.xml' - credscan: - enabled: false - - stages: - - ${{ if eq(parameters.IsDummyPackage, false) }}: - - template: templates/build-package-for-nuget.yml@self - parameters: - DoCompliance: ${{ parameters.DoCompliance }} - DoEsrp: ${{ parameters.DoEsrp }} - IsReleaseBuild: ${{ parameters.IsReleaseBuild }} - NugetVersionSuffix: ${{ parameters.NugetVersionSuffix }} - - - ${{ else }}: - - template: templates/build-package-for-nuget.yml@self - parameters: - DoCompliance: ${{ parameters.DoCompliance }} - DoEsrp: ${{ parameters.DoEsrp }} - IsReleaseBuild: ${{ parameters.IsReleaseBuild }} - NugetVersionSuffix: ${{ parameters.NugetVersionSuffix }} - IsDummyPackage: true - # set flags to do a build with no operators for the dummy package - OperatorSelectionFlags: '' - AdditionalBuildFlags: '--include_ops_by_config ./tools/ci_build/no_ops.config --skip_tests --cmake_extra_defines OCOS_ENABLE_CTEST=OFF' diff --git a/tools/ci_build/github/azure-pipeline/onnxruntime-extensions-official.yml b/tools/ci_build/github/azure-pipeline/onnxruntime-extensions-official.yml deleted file mode 100644 index b2c7c761f..000000000 --- a/tools/ci_build/github/azure-pipeline/onnxruntime-extensions-official.yml +++ /dev/null @@ -1,50 +0,0 @@ -parameters: # parameters are shown up in ADO UI in a build queue time -- name: 'debug' - displayName: 'Enable debug output' - type: boolean - default: false - -- name: ExtraEnv - displayName: 'Extra env variable set to CIBW_ENVIRONMENT, in form of "A=1 B=2 C=3"' - type: string - default: 'ExampleEnvVar=ON' - -variables: -- template: templates/common-variables.yml@self - parameters: - debug: ${{ parameters.debug }} - -trigger: none - -resources: - repositories: - - repository: 1esPipelines - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release - -extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - parameters: - sdl: - sourceAnalysisPool: - name: onnxruntime-Win-CPU-2022 - os: windows - tsa: - enabled: true - binskim: - enabled: true - targetPathPattern: '**\_extensions_pydll.*' # avoid scanning the 3rd party DLLs. - codeql: - compiled: - enabled: true - cadence: 10 - policheck: - enabled: true - break: true # always break the build on policheck issues. You can disable it by setting to 'false' - exclusionsFile: '$(Build.SourcesDirectory)\.config\policheck_exclusions.xml' - - stages: - - template: templates/windows-build-stage.yml@self - parameters: - CibwEnv: ${{ parameters.ExtraEnv }} diff --git a/tools/ci_build/github/azure-pipeline/templates/android-shared-lib-build.yml b/tools/ci_build/github/azure-pipeline/templates/android-shared-lib-build.yml deleted file mode 100644 index ba65d85c3..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/android-shared-lib-build.yml +++ /dev/null @@ -1,80 +0,0 @@ -# packaging pipeline for onnxruntime-extensions Android AAR in nuget package -parameters: -- name: AndroidABI - displayName: android abi,[arm64-v8a, x86_64, x86, armeabi-v7a] - values: - - 'x86_64' - - 'x86' - - 'arm64-v8a' - - 'armeabi-v7a' - type: string - -- name: JobSuffix - displayName: android abi has dash `-`, which can't be part of job name. - type: string - -- name: AdditionalBuildFlags - displayName: Additional build flags for /tools/android/build_aar.py - type: string - - -jobs: - - job: Android_C_API_Packaging_${{ parameters.JobSuffix }} - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - timeoutInMinutes: 120 - variables: - buildConfig: Release - templateContext: - outputs: - - output: pipelineArtifact - path: $(Build.ArtifactStagingDirectory) - artifact: onnxruntime-extensions-android-${{ parameters.AndroidABI }} - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: "3.12" - addToPath: true - architecture: "x64" - displayName: "Use Python 3.12" - - - task: JavaToolInstaller@0 - displayName: Use jdk 17 - inputs: - versionSpec: "17" - jdkArchitectureOption: "x64" - jdkSourceOption: "PreInstalled" - - - script: brew install coreutils ninja - displayName: Install coreutils and ninja - - - task: Bash@3 - displayName: 'Build android shared library' - inputs: - targetType: 'inline' - script: | - set -e -x - python ./tools/android/build_aar.py \ - --output_dir $(Build.BinariesDirectory)/android_so \ - --mode build_so_only \ - --abi ${{ parameters.AndroidABI }} \ - --config $(buildConfig) \ - -- \ - ${{parameters.AdditionalBuildFlags}} - workingDirectory: '$(Build.SourcesDirectory)' - - - bash: | - set -e -x - - SO_DIR=$(Build.BinariesDirectory)/android_so - ARTIFACTS_STAGING_DIR="$(Build.ArtifactStagingDirectory)" - mkdir ${ARTIFACTS_STAGING_DIR}/intermediates - cp -r ${SO_DIR}/intermediates/jnilibs ${ARTIFACTS_STAGING_DIR}/intermediates/ - - displayName: "Assemble artifacts" - - - template: component-governance-component-detection-steps.yml - parameters : - condition : 'succeeded' diff --git a/tools/ci_build/github/azure-pipeline/templates/build-package-for-android-aar.yml b/tools/ci_build/github/azure-pipeline/templates/build-package-for-android-aar.yml deleted file mode 100644 index d1c0d91df..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/build-package-for-android-aar.yml +++ /dev/null @@ -1,108 +0,0 @@ -# packaging pipeline for onnxruntime-extensions Android AAR package -parameters: -- name: IsReleaseBuild - displayName: "Is this a release build?" - type: boolean - default: false - -- name: AdditionalBuildFlags - displayName: Additional build flags for /tools/android/build_aar.py - type: string - -stages: -- stage: Android_Java_API_AAR_Packaging_Full - dependsOn: [] - jobs: - - template: android-shared-lib-build.yml - parameters: - AndroidABI: 'x86_64' - JobSuffix: 'x86_64' - AdditionalBuildFlags: ${{parameters.AdditionalBuildFlags}} - - template: android-shared-lib-build.yml - parameters: - AndroidABI: 'x86' - JobSuffix: 'x86' - AdditionalBuildFlags: ${{parameters.AdditionalBuildFlags}} - - template: android-shared-lib-build.yml - parameters: - AndroidABI: 'armeabi-v7a' - JobSuffix: 'armeabi_v7a' - AdditionalBuildFlags: ${{parameters.AdditionalBuildFlags}} - - template: android-shared-lib-build.yml - parameters: - AndroidABI: 'arm64-v8a' - JobSuffix: 'arm64_v8a' - AdditionalBuildFlags: ${{parameters.AdditionalBuildFlags}} - - job: Android_Java_API_AAR_Package_Publish_All - dependsOn: - - Android_C_API_Packaging_x86_64 - - Android_C_API_Packaging_x86 - - Android_C_API_Packaging_armeabi_v7a - - Android_C_API_Packaging_arm64_v8a - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - templateContext: - inputs: - - input: pipelineArtifact - artifactName: onnxruntime-extensions-android-x86_64 - targetPath: $(Build.BinariesDirectory)/android_aar - - input: pipelineArtifact - artifactName: onnxruntime-extensions-android-x86 - targetPath: $(Build.BinariesDirectory)/android_aar - - input: pipelineArtifact - artifactName: onnxruntime-extensions-android-armeabi-v7a - targetPath: $(Build.BinariesDirectory)/android_aar - - input: pipelineArtifact - artifactName: onnxruntime-extensions-android-arm64-v8a - targetPath: $(Build.BinariesDirectory)/android_aar - outputs: - - output: pipelineArtifact - path: $(Build.ArtifactStagingDirectory) - artifact: onnxruntime-extensions-android-aar - timeoutInMinutes: 120 - variables: - buildConfig: Release - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: "3.12" - addToPath: true - architecture: "x64" - displayName: "Use Python 3.12" - - task: JavaToolInstaller@0 - displayName: Use jdk 17 - inputs: - versionSpec: "17" - jdkArchitectureOption: "x64" - jdkSourceOption: "PreInstalled" - - - task: Bash@3 - displayName: 'build android aar' - inputs: - targetType: 'inline' - script: | - set -e -x - python ./tools/android/build_aar.py \ - --output_dir $(Build.BinariesDirectory)/android_aar \ - --mode pack_aar_only \ - --config $(buildConfig) - VERSION=$(cat ./version.txt) - AAR_PATH="$(Build.BinariesDirectory)/android_aar/aar_out/$(buildConfig)/com/microsoft/onnxruntime/onnxruntime-extensions-android/${VERSION}/onnxruntime-extensions-android-${VERSION}.aar" - - # Do not output ##vso[] commands with `set -x` or they may be parsed again and include a trailing quote. - set +x - echo "##vso[task.setvariable variable=ORT_EXTENSIONS_AAR_PATH]${AAR_PATH}" - workingDirectory: '$(Build.SourcesDirectory)' - - bash: | - set -e -x - - AAR_DIR=$(dirname "${ORT_EXTENSIONS_AAR_PATH}") - ARTIFACTS_STAGING_DIR="$(Build.ArtifactStagingDirectory)" - - cp ${ORT_EXTENSIONS_AAR_PATH} ${ARTIFACTS_STAGING_DIR} - cp ${AAR_DIR}/*-javadoc.jar ${ARTIFACTS_STAGING_DIR} - cp ${AAR_DIR}/*-sources.jar ${ARTIFACTS_STAGING_DIR} - cp ${AAR_DIR}/*.pom ${ARTIFACTS_STAGING_DIR} - displayName: "Assemble artifacts" diff --git a/tools/ci_build/github/azure-pipeline/templates/build-package-for-ios-cocoapods.yml b/tools/ci_build/github/azure-pipeline/templates/build-package-for-ios-cocoapods.yml deleted file mode 100644 index 44dea4ee7..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/build-package-for-ios-cocoapods.yml +++ /dev/null @@ -1,183 +0,0 @@ -# packaging pipeline for iOS CocoaPods package - -parameters: -- name: IsReleaseBuild - displayName: "Is this a release build?" - type: boolean - default: false - - -- name: AdditionalBuildFlags - displayName: Additional build flags for /tools/ios/build_xcframework.py - type: string - -jobs: -- template: ios-framework-build.yml - parameters: - Platform: 'iphoneos' - IosArch: 'arm64' - IosVersion: '15.0' - IsReleaseBuild: ${{parameters.IsReleaseBuild}} - AdditionalBuildFlags: ${{parameters.AdditionalBuildFlags}} - -- template: ios-framework-build.yml - parameters: - Platform: 'iphonesimulator' - IosArch: 'x86_64' - IosVersion: '15.0' - IsReleaseBuild: ${{parameters.IsReleaseBuild}} - AdditionalBuildFlags: ${{parameters.AdditionalBuildFlags}} - -- template: ios-framework-build.yml - parameters: - Platform: 'iphonesimulator' - IosArch: 'arm64' - IosVersion: '15.0' - IsReleaseBuild: ${{parameters.IsReleaseBuild}} - AdditionalBuildFlags: ${{parameters.AdditionalBuildFlags}} - -- template: ios-framework-build.yml - parameters: - Platform: 'maccatalyst' - IosArch: 'arm64' - IosVersion: '15.0' - IsReleaseBuild: ${{parameters.IsReleaseBuild}} - AdditionalBuildFlags: ${{parameters.AdditionalBuildFlags}} - -- template: ios-framework-build.yml - parameters: - Platform: 'maccatalyst' - IosArch: 'x86_64' - IosVersion: '15.0' - IsReleaseBuild: ${{parameters.IsReleaseBuild}} - AdditionalBuildFlags: ${{parameters.AdditionalBuildFlags}} - -- job: IosPackaging - condition: not(or(failed(), canceled())) - displayName: "iOS Packaging" - dependsOn: - - IOS_C_API_Packaging_iphoneos_arm64 - - IOS_C_API_Packaging_iphonesimulator_arm64 - - IOS_C_API_Packaging_iphonesimulator_x86_64 - - IOS_C_API_Packaging_maccatalyst_x86_64 - - IOS_C_API_Packaging_maccatalyst_arm64 - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - templateContext: - inputs: - - input: pipelineArtifact - artifactName: onnxruntime-extensions-ios-iphoneos-arm64-lib - targetPath: $(Build.BinariesDirectory) - - input: pipelineArtifact - artifactName: onnxruntime-extensions-ios-iphonesimulator-arm64-lib - targetPath: $(Build.BinariesDirectory) - - input: pipelineArtifact - artifactName: onnxruntime-extensions-ios-iphonesimulator-x86_64-lib - targetPath: $(Build.BinariesDirectory) - - input: pipelineArtifact - artifactName: onnxruntime-extensions-ios-maccatalyst-x86_64-lib - targetPath: $(Build.BinariesDirectory) - - input: pipelineArtifact - artifactName: onnxruntime-extensions-ios-maccatalyst-arm64-lib - targetPath: $(Build.BinariesDirectory) - outputs: - - output: pipelineArtifact - path: $(Build.ArtifactStagingDirectory) - artifact: onnxruntime-extensions-ios_package - - timeoutInMinutes: 120 - - steps: - - checkout: self - submodules: true - - - template: use-xcode-version.yml - - - task: UsePythonVersion@0 - inputs: - versionSpec: "3.12" - addToPath: true - architecture: "x64" - - - script: | - python -m pip install cmake - displayName: "Install CMake" - - - template: set-package-version-variable-step.yml - parameters: - IsReleaseBuild: ${{ parameters.IsReleaseBuild }} - PackageVersionVariableName: ORT_EXTENSIONS_POD_VERSION - - - script: | - set -e -x - ls - if ! ls onnxruntime-extensions-ios*.tgz &> /dev/null; then - echo "no tgz files found. It's not distributed building, skip!" - exit 0 - fi - for tgz_lib in `ls onnxruntime-extensions-ios*.tgz` - do - echo "decompress $tgz_lib" - tar -xvzf $tgz_lib - done - - ls - ls xcframework_out/intermediates/* - workingDirectory: $(Build.BinariesDirectory) - displayName: "Extract file from distributed build" - - - script: | - python ./tools/ios/build_xcframework.py \ - --output_dir $(Build.BinariesDirectory)/xcframework_out \ - --config Release \ - --platform_arch iphonesimulator x86_64 \ - --platform_arch iphonesimulator arm64 \ - --platform_arch iphoneos arm64 \ - --platform_arch maccatalyst x86_64 \ - --platform_arch maccatalyst arm64 \ - --mode pack_xcframework_only - displayName: "Pack xcframework for distributed building" - - - script: | - python ./tools/ios/assemble_pod_package.py \ - --staging-dir $(Build.BinariesDirectory)/pod_staging \ - --xcframework-output-dir $(Build.BinariesDirectory)/xcframework_out \ - --pod-version ${ORT_EXTENSIONS_POD_VERSION} \ - --mac_catalyst_enabled - displayName: "Assemble pod" - - - script: | - ls -lR $(Build.BinariesDirectory)/pod_staging - pod lib lint - displayName: "Lint pod" - workingDirectory: $(Build.BinariesDirectory)/pod_staging - - # Note: In this CI, we exclude macos arch in the build_framework.py command however the test app's podfile by default - # is setup for all platforms, and due to that we have explicitly exclude the macos target below when installing the pod - # for the test app. - - script: | - ORT_EXTENSIONS_LOCAL_POD_PATH=$(Build.BinariesDirectory)/pod_staging \ - EXCLUDE_MACOS_TARGET=true \ - pod install - displayName: "Install pods for OrtExtensionsUsage" - workingDirectory: $(Build.SourcesDirectory)/test/ios/OrtExtensionsUsage - - - script: | - set -e -x - - POD_STAGING_DIR="$(Build.BinariesDirectory)/pod_staging" - ARTIFACTS_STAGING_DIR="$(Build.ArtifactStagingDirectory)" - POD_NAME="onnxruntime-extensions-c" - POD_ARCHIVE_BASENAME="onnxruntime_extensions.xcframework.${ORT_EXTENSIONS_POD_VERSION}.zip" - PODSPEC_BASENAME="${POD_NAME}.podspec" - - pushd ${POD_STAGING_DIR} - - # assemble the files in the artifacts staging directory - zip -vry ${ARTIFACTS_STAGING_DIR}/${POD_ARCHIVE_BASENAME} * --exclude ${PODSPEC_BASENAME} - cp ${PODSPEC_BASENAME} ${ARTIFACTS_STAGING_DIR}/${PODSPEC_BASENAME} - - popd - displayName: "Assemble artifacts" \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipeline/templates/build-package-for-linux.yml b/tools/ci_build/github/azure-pipeline/templates/build-package-for-linux.yml deleted file mode 100644 index 1be101d29..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/build-package-for-linux.yml +++ /dev/null @@ -1,109 +0,0 @@ -# This file contains the ADO job that build so-file on Linux -parameters: -- name: IsReleaseBuild - displayName: "Is this a release build?" - type: boolean - default: false - -- name: OrtExtensionsArch - type: string - -- name: PoolName - type: string - default: 'onnxruntime-Ubuntu2204-AMD-CPU' - -- name: OrtExtensionsCFlags - type: string - -- name: OrtExtensionsCXXFlags - type: string - -- name: AdditionalBuildFlags - displayName: Additional build flags for build_lib.sh - type: string - -jobs: -- job: Linux_C_API_Packaging_CPU_${{parameters.OrtExtensionsArch}} - - workspace: - clean: all - timeoutInMinutes: 210 - pool: - name: ${{parameters.PoolName}} - os: linux - ${{ if eq(parameters.OrtExtensionsArch, 'aarch64') }}: - hostArchitecture: Arm64 - templateContext: - outputs: - - output: pipelineArtifact - path: $(Build.ArtifactStagingDirectory) - artifact: onnxruntime-extensions-linux-${{parameters.OrtExtensionsArch}} - - steps: - - checkout: self - clean: true - submodules: none - - # NOTE: on arm64 machine, CMake version needs to be updated since we now require CMake 3.28 or newer. - - ${{ if eq(parameters.OrtExtensionsArch, 'x64') }}: - - bash: | - export CFLAGS="${{parameters.OrtExtensionsCFlags}}" - export CXXFLAGS="${{parameters.OrtExtensionsCXXFlags}}" - ./build_lib.sh --build_dir $(Build.BinariesDirectory)/out/ --config RelWithDebInfo --parallel --enable_cxx_tests ${{parameters.AdditionalBuildFlags}} - workingDirectory: '$(Build.SourcesDirectory)' - displayName: 'build onnxruntime-extensions and run tests' - - ${{ else }}: - - bash: | - if ! dnf list installed cmake &>/dev/null; then - echo "CMake is not installed. Installing/upgrading cmake." - pip install cmake --upgrade - else - echo "CMake is already installed." - fi - export PATH=~/.local/bin:$PATH - cmake --version - export CFLAGS="${{parameters.OrtExtensionsCFlags}}" - export CXXFLAGS="${{parameters.OrtExtensionsCXXFlags}}" - ./build_lib.sh --build_dir $(Build.BinariesDirectory)/out/ --config RelWithDebInfo --parallel --enable_cxx_tests ${{parameters.AdditionalBuildFlags}} - workingDirectory: '$(Build.SourcesDirectory)' - displayName: 'build onnxruntime-extensions' - - - template: set-package-version-variable-step.yml - parameters: - IsReleaseBuild: true - PackageVersionVariableName: ORT_EXTENSIONS_VERSION - - - bash: | - set -e -x - - lib_target=$(Build.BinariesDirectory)/onnxruntime-extensions-linux-${{parameters.OrtExtensionsArch}}-$(ORT_EXTENSIONS_VERSION)/lib - mkdir -p $lib_target - - ls -l out/RelWithDebInfo/lib - cp out/RelWithDebInfo/lib/libortextensions.so $lib_target - - cd $lib_target - objcopy --only-keep-debug libortextensions.so libortextensions.so.dbg - objcopy --strip-debug libortextensions.so - objcopy --add-gnu-debuglink=libortextensions.so.dbg libortextensions.so - - displayName: create and copy artifacts. - workingDirectory: $(Build.BinariesDirectory) - - - - task: ArchiveFiles@2 - inputs: - rootFolderOrFile: '$(Build.BinariesDirectory)/onnxruntime-extensions-linux-${{parameters.OrtExtensionsArch}}-$(ORT_EXTENSIONS_VERSION)' - includeRootFolder: true - archiveType: 'tar' # Options: zip, 7z, tar, wim - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/onnxruntime-extensions-linux-${{parameters.OrtExtensionsArch}}.tgz' - replaceExistingArchive: true - - - template: component-governance-component-detection-steps.yml - parameters : - condition : 'succeeded' - - - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 - displayName: 'Clean Agent Directories' - condition: always() diff --git a/tools/ci_build/github/azure-pipeline/templates/build-package-for-macosx.yml b/tools/ci_build/github/azure-pipeline/templates/build-package-for-macosx.yml deleted file mode 100644 index 25503340a..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/build-package-for-macosx.yml +++ /dev/null @@ -1,51 +0,0 @@ -parameters: -- name: AdditionalBuildFlags - displayName: Additional build flags for build.sh - type: string - -- name: IsReleaseBuild - displayName: "Is this a release build?" - type: boolean - default: false - -stages: -- stage: MacOS_C_API_Packaging_CPU - dependsOn: [] - jobs: - - template: mac-shared-lib-build.yml - parameters: - MacosArch: 'x86_64' - AdditionalBuildFlags: ${{ parameters.AdditionalBuildFlags }} - - - template: mac-shared-lib-build.yml - parameters: - MacosArch: 'arm64' - AdditionalBuildFlags: "${{ parameters.AdditionalBuildFlags }} --cmake_extra_defines CMAKE_OSX_ARCHITECTURES=arm64" - - template: mac-shared-lib-build.yml - parameters: - MacosArch: 'universal2' - AdditionalBuildFlags: "${{ parameters.AdditionalBuildFlags }} --cmake_extra_defines CMAKE_OSX_ARCHITECTURES=\"arm64;x86_64\"" - - job: MacOS_C_API_Package_Publish_All - dependsOn: - - MacOS_C_API_Packaging_CPU_x86_64 - - MacOS_C_API_Packaging_CPU_arm64 - - MacOS_C_API_Packaging_CPU_universal2 - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - templateContext: - inputs: - - input: pipelineArtifact - artifactName: onnxruntime-extensions-osx-x86_64 - targetPath: $(Build.ArtifactStagingDirectory) - - input: pipelineArtifact - artifactName: onnxruntime-extensions-osx-arm64 - targetPath: $(Build.ArtifactStagingDirectory) - - input: pipelineArtifact - artifactName: onnxruntime-extensions-osx-universal2 - targetPath: $(Build.ArtifactStagingDirectory) - outputs: - - output: pipelineArtifact - path: $(Build.ArtifactStagingDirectory) - artifact: onnxruntime-extensions-osx diff --git a/tools/ci_build/github/azure-pipeline/templates/build-package-for-nuget.yml b/tools/ci_build/github/azure-pipeline/templates/build-package-for-nuget.yml deleted file mode 100644 index f1b427b91..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/build-package-for-nuget.yml +++ /dev/null @@ -1,260 +0,0 @@ -parameters: -- name: DoCompliance - displayName: Run Compliance Tasks? - type: boolean - default: true - -- name: DoEsrp - displayName: Run code sign tasks? Must be true if you are doing an OnnxRuntime extensions release. - type: boolean - default: false - -- name: IsReleaseBuild - displayName: Is a release build? - type: boolean - default: false - -- name: IsDummyPackage - displayName: Is this a build of Microsoft.ML.OnnxRuntime.Extensions.Dummy package that has no operators? - type: boolean - default: false - -- name: NugetVersionSuffix - displayName: Nuget version suffix - type: string - -- name: OperatorSelectionFlags - displayName: Flags to select operators included. Default is to disable OCOS_ENABLE_CV2 and OCOS_ENABLE_BLINGFIRE - type: string - default: '--cmake_extra_defines OCOS_ENABLE_CV2=OFF OCOS_ENABLE_BLINGFIRE=OFF' - -- name: AdditionalBuildFlags - displayName: Additional build flags. - type: string - default: '' - -stages: -# MacOS_C_API_Packaging_CPU -- template: build-package-for-macosx.yml - parameters: - IsReleaseBuild: ${{ parameters.IsReleaseBuild }} - AdditionalBuildFlags: ${{parameters.OperatorSelectionFlags}} ${{parameters.AdditionalBuildFlags}} - -- stage: Linux_C_API_Packaging_CPU - dependsOn: [] - jobs: - - template: build-package-for-linux.yml - parameters: - OrtExtensionsArch: 'x64' - PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' - IsReleaseBuild: ${{parameters.IsReleaseBuild}} - OrtExtensionsCFlags: '' - OrtExtensionsCXXFlags: '' - AdditionalBuildFlags: ${{parameters.OperatorSelectionFlags}} ${{parameters.AdditionalBuildFlags}} - - - template: build-package-for-linux.yml - parameters: - OrtExtensionsArch: 'aarch64' - PoolName: 'onnxruntime-linux-ARM64-CPU-2019' - IsReleaseBuild: ${{parameters.IsReleaseBuild}} - OrtExtensionsCFlags: '' - OrtExtensionsCXXFlags: '' - AdditionalBuildFlags: ${{parameters.OperatorSelectionFlags}} ${{parameters.AdditionalBuildFlags}} - -- stage: Windows_C_API_Packaging_CPU - dependsOn: [] - jobs: - - template: build-package-for-windows.yml - parameters: - DoCompliance: ${{ parameters.DoCompliance }} - DoEsrp: ${{ parameters.DoEsrp }} - StageNameSuffix: CPU_x86 - # Win32 - BuildPlatform: x86 - AdditionalBuildFlags: ${{parameters.OperatorSelectionFlags}} ${{parameters.AdditionalBuildFlags}} - - - template: build-package-for-windows.yml - parameters: - DoCompliance: ${{ parameters.DoCompliance }} - DoEsrp: ${{ parameters.DoEsrp }} - StageNameSuffix: CPU_arm64 - BuildPlatform: arm64 - AdditionalBuildFlags: ${{parameters.OperatorSelectionFlags}} ${{parameters.AdditionalBuildFlags}} - - - template: build-package-for-windows.yml - parameters: - DoCompliance: ${{ parameters.DoCompliance }} - DoEsrp: ${{ parameters.DoEsrp }} - StageNameSuffix: CPU_x64 - BuildPlatform: 'x64' - AdditionalBuildFlags: ${{parameters.OperatorSelectionFlags}} ${{parameters.AdditionalBuildFlags}} - -#Android_Java_API_AAR_Packaging_Full -- template: build-package-for-android-aar.yml - parameters: - IsReleaseBuild: ${{ parameters.IsReleaseBuild }} - AdditionalBuildFlags: ${{parameters.OperatorSelectionFlags}} ${{parameters.AdditionalBuildFlags}} - -- stage: iOS_Full_xcframework - dependsOn: [] - jobs: - - template: build-package-for-ios-cocoapods.yml - parameters: - IsReleaseBuild: ${{ parameters.IsReleaseBuild }} - AdditionalBuildFlags: ${{parameters.OperatorSelectionFlags}} ${{parameters.AdditionalBuildFlags}} - - -- stage: NuGet_Packaging_CPU - dependsOn: - - Linux_C_API_Packaging_CPU - - Windows_C_API_Packaging_CPU - - MacOS_C_API_Packaging_CPU - - Android_Java_API_AAR_Packaging_Full - - iOS_Full_xcframework - condition: succeeded() - jobs: - - job: Nuget_Packaging - workspace: - clean: all - # we need to use the 2022 pool to create the nuget package with both pre-net6+Xamarin and net6 targets. - # VS2019 has no support for net6 and we need to use msbuild (from the VS install) to do the packing - pool: - name: 'onnxruntime-Win-CPU-2022' - os: windows - variables: - breakCodesignValidationInjection: ${{ parameters.DoEsrp }} - templateContext: - inputs: - - input: pipelineArtifact - artifactName: onnxruntime-extensions-win-x64 - targetPath: $(Build.BinariesDirectory)/artifact-downloads - - input: pipelineArtifact - artifactName: onnxruntime-extensions-win-x86 - targetPath: $(Build.BinariesDirectory)/artifact-downloads - - input: pipelineArtifact - artifactName: onnxruntime-extensions-win-arm64 - targetPath: $(Build.BinariesDirectory)/artifact-downloads - - input: pipelineArtifact - artifactName: onnxruntime-extensions-osx - targetPath: $(Build.BinariesDirectory)/artifact-downloads - - input: pipelineArtifact - artifactName: onnxruntime-extensions-ios_package - targetPath: $(Build.BinariesDirectory)/artifact-downloads - - input: pipelineArtifact - artifactName: onnxruntime-extensions-android-aar - targetPath: $(Build.BinariesDirectory)/artifact-downloads - itemPattern: | - **/*.aar - - input: pipelineArtifact - artifactName: onnxruntime-extensions-linux-x64 - targetPath: $(Build.BinariesDirectory)/artifact-downloads - - input: pipelineArtifact - artifactName: onnxruntime-extensions-linux-aarch64 - targetPath: $(Build.BinariesDirectory)/artifact-downloads - outputs: - - output: pipelineArtifact - path: $(Build.ArtifactStagingDirectory) - artifact: drop-signed-nuget-CPU - - steps: - - checkout: self - submodules: true - - - task: UsePythonVersion@0 - inputs: - versionSpec: "3.12" - addToPath: true - architecture: "x64" - displayName: "Use Python 3.12" - - - script: | - dir - workingDirectory: '$(Build.BinariesDirectory)/artifact-downloads' - displayName: 'List artifacts' - - # Reconstruct the build dir - - task: PowerShell@2 - displayName: 'Extract native libraries to artifact-downloads for addition to nuget native package' - inputs: - targetType: filePath - filePath: $(Build.SourcesDirectory)\tools\ci_build\extract_nuget_files.ps1 - arguments: $(Build.BinariesDirectory)/artifact-downloads $(Build.BinariesDirectory)\nuget-artifacts - - - task: NuGetToolInstaller@0 - displayName: Use Nuget 6.2.1 - inputs: - versionSpec: 6.2.1 - - - ${{ if eq(parameters.IsDummyPackage, false) }}: - - task: PowerShell@2 - displayName: 'Updating NativeNuget.NuSpec' - inputs: - targetType: 'inline' - script: | - $OrtExtVersion=(cat ./version.txt) - python $(Build.SourcesDirectory)\tools\ci_build\update_nuspec_for_native_nuget.py ` - --package_version $OrtExtVersion ` - --commit_id $(Build.SourceVersion) ` - --is_release_build ${{ parameters.IsReleaseBuild }} ` - --nuget_version_suffix ${{ parameters.NugetVersionSuffix }} - - cat $(Build.SourcesDirectory)\nuget\NativeNuget.nuspec - workingDirectory: '$(Build.SourcesDirectory)' - - - ${{ else }}: - - task: PowerShell@2 - displayName: 'Updating DummyNativeNuget.NuSpec, and props and targets filenames' - inputs: - targetType: 'inline' - script: | - $OrtExtVersion=(cat ./version.txt) - python $(Build.SourcesDirectory)\tools\ci_build\update_nuspec_for_native_nuget.py ` - --package_version $OrtExtVersion ` - --commit_id $(Build.SourceVersion) ` - --is_release_build ${{ parameters.IsReleaseBuild }} ` - --nuget_version_suffix ${{ parameters.NugetVersionSuffix }} ` - --nuspec_path $(Build.SourcesDirectory)\nuget\DummyNativeNuget.nuspec - - gci $(Build.SourcesDirectory)/nuget -Filter *.props -Recurse | Rename-Item -NewName { $_.name -replace 'Extensions', 'Extensions.Dummy' } - gci $(Build.SourcesDirectory)/nuget -Filter *.targets -Recurse | Rename-Item -NewName { $_.name -replace 'Extensions', 'Extensions.Dummy' } - - cat $(Build.SourcesDirectory)\nuget\DummyNativeNuget.nuspec - workingDirectory: '$(Build.SourcesDirectory)' - - - task: PowerShell@2 - displayName: 'Setup for packing' - inputs: - # copy nuget folder to binaries dir so we can refer to the assembled artifacts in - # $(Build.BinariesDirectory)/nuget-artifacts using a deterministic relative path in the nuspec. - targetType: 'inline' - script: | - cp -r $(Build.SourcesDirectory)/nuget $(Build.BinariesDirectory) - cp $(Build.SourcesDirectory)/ThirdPartyNotices.txt $(Build.BinariesDirectory) - - workingDirectory: '$(Build.SourcesDirectory)' - - - ${{ if eq(parameters.IsDummyPackage, false) }}: - - task: NuGetCommand@2 - displayName: Packing Microsoft.ML.OnnxRuntime.Extensions NuGet-package - inputs: - command: 'pack' - packagesToPack: '$(Build.BinariesDirectory)\nuget\NativeNuget.nuspec' - packDestination: $(Build.ArtifactStagingDirectory) - - - ${{ else }}: - - task: NuGetCommand@2 - displayName: Packing Microsoft.ML.OnnxRuntime.Extensions.Dummy NuGet-package - inputs: - command: 'pack' - packagesToPack: '$(Build.BinariesDirectory)\nuget\DummyNativeNuget.nuspec' - packDestination: $(Build.ArtifactStagingDirectory) - - - template: esrp_nuget.yml - parameters: - DisplayName: 'ESRP - sign NuGet package' - FolderPath: '$(Build.ArtifactStagingDirectory)' - DoEsrp: 'true' - - - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 - displayName: 'Clean Agent Directories' - condition: always() diff --git a/tools/ci_build/github/azure-pipeline/templates/build-package-for-windows.yml b/tools/ci_build/github/azure-pipeline/templates/build-package-for-windows.yml deleted file mode 100644 index 50d9ab7fc..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/build-package-for-windows.yml +++ /dev/null @@ -1,118 +0,0 @@ -parameters: -- name: DoCompliance - displayName: Run Compliance Tasks? - type: boolean - default: true - -- name: DoEsrp - displayName: Run code sign tasks? Must be true if you are doing an OnnxRuntime extensions release. - type: boolean - default: false - -- name: BuildPlatform - type: string - values: - - 'x86' - - 'x64' - - 'arm64' - -- name: StageNameSuffix - displayName: job name for nuget - type: string - default: '' - -- name: BuildPool - type: string - default: 'onnxruntime-Win-CPU-2022' - -- name: AdditionalBuildFlags - displayName: Additional build flags for build_lib.bat - type: string - - -jobs: -- job: Windows_Packaging_${{ parameters.StageNameSuffix }} - workspace: - clean: all - pool: - name: ${{ parameters.BuildPool }} - os: windows - timeoutInMinutes: 300 - templateContext: - outputs: - - output: pipelineArtifact - path: $(Build.ArtifactStagingDirectory) - artifact: onnxruntime-extensions-win-${{parameters.BuildPlatform}} - - steps: - - checkout: self - clean: true - submodules: none - - task: UsePythonVersion@0 - # Currently we can only run tests on x64. x86 tests faile. arm64 tests can't be run as the build machine is amd64 - # TODO: Fix these issues so the nuget build is properly tested. - - ${{ if eq(parameters.BuildPlatform, 'x64') }}: - - task: BatchScript@1 - displayName: 'build onnxruntime-extensions and run tests' - inputs: - filename: '.\build_lib.bat' - arguments: '--${{parameters.BuildPlatform}} --build_dir $(Build.BinariesDirectory)/out --config RelWithDebInfo --cmake_generator "Visual Studio 17 2022" --enable_cxx_tests ${{parameters.AdditionalBuildFlags}} --cmake_extra_defines OCOS_ENABLE_C_API=ON' - modifyEnvironment: true - workingFolder: $(Build.SourcesDirectory) - - ${{ else }}: - - task: BatchScript@1 - displayName: 'build onnxruntime-extensions' - inputs: - filename: '.\build_lib.bat' - arguments: '--${{parameters.BuildPlatform}} --build_dir $(Build.BinariesDirectory)/out --config RelWithDebInfo --cmake_generator "Visual Studio 17 2022" ${{parameters.AdditionalBuildFlags}} --cmake_extra_defines OCOS_ENABLE_C_API=ON' - modifyEnvironment: true - workingFolder: $(Build.SourcesDirectory) - - - script: | - dir $(Build.BinariesDirectory)\out\RelWithDebInfo\lib\RelWithDebInfo - dir $(Build.BinariesDirectory)\out\RelWithDebInfo\bin\RelWithDebInfo - displayName: 'List built DLLs' - workingDirectory: $(Build.BinariesDirectory) - - - task: PowerShell@2 - displayName: 'Set version' - inputs: - targetType: 'inline' - script: | - $_OrtExtVersion=(cat version.txt) - echo "##vso[task.setvariable variable=OrtExtVersion;]$_OrtExtVersion" - workingDirectory: '$(Build.SourcesDirectory)' - - - task: PowerShell@2 - displayName: 'Copy and Create artifacts' - inputs: - targetType: 'inline' - script: | - $target_base="$(Build.BinariesDirectory)/onnxruntime-extensions-win-${{parameters.BuildPlatform}}-$(OrtExtVersion)" - $target_lib_path="$target_base/lib" - $target_include_path="$target_base/include" - New-Item $target_lib_path -ItemType Directory -Force - New-Item $target_include_path -ItemType Directory -Force - Copy-Item -Path "bin/RelWithDebInfo/ortextensions.*" -Destination $target_lib_path -Force - Copy-Item -Path "lib/RelWithDebInfo/ortextensions.*" -Destination $target_lib_path -Force - Copy-Item -Path "$(Build.SourcesDirectory)/include/*" -Destination $target_include_path -Recurse -Force - workingDirectory: '$(Build.BinariesDirectory)/out/RelWithDebInfo' - - - template: win-esrp-dll.yml - parameters: - FolderPath: '$(Build.BinariesDirectory)/onnxruntime-extensions-win-${{parameters.BuildPlatform}}-$(OrtExtVersion)' - DisplayName: 'Sign DLL' - DoEsrp: 'true' - - - task: ArchiveFiles@2 - inputs: - rootFolderOrFile: '$(Build.BinariesDirectory)/onnxruntime-extensions-win-${{parameters.BuildPlatform}}-$(OrtExtVersion)' - includeRootFolder: true - archiveType: 'tar' # Options: zip, 7z, tar, wim - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/onnxruntime-extensions-win-${{parameters.BuildPlatform}}.tgz' - replaceExistingArchive: true - - - template: component-governance-component-detection-steps.yml - parameters : - condition : 'succeeded' diff --git a/tools/ci_build/github/azure-pipeline/templates/common-variables.yml b/tools/ci_build/github/azure-pipeline/templates/common-variables.yml deleted file mode 100644 index b7b4859c8..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/common-variables.yml +++ /dev/null @@ -1,15 +0,0 @@ -parameters: -- name: debug - displayName: 'Enable debug output' - type: boolean - default: false - -variables: - CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] - system.debug: ${{ parameters.debug }} - ENABLE_PRS_DELAYSIGN: 1 - ROOT: $(Build.SourcesDirectory) - REPOROOT: $(Build.SourcesDirectory) - OUTPUTROOT: $(REPOROOT)\out - NUGET_XMLDOC_MODE: none - DEBIAN_FRONTEND: noninteractive diff --git a/tools/ci_build/github/azure-pipeline/templates/component-governance-component-detection-steps.yml b/tools/ci_build/github/azure-pipeline/templates/component-governance-component-detection-steps.yml deleted file mode 100644 index d7a9f89b4..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/component-governance-component-detection-steps.yml +++ /dev/null @@ -1,28 +0,0 @@ -# component detection for component governance checks -parameters: -- name: condition - type: string - default: 'succeeded' # could be 'ci_only', 'always', 'succeeded' - -steps: -- ${{ if eq(variables['System.TeamProject'], 'Lotus') }}: - - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 - displayName: 'Component Detection' - continueOnError: true - condition: - or(or(and(eq('${{parameters.condition}}', 'ci_only'), and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Scheduled'))), - and(eq('${{parameters.condition}}', 'always'), always())), - and(eq('${{parameters.condition}}', 'succeeded'), succeeded())) - inputs: - # ignore unused language bindings from 3rd party dependencies. - # skip the multi-build directories used for the Android and iOS packages. the contents of _deps is covered - # by the other builds where we explicitly exclude a subset of _deps - ignoreDirectories: - '$(Build.BinariesDirectory)/out/RelWithDebInfo/_deps/triton-src/src/grpc_generated, - $(Build.BinariesDirectory)/out/RelWithDebInfo/_deps/protobuf-src/benchmarks, - $(Build.BinariesDirectory)/out/RelWithDebInfo/_deps/protobuf-src/examples, - $(Build.BinariesDirectory)/out/RelWithDebInfo/_deps/protobuf-src/java, - $(Build.BinariesDirectory)/out/RelWithDebInfo/_deps/protobuf-src/js, - $(Build.BinariesDirectory)/out/RelWithDebInfo/_deps/protobuf-src/ruby, - $(Build.BinariesDirectory)/xcframework_out, - $(Build.BinariesDirectory)/android_aar' diff --git a/tools/ci_build/github/azure-pipeline/templates/esrp_nuget.yml b/tools/ci_build/github/azure-pipeline/templates/esrp_nuget.yml deleted file mode 100644 index c27231b77..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/esrp_nuget.yml +++ /dev/null @@ -1,42 +0,0 @@ -parameters: - FolderPath: '' - DisplayName: '' - DoEsrp: 'false' - -steps: - - ${{ if eq(parameters['DoEsrp'], 'true') }}: - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5 - displayName: 'ESRP CodeSigning' - inputs: - ConnectedServiceName: 'esrp_release' - AppRegistrationClientId: '62b7cfed-4d25-454f-880e-010dc21455ac' - AppRegistrationTenantId: '975f013f-7f24-47e8-a7d3-abc4752bf346' - AuthAKVName: 'ortbuildkeyvault' - AuthSignCertName: 'esrpcodesign' - - FolderPath: ${{ parameters.FolderPath }} - Pattern: '*.nupkg' - SessionTimeout: 90 - ServiceEndpointUrl: 'https://api.esrp.microsoft.com/api/v2' - MaxConcurrency: 25 - - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "keyCode": "CP-401405", - "operationSetCode": "NuGetSign", - "parameters": [ ], - "toolName": "sign", - "toolVersion": "6.2.9304.0" - }, - { - "keyCode": "CP-401405", - "operationSetCode": "NuGetVerify", - "parameters": [ ], - "toolName": "sign", - "toolVersion": "6.2.9304.0" - } - ] - EsrpClientId: 53d54d02-978d-4305-8572-583cf6711c4f - UseMSIAuthentication: true diff --git a/tools/ci_build/github/azure-pipeline/templates/install-appcenter.yml b/tools/ci_build/github/azure-pipeline/templates/install-appcenter.yml deleted file mode 100644 index 51be73d4c..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/install-appcenter.yml +++ /dev/null @@ -1,12 +0,0 @@ -# Install appcenter CLI - -parameters: -- name: appcenterVersion - type: string - default: "2.13.7" - -steps: -- bash: | - set -e -x - npm install -g appcenter-cli@${{ parameters.appcenterVersion }} - displayName: Install appcenter CLI ${{ parameters.appcenterVersion }} diff --git a/tools/ci_build/github/azure-pipeline/templates/ios-framework-build.yml b/tools/ci_build/github/azure-pipeline/templates/ios-framework-build.yml deleted file mode 100644 index ddb08f829..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/ios-framework-build.yml +++ /dev/null @@ -1,80 +0,0 @@ -# packaging pipeline for onnxruntime-extensions ios cocoapods package -parameters: -- name: Platform - displayName: ios Platform - type: string - -- name: IosArch - displayName: IosArch - type: string - -- name: IosVersion - displayName: IosVersion - type: string - -- name: IsReleaseBuild - displayName: "Is this a release build?" - type: boolean - - -- name: AdditionalBuildFlags - displayName: Additional build flags for /tools/ios/build_xcframework.py - type: string - -jobs: - - job: IOS_C_API_Packaging_${{ parameters.Platform }}_${{ parameters.IosArch }} - condition: succeeded() - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - timeoutInMinutes: 120 - variables: - buildConfig: Release - templateContext: - outputs: - - output: pipelineArtifact - path: $(Build.ArtifactStagingDirectory) - artifact: onnxruntime-extensions-ios-${{ parameters.Platform }}-${{ parameters.IosArch }}-lib - steps: - - template: use-xcode-version.yml - - - task: UsePythonVersion@0 - inputs: - versionSpec: "3.12" - addToPath: true - architecture: "x64" - - - script: | - python -m pip install cmake - displayName: "Install CMake" - - - template: set-package-version-variable-step.yml - parameters: - IsReleaseBuild: ${{ parameters.IsReleaseBuild }} - PackageVersionVariableName: ORT_EXTENSIONS_POD_VERSION - - - script: | - python ./tools/ios/build_xcframework.py \ - --output_dir $(Build.BinariesDirectory)/xcframework_out \ - --config $(buildConfig) \ - --platform_arch ${{ parameters.Platform }} ${{ parameters.IosArch }} \ - --mode build_platform_arch_frameworks_only \ - --ios_deployment_target ${{ parameters.IosVersion}} \ - -- \ - ${{parameters.AdditionalBuildFlags}} - displayName: "Build xcframework" - - - bash: | - set -e -x - - package_name=onnxruntime-extensions-ios-${{ parameters.Platform }}-${{ parameters.IosArch }}-lib.tgz - target_folder=xcframework_out/intermediates/${{ parameters.Platform }}/${{ parameters.IosArch }}/$(buildConfig) - framework_info=${target_folder}/framework_info.json - tar -cvzf $(Build.ArtifactStagingDirectory)/${package_name} -C $(Build.BinariesDirectory)/ ${target_folder}/static_framework ${framework_info} - - displayName: "Assemble artifacts" - - - template: component-governance-component-detection-steps.yml - parameters : - condition : 'succeeded' diff --git a/tools/ci_build/github/azure-pipeline/templates/mac-shared-lib-build.yml b/tools/ci_build/github/azure-pipeline/templates/mac-shared-lib-build.yml deleted file mode 100644 index 56711a813..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/mac-shared-lib-build.yml +++ /dev/null @@ -1,80 +0,0 @@ -parameters: -- name: MacosArch - type: string - values: - - 'x86_64' - - 'arm64' - - 'universal2' - default: 'x86_64' - -- name: AdditionalBuildFlags - displayName: Additional build flags for build_lib.sh - type: string - -jobs: -- job: MacOS_C_API_Packaging_CPU_${{ parameters.MacosArch }} - workspace: - clean: all - variables: - MACOSX_DEPLOYMENT_TARGET: '11.0' - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - timeoutInMinutes: 300 - templateContext: - outputs: - - output: pipelineArtifact - path: $(Build.ArtifactStagingDirectory) - artifact: onnxruntime-extensions-osx-${{ parameters.MacosArch }} - - steps: - - checkout: self - clean: true - submodules: none - - - template: use-xcode-version.yml - - - task: NodeTool@0 - inputs: - versionSpec: '16.x' - - - template: set-package-version-variable-step.yml - parameters: - IsReleaseBuild: true - PackageVersionVariableName: ORT_EXTENSIONS_VERSION - - # Can't run tests on macos due to build error - # https://github.com/microsoft/onnxruntime-extensions/issues/418 - # Add --enable_cxx_tests to the build_lib.sh command line when fixed - - script: | - set -e -x - ./build_lib.sh --build_dir $(Build.BinariesDirectory)/out/ --config RelWithDebInfo --parallel ${{parameters.AdditionalBuildFlags}} - displayName: 'Build ${{ parameters.MacosArch }}' - - - task: Bash@3 - displayName: 'Copy build artifacts for zipping' - inputs: - targetType: 'inline' - # TODO: Save debug symbols instead of just stripping - script: | - set -e -x - target_lib_path=onnxruntime-extensions-osx-${{ parameters.MacosArch }}-$(ORT_EXTENSIONS_VERSION)/lib - mkdir -p $target_lib_path - cp out/RelWithDebInfo/lib/libortextensions.dylib ${target_lib_path}/ - strip -S ${target_lib_path}/libortextensions.dylib - workingDirectory: $(Build.BinariesDirectory) - - - task: ArchiveFiles@2 - inputs: - rootFolderOrFile: '$(Build.BinariesDirectory)/onnxruntime-extensions-osx-${{ parameters.MacosArch }}-$(ORT_EXTENSIONS_VERSION)' - includeRootFolder: true - archiveType: 'tar' # Options: zip, 7z, tar, wim - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/onnxruntime-extensions-osx-${{ parameters.MacosArch }}.tgz' - replaceExistingArchive: true - - - template: component-governance-component-detection-steps.yml - parameters : - condition : 'succeeded' diff --git a/tools/ci_build/github/azure-pipeline/templates/run-with-android-emulator-steps.yml b/tools/ci_build/github/azure-pipeline/templates/run-with-android-emulator-steps.yml deleted file mode 100644 index af6683a03..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/run-with-android-emulator-steps.yml +++ /dev/null @@ -1,15 +0,0 @@ -parameters: -- name: steps - type: stepList - -steps: -- template: use-android-emulator.yml@self - parameters: - create: true - start: true - -- ${{ parameters.steps }} - -- template: use-android-emulator.yml@self - parameters: - stop: true diff --git a/tools/ci_build/github/azure-pipeline/templates/set-package-version-variable-step.yml b/tools/ci_build/github/azure-pipeline/templates/set-package-version-variable-step.yml deleted file mode 100644 index 11c10e40a..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/set-package-version-variable-step.yml +++ /dev/null @@ -1,31 +0,0 @@ -parameters: -- name: IsReleaseBuild - displayName: | - If true, the version is a release version. Otherwise, the version has a development suffix. - type: boolean - default: false - -- name: PackageVersionVariableName - displayName: | - The name of the variable that will contain the version value. - type: string - -steps: -- bash: | - set -e -x - - VERSION_FILE="$(Build.SourcesDirectory)/version.txt" - BASE_VERSION="$(cat "${VERSION_FILE}")" - - IS_RELEASE_BUILD="$(printf "%s" "${{ parameters.IsReleaseBuild }}" | tr "[:upper:]" "[:lower:]")" - if [[ "${IS_RELEASE_BUILD}" == "true" ]]; then - VERSION="${BASE_VERSION}" - else - SHORT_COMMIT_HASH="$(git rev-parse --short HEAD)" - VERSION="${BASE_VERSION}-dev+$(Build.BuildId).${SHORT_COMMIT_HASH}" - fi - - # Do not output ##vso[] commands with `set -x` or they may be parsed again and include a trailing quote. - set +x - echo "##vso[task.setvariable variable=${{ parameters.PackageVersionVariableName }}]${VERSION}" - displayName: "Set \"${{ parameters.PackageVersionVariableName }}\" variable to package version" diff --git a/tools/ci_build/github/azure-pipeline/templates/use-android-emulator.yml b/tools/ci_build/github/azure-pipeline/templates/use-android-emulator.yml deleted file mode 100644 index 7886ccf40..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/use-android-emulator.yml +++ /dev/null @@ -1,64 +0,0 @@ -# Android Emulator helpers -# Copied from https://github.com/microsoft/onnxruntime/blob/main/tools/ci_build/github/azure-pipelines/templates/use-android-emulator.yml -parameters: -- name: create - type: boolean - default: false - -- name: start - type: boolean - default: false - -- name: stop - type: boolean - default: false - -steps: -- ${{ if eq(parameters.create, true) }}: - - script: | - set -e -x - python3 tools/android/run_android_emulator.py \ - --android-sdk-root $(ANDROID_SDK_ROOT) \ - --create-avd --system-image "system-images;android-31;default;x86_64" - displayName: Create Android Emulator - -- ${{ if eq(parameters.start, true) }}: - - script: | - if test -f $(Build.BinariesDirectory)/emulator.pid; then - echo "Emulator PID file was not expected to exist but does and has pid:" \ - `cat $(Build.BinariesDirectory)/emulator.pid` - exit 1 - fi - displayName: Check emulator.pid does not exist - - # Add -verbose to --emulator-extra-args to enable additional logging. - - script: | - set -e -x - python3 tools/android/run_android_emulator.py \ - --android-sdk-root $(ANDROID_SDK_ROOT) \ - --start --emulator-extra-args="-partition-size 2047" \ - --emulator-pid-file $(Build.BinariesDirectory)/emulator.pid - echo "Emulator PID:"`cat $(Build.BinariesDirectory)/emulator.pid` - displayName: Start Android Emulator - -- ${{ if eq(parameters.stop, true) }}: - - script: | - set -e -x - python3 -m pip install psutil - displayName: Install psutil for emulator shutdown by run_android_emulator.py - condition: always() - - - script: | - set -e -x - if test -f $(Build.BinariesDirectory)/emulator.pid; then - echo "Emulator PID:"`cat $(Build.BinariesDirectory)/emulator.pid` - python3 tools/android/run_android_emulator.py \ - --android-sdk-root $(ANDROID_SDK_ROOT) \ - --stop \ - --emulator-pid-file $(Build.BinariesDirectory)/emulator.pid - rm $(Build.BinariesDirectory)/emulator.pid - else - echo "Emulator PID file was expected to exist but does not." - fi - displayName: Stop Android Emulator - condition: always() diff --git a/tools/ci_build/github/azure-pipeline/templates/use-xcode-version.yml b/tools/ci_build/github/azure-pipeline/templates/use-xcode-version.yml deleted file mode 100644 index 6ab844a78..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/use-xcode-version.yml +++ /dev/null @@ -1,14 +0,0 @@ -# Specify use of a specific Xcode version. - -parameters: -- name: xcodeVersion - type: string - default: "16.2" - -steps: -- bash: | - set -e -x - XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ parameters.xcodeVersion }}.app/Contents/Developer" - sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}" - - displayName: Use Xcode ${{ parameters.xcodeVersion }} diff --git a/tools/ci_build/github/azure-pipeline/templates/win-esrp-dll.yml b/tools/ci_build/github/azure-pipeline/templates/win-esrp-dll.yml deleted file mode 100644 index 05d012694..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/win-esrp-dll.yml +++ /dev/null @@ -1,123 +0,0 @@ -parameters: - - name: DoEsrp - type: boolean - default: true - - - name: FolderPath - type: string - default: '' - - - name: DisplayName - type: string - default: '' - - - name: Pattern - type: string - default: '*.dll' - -steps: - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5 - displayName: ${{ parameters.DisplayName }} - condition: and(succeeded(), eq('${{ parameters.DoEsrp }}', true)) - inputs: - ConnectedServiceName: 'esrp_release' - AppRegistrationClientId: '62b7cfed-4d25-454f-880e-010dc21455ac' - AppRegistrationTenantId: '975f013f-7f24-47e8-a7d3-abc4752bf346' - AuthAKVName: 'ortbuildkeyvault' - AuthSignCertName: 'esrpcodesign' - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolSign", - "parameters": [ - { - "parameterName": "OpusName", - "parameterValue": "Microsoft" - }, - { - "parameterName": "OpusInfo", - "parameterValue": "http://www.microsoft.com" - }, - { - "parameterName": "PageHash", - "parameterValue": "/NPH" - }, - { - "parameterName": "FileDigest", - "parameterValue": "/fd sha256" - }, - { - "parameterName": "TimeStamp", - "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - } - ] - FolderPath: ${{ parameters.FolderPath }} - Pattern: ${{ parameters.Pattern }} - SessionTimeout: 90 - ServiceEndpointUrl: 'https://api.esrp.microsoft.com/api/v2' - MaxConcurrency: 25 - - EsrpClientId: 53d54d02-978d-4305-8572-583cf6711c4f - UseMSIAuthentication: true - - task: PowerShell@2 - displayName: 'Signature validation for signed file(s)' - condition: and(succeeded(), eq('${{ parameters.DoEsrp }}', true)) - inputs: - targetType: 'inline' - script: | - Write-Host "FolderPath: ${{ parameters.FolderPath }}" - Write-Host "Pattern(s): ${{ parameters.Pattern }}" - - if ("${{ parameters.Pattern }}" -eq "") - { - Write-Host "Pattern is empty." - exit 0 - } - - $valid_flag=$true - $normal_sign_status="Valid" - - $patterns="${{ parameters.Pattern }}" -split ',' - - foreach($pattern_original in $patterns) - { - $pattern=$pattern_original.Trim() - Write-Host "Validating pattern:" $pattern - - $file_names=Get-ChildItem -Path ${{ parameters.FolderPath }} .\$pattern -Name -Recurse -Force - - foreach($file in $file_names) - { - $file_path=Join-Path ${{ parameters.FolderPath }} -ChildPath $file - $sign=Get-AuthenticodeSignature -FilePath $file_path - $sign_status=$sign.Status.ToString() - Write-Host "File:" $file - Write-Host "Signature Status:" $sign_status - if ($sign_status -ne $normal_sign_status) - { - Write-Host "File" $file "does not have valid signature." - Write-Host "Signature status:" $sign.status - Write-Host "Signature message:" $sign.StatusMessage - $valid_flag=$false - break - } - } - } - - if ($valid_flag -eq $false) - { - Write-Host "Signature validation failed." - exit 1 - } - else - { - Write-Host "Signature validation passed." - exit 0 - } - workingDirectory: ${{ parameters.FolderPath }} diff --git a/tools/ci_build/github/azure-pipeline/templates/windows-build-stage.yml b/tools/ci_build/github/azure-pipeline/templates/windows-build-stage.yml deleted file mode 100644 index 1cd4194c5..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/windows-build-stage.yml +++ /dev/null @@ -1,127 +0,0 @@ -parameters: -- name: CibwEnv - displayName: 'Extra env variable set to CIBW_ENVIRONMENT, in form of "A=1 B=2 C=3"' - type: string - default: '' - -- name: artifact_feed - displayName: 'Artifact feed' - type: string - default: 'ORT-Nightly' - -stages: -- stage: Windows_Build - dependsOn: [] - jobs: - - job: main - timeoutInMinutes: 120 - pool: - name: onnxruntime-Win-CPU-2022 - os: windows - - variables: - CIBW_BUILD: cp3{10,11,12,13}-*amd64 - CIBW_ARCHS: AMD64 - CIBW_ENVIRONMENT: "${{ parameters.CibwEnv }}" - CIBW_BUILD_VERBOSITY: 1 - templateContext: - outputs: - - output: pipelineArtifact - path: '$(REPOROOT)\out' - artifact: drop_Windows_Build_main - - steps: - - script: | - @echo off - set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" - for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationPath`) do ( - set vslatest="%%i" - if exist "%%i\Common7\Tools\vsdevcmd.bat" ( - set vsdevcmd="%%i\Common7\Tools\vsdevcmd.bat" - ) - if exist "%%i\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" ( - set vscmake="%%i\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" - ) - if exist "%%i\MSBuild\Current\Bin\amd64\msbuild.exe" ( - set vsmsbuild="%%i\MSBuild\Current\Bin\amd64\msbuild.exe" - ) - ) - - @echo vslatest %vslatest% - @echo vsdevcmd %vsdevcmd% - @echo vscmake %vscmake% - @echo vsmsbuild %vsmsbuild% - - @echo ##vso[task.setvariable variable=vslatest]%vslatest% - @echo ##vso[task.setvariable variable=vsdevcmd]%vsdevcmd% - @echo ##vso[task.setvariable variable=vscmake]%vscmake% - @echo ##vso[task.setvariable variable=vsmsbuild]%vsmsbuild% - displayName: 'locate vsdevcmd via vswhere' - - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.13' - addToPath: true - - - template: /.pipelines/templates/setup-python-feed.yml@self - - - script: | - call $(vsdevcmd) -arch=amd64 - set PYTHONPATH= - set PYTHONHOME= - python -m pip install --upgrade pip - python -m pip install cibuildwheel numpy - python -m cibuildwheel --platform windows --archs AMD64 --output-dir $(REPOROOT)\out - displayName: Build wheels - - #- task: SDLNativeRules@3 - # inputs: - # msBuildArchitecture: amd64 - # setupCommandlines: '"$(vscmake)" $(REPOROOT) -A x64 -B $(REPOROOT)\windows_out -DOCOS_BUILD_PYTHON=ON -DOCOS_ENABLE_CTEST=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo' - # msBuildCommandline: '"$(vsmsbuild)" "$(REPOROOT)\windows_out\onnxruntime_extensions.sln" /p:RunCodeAnalysis=true /p:platform=x64 /p:configuration=RelWithDebInfo /p:VisualStudioVersion="17.0" /m /p:PreferredToolArchitecture=x64 /t:extensions_shared;extensions_pydll' - # excludedPaths: '$(REPOROOT)\windows_out#$(Build.SourcesDirectory)\cmake#C:\program files (x86)' - # displayName: 'Run the PREfast SDL Native Rules for MSBuild' - - - task: PostAnalysis@2 - inputs: - GdnBreakGdnToolSDLNativeRulesSeverity: Warning - GdnBreakGdnToolSDLNativeRules: true - displayName: 'Guardian Break' - - - script: | - 7z x $(REPOROOT)\out\*.whl -o$(REPOROOT)\out\* - displayName: unzip the package - - - template: win-esrp-dll.yml - parameters: - FolderPath: '$(REPOROOT)\out' - DisplayName: 'Sign runtime DLLs' - Pattern: '*.pyd,*.dll' - - - script: | - for /D %%i in ("out\onnxruntime_extensions*-win*") do ( - 7z u %%i.whl .\%%i\* - copy %%i\onnxruntime_extensions\*.pyd out\ - rmdir /s /q %%i - ) - for %%i in (out\*.pyd) do ( - move %%i %%~pni.dll - ) - dir out\*.* - workingDirectory: '$(REPOROOT)' - displayName: zip package - - - script: 'pip install twine==3.4.2' - displayName: 'Install Twine' - - - task: TwineAuthenticate@1 - displayName: 'Twine Authenticate ' - inputs: - artifactFeed: PublicPackages/${{ parameters.artifact_feed }} - - - script: 'python -m twine upload -r ${{ parameters.artifact_feed }} --config-file $(PYPIRC_PATH) --non-interactive --skip-existing *.whl' - workingDirectory: '$(REPOROOT)\out' - displayName: 'Uploading wheels to ${{ parameters.artifact_feed }}' - retryCountOnTaskFailure: 3 - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipeline/templates/with-container-registry-steps.yml b/tools/ci_build/github/azure-pipeline/templates/with-container-registry-steps.yml deleted file mode 100644 index 165bde2b6..000000000 --- a/tools/ci_build/github/azure-pipeline/templates/with-container-registry-steps.yml +++ /dev/null @@ -1,25 +0,0 @@ -# runs the specified steps while logged in to the container registry - -parameters: -- name: Steps - type: stepList -- name: ContainerRegistry - type: string - -steps: -- task: Docker@2 - inputs: - containerRegistry: "${{ parameters.ContainerRegistry }}" - command: "login" - addPipelineData: false - displayName: "Log in to container registry" - -- ${{ parameters.Steps }} - -- task: Docker@2 - inputs: - containerRegistry: "${{ parameters.ContainerRegistry }}" - command: "logout" - addPipelineData: false - displayName: "Log out of container registry" - condition: always() \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipeline/wheels_linux.yml b/tools/ci_build/github/azure-pipeline/wheels_linux.yml deleted file mode 100644 index 4d7940f2c..000000000 --- a/tools/ci_build/github/azure-pipeline/wheels_linux.yml +++ /dev/null @@ -1,81 +0,0 @@ -parameters: -- name: ExtraEnv - displayName: 'Extra env variable set to CIBW_ENVIRONMENT, in form of "A=1 B=2 C=3"' - type: string - default: '' - -trigger: none - -resources: - repositories: - - repository: 1esPipelines - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release - -extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - parameters: - pool: - name: 'onnxruntime-Ubuntu2204-AMD-CPU' - os: linux - sdl: - sourceAnalysisPool: - name: onnxruntime-Win-CPU-2022 - os: windows - policheck: - enabled: true - break: true # always break the build on policheck issues. You can disable it by setting to 'false' - exclusionsFile: '$(Build.SourcesDirectory)\.config\policheck_exclusions.xml' - stages: - - stage: stage - jobs: - - job: linux_x86_64 - timeoutInMinutes: 180 - variables: - CIBW_BUILD: "cp3{10,11,12,13}-*" - CIBW_SKIP: "*musllinux*" - CIBW_ENVIRONMENT: "${{ parameters.ExtraEnv }}" - templateContext: - outputs: - - output: pipelineArtifact - path: 'wheelhouse' - artifact: drop_x86_64 - - steps: - - task: UsePythonVersion@0 - - bash: | - set -o errexit - python3 -m pip install --upgrade pip - pip3 install cibuildwheel - displayName: Install dependencies - - - bash: cibuildwheel --archs x86_64 --output-dir wheelhouse . - displayName: Build wheels for x86_64 - - - job: manylinux_aarch64 - timeoutInMinutes: 180 - variables: - CIBW_BUILD: "cp3{10,11,12,13}-*" - CIBW_SKIP: "*musllinux_*" - # AzureOp doesn't support aaarch64 yet. - # CIBW_ENVIRONMENT: "${{ parameters.ExtraEnv }}" - templateContext: - outputs: - - output: pipelineArtifact - path: 'wheelhouse' - artifact: drop_aarch64 - - steps: - - task: UsePythonVersion@0 - - bash: | - set -o errexit - python3 -m pip install --upgrade pip - pip3 install cibuildwheel - displayName: Install dependencies - - - script: docker run --privileged --rm tonistiigi/binfmt --install arm64 - displayName: Register QEMU for arm64 - - - bash: cibuildwheel --archs aarch64 --output-dir wheelhouse . - displayName: Build wheels for arm64 diff --git a/tools/ci_build/github/azure-pipeline/wheels_macos.yml b/tools/ci_build/github/azure-pipeline/wheels_macos.yml deleted file mode 100644 index a9c765e48..000000000 --- a/tools/ci_build/github/azure-pipeline/wheels_macos.yml +++ /dev/null @@ -1,52 +0,0 @@ -trigger: none - -resources: - repositories: - - repository: 1esPipelines - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release - -extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - parameters: - pool: - name: "Azure Pipelines" - image: "macOS-14" - os: macOS - sdl: - sourceAnalysisPool: - name: onnxruntime-Win-CPU-2022 - os: windows - policheck: - enabled: true - break: true # always break the build on policheck issues. You can disable it by setting to 'false' - exclusionsFile: '$(Build.SourcesDirectory)\.config\policheck_exclusions.xml' - stages: - - stage: stage - jobs: - - job: macos - timeoutInMinutes: 180 - variables: - CIBW_BUILD: "cp3{10,11,12,13}-*" - CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" - CIBW_ENVIRONMENT: "MACOSX_DEPLOYMENT_TARGET=11.0" - # Skip trying to test arm64 builds on Intel Macs - # CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64" - # Disable building PyPy wheels - CIBW_SKIP: pp* - templateContext: - outputs: - - output: pipelineArtifact - path: 'wheelhouse' - artifact: drop - - steps: - - task: UsePythonVersion@0 - - bash: | - set -o errexit - python3 -m pip install --upgrade pip - python3 -m pip install cibuildwheel - displayName: Install dependencies - - bash: CPU_NUMBER=2 cibuildwheel --output-dir wheelhouse . - displayName: Build wheels diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubi8_cuda11_8_tensorrt8_6 b/tools/ci_build/github/linux/docker/Dockerfile.ubi8_cuda11_8_tensorrt8_6 deleted file mode 100644 index fa175b234..000000000 --- a/tools/ci_build/github/linux/docker/Dockerfile.ubi8_cuda11_8_tensorrt8_6 +++ /dev/null @@ -1,43 +0,0 @@ -# -------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. -# -------------------------------------------------------------- -# Dockerfile to Test ONNX Runtime on UBI8 with CUDA 11.8 and TensorRT 8.6 - -# Build base image with required system packages -FROM nvidia/cuda:11.8.0-cudnn8-devel-ubi8 AS base - -ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/src/tensorrt/bin:${PATH} - -RUN dnf install -y bash wget git&&\ - dnf clean dbcache - -# Install python3 -RUN dnf install -y \ - python3.8 \ - python38-pip \ - python38-wheel &&\ - cd /usr/local/bin &&\ - ln -s /usr/bin/python3 python3.8 &&\ - ln -s /usr/bin/pip3 pip3.8; - -RUN pip3 install --upgrade pip -RUN pip3 install setuptools>=68.2.2 -RUN pip3 install cmake==3.28.4 - -# Install TensorRT -RUN dnf install -y libnvinfer8 libnvonnxparsers8 libnvparsers8 libnvinfer-plugin8 libnvinfer-lean8 libnvinfer-vc-plugin8 libnvinfer-dispatch8 -RUN v="8.6.1.6-1+cuda11.8" &&\ - dnf downgrade -y libnvinfer8-${v} libnvinfer8-${v} libnvonnxparsers8-${v} libnvparsers8-${v} libnvinfer-plugin8-${v} libnvinfer-lean8-${v} libnvinfer-vc-plugin8-${v} libnvinfer-dispatch8-${v} &&\ - dnf install -y dnf-plugin-versionlock &&\ - dnf versionlock libnvinfer8 libnvonnxparsers8 libnvparsers8 libnvinfer-plugin8 libnvinfer-lean8 libnvinfer-vc-plugin8 libnvinfer-dispatch8 -RUN dnf clean dbcache -#RUN ln -s /usr/local/cuda-11.8/bin /usr/local/cuda/bin - -# Build final image from base. -FROM base as final -ARG BUILD_USER=onnxruntimedev -ARG BUILD_UID=1000 -RUN adduser --uid $BUILD_UID $BUILD_USER -WORKDIR /home/$BUILD_USER -USER $BUILD_USER