From 9dfe705e1b4da2039f828288938cdff356a0470b Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 19 Feb 2025 10:11:00 -0800 Subject: [PATCH 01/33] Update rn ci to 1es --- .../templates/android-java-api-aar.yml | 4 +- .../templates/react-native-ci.yml | 412 +++++++++--------- 2 files changed, 216 insertions(+), 200 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml index cecd6fd912270..0c1bf14824831 100644 --- a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml +++ b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml @@ -136,7 +136,7 @@ jobs: parameters: JarFileDirectory: '$(artifacts_directory)' - - task: PublishBuildArtifacts@1 + - task: 1ES.PublishPipelineArtifacts@1 inputs: - pathtoPublish: '$(artifacts_directory)' + targetPath: '$(artifacts_directory)' artifactName: '${{parameters.artifactName}}' diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index b46fae79899e2..c046f23400209 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -28,229 +28,245 @@ parameters: displayName: Use GPG to sign the jars type: boolean -stages: -- stage: Build_Android_Packages - displayName: Build_Android_Packages - dependsOn: '${{parameters.InitialStageDependsOn}}' - jobs: - - template: android-java-api-aar.yml - parameters: - buildConfig: '${{parameters.BuildConfig}}' - buildSettings: '$(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_aar_build_settings.json' - artifactName: 'onnxruntime-android-full-aar' - job_name_suffix: 'For_React_Native' - enable_code_sign: '${{parameters.enable_code_sign}}' - pool_name: '${{parameters.PoolName}}' - packageName: 'onnxruntime-android' -- stage: ReactNative_CI_Android - displayName: ReactNative_CI_Android - dependsOn: Build_Android_Packages - jobs: - - template: ../stages/jobs/react-natvie-andriod-e2e-test-job.yml - parameters: - PackageName: '${{parameters.PackageName}}' - ArtifactName: 'onnxruntime-android-full-aar' - NpmPackagingMode: '${{parameters.NpmPackagingMode}}' +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release +extends: + # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks. + # For non-production pipelines, use "Unofficial" as defined below. + # For productions pipelines, use "Official". + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + parameters: + sdl: + sourceAnalysisPool: + name: onnxruntime-Win-CPU-2022 + os: windows + stages: + - stage: Build_Android_Packages + displayName: Build_Android_Packages + dependsOn: '${{parameters.InitialStageDependsOn}}' + jobs: + - template: android-java-api-aar.yml + parameters: + buildConfig: '${{parameters.BuildConfig}}' + buildSettings: '$(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_aar_build_settings.json' + artifactName: 'onnxruntime-android-full-aar' + job_name_suffix: 'For_React_Native' + enable_code_sign: '${{parameters.enable_code_sign}}' + pool_name: '${{parameters.PoolName}}' + packageName: 'onnxruntime-android' + - stage: ReactNative_CI_Android + displayName: ReactNative_CI_Android + dependsOn: Build_Android_Packages + jobs: + - template: ../stages/jobs/react-natvie-andriod-e2e-test-job.yml + parameters: + PackageName: '${{parameters.PackageName}}' + ArtifactName: 'onnxruntime-android-full-aar' + NpmPackagingMode: '${{parameters.NpmPackagingMode}}' -- stage: ReactNative_CI_iOS - displayName: ReactNative_CI_iOS - dependsOn: '${{parameters.InitialStageDependsOn}}' - jobs: - - job: ReactNative_CI_iOS - pool: - vmImage: 'macOS-13' + - stage: ReactNative_CI_iOS + displayName: ReactNative_CI_iOS + dependsOn: '${{parameters.InitialStageDependsOn}}' + jobs: + - job: ReactNative_CI_iOS + pool: + vmImage: 'macOS-13' - timeoutInMinutes: 90 + timeoutInMinutes: 90 - variables: - runCodesignValidationInjection: false - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - ORT_CACHE_DIR: '$(Pipeline.Workspace)/ccache_ort' + variables: + runCodesignValidationInjection: false + TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] + ORT_CACHE_DIR: '$(Pipeline.Workspace)/ccache_ort' - steps: - - template: use-xcode-version.yml - - task: UsePythonVersion@0 - displayName: Use python 3.12 - inputs: - versionSpec: "3.12" - addToPath: true - architecture: "x64" + steps: + - template: use-xcode-version.yml + - task: UsePythonVersion@0 + displayName: Use python 3.12 + inputs: + versionSpec: "3.12" + addToPath: true + architecture: "x64" - - script: | - pip install -r tools/ci_build/github/apple/ios_packaging/requirements.txt - displayName: "Install Python requirements" - # Build the iOS package - - template: mac-build-step-with-cache.yml - parameters: - WithCache: true - Today: $(TODAY) - AdditionalKey: react_${{parameters.BuildConfig}} - CacheDir: $(ORT_CACHE_DIR) - BuildStep: - - script: | - set -e -x - python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_apple_pods.py \ - --build-dir "$(Build.BinariesDirectory)/ios_framework_full" \ - --staging-dir "$(Build.BinariesDirectory)/ios-full-pod" \ - --variant Full \ - --build-settings-file $(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json - displayName: Build iOS package and assemble pods - env: - CC: clang - CXX: clang++ - CCACHE_CPP2: 1 - CCACHE_DEPEND: 1 - CCACHE_SLOPPINESS: modules - CCACHE_DIR: $(ORT_CACHE_DIR) - # Test the iOS package - - task: NodeTool@0 - inputs: - versionSpec: '20.x' - - script: - brew install coreutils ninja npm yarn - displayName: Install coreutils, ninja, npm, and yarn + - script: | + pip install -r tools/ci_build/github/apple/ios_packaging/requirements.txt + displayName: "Install Python requirements" + # Build the iOS package + - template: mac-build-step-with-cache.yml + parameters: + WithCache: true + Today: $(TODAY) + AdditionalKey: react_${{parameters.BuildConfig}} + CacheDir: $(ORT_CACHE_DIR) + BuildStep: + - script: | + set -e -x + python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_apple_pods.py \ + --build-dir "$(Build.BinariesDirectory)/ios_framework_full" \ + --staging-dir "$(Build.BinariesDirectory)/ios-full-pod" \ + --variant Full \ + --build-settings-file $(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json + displayName: Build iOS package and assemble pods + env: + CC: clang + CXX: clang++ + CCACHE_CPP2: 1 + CCACHE_DEPEND: 1 + CCACHE_SLOPPINESS: modules + CCACHE_DIR: $(ORT_CACHE_DIR) + # Test the iOS package + - task: NodeTool@0 + inputs: + versionSpec: '20.x' + - script: + brew install coreutils ninja npm yarn + displayName: Install coreutils, ninja, npm, and yarn - - script: - yarn global add detox-cli - displayName: Install detox cli tools + - script: + yarn global add detox-cli + displayName: Install detox cli tools - - script: - brew tap wix/brew - displayName: brew tap wix/brew + - script: + brew tap wix/brew + displayName: brew tap wix/brew - - script: - brew install applesimutils - displayName: Install applesimutils tools required by detox ios + - script: + brew install applesimutils + displayName: Install applesimutils tools required by detox ios - - script: | - npm ci - workingDirectory: '$(Build.SourcesDirectory)/js' - displayName: npm ci js + - script: | + npm ci + workingDirectory: '$(Build.SourcesDirectory)/js' + displayName: npm ci js - - script: | - npm ci - workingDirectory: '$(Build.SourcesDirectory)/js/common' - displayName: npm ci js/common + - script: | + npm ci + workingDirectory: '$(Build.SourcesDirectory)/js/common' + displayName: npm ci js/common - - script: | - yarn - workingDirectory: '$(Build.SourcesDirectory)/js/react_native' - displayName: yarn js/react_native + - script: | + yarn + workingDirectory: '$(Build.SourcesDirectory)/js/react_native' + displayName: yarn js/react_native - - task: PowerShell@2 - inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/js/pack-npm-packages.ps1' - arguments: '"-dev.$(Get-Date -Format yyyyMMdd)-$(git rev-parse --short HEAD)" $(Build.SourcesDirectory) react_native' - workingDirectory: '$(Build.SourcesDirectory)' - errorActionPreference: stop - env: - ORT_JS_PACK_MODE: e2e - displayName: Pack NPM packages + - task: PowerShell@2 + inputs: + filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/js/pack-npm-packages.ps1' + arguments: '"-dev.$(Get-Date -Format yyyyMMdd)-$(git rev-parse --short HEAD)" $(Build.SourcesDirectory) react_native' + workingDirectory: '$(Build.SourcesDirectory)' + errorActionPreference: stop + env: + ORT_JS_PACK_MODE: e2e + displayName: Pack NPM packages - - script: | - set -x -e - mv $(Build.SourcesDirectory)/js/common/onnxruntime-common*.tgz onnxruntime-common.tgz - yarn add --no-lockfile file:./onnxruntime-common.tgz - mv $(Build.SourcesDirectory)/js/react_native/onnxruntime-react-native*.tgz onnxruntime-react-native.tgz - yarn add --no-lockfile file:./onnxruntime-react-native.tgz - yarn - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' - displayName: Bootstrap Android and iOS e2e tests + - script: | + set -x -e + mv $(Build.SourcesDirectory)/js/common/onnxruntime-common*.tgz onnxruntime-common.tgz + yarn add --no-lockfile file:./onnxruntime-common.tgz + mv $(Build.SourcesDirectory)/js/react_native/onnxruntime-react-native*.tgz onnxruntime-react-native.tgz + yarn add --no-lockfile file:./onnxruntime-react-native.tgz + yarn + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' + displayName: Bootstrap Android and iOS e2e tests - - script: | - yarn add --dev jest-junit - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' - displayName: install jest junit reporter js/react_native/e2e + - script: | + yarn add --dev jest-junit + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' + displayName: install jest junit reporter js/react_native/e2e - - script: | - ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios-full-pod/onnxruntime-c \ - pod install - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios' - displayName: Pod install for onnxruntime react native ios bridge library + - script: | + ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios-full-pod/onnxruntime-c \ + pod install + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios' + displayName: Pod install for onnxruntime react native ios bridge library - - script: | - ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios-full-pod/onnxruntime-c \ - pod install - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e/ios' - displayName: Pod install for onnxruntime react native ios e2e tests + - script: | + ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios-full-pod/onnxruntime-c \ + pod install + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e/ios' + displayName: Pod install for onnxruntime react native ios e2e tests - - script: | - detox build --configuration ios.sim.release - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' - displayName: Build React Native Detox iOS e2e Tests - # - # Unit tests and E2E tests with iOS simulator - # - - script: | - set -e - DEVICE_ID_FILE="$(Build.BinariesDirectory)/ios_simulator_device_id.txt" - xcrun simctl create iPhoneRNTest com.apple.CoreSimulator.SimDeviceType.iPhone-13 > "${DEVICE_ID_FILE}" - displayName: Start iOS Simulator + - script: | + detox build --configuration ios.sim.release + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' + displayName: Build React Native Detox iOS e2e Tests + # + # Unit tests and E2E tests with iOS simulator + # + - script: | + set -e + DEVICE_ID_FILE="$(Build.BinariesDirectory)/ios_simulator_device_id.txt" + xcrun simctl create iPhoneRNTest com.apple.CoreSimulator.SimDeviceType.iPhone-13 > "${DEVICE_ID_FILE}" + displayName: Start iOS Simulator - - task: Xcode@5 - inputs: - actions: 'test' - configuration: 'Debug' - sdk: 'iphonesimulator' - xcWorkspacePath: '$(Build.SourcesDirectory)/js/react_native/ios/OnnxruntimeModule.xcworkspace' - scheme: 'OnnxruntimeModuleTest' - packageApp: false - destinationPlatformOption: 'iOS' - destinationSimulators: 'iPhone 14,OS=16.4' - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios' - xcprettyArgs: '--output build/reports/test-results.xml' - publishJUnitResults: true - testRunTitle: 'React Native iOS Instrumented Test Results' - displayName: Run React Native iOS Instrumented Tests + - task: Xcode@5 + inputs: + actions: 'test' + configuration: 'Debug' + sdk: 'iphonesimulator' + xcWorkspacePath: '$(Build.SourcesDirectory)/js/react_native/ios/OnnxruntimeModule.xcworkspace' + scheme: 'OnnxruntimeModuleTest' + packageApp: false + destinationPlatformOption: 'iOS' + destinationSimulators: 'iPhone 14,OS=16.4' + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios' + xcprettyArgs: '--output build/reports/test-results.xml' + publishJUnitResults: true + testRunTitle: 'React Native iOS Instrumented Test Results' + displayName: Run React Native iOS Instrumented Tests - - task: PublishTestResults@2 - inputs: - testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/ios/build/reports/test-results.xml' - failTaskOnFailedTests: true - testRunTitle: 'React Native iOS Instrumented Test results' - condition: succeededOrFailed() - displayName: Publish React Native iOS Instrumented Test Results + - task: PublishTestResults@2 + inputs: + testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/ios/build/reports/test-results.xml' + failTaskOnFailedTests: true + testRunTitle: 'React Native iOS Instrumented Test results' + condition: succeededOrFailed() + displayName: Publish React Native iOS Instrumented Test Results - - script: | - xcrun simctl list devices - displayName: List iOS Simulators - continueOnError: true + - script: | + xcrun simctl list devices + displayName: List iOS Simulators + continueOnError: true - - script: | - JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml \ - detox test --record-logs all \ - --configuration ios.sim.release \ - --loglevel trace \ - --take-screenshots failing - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' - displayName: Run React Native Detox iOS e2e Tests + - script: | + JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml \ + detox test --record-logs all \ + --configuration ios.sim.release \ + --loglevel trace \ + --take-screenshots failing + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' + displayName: Run React Native Detox iOS e2e Tests - - script: | - set -e - DEVICE_ID_FILE="$(Build.BinariesDirectory)/ios_simulator_device_id.txt" - if [[ -f "${DEVICE_ID_FILE}" ]]; then - xcrun simctl delete "$(cat "${DEVICE_ID_FILE}")" - rm "${DEVICE_ID_FILE}" - fi - displayName: Stop iOS Simulator - condition: always() + - script: | + set -e + DEVICE_ID_FILE="$(Build.BinariesDirectory)/ios_simulator_device_id.txt" + if [[ -f "${DEVICE_ID_FILE}" ]]; then + xcrun simctl delete "$(cat "${DEVICE_ID_FILE}")" + rm "${DEVICE_ID_FILE}" + fi + displayName: Stop iOS Simulator + condition: always() - - task: PublishTestResults@2 - inputs: - testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml' - failTaskOnFailedTests: true - testRunTitle: 'React Native Detox iOS e2e Test Results' - condition: succeededOrFailed() - displayName: Publish React Native Detox iOS e2e Test Results + - task: PublishTestResults@2 + inputs: + testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml' + failTaskOnFailedTests: true + testRunTitle: 'React Native Detox iOS e2e Test Results' + condition: succeededOrFailed() + displayName: Publish React Native Detox iOS e2e Test Results - - task: PublishPipelineArtifact@1 - inputs: - artifact: ios_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) - targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' - condition: succeededOrFailed() - displayName: Publish React Native Detox E2E test logs + - task: PublishPipelineArtifact@1 + inputs: + artifact: ios_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs - - template: explicitly-defined-final-tasks.yml + - template: explicitly-defined-final-tasks.yml From 57fb1e7bd184edf7a060ac04e4dd89c818336395 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 19 Feb 2025 10:12:25 -0800 Subject: [PATCH 02/33] Update rn ci to 1es --- .../azure-pipelines/templates/react-native-ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index c046f23400209..aed0cd5de5e96 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -1,3 +1,10 @@ +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + parameters: - name: NpmPackagingMode displayName: 'NPM packages publish configuration' @@ -28,12 +35,7 @@ parameters: displayName: Use GPG to sign the jars type: boolean -resources: - repositories: - - repository: 1esPipelines - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release + extends: # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks. # For non-production pipelines, use "Unofficial" as defined below. From 383e83877837197135d5f63073c096e14f4ba7f7 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 19 Feb 2025 10:14:37 -0800 Subject: [PATCH 03/33] Update rn ci to 1es --- .../github/azure-pipelines/templates/react-native-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index aed0cd5de5e96..ecad7526382a5 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -1,3 +1,4 @@ +#### end trigger #### resources: repositories: - repository: 1esPipelines @@ -5,6 +6,7 @@ resources: name: 1ESPipelineTemplates/1ESPipelineTemplates ref: refs/tags/release + parameters: - name: NpmPackagingMode displayName: 'NPM packages publish configuration' From 906939467254ee97b644cb185d71270a0865e57c Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 19 Feb 2025 10:17:48 -0800 Subject: [PATCH 04/33] Update rn ci to 1es --- .../mac-react-native-ci-pipeline.yml | 28 +- .../templates/react-native-ci.yml | 462 +++++++++--------- 2 files changed, 243 insertions(+), 247 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml index e72f088cfeb55..40c051ee99238 100644 --- a/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml @@ -27,6 +27,12 @@ pr: - 'js/web' - 'onnxruntime/core/providers/js' #### end trigger #### +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release parameters: - name: NpmPublish @@ -50,10 +56,20 @@ variables: ${{ if eq(parameters.NpmPublish, 'custom') }}: NpmPackagingMode: '$(VersionSuffix)' -stages: -- template: templates/react-native-ci.yml +exstends: + # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks. + # For non-production pipelines, use "Unofficial" as defined below. + # For productions pipelines, use "Official". + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines parameters: - NpmPackagingMode: ${{ variables.NpmPackagingMode }} - BuildConfig: 'Release' - PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' - enable_code_sign: false + sdl: + sourceAnalysisPool: + name: onnxruntime-Win-CPU-2022 + os: windows + stages: + - template: templates/react-native-ci.yml + parameters: + NpmPackagingMode: ${{ variables.NpmPackagingMode }} + BuildConfig: 'Release' + PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' + enable_code_sign: false diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index ecad7526382a5..b46fae79899e2 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -1,12 +1,3 @@ -#### end trigger #### -resources: - repositories: - - repository: 1esPipelines - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release - - parameters: - name: NpmPackagingMode displayName: 'NPM packages publish configuration' @@ -37,240 +28,229 @@ parameters: displayName: Use GPG to sign the jars type: boolean - -extends: - # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks. - # For non-production pipelines, use "Unofficial" as defined below. - # For productions pipelines, use "Official". - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines - parameters: - sdl: - sourceAnalysisPool: - name: onnxruntime-Win-CPU-2022 - os: windows - stages: - - stage: Build_Android_Packages - displayName: Build_Android_Packages - dependsOn: '${{parameters.InitialStageDependsOn}}' - jobs: - - template: android-java-api-aar.yml - parameters: - buildConfig: '${{parameters.BuildConfig}}' - buildSettings: '$(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_aar_build_settings.json' - artifactName: 'onnxruntime-android-full-aar' - job_name_suffix: 'For_React_Native' - enable_code_sign: '${{parameters.enable_code_sign}}' - pool_name: '${{parameters.PoolName}}' - packageName: 'onnxruntime-android' - - stage: ReactNative_CI_Android - displayName: ReactNative_CI_Android - dependsOn: Build_Android_Packages - jobs: - - template: ../stages/jobs/react-natvie-andriod-e2e-test-job.yml +stages: +- stage: Build_Android_Packages + displayName: Build_Android_Packages + dependsOn: '${{parameters.InitialStageDependsOn}}' + jobs: + - template: android-java-api-aar.yml + parameters: + buildConfig: '${{parameters.BuildConfig}}' + buildSettings: '$(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_aar_build_settings.json' + artifactName: 'onnxruntime-android-full-aar' + job_name_suffix: 'For_React_Native' + enable_code_sign: '${{parameters.enable_code_sign}}' + pool_name: '${{parameters.PoolName}}' + packageName: 'onnxruntime-android' +- stage: ReactNative_CI_Android + displayName: ReactNative_CI_Android + dependsOn: Build_Android_Packages + jobs: + - template: ../stages/jobs/react-natvie-andriod-e2e-test-job.yml + parameters: + PackageName: '${{parameters.PackageName}}' + ArtifactName: 'onnxruntime-android-full-aar' + NpmPackagingMode: '${{parameters.NpmPackagingMode}}' + +- stage: ReactNative_CI_iOS + displayName: ReactNative_CI_iOS + dependsOn: '${{parameters.InitialStageDependsOn}}' + jobs: + - job: ReactNative_CI_iOS + pool: + vmImage: 'macOS-13' + + timeoutInMinutes: 90 + + variables: + runCodesignValidationInjection: false + TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] + ORT_CACHE_DIR: '$(Pipeline.Workspace)/ccache_ort' + + steps: + - template: use-xcode-version.yml + - task: UsePythonVersion@0 + displayName: Use python 3.12 + inputs: + versionSpec: "3.12" + addToPath: true + architecture: "x64" + + - script: | + pip install -r tools/ci_build/github/apple/ios_packaging/requirements.txt + displayName: "Install Python requirements" + # Build the iOS package + - template: mac-build-step-with-cache.yml parameters: - PackageName: '${{parameters.PackageName}}' - ArtifactName: 'onnxruntime-android-full-aar' - NpmPackagingMode: '${{parameters.NpmPackagingMode}}' - - - stage: ReactNative_CI_iOS - displayName: ReactNative_CI_iOS - dependsOn: '${{parameters.InitialStageDependsOn}}' - jobs: - - job: ReactNative_CI_iOS - pool: - vmImage: 'macOS-13' - - timeoutInMinutes: 90 - - variables: - runCodesignValidationInjection: false - TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] - ORT_CACHE_DIR: '$(Pipeline.Workspace)/ccache_ort' - - steps: - - template: use-xcode-version.yml - - task: UsePythonVersion@0 - displayName: Use python 3.12 - inputs: - versionSpec: "3.12" - addToPath: true - architecture: "x64" - - - script: | - pip install -r tools/ci_build/github/apple/ios_packaging/requirements.txt - displayName: "Install Python requirements" - # Build the iOS package - - template: mac-build-step-with-cache.yml - parameters: - WithCache: true - Today: $(TODAY) - AdditionalKey: react_${{parameters.BuildConfig}} - CacheDir: $(ORT_CACHE_DIR) - BuildStep: - - script: | - set -e -x - python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_apple_pods.py \ - --build-dir "$(Build.BinariesDirectory)/ios_framework_full" \ - --staging-dir "$(Build.BinariesDirectory)/ios-full-pod" \ - --variant Full \ - --build-settings-file $(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json - displayName: Build iOS package and assemble pods - env: - CC: clang - CXX: clang++ - CCACHE_CPP2: 1 - CCACHE_DEPEND: 1 - CCACHE_SLOPPINESS: modules - CCACHE_DIR: $(ORT_CACHE_DIR) - # Test the iOS package - - task: NodeTool@0 - inputs: - versionSpec: '20.x' - - script: - brew install coreutils ninja npm yarn - displayName: Install coreutils, ninja, npm, and yarn - - - script: - yarn global add detox-cli - displayName: Install detox cli tools - - - script: - brew tap wix/brew - displayName: brew tap wix/brew - - - script: - brew install applesimutils - displayName: Install applesimutils tools required by detox ios - - - script: | - npm ci - workingDirectory: '$(Build.SourcesDirectory)/js' - displayName: npm ci js - - - script: | - npm ci - workingDirectory: '$(Build.SourcesDirectory)/js/common' - displayName: npm ci js/common - - - script: | - yarn - workingDirectory: '$(Build.SourcesDirectory)/js/react_native' - displayName: yarn js/react_native - - - task: PowerShell@2 - inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/js/pack-npm-packages.ps1' - arguments: '"-dev.$(Get-Date -Format yyyyMMdd)-$(git rev-parse --short HEAD)" $(Build.SourcesDirectory) react_native' - workingDirectory: '$(Build.SourcesDirectory)' - errorActionPreference: stop - env: - ORT_JS_PACK_MODE: e2e - displayName: Pack NPM packages - - - script: | - set -x -e - mv $(Build.SourcesDirectory)/js/common/onnxruntime-common*.tgz onnxruntime-common.tgz - yarn add --no-lockfile file:./onnxruntime-common.tgz - mv $(Build.SourcesDirectory)/js/react_native/onnxruntime-react-native*.tgz onnxruntime-react-native.tgz - yarn add --no-lockfile file:./onnxruntime-react-native.tgz - yarn - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' - displayName: Bootstrap Android and iOS e2e tests - - - script: | - yarn add --dev jest-junit - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' - displayName: install jest junit reporter js/react_native/e2e - - - script: | - ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios-full-pod/onnxruntime-c \ - pod install + WithCache: true + Today: $(TODAY) + AdditionalKey: react_${{parameters.BuildConfig}} + CacheDir: $(ORT_CACHE_DIR) + BuildStep: + - script: | + set -e -x + python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_apple_pods.py \ + --build-dir "$(Build.BinariesDirectory)/ios_framework_full" \ + --staging-dir "$(Build.BinariesDirectory)/ios-full-pod" \ + --variant Full \ + --build-settings-file $(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json + displayName: Build iOS package and assemble pods + env: + CC: clang + CXX: clang++ + CCACHE_CPP2: 1 + CCACHE_DEPEND: 1 + CCACHE_SLOPPINESS: modules + CCACHE_DIR: $(ORT_CACHE_DIR) + # Test the iOS package + - task: NodeTool@0 + inputs: + versionSpec: '20.x' + - script: + brew install coreutils ninja npm yarn + displayName: Install coreutils, ninja, npm, and yarn + + - script: + yarn global add detox-cli + displayName: Install detox cli tools + + - script: + brew tap wix/brew + displayName: brew tap wix/brew + + - script: + brew install applesimutils + displayName: Install applesimutils tools required by detox ios + + - script: | + npm ci + workingDirectory: '$(Build.SourcesDirectory)/js' + displayName: npm ci js + + - script: | + npm ci + workingDirectory: '$(Build.SourcesDirectory)/js/common' + displayName: npm ci js/common + + - script: | + yarn + workingDirectory: '$(Build.SourcesDirectory)/js/react_native' + displayName: yarn js/react_native + + - task: PowerShell@2 + inputs: + filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/js/pack-npm-packages.ps1' + arguments: '"-dev.$(Get-Date -Format yyyyMMdd)-$(git rev-parse --short HEAD)" $(Build.SourcesDirectory) react_native' + workingDirectory: '$(Build.SourcesDirectory)' + errorActionPreference: stop + env: + ORT_JS_PACK_MODE: e2e + displayName: Pack NPM packages + + - script: | + set -x -e + mv $(Build.SourcesDirectory)/js/common/onnxruntime-common*.tgz onnxruntime-common.tgz + yarn add --no-lockfile file:./onnxruntime-common.tgz + mv $(Build.SourcesDirectory)/js/react_native/onnxruntime-react-native*.tgz onnxruntime-react-native.tgz + yarn add --no-lockfile file:./onnxruntime-react-native.tgz + yarn + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' + displayName: Bootstrap Android and iOS e2e tests + + - script: | + yarn add --dev jest-junit + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' + displayName: install jest junit reporter js/react_native/e2e + + - script: | + ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios-full-pod/onnxruntime-c \ + pod install + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios' + displayName: Pod install for onnxruntime react native ios bridge library + + - script: | + ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios-full-pod/onnxruntime-c \ + pod install + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e/ios' + displayName: Pod install for onnxruntime react native ios e2e tests + + - script: | + detox build --configuration ios.sim.release + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' + displayName: Build React Native Detox iOS e2e Tests + # + # Unit tests and E2E tests with iOS simulator + # + - script: | + set -e + DEVICE_ID_FILE="$(Build.BinariesDirectory)/ios_simulator_device_id.txt" + xcrun simctl create iPhoneRNTest com.apple.CoreSimulator.SimDeviceType.iPhone-13 > "${DEVICE_ID_FILE}" + displayName: Start iOS Simulator + + - task: Xcode@5 + inputs: + actions: 'test' + configuration: 'Debug' + sdk: 'iphonesimulator' + xcWorkspacePath: '$(Build.SourcesDirectory)/js/react_native/ios/OnnxruntimeModule.xcworkspace' + scheme: 'OnnxruntimeModuleTest' + packageApp: false + destinationPlatformOption: 'iOS' + destinationSimulators: 'iPhone 14,OS=16.4' workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios' - displayName: Pod install for onnxruntime react native ios bridge library - - - script: | - ORT_C_LOCAL_POD_PATH=$(Build.BinariesDirectory)/ios-full-pod/onnxruntime-c \ - pod install - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e/ios' - displayName: Pod install for onnxruntime react native ios e2e tests - - - script: | - detox build --configuration ios.sim.release - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' - displayName: Build React Native Detox iOS e2e Tests - # - # Unit tests and E2E tests with iOS simulator - # - - script: | - set -e - DEVICE_ID_FILE="$(Build.BinariesDirectory)/ios_simulator_device_id.txt" - xcrun simctl create iPhoneRNTest com.apple.CoreSimulator.SimDeviceType.iPhone-13 > "${DEVICE_ID_FILE}" - displayName: Start iOS Simulator - - - task: Xcode@5 - inputs: - actions: 'test' - configuration: 'Debug' - sdk: 'iphonesimulator' - xcWorkspacePath: '$(Build.SourcesDirectory)/js/react_native/ios/OnnxruntimeModule.xcworkspace' - scheme: 'OnnxruntimeModuleTest' - packageApp: false - destinationPlatformOption: 'iOS' - destinationSimulators: 'iPhone 14,OS=16.4' - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios' - xcprettyArgs: '--output build/reports/test-results.xml' - publishJUnitResults: true - testRunTitle: 'React Native iOS Instrumented Test Results' - displayName: Run React Native iOS Instrumented Tests - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/ios/build/reports/test-results.xml' - failTaskOnFailedTests: true - testRunTitle: 'React Native iOS Instrumented Test results' - condition: succeededOrFailed() - displayName: Publish React Native iOS Instrumented Test Results - - - script: | - xcrun simctl list devices - displayName: List iOS Simulators - continueOnError: true - - - script: | - JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml \ - detox test --record-logs all \ - --configuration ios.sim.release \ - --loglevel trace \ - --take-screenshots failing - workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' - displayName: Run React Native Detox iOS e2e Tests - - - script: | - set -e - DEVICE_ID_FILE="$(Build.BinariesDirectory)/ios_simulator_device_id.txt" - if [[ -f "${DEVICE_ID_FILE}" ]]; then - xcrun simctl delete "$(cat "${DEVICE_ID_FILE}")" - rm "${DEVICE_ID_FILE}" - fi - displayName: Stop iOS Simulator - condition: always() - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml' - failTaskOnFailedTests: true - testRunTitle: 'React Native Detox iOS e2e Test Results' - condition: succeededOrFailed() - displayName: Publish React Native Detox iOS e2e Test Results - - - task: PublishPipelineArtifact@1 - inputs: - artifact: ios_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) - targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' - condition: succeededOrFailed() - displayName: Publish React Native Detox E2E test logs - - - template: explicitly-defined-final-tasks.yml + xcprettyArgs: '--output build/reports/test-results.xml' + publishJUnitResults: true + testRunTitle: 'React Native iOS Instrumented Test Results' + displayName: Run React Native iOS Instrumented Tests + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/ios/build/reports/test-results.xml' + failTaskOnFailedTests: true + testRunTitle: 'React Native iOS Instrumented Test results' + condition: succeededOrFailed() + displayName: Publish React Native iOS Instrumented Test Results + + - script: | + xcrun simctl list devices + displayName: List iOS Simulators + continueOnError: true + + - script: | + JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml \ + detox test --record-logs all \ + --configuration ios.sim.release \ + --loglevel trace \ + --take-screenshots failing + workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' + displayName: Run React Native Detox iOS e2e Tests + + - script: | + set -e + DEVICE_ID_FILE="$(Build.BinariesDirectory)/ios_simulator_device_id.txt" + if [[ -f "${DEVICE_ID_FILE}" ]]; then + xcrun simctl delete "$(cat "${DEVICE_ID_FILE}")" + rm "${DEVICE_ID_FILE}" + fi + displayName: Stop iOS Simulator + condition: always() + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml' + failTaskOnFailedTests: true + testRunTitle: 'React Native Detox iOS e2e Test Results' + condition: succeededOrFailed() + displayName: Publish React Native Detox iOS e2e Test Results + + - task: PublishPipelineArtifact@1 + inputs: + artifact: ios_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs + + - template: explicitly-defined-final-tasks.yml From e8fb5fed77fc4505c431e40fe52d3a2f57eb866d Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 19 Feb 2025 10:18:35 -0800 Subject: [PATCH 05/33] Update rn ci to 1es --- .../github/azure-pipelines/mac-react-native-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml index 40c051ee99238..42d9fc34192cf 100644 --- a/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml @@ -56,7 +56,7 @@ variables: ${{ if eq(parameters.NpmPublish, 'custom') }}: NpmPackagingMode: '$(VersionSuffix)' -exstends: +extends: # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks. # For non-production pipelines, use "Unofficial" as defined below. # For productions pipelines, use "Official". From c5f73a32eb9538774b26f2c6292032b1c9bc0c80 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 19 Feb 2025 10:19:50 -0800 Subject: [PATCH 06/33] Update rn ci to 1es --- .../mac-react-native-ci-pipeline.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml index 42d9fc34192cf..9d63fe9cc118d 100644 --- a/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/mac-react-native-ci-pipeline.yml @@ -66,10 +66,10 @@ extends: sourceAnalysisPool: name: onnxruntime-Win-CPU-2022 os: windows - stages: - - template: templates/react-native-ci.yml - parameters: - NpmPackagingMode: ${{ variables.NpmPackagingMode }} - BuildConfig: 'Release' - PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' - enable_code_sign: false + stages: + - template: templates/react-native-ci.yml + parameters: + NpmPackagingMode: ${{ variables.NpmPackagingMode }} + BuildConfig: 'Release' + PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' + enable_code_sign: false From 30f340305ab8367317dde75342b2150a5969660c Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:35:37 -0800 Subject: [PATCH 07/33] Update rn ci to 1es --- .../npm-packaging-pipeline.yml | 9 +- .../templates/android-java-api-aar.yml | 20 ++- .../templates/linux-wasm-ci.yml | 61 +++++---- .../templates/react-native-ci.yml | 22 ++-- .../azure-pipelines/templates/web-ci.yml | 29 +++-- .../azure-pipelines/templates/win-web-ci.yml | 119 ++++++++++-------- 6 files changed, 161 insertions(+), 99 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml index 73719426e2875..a2414287b87b4 100644 --- a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml @@ -9,6 +9,10 @@ parameters: - 'custom' default: 'nightly (@dev)' +- name: is1ES + type: boolean + default: true + variables: # pipeline should define the following variables # ExtraBuildArgs @@ -49,6 +53,7 @@ stages: RunWebGpuTestsForReleaseBuild: true WebGpuPoolName: 'onnxruntime-Win2022-VS2022-webgpu-A10' WebCpuPoolName: 'onnxruntime-Win2022-VS2022-webgpu-A10' + is1ES: ${{ parameters.is1ES }} - template: templates/react-native-ci.yml parameters: @@ -85,7 +90,7 @@ stages: targetFolder: $(Build.ArtifactStagingDirectory)\node-artifacts displayName: 'Copy onnxruntime-node Artifacts' - - task: PublishPipelineArtifact@0 + - task: 1ES.PublishPipelineArtifact@1 inputs: artifactName: 'onnxruntime-node' targetPath: '$(Build.ArtifactStagingDirectory)\node-artifacts' @@ -98,7 +103,7 @@ stages: targetFolder: $(Build.ArtifactStagingDirectory)\validation-scripts displayName: 'Copy validation scripts' - - task: PublishPipelineArtifact@0 + - task: 1ES.PublishPipelineArtifact@1 inputs: artifactName: 'validation_scripts' targetPath: '$(Build.ArtifactStagingDirectory)\validation-scripts' diff --git a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml index 0c1bf14824831..fbd7499ba1847 100644 --- a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml +++ b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml @@ -53,6 +53,11 @@ parameters: type: string default: '2.31.0.250130' +- name: is1ES + displayName: Is 1ES pipeline + type: boolean + default: false + jobs: - job: Android_Java_API_AAR_Packaging_${{ parameters.job_name_suffix }} timeoutInMinutes: 120 @@ -135,8 +140,13 @@ jobs: - template: jar-maven-signing-linux.yml parameters: JarFileDirectory: '$(artifacts_directory)' - - - task: 1ES.PublishPipelineArtifacts@1 - inputs: - targetPath: '$(artifacts_directory)' - artifactName: '${{parameters.artifactName}}' + - ${{ if eq(parameters.is1ES, false) }}: + - task: PublishPipelineArtifact@1 + inputs: + targetPath: '$(artifacts_directory)' + artifactName: '${{parameters.artifactName}}' + - ${{ if eq(parameters.is1ES, true) }}: + - task: 1ES.PublishPipelineArtifacts@1 + inputs: + targetPath: '$(artifacts_directory)' + artifactName: '${{parameters.artifactName}}' diff --git a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml index c050fec59476a..066962ab81c08 100644 --- a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml @@ -39,6 +39,11 @@ parameters: type: boolean default: false +- name: is1ES + displayName: 'Is 1ES pipeline' + type: boolean + default: false + jobs: - job: build_WASM pool: @@ -61,15 +66,15 @@ jobs: displayName: 'Get commit SHA' condition: eq('${{ parameters.CommitOverride }}', 'true') - script: | - export __commit__=<$(Pipeline.Workspace)/__commit.txt - git fetch origin +$__commit__:refs/remotes/origin/$__commit__ - git checkout --force $__commit__ + export __commit__=<$(Pipeline.Workspace)/__commit.txt + git fetch origin +$__commit__:refs/remotes/origin/$__commit__ + git checkout --force $__commit__ workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Read commit SHA and checkout' condition: eq('${{ parameters.CommitOverride }}', 'true') - script: | - git submodule sync --recursive - git submodule update --init --recursive + git submodule sync --recursive + git submodule update --init --recursive workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Checkout submodules' - task: UsePythonVersion@0 @@ -79,19 +84,19 @@ jobs: architecture: $(buildArch) - ${{if eq(parameters.WithCache, true)}}: - - script: | - set -ex - cd '$(Build.SourcesDirectory)/cmake/external/emsdk' - ./emsdk install 4.0.3 ccache-git-emscripten-64bit - ./emsdk activate 4.0.3 ccache-git-emscripten-64bit - displayName: 'emsdk install and activate ccache for emscripten' + - script: | + set -ex + cd '$(Build.SourcesDirectory)/cmake/external/emsdk' + ./emsdk install 4.0.3 ccache-git-emscripten-64bit + ./emsdk activate 4.0.3 ccache-git-emscripten-64bit + displayName: 'emsdk install and activate ccache for emscripten' - ${{if eq(parameters.WithCache, false)}}: - - script: | - set -ex - cd '$(Build.SourcesDirectory)/cmake/external/emsdk' - ./emsdk install 4.0.3 - ./emsdk activate 4.0.3 - displayName: 'emsdk install and activate ccache for emscripten' + - script: | + set -ex + cd '$(Build.SourcesDirectory)/cmake/external/emsdk' + ./emsdk install 4.0.3 + ./emsdk activate 4.0.3 + displayName: 'emsdk install and activate ccache for emscripten' - template: build-linux-wasm-step.yml parameters: @@ -145,12 +150,18 @@ jobs: cp $(Build.BinariesDirectory)/wasm_inferencing_jsep/${{ parameters.BuildConfig }}/ort-wasm-simd-threaded.jsep.mjs $(Build.ArtifactStagingDirectory) fi displayName: 'Create Artifacts' - - ${{ if eq(parameters.SkipPublish, false) }}: - - task: PublishPipelineArtifact@0 - displayName: 'Publish Pipeline Artifact' - inputs: - artifactName: '${{ parameters.BuildConfig }}_wasm' - targetPath: '$(Build.ArtifactStagingDirectory)' + - ${{ if eq(parameters.1ES, false) }}: + - task: PublishPipelineArtifact@0 + displayName: 'Publish Pipeline Artifact' + inputs: + artifactName: '${{ parameters.BuildConfig }}_wasm' + targetPath: '$(Build.ArtifactStagingDirectory)' + - ${{ if eq(parameters.1ES, true) }}: + - task: 1ES.PublishPipelineArtifact@1 + displayName: 'Publish Pipeline Artifact' + inputs: + artifactName: '${{ parameters.BuildConfig }}_wasm' + targetPath: '$(Build.ArtifactStagingDirectory)' - task: PublishTestResults@2 displayName: 'Publish unit test results' inputs: @@ -159,5 +170,5 @@ jobs: testRunTitle: 'Unit Test Run' condition: and(succeededOrFailed(), eq('${{ parameters.BuildConfig }}', 'Debug')) - template: component-governance-component-detection-steps.yml - parameters : - condition : 'succeeded' + parameters: + condition: 'succeeded' diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index b46fae79899e2..99a7eb6888ce8 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -42,6 +42,7 @@ stages: enable_code_sign: '${{parameters.enable_code_sign}}' pool_name: '${{parameters.PoolName}}' packageName: 'onnxruntime-android' + is1ES: '${{parameters.is1ES}}' - stage: ReactNative_CI_Android displayName: ReactNative_CI_Android dependsOn: Build_Android_Packages @@ -242,13 +243,20 @@ stages: testRunTitle: 'React Native Detox iOS e2e Test Results' condition: succeededOrFailed() displayName: Publish React Native Detox iOS e2e Test Results - - - task: PublishPipelineArtifact@1 - inputs: - artifact: ios_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) - targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' - condition: succeededOrFailed() - displayName: Publish React Native Detox E2E test logs + - ${{ if eq(parameters.is1ES, true) }}: + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifactName: 'ios_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt)' + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs + - ${{ if eq(parameters.is1ES, false) }}: + - task: PublishPipelineArtifact@1 + inputs: + artifact: ios_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs - template: explicitly-defined-final-tasks.yml diff --git a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml index d059921bb74c9..d2420979d60d8 100644 --- a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml @@ -57,6 +57,11 @@ parameters: type: boolean default: false +- name: is1ES + displayName: 'Is 1ES pipeline' + type: boolean + default: false + stages: - stage: Precheck_and_extract_commit jobs: @@ -71,8 +76,8 @@ stages: - checkout: self submodules: false - script: | - git submodule sync -- cmake/external/onnx - git submodule update --init -- cmake/external/onnx + git submodule sync -- cmake/external/onnx + git submodule update --init -- cmake/external/onnx workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Checkout submodule onnx' - task: NodeTool@0 @@ -86,11 +91,18 @@ stages: script: | echo $(Build.SourceVersion) echo $(Build.SourceVersion) > "$(Build.ArtifactStagingDirectory)"/__commit.txt - - task: PublishPipelineArtifact@0 - displayName: 'Publish __commit.txt' - inputs: - artifactName: '__commit' - targetPath: '$(Build.ArtifactStagingDirectory)' + - ${{ if eq(parameters.is1ES, false) }}: + - task: PublishPipelineArtifact@1 + displayName: 'Publish __commit.txt' + inputs: + artifactName: '__commit' + targetPath: '$(Build.ArtifactStagingDirectory)' + - ${{ if eq(parameters.is1ES, True) }}: + - task: 1ES.PublishPipelineArtifact@0 + displayName: 'Publish __commit.txt' + inputs: + artifactName: '__commit' + targetPath: '$(Build.ArtifactStagingDirectory)' - stage: Build_wasm_Debug dependsOn: Precheck_and_extract_commit @@ -104,6 +116,7 @@ stages: BuildJsep: ${{ parameters.BuildJsep }} BuildWebGPU: ${{ parameters.BuildWebGPU }} WithCache: ${{ parameters.WithCache }} + is1ES: ${{ parameters.is1ES }} - stage: Build_web_Debug dependsOn: Build_wasm_Debug @@ -111,6 +124,7 @@ stages: - template: win-web-ci.yml parameters: CommitOverride: true + is1ES: ${{ parameters.is1ES }} BuildConfig: 'Debug' NpmPackagingMode: ${{ parameters.NpmPackagingMode }} ${{ if eq(parameters.UseWebPoolName, true)}}: @@ -156,6 +170,7 @@ stages: jobs: - template: win-web-ci.yml parameters: + is1ES: ${{ parameters.is1ES }} CommitOverride: true BuildConfig: 'Release' NpmPackagingMode: ${{ parameters.NpmPackagingMode }} diff --git a/tools/ci_build/github/azure-pipelines/templates/win-web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/win-web-ci.yml index 06e16dcc25046..c4e748d1230a4 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-web-ci.yml @@ -24,6 +24,11 @@ parameters: type: boolean default: false +- name: is1ES + displayName: 'Is 1ES pipeline' + type: boolean + default: false + jobs: - job: build_onnxruntime_web pool: ${{ parameters.PoolName }} @@ -45,28 +50,28 @@ jobs: displayName: 'Get commit SHA' condition: eq('${{ parameters.CommitOverride }}', 'true') - script: | - set /p __commit__=<$(Pipeline.Workspace)\__commit.txt - git fetch origin +%__commit__%:refs/remotes/origin/%__commit__% - git checkout --force %__commit__% + set /p __commit__=<$(Pipeline.Workspace)\__commit.txt + git fetch origin +%__commit__%:refs/remotes/origin/%__commit__% + git checkout --force %__commit__% workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Read commit SHA and checkout' condition: eq('${{ parameters.CommitOverride }}', 'true') - script: | - echo.$(Build.SourceVersion)>$(Pipeline.Workspace)\__commit.txt + echo.$(Build.SourceVersion)>$(Pipeline.Workspace)\__commit.txt workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Write commit SHA to __commit.txt' condition: ne('${{ parameters.CommitOverride }}', 'true') - script: | - git submodule sync -- cmake\external\onnx - git submodule update --init -- cmake\external\onnx + git submodule sync -- cmake\external\onnx + git submodule update --init -- cmake\external\onnx workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Checkout submodule onnx' - script: | - echo.>>.gitattributes - echo /js/** text=auto eol=lf>>.gitattributes - rd /s /q js - git checkout -- js/** - git checkout -- .gitattributes + echo.>>.gitattributes + echo /js/** text=auto eol=lf>>.gitattributes + rd /s /q js + git checkout -- js/** + git checkout -- .gitattributes workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Testing: force EOL to lf on windows for /js/**' - task: NodeTool@0 @@ -86,43 +91,43 @@ jobs: flattenFolders: true displayName: 'Binplace dist files' - script: | - npm ci + npm ci workingDirectory: '$(Build.SourcesDirectory)\js' displayName: 'npm ci /js/' - script: | - npm ci + npm ci workingDirectory: '$(Build.SourcesDirectory)\js\common' displayName: 'npm ci /js/common/' - script: | - npm test + npm test workingDirectory: '$(Build.SourcesDirectory)\js\common' displayName: 'run onnxruntime-common tests' - script: | - npm ci + npm ci workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'npm ci /js/web/' - script: | - npm run prebuild + npm run prebuild workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'run TypeScript type check in /js/web/' - script: | - npm run lint + npm run lint workingDirectory: '$(Build.SourcesDirectory)\js' displayName: 'run ESLint' - script: | - npm run format + npm run format workingDirectory: '$(Build.SourcesDirectory)\js' displayName: 'Clang-format' - script: | - node -e "a=require('child_process').execSync('git diff --name-only').toString();if(a)throw new Error('Following source files are not formatted: (did you run \"npm run format\"?)\n'+a)" + node -e "a=require('child_process').execSync('git diff --name-only').toString();if(a)throw new Error('Following source files are not formatted: (did you run \"npm run format\"?)\n'+a)" workingDirectory: '$(Build.SourcesDirectory)\js' displayName: 'Check unformatted files' - script: | - npm run build:doc + npm run build:doc workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'Generating documents' - script: | - node -e "a=require('child_process').execSync('git diff --name-only').toString();if(a)throw new Error('Following documents are not up-to-date: (did you run \"npm run build:doc\"?)\n'+a)" + node -e "a=require('child_process').execSync('git diff --name-only').toString();if(a)throw new Error('Following documents are not up-to-date: (did you run \"npm run build:doc\"?)\n'+a)" workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'Check out of dated documents' - task: Cache@2 @@ -142,67 +147,67 @@ jobs: errorActionPreference: stop displayName: 'Pack NPM packages' - script: | - powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" + powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" displayName: 'Check active Chrome processes (before test)' condition: and(succeeded(), eq(variables['Agent.Diagnostic'], 'true')) - script: | - mkdir $(Agent.TempDirectory)\web\test\01 - dir $(Agent.TempDirectory)\web\test\01 - npm test -- -e=chrome -b=webgl,wasm --user-data-dir=$(Agent.TempDirectory)\web\test\01 --chromium-flags=--enable-logging --chromium-flags=--v=1 + mkdir $(Agent.TempDirectory)\web\test\01 + dir $(Agent.TempDirectory)\web\test\01 + npm test -- -e=chrome -b=webgl,wasm --user-data-dir=$(Agent.TempDirectory)\web\test\01 --chromium-flags=--enable-logging --chromium-flags=--v=1 workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'Run ort-web tests (wasm,webgl backend)' condition: and(succeeded(), eq('${{ parameters.RunWebGpuTests }}', 'false')) - script: | - powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" + powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" displayName: 'Check active Chrome processes (before test)' condition: and(succeeded(), eq(variables['Agent.Diagnostic'], 'true')) - script: | - mkdir $(Agent.TempDirectory)\web\test\02 - dir $(Agent.TempDirectory)\web\test\02 - npm test -- -e=chrome -b=webgl,wasm,webgpu $(webgpuCommandlineExtraFlags) --user-data-dir=$(Agent.TempDirectory)\web\test\02 --chromium-flags=--enable-logging --chromium-flags=--v=1 + mkdir $(Agent.TempDirectory)\web\test\02 + dir $(Agent.TempDirectory)\web\test\02 + npm test -- -e=chrome -b=webgl,wasm,webgpu $(webgpuCommandlineExtraFlags) --user-data-dir=$(Agent.TempDirectory)\web\test\02 --chromium-flags=--enable-logging --chromium-flags=--v=1 workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'Run ort-web tests (ALL backends)' condition: and(succeeded(), eq('${{ parameters.RunWebGpuTests }}', 'true')) - script: | - powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" + powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" displayName: 'Check active Chrome processes (before test)' condition: and(succeeded(), eq(variables['Agent.Diagnostic'], 'true')) - script: | - mkdir $(Agent.TempDirectory)\web\test\03 - dir $(Agent.TempDirectory)\web\test\03 - npm test -- suite1 -e=chrome -b=webgpu --io-binding=gpu-tensor $(webgpuCommandlineExtraFlags) --user-data-dir=$(Agent.TempDirectory)\web\test\03 --chromium-flags=--enable-logging --chromium-flags=--v=1 + mkdir $(Agent.TempDirectory)\web\test\03 + dir $(Agent.TempDirectory)\web\test\03 + npm test -- suite1 -e=chrome -b=webgpu --io-binding=gpu-tensor $(webgpuCommandlineExtraFlags) --user-data-dir=$(Agent.TempDirectory)\web\test\03 --chromium-flags=--enable-logging --chromium-flags=--v=1 workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'Run ort-web tests (Suite1, webgpu, IO-binding=gpu-tensor)' condition: and(succeeded(), eq('${{ parameters.RunWebGpuTests }}', 'true')) - script: | - powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" + powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" displayName: 'Check active Chrome processes (before test)' condition: and(succeeded(), eq(variables['Agent.Diagnostic'], 'true')) - script: | - mkdir $(Agent.TempDirectory)\web\test\04 - dir $(Agent.TempDirectory)\web\test\04 - npm test -- suite1 -e=chrome -b=webgpu --io-binding=gpu-location $(webgpuCommandlineExtraFlags) --user-data-dir=$(Agent.TempDirectory)\web\test\04 --chromium-flags=--enable-logging --chromium-flags=--v=1 + mkdir $(Agent.TempDirectory)\web\test\04 + dir $(Agent.TempDirectory)\web\test\04 + npm test -- suite1 -e=chrome -b=webgpu --io-binding=gpu-location $(webgpuCommandlineExtraFlags) --user-data-dir=$(Agent.TempDirectory)\web\test\04 --chromium-flags=--enable-logging --chromium-flags=--v=1 workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'Run ort-web tests (Suite1, webgpu, IO-binding=gpu-location)' condition: and(succeeded(), eq('${{ parameters.RunWebGpuTests }}', 'true')) - script: | - powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" + powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" displayName: 'Check active Chrome processes (before test)' condition: and(succeeded(), eq(variables['Agent.Diagnostic'], 'true')) - script: | - mkdir $(Agent.TempDirectory)\web\test\05 - dir $(Agent.TempDirectory)\web\test\05 - npm test -- --webgl.pack -b=webgl -e=chrome --user-data-dir=$(Agent.TempDirectory)\web\test\05 --chromium-flags=--enable-logging --chromium-flags=--v=1 + mkdir $(Agent.TempDirectory)\web\test\05 + dir $(Agent.TempDirectory)\web\test\05 + npm test -- --webgl.pack -b=webgl -e=chrome --user-data-dir=$(Agent.TempDirectory)\web\test\05 --chromium-flags=--enable-logging --chromium-flags=--v=1 workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'Run ort-web tests - WebGL: packed mode' - script: | - powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" + powershell "Get-WmiObject Win32_Process -Filter \"name = 'chrome.exe'\" | Format-List CommandLine" displayName: 'Check active Chrome processes (before test)' condition: and(succeeded(), eq(variables['Agent.Diagnostic'], 'true')) - script: | - mkdir $(Agent.TempDirectory)\web\test\06 - dir $(Agent.TempDirectory)\web\test\06 - npm test -- --wasm.proxy -b=wasm -e=chrome --user-data-dir=$(Agent.TempDirectory)\web\test\06 --chromium-flags=--enable-logging --chromium-flags=--v=1 + mkdir $(Agent.TempDirectory)\web\test\06 + dir $(Agent.TempDirectory)\web\test\06 + npm test -- --wasm.proxy -b=wasm -e=chrome --user-data-dir=$(Agent.TempDirectory)\web\test\06 --chromium-flags=--enable-logging --chromium-flags=--v=1 workingDirectory: '$(Build.SourcesDirectory)\js\web' displayName: 'Run ort-web tests - WebAssembly: proxy' condition: and(succeeded(), eq('${{ parameters.BuildConfig }}', 'Release')) @@ -226,12 +231,20 @@ jobs: targetFolder: $(Build.ArtifactStagingDirectory) displayName: 'Create Artifacts (onnxruntime-web)' condition: and(succeeded(), eq('${{ parameters.BuildConfig }}', 'Release')) - - task: PublishPipelineArtifact@0 - inputs: - artifactName: '${{ parameters.PackageName }}' - targetPath: '$(Build.ArtifactStagingDirectory)' - displayName: 'Publish Pipeline Artifact' - condition: and(succeeded(), eq('${{ parameters.BuildConfig }}', 'Release')) + - ${{ if eq(parameters.is1ES, false) }}: + - task: PublishPipelineArtifact@0 + inputs: + artifactName: '${{ parameters.PackageName }}' + targetPath: '$(Build.ArtifactStagingDirectory)' + displayName: 'Publish Pipeline Artifact' + condition: and(succeeded(), eq('${{ parameters.BuildConfig }}', 'Release')) + - ${{ if eq(parameters.is1ES, true) }}: + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifactName: '${{ parameters.PackageName }}' + targetPath: '$(Build.ArtifactStagingDirectory)' + displayName: 'Publish Pipeline Artifact' + condition: and(succeeded(), eq('${{ parameters.BuildConfig }}', 'Release')) - script: | if exist 01 (echo ------------------- BEGIN 01 -------------------&&type 01\chrome_debug.log&&echo ------------------- END 01 ------------------- ) if exist 02 (echo ------------------- BEGIN 02 -------------------&&type 02\chrome_debug.log&&echo ------------------- END 02 ------------------- ) @@ -243,5 +256,5 @@ jobs: workingDirectory: '$(Agent.TempDirectory)\web\test' condition: always() - template: component-governance-component-detection-steps.yml - parameters : - condition : 'succeeded' + parameters: + condition: 'succeeded' From d936efce7d8e527dc9f194cc742ee484113837a3 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:37:07 -0800 Subject: [PATCH 08/33] Update rn ci to 1es --- .../github/azure-pipelines/templates/linux-wasm-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml index 066962ab81c08..7c97b7bb20f7a 100644 --- a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml @@ -150,13 +150,13 @@ jobs: cp $(Build.BinariesDirectory)/wasm_inferencing_jsep/${{ parameters.BuildConfig }}/ort-wasm-simd-threaded.jsep.mjs $(Build.ArtifactStagingDirectory) fi displayName: 'Create Artifacts' - - ${{ if eq(parameters.1ES, false) }}: + - ${{ if eq(parameters.is1ES, false) }}: - task: PublishPipelineArtifact@0 displayName: 'Publish Pipeline Artifact' inputs: artifactName: '${{ parameters.BuildConfig }}_wasm' targetPath: '$(Build.ArtifactStagingDirectory)' - - ${{ if eq(parameters.1ES, true) }}: + - ${{ if eq(parameters.is1ES, true) }}: - task: 1ES.PublishPipelineArtifact@1 displayName: 'Publish Pipeline Artifact' inputs: From a019b2ce6e75c85be7eb1ad30e6731dd0e4fd375 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:38:16 -0800 Subject: [PATCH 09/33] Is 1ES --- .../github/azure-pipelines/templates/react-native-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index 99a7eb6888ce8..6a64b1b77e46b 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -28,6 +28,9 @@ parameters: displayName: Use GPG to sign the jars type: boolean +- name: is1ES + type: boolean + default: false stages: - stage: Build_Android_Packages displayName: Build_Android_Packages From 6973d04bef4b765f15f62ad400cf018b0f6acee9 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:40:42 -0800 Subject: [PATCH 10/33] Adding - repository: 1esPipelines --- .../github/azure-pipelines/npm-packaging-pipeline.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml index a2414287b87b4..1ca69dd619686 100644 --- a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml @@ -39,6 +39,11 @@ resources: endpoint: Microsoft name: pypa/manylinux ref: 5eda9aded5462201e6310105728d33016e637ea7 + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release stages: - template: templates/web-ci.yml From f1093f2cf7ff578f2eb2a5157b75115e4f80545d Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:41:20 -0800 Subject: [PATCH 11/33] Adding - repository: 1esPipelines --- tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml index 1ca69dd619686..989e470c7ae13 100644 --- a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml @@ -39,7 +39,6 @@ resources: endpoint: Microsoft name: pypa/manylinux ref: 5eda9aded5462201e6310105728d33016e637ea7 - repositories: - repository: 1esPipelines type: git name: 1ESPipelineTemplates/1ESPipelineTemplates From 518877cc479c677b8f2629ccfcf74d523c4d5242 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:43:47 -0800 Subject: [PATCH 12/33] Adding extends: --- .../npm-packaging-pipeline.yml | 134 ++++++++++-------- 1 file changed, 72 insertions(+), 62 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml index 989e470c7ae13..e9b19bacae0df 100644 --- a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml @@ -43,72 +43,82 @@ resources: type: git name: 1ESPipelineTemplates/1ESPipelineTemplates ref: refs/tags/release - -stages: -- template: templates/web-ci.yml +extends: + # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks. + # For non-production pipelines, use "Unofficial" as defined below. + # For productions pipelines, use "Official". + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines parameters: - NpmPackagingMode: ${{ variables.NpmPackagingMode }} - IsReleasePipeline: true - PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' - PackageName: 'onnxruntime-web' - ExtraBuildArgs: '' - UseWebPoolName: true - RunWebGpuTestsForDebugBuild: false - RunWebGpuTestsForReleaseBuild: true - WebGpuPoolName: 'onnxruntime-Win2022-VS2022-webgpu-A10' - WebCpuPoolName: 'onnxruntime-Win2022-VS2022-webgpu-A10' - is1ES: ${{ parameters.is1ES }} + # Update the pool with your team's 1ES hosted pool. + sdl: + sourceAnalysisPool: + name: onnxruntime-Win-CPU-2022 + os: windows + stages: + - template: templates/web-ci.yml + parameters: + NpmPackagingMode: ${{ variables.NpmPackagingMode }} + IsReleasePipeline: true + PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' + PackageName: 'onnxruntime-web' + ExtraBuildArgs: '' + UseWebPoolName: true + RunWebGpuTestsForDebugBuild: false + RunWebGpuTestsForReleaseBuild: true + WebGpuPoolName: 'onnxruntime-Win2022-VS2022-webgpu-A10' + WebCpuPoolName: 'onnxruntime-Win2022-VS2022-webgpu-A10' + is1ES: ${{ parameters.is1ES }} -- template: templates/react-native-ci.yml - parameters: - NpmPackagingMode: ${{ variables.NpmPackagingMode }} - BuildConfig: 'Release' - PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' - PackageName: 'onnxruntime-react-native' - InitialStageDependsOn: 'Precheck_and_extract_commit' - enable_code_sign: false + - template: templates/react-native-ci.yml + parameters: + NpmPackagingMode: ${{ variables.NpmPackagingMode }} + BuildConfig: 'Release' + PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' + PackageName: 'onnxruntime-react-native' + InitialStageDependsOn: 'Precheck_and_extract_commit' + enable_code_sign: false -- stage: Download_Node_Package_And_Publish_Validation_Script - dependsOn: - - ReactNative_CI_Android - - ReactNative_CI_iOS - - Build_web_Release - - Build_web_Debug - jobs: - - job: Download_Node_Package_And_Publish_Validation_Script - pool: 'Onnxruntime-Win-CPU-2022' - variables: - runCodesignValidationInjection: false - timeoutInMinutes: 10 - steps: -# This pipeline usually are triggered by Zip-Nuget-Java-Nodejs Packaging Pipeline, -# The NPM_packages is from Android_Java_API_AAR_Packaging_QNN, not from RN_CI - - download: build - artifact: 'NPM_packages' - displayName: 'Download NPM_packages from Zip-Nuget-Java-Nodejs Packaging Pipeline Pipeline Artifact' + - stage: Download_Node_Package_And_Publish_Validation_Script + dependsOn: + - ReactNative_CI_Android + - ReactNative_CI_iOS + - Build_web_Release + - Build_web_Debug + jobs: + - job: Download_Node_Package_And_Publish_Validation_Script + pool: 'Onnxruntime-Win-CPU-2022' + variables: + runCodesignValidationInjection: false + timeoutInMinutes: 10 + steps: + # This pipeline usually are triggered by Zip-Nuget-Java-Nodejs Packaging Pipeline, + # The NPM_packages is from Android_Java_API_AAR_Packaging_QNN, not from RN_CI + - download: build + artifact: 'NPM_packages' + displayName: 'Download NPM_packages from Zip-Nuget-Java-Nodejs Packaging Pipeline Pipeline Artifact' - - task: CopyFiles@2 - inputs: - sourceFolder: '$(Pipeline.Workspace)\build\NPM_packages' - contents: onnxruntime-*.tgz - targetFolder: $(Build.ArtifactStagingDirectory)\node-artifacts - displayName: 'Copy onnxruntime-node Artifacts' + - task: CopyFiles@2 + inputs: + sourceFolder: '$(Pipeline.Workspace)\build\NPM_packages' + contents: onnxruntime-*.tgz + targetFolder: $(Build.ArtifactStagingDirectory)\node-artifacts + displayName: 'Copy onnxruntime-node Artifacts' - - task: 1ES.PublishPipelineArtifact@1 - inputs: - artifactName: 'onnxruntime-node' - targetPath: '$(Build.ArtifactStagingDirectory)\node-artifacts' - displayName: 'Publish onnxruntime-node Pipeline Artifact' + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifactName: 'onnxruntime-node' + targetPath: '$(Build.ArtifactStagingDirectory)\node-artifacts' + displayName: 'Publish onnxruntime-node Pipeline Artifact' - - task: CopyFiles@2 - inputs: - sourceFolder: $(Build.SourcesDirectory)\tools\ci_build\github\js - contents: validate-npm-packages.py - targetFolder: $(Build.ArtifactStagingDirectory)\validation-scripts - displayName: 'Copy validation scripts' + - task: CopyFiles@2 + inputs: + sourceFolder: $(Build.SourcesDirectory)\tools\ci_build\github\js + contents: validate-npm-packages.py + targetFolder: $(Build.ArtifactStagingDirectory)\validation-scripts + displayName: 'Copy validation scripts' - - task: 1ES.PublishPipelineArtifact@1 - inputs: - artifactName: 'validation_scripts' - targetPath: '$(Build.ArtifactStagingDirectory)\validation-scripts' - displayName: 'Publish validation scripts' + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifactName: 'validation_scripts' + targetPath: '$(Build.ArtifactStagingDirectory)\validation-scripts' + displayName: 'Publish validation scripts' From 53f016158b3876b5102a267d02031b990add07e8 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:46:13 -0800 Subject: [PATCH 13/33] Adding extends: --- tools/ci_build/github/azure-pipelines/templates/web-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml index d2420979d60d8..23c9294123c31 100644 --- a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml @@ -98,7 +98,7 @@ stages: artifactName: '__commit' targetPath: '$(Build.ArtifactStagingDirectory)' - ${{ if eq(parameters.is1ES, True) }}: - - task: 1ES.PublishPipelineArtifact@0 + - task: 1ES.PublishPipelineArtifact@1 displayName: 'Publish __commit.txt' inputs: artifactName: '__commit' From e5fb6b0452b3d6ae487adfbc233d36ab4ad679f3 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:47:40 -0800 Subject: [PATCH 14/33] is1ES parameter --- tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml index e9b19bacae0df..af07574d12dd3 100644 --- a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml @@ -77,6 +77,7 @@ extends: PackageName: 'onnxruntime-react-native' InitialStageDependsOn: 'Precheck_and_extract_commit' enable_code_sign: false + is1ES: ${{ parameters.is1ES }} - stage: Download_Node_Package_And_Publish_Validation_Script dependsOn: From 792bf07f56b4db46934df7429a3b050e730e8adb Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:50:27 -0800 Subject: [PATCH 15/33] is1ES parameter --- .../ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml index 7c97b7bb20f7a..59464d72853df 100644 --- a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml @@ -151,7 +151,7 @@ jobs: fi displayName: 'Create Artifacts' - ${{ if eq(parameters.is1ES, false) }}: - - task: PublishPipelineArtifact@0 + - task: PublishPipelineArtifact@1 displayName: 'Publish Pipeline Artifact' inputs: artifactName: '${{ parameters.BuildConfig }}_wasm' From 30717e3d4b70db1da45dbb7d87ab05deea70e06d Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:51:36 -0800 Subject: [PATCH 16/33] is1ES parameter --- tools/ci_build/github/azure-pipelines/templates/web-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml index 23c9294123c31..165ea84000535 100644 --- a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml @@ -149,6 +149,7 @@ stages: BuildJsep: ${{ parameters.BuildJsep }} BuildWebGPU: false WithCache: ${{ parameters.WithCache }} + is1ES: ${{ parameters.is1ES }} - ${{ if eq(parameters.BuildStaticLib, 'true') }}: - stage: Build_wasm_Release_static_library @@ -164,6 +165,7 @@ stages: TimeoutInMinutes: 270 BuildStaticLib: true WithCache: ${{ parameters.WithCache }} + is1ES: ${{ parameters.is1ES }} - stage: Build_web_Release dependsOn: Build_wasm_Release From be1776c289ec95037c02f5d2ee5fd75fd6bd48f1 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:53:53 -0800 Subject: [PATCH 17/33] is1ES parameter --- .../github/azure-pipelines/npm-packaging-pipeline.yml | 8 ++------ .../ci_build/github/azure-pipelines/templates/web-ci.yml | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml index af07574d12dd3..e5d45f9f07bfb 100644 --- a/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml @@ -9,10 +9,6 @@ parameters: - 'custom' default: 'nightly (@dev)' -- name: is1ES - type: boolean - default: true - variables: # pipeline should define the following variables # ExtraBuildArgs @@ -67,7 +63,7 @@ extends: RunWebGpuTestsForReleaseBuild: true WebGpuPoolName: 'onnxruntime-Win2022-VS2022-webgpu-A10' WebCpuPoolName: 'onnxruntime-Win2022-VS2022-webgpu-A10' - is1ES: ${{ parameters.is1ES }} + is1ES: true - template: templates/react-native-ci.yml parameters: @@ -77,7 +73,7 @@ extends: PackageName: 'onnxruntime-react-native' InitialStageDependsOn: 'Precheck_and_extract_commit' enable_code_sign: false - is1ES: ${{ parameters.is1ES }} + is1ES: true - stage: Download_Node_Package_And_Publish_Validation_Script dependsOn: diff --git a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml index 165ea84000535..f25ed9c60eaa9 100644 --- a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml @@ -185,6 +185,7 @@ stages: PoolName: ${{ parameters.PoolName }} PackageName: ${{ parameters.PackageName }} RunWebGpuTests: ${{ parameters.RunWebGpuTestsForReleaseBuild }} + is1ES: ${{ parameters.is1ES }} # Disable BrowserStack test # TODO: fix and re-enable in PostMerge test From 2af219cfba208c3343d18f667d6a508121f0f817 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 10:55:39 -0800 Subject: [PATCH 18/33] is1ES parameter --- tools/ci_build/github/azure-pipelines/templates/web-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml index f25ed9c60eaa9..165ea84000535 100644 --- a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml @@ -185,7 +185,6 @@ stages: PoolName: ${{ parameters.PoolName }} PackageName: ${{ parameters.PackageName }} RunWebGpuTests: ${{ parameters.RunWebGpuTestsForReleaseBuild }} - is1ES: ${{ parameters.is1ES }} # Disable BrowserStack test # TODO: fix and re-enable in PostMerge test From 88caf89891dbd54983ce3a670f86bddb21372384 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:01:07 -0800 Subject: [PATCH 19/33] is1ES parameter --- .../stages/jobs/react-natvie-andriod-e2e-test-job.yml | 6 ++++-- .../github/azure-pipelines/templates/react-native-ci.yml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml index 638da2866bdef..586e41ec0946b 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml @@ -12,7 +12,9 @@ parameters: displayName: 'NPM packages publish configuration' type: string default: 'dev' - +- name: is1ES + type: boolean + default: false jobs: - job: ReactNative_CI_Android pool: 'onnxruntime-Ubuntu2204-AMD-CPU' @@ -203,7 +205,7 @@ jobs: condition: succeededOrFailed() displayName: Publish React Native Detox E2E test logs - - task: PublishPipelineArtifact@0 + - task: PublishPipelineArtifact@1 inputs: artifactName: '${{parameters.PackageName}}' targetPath: '$(Build.ArtifactStagingDirectory)' diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index 6a64b1b77e46b..8a196011997b3 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -55,6 +55,7 @@ stages: PackageName: '${{parameters.PackageName}}' ArtifactName: 'onnxruntime-android-full-aar' NpmPackagingMode: '${{parameters.NpmPackagingMode}}' + is1ES: '${{parameters.is1ES}}' - stage: ReactNative_CI_iOS displayName: ReactNative_CI_iOS From 5c357fe71d4f6fac628c2484e24b649178e5db1d Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:02:04 -0800 Subject: [PATCH 20/33] is1ES parameter --- .../react-natvie-andriod-e2e-test-job.yml | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml index 586e41ec0946b..a0bd13df1691a 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml @@ -197,18 +197,31 @@ jobs: contents: onnxruntime-react-native*.tgz targetFolder: $(Build.ArtifactStagingDirectory) displayName: Create Artifacts onnxruntime-react-native - - - task: PublishPipelineArtifact@1 - inputs: - artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) - targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' - condition: succeededOrFailed() - displayName: Publish React Native Detox E2E test logs - - - task: PublishPipelineArtifact@1 - inputs: - artifactName: '${{parameters.PackageName}}' - targetPath: '$(Build.ArtifactStagingDirectory)' - displayName: Publish Pipeline Artifact + - ${{ if eq(parameters.is1ES, true) }} + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs + + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifactName: '${{parameters.PackageName}}' + targetPath: '$(Build.ArtifactStagingDirectory)' + displayName: Publish Pipeline Artifact + - ${{ if eq(parameters.is1ES, false) }}: + - task: PublishPipelineArtifact@1 + inputs: + artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs + + - task: PublishPipelineArtifact@1 + inputs: + artifactName: '${{parameters.PackageName}}' + targetPath: '$(Build.ArtifactStagingDirectory)' + displayName: Publish Pipeline Artifact - template: ../../templates/explicitly-defined-final-tasks.yml \ No newline at end of file From 905cd7d2a5d53d4fe42cf4feb8c69e92eacb9750 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:05:05 -0800 Subject: [PATCH 21/33] is1ES parameter --- .../stages/jobs/react-natvie-andriod-e2e-test-job.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml index a0bd13df1691a..b44e750401a32 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml @@ -204,12 +204,13 @@ jobs: targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' condition: succeededOrFailed() displayName: Publish React Native Detox E2E test logs - + - ${{ if eq(parameters.is1ES, true) }} - task: 1ES.PublishPipelineArtifact@1 inputs: artifactName: '${{parameters.PackageName}}' targetPath: '$(Build.ArtifactStagingDirectory)' displayName: Publish Pipeline Artifact + - ${{ if eq(parameters.is1ES, false) }}: - task: PublishPipelineArtifact@1 inputs: @@ -217,7 +218,7 @@ jobs: targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' condition: succeededOrFailed() displayName: Publish React Native Detox E2E test logs - + - ${{ if eq(parameters.is1ES, false) }}: - task: PublishPipelineArtifact@1 inputs: artifactName: '${{parameters.PackageName}}' From af1e405cddb8fbbbba3c9f6c127a187339d1e67f Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:05:54 -0800 Subject: [PATCH 22/33] is1ES parameter --- .../react-natvie-andriod-e2e-test-job.yml | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml index b44e750401a32..2722adc128333 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml @@ -197,32 +197,30 @@ jobs: contents: onnxruntime-react-native*.tgz targetFolder: $(Build.ArtifactStagingDirectory) displayName: Create Artifacts onnxruntime-react-native - - ${{ if eq(parameters.is1ES, true) }} - - task: 1ES.PublishPipelineArtifact@1 - inputs: - artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) - targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' - condition: succeededOrFailed() - displayName: Publish React Native Detox E2E test logs - - ${{ if eq(parameters.is1ES, true) }} - - task: 1ES.PublishPipelineArtifact@1 - inputs: - artifactName: '${{parameters.PackageName}}' - targetPath: '$(Build.ArtifactStagingDirectory)' - displayName: Publish Pipeline Artifact - - - ${{ if eq(parameters.is1ES, false) }}: - - task: PublishPipelineArtifact@1 - inputs: - artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) - targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' - condition: succeededOrFailed() - displayName: Publish React Native Detox E2E test logs - - ${{ if eq(parameters.is1ES, false) }}: - - task: PublishPipelineArtifact@1 - inputs: - artifactName: '${{parameters.PackageName}}' - targetPath: '$(Build.ArtifactStagingDirectory)' - displayName: Publish Pipeline Artifact + ${{ if eq(parameters.is1ES, true) }} + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifactName: '${{parameters.PackageName}}' + targetPath: '$(Build.ArtifactStagingDirectory)' + displayName: Publish Pipeline Artifact + + ${{ if eq(parameters.is1ES, false) }}: + - task: PublishPipelineArtifact@1 + inputs: + artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs + - task: PublishPipelineArtifact@1 + inputs: + artifactName: '${{parameters.PackageName}}' + targetPath: '$(Build.ArtifactStagingDirectory)' + displayName: Publish Pipeline Artifact - template: ../../templates/explicitly-defined-final-tasks.yml \ No newline at end of file From 605d033455a9cb20658ff27842be3391fadb4f56 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:06:23 -0800 Subject: [PATCH 23/33] is1ES parameter --- .../stages/jobs/react-natvie-andriod-e2e-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml index 2722adc128333..b346f2d14ccf8 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml @@ -197,7 +197,7 @@ jobs: contents: onnxruntime-react-native*.tgz targetFolder: $(Build.ArtifactStagingDirectory) displayName: Create Artifacts onnxruntime-react-native - ${{ if eq(parameters.is1ES, true) }} + ${{ if eq(parameters.is1ES, true) }}: - task: 1ES.PublishPipelineArtifact@1 inputs: artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) From 9e947ee7b4689cc99866e795c8439e607f3f14a2 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:06:40 -0800 Subject: [PATCH 24/33] is1ES parameter --- .../react-natvie-andriod-e2e-test-job.yml | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml index b346f2d14ccf8..afe3c5d38df4a 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml @@ -198,29 +198,29 @@ jobs: targetFolder: $(Build.ArtifactStagingDirectory) displayName: Create Artifacts onnxruntime-react-native ${{ if eq(parameters.is1ES, true) }}: - - task: 1ES.PublishPipelineArtifact@1 - inputs: - artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) - targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' - condition: succeededOrFailed() - displayName: Publish React Native Detox E2E test logs - - task: 1ES.PublishPipelineArtifact@1 - inputs: - artifactName: '${{parameters.PackageName}}' - targetPath: '$(Build.ArtifactStagingDirectory)' - displayName: Publish Pipeline Artifact + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifactName: '${{parameters.PackageName}}' + targetPath: '$(Build.ArtifactStagingDirectory)' + displayName: Publish Pipeline Artifact ${{ if eq(parameters.is1ES, false) }}: - - task: PublishPipelineArtifact@1 - inputs: - artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) - targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' - condition: succeededOrFailed() - displayName: Publish React Native Detox E2E test logs - - task: PublishPipelineArtifact@1 - inputs: - artifactName: '${{parameters.PackageName}}' - targetPath: '$(Build.ArtifactStagingDirectory)' - displayName: Publish Pipeline Artifact + - task: PublishPipelineArtifact@1 + inputs: + artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) + targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' + condition: succeededOrFailed() + displayName: Publish React Native Detox E2E test logs + - task: PublishPipelineArtifact@1 + inputs: + artifactName: '${{parameters.PackageName}}' + targetPath: '$(Build.ArtifactStagingDirectory)' + displayName: Publish Pipeline Artifact - template: ../../templates/explicitly-defined-final-tasks.yml \ No newline at end of file From 27446dc58f335a3b2c828d68b083bd13ea575026 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:07:51 -0800 Subject: [PATCH 25/33] is1ES parameter --- .../stages/jobs/react-natvie-andriod-e2e-test-job.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml index afe3c5d38df4a..5b1845976df76 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml @@ -197,7 +197,7 @@ jobs: contents: onnxruntime-react-native*.tgz targetFolder: $(Build.ArtifactStagingDirectory) displayName: Create Artifacts onnxruntime-react-native - ${{ if eq(parameters.is1ES, true) }}: + - ${{ if eq(parameters.is1ES, true) }}: - task: 1ES.PublishPipelineArtifact@1 inputs: artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) @@ -210,7 +210,7 @@ jobs: targetPath: '$(Build.ArtifactStagingDirectory)' displayName: Publish Pipeline Artifact - ${{ if eq(parameters.is1ES, false) }}: + - ${{ if eq(parameters.is1ES, false) }}: - task: PublishPipelineArtifact@1 inputs: artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) From 842ab4a1cb9f1fcfe4adaacf9b2d53eaa40a5cc7 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:10:29 -0800 Subject: [PATCH 26/33] 1ES.PublishPipelineArtifacts --- .../github/azure-pipelines/templates/android-java-api-aar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml index fbd7499ba1847..304eb56513058 100644 --- a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml +++ b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml @@ -146,7 +146,7 @@ jobs: targetPath: '$(artifacts_directory)' artifactName: '${{parameters.artifactName}}' - ${{ if eq(parameters.is1ES, true) }}: - - task: 1ES.PublishPipelineArtifacts@1 + - task: 1ES.PublishPipelineArtifact@1 inputs: targetPath: '$(artifacts_directory)' artifactName: '${{parameters.artifactName}}' From 99b6b1ca692c781c52bd32cf497e78bd0dd857a8 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:49:51 -0800 Subject: [PATCH 27/33] - ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(toLower(parameters.pool), 'linux')) }} --- tools/ci_build/github/azure-pipelines/templates/web-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml index 165ea84000535..4338e7dc8a585 100644 --- a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml @@ -66,7 +66,10 @@ stages: - stage: Precheck_and_extract_commit jobs: - job: Precheck_and_extract_commit - pool: ${{ parameters.PoolName }} + pool: + name: ${{ parameters.PoolName }} + ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(toLower(parameters.pool), 'linux')) }} + os: linux variables: runCodesignValidationInjection: false timeoutInMinutes: 30 From 22980092435b8d67ef95b36b5fa00d608c60f321 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:50:20 -0800 Subject: [PATCH 28/33] - ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(toLower(parameters.pool), 'linux')) }} --- tools/ci_build/github/azure-pipelines/templates/web-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml index 4338e7dc8a585..911176cab1e5c 100644 --- a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml @@ -68,7 +68,7 @@ stages: - job: Precheck_and_extract_commit pool: name: ${{ parameters.PoolName }} - ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(toLower(parameters.pool), 'linux')) }} + ${{ if or(contains(toLower(parameters.PoolName), 'ubuntu'), contains(toLower(parameters.PoolName), 'linux')) }} os: linux variables: runCodesignValidationInjection: false From eebe0ade9de30d51c3c4cf38d8b074cbe27ef305 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:51:01 -0800 Subject: [PATCH 29/33] - ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(toLower(parameters.pool), 'linux')) }} --- tools/ci_build/github/azure-pipelines/templates/web-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml index 911176cab1e5c..48bf38fd50d73 100644 --- a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml @@ -68,7 +68,7 @@ stages: - job: Precheck_and_extract_commit pool: name: ${{ parameters.PoolName }} - ${{ if or(contains(toLower(parameters.PoolName), 'ubuntu'), contains(toLower(parameters.PoolName), 'linux')) }} + ${{ if or(contains(toLower(parameters.PoolName), 'ubuntu'), contains(toLower(parameters.PoolName), 'linux')) }}: os: linux variables: runCodesignValidationInjection: false From c6e719a6cfc71e21b0715f82e50339e61ecb870b Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 11:52:18 -0800 Subject: [PATCH 30/33] - ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(toLower(parameters.pool), 'linux')) }} --- tools/ci_build/github/azure-pipelines/templates/web-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml index 48bf38fd50d73..87836880cbdb8 100644 --- a/tools/ci_build/github/azure-pipelines/templates/web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/web-ci.yml @@ -68,7 +68,7 @@ stages: - job: Precheck_and_extract_commit pool: name: ${{ parameters.PoolName }} - ${{ if or(contains(toLower(parameters.PoolName), 'ubuntu'), contains(toLower(parameters.PoolName), 'linux')) }}: + ${{ if or(contains(parameters.PoolName, 'ubuntu'), contains(parameters.PoolName, 'linux')) }}: os: linux variables: runCodesignValidationInjection: false From cbc881fb0ebcac731f8c86325722734b4955f4eb Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 12:16:27 -0800 Subject: [PATCH 31/33] ${{ parameters.PoolName }} --- .../github/azure-pipelines/templates/linux-wasm-ci.yml | 1 + .../ci_build/github/azure-pipelines/templates/win-web-ci.yml | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml index 59464d72853df..1e58f675febe2 100644 --- a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml @@ -48,6 +48,7 @@ jobs: - job: build_WASM pool: name: ${{ parameters.PoolName }} + os: linux variables: buildArch: x64 CommonBuildArgs: '--parallel --use_vcpkg --config ${{ parameters.BuildConfig }} --skip_submodule_sync --build_wasm --enable_wasm_simd --enable_wasm_threads ${{ parameters.ExtraBuildArgs }}' diff --git a/tools/ci_build/github/azure-pipelines/templates/win-web-ci.yml b/tools/ci_build/github/azure-pipelines/templates/win-web-ci.yml index c4e748d1230a4..b77cab6a19ba0 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-web-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-web-ci.yml @@ -31,7 +31,9 @@ parameters: jobs: - job: build_onnxruntime_web - pool: ${{ parameters.PoolName }} + pool: + name: ${{ parameters.PoolName }} + os: windows variables: webgpuCommandlineExtraFlags: '--chromium-flags=--ignore-gpu-blocklist --chromium-flags=--gpu-vendor-id=0x10de' From dca0374fc39776aaf7391376426c1fa0aa2cf28a Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 12:20:36 -0800 Subject: [PATCH 32/33] ${{ parameters.PoolName }} --- .../azure-pipelines/templates/android-java-api-aar.yml | 10 +++++++++- .../azure-pipelines/templates/react-native-ci.yml | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml index 304eb56513058..2f891360c626a 100644 --- a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml +++ b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml @@ -63,7 +63,15 @@ jobs: timeoutInMinutes: 120 workspace: clean: all - pool: ${{parameters.pool_name}} + pool: + name: ${{ parameters.pool_name }} + ${{ if or(contains(parameters.pool_name, 'ubuntu'), contains(parameters.PoolName, 'linux')) }}: + os: linux + ${{ if contains(parameters.pool_name, 'win')}}: + os: windows + ${{ if contains(parameters.pool_name, 'mac')}}: + os: macOS + variables: artifacts_directory: $(Build.BinariesDirectory)/.artifacts diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index 8a196011997b3..3f4581f63217e 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -63,7 +63,9 @@ stages: jobs: - job: ReactNative_CI_iOS pool: - vmImage: 'macOS-13' + name: 'Azure Pipelines' + image: 'macOS-13' + os: 'macOS' timeoutInMinutes: 90 From 46d23ac8b4e34c3f251aae81684f940e17640b73 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 20 Feb 2025 17:20:48 -0800 Subject: [PATCH 33/33] ${{ parameters.PoolName }} --- .../stages/jobs/react-natvie-andriod-e2e-test-job.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml index 5b1845976df76..ed7d77246e862 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml @@ -17,7 +17,9 @@ parameters: default: false jobs: - job: ReactNative_CI_Android - pool: 'onnxruntime-Ubuntu2204-AMD-CPU' + pool: + name: onnxruntime-Ubuntu2204-AMD-CPU + os: linux variables: runCodesignValidationInjection: false ANDROID_AVD_HOME: $(Agent.TempDirectory)