Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conveting npm packaging pipeline to 1ES #23767

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9dfe705
Update rn ci to 1es
jchen351 Feb 19, 2025
57fb1e7
Update rn ci to 1es
jchen351 Feb 19, 2025
383e838
Update rn ci to 1es
jchen351 Feb 19, 2025
9069394
Update rn ci to 1es
jchen351 Feb 19, 2025
e8fb5fe
Update rn ci to 1es
jchen351 Feb 19, 2025
c5f73a3
Update rn ci to 1es
jchen351 Feb 19, 2025
30f3403
Update rn ci to 1es
jchen351 Feb 20, 2025
d936efc
Update rn ci to 1es
jchen351 Feb 20, 2025
a019b2c
Is 1ES
jchen351 Feb 20, 2025
6973d04
Adding - repository: 1esPipelines
jchen351 Feb 20, 2025
f1093f2
Adding - repository: 1esPipelines
jchen351 Feb 20, 2025
a5c0641
Merge branch 'main' into Cjian/1es_npm
jchen351 Feb 20, 2025
518877c
Adding extends:
jchen351 Feb 20, 2025
53f0161
Adding extends:
jchen351 Feb 20, 2025
e5fb6b0
is1ES parameter
jchen351 Feb 20, 2025
792bf07
is1ES parameter
jchen351 Feb 20, 2025
30717e3
is1ES parameter
jchen351 Feb 20, 2025
be1776c
is1ES parameter
jchen351 Feb 20, 2025
2af219c
is1ES parameter
jchen351 Feb 20, 2025
88caf89
is1ES parameter
jchen351 Feb 20, 2025
5c357fe
is1ES parameter
jchen351 Feb 20, 2025
905cd7d
is1ES parameter
jchen351 Feb 20, 2025
af1e405
is1ES parameter
jchen351 Feb 20, 2025
605d033
is1ES parameter
jchen351 Feb 20, 2025
9e947ee
is1ES parameter
jchen351 Feb 20, 2025
27446dc
is1ES parameter
jchen351 Feb 20, 2025
842ab4a
1ES.PublishPipelineArtifacts
jchen351 Feb 20, 2025
99b6b1c
- ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(t…
jchen351 Feb 20, 2025
2298009
- ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(t…
jchen351 Feb 20, 2025
eebe0ad
- ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(t…
jchen351 Feb 20, 2025
c6e719a
- ${{ if or(contains(toLower(parameters.pool), 'ubuntu'), contains(t…
jchen351 Feb 20, 2025
cbc881f
${{ parameters.PoolName }}
jchen351 Feb 20, 2025
dca0374
${{ parameters.PoolName }}
jchen351 Feb 20, 2025
46d23ac
${{ parameters.PoolName }}
jchen351 Feb 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -50,10 +56,20 @@ variables:
${{ if eq(parameters.NpmPublish, 'custom') }}:
NpmPackagingMode: '$(VersionSuffix)'

stages:
- template: templates/react-native-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 }}
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
138 changes: 77 additions & 61 deletions tools/ci_build/github/azure-pipelines/npm-packaging-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,71 +35,87 @@ resources:
endpoint: Microsoft
name: pypa/manylinux
ref: 5eda9aded5462201e6310105728d33016e637ea7

stages:
- template: templates/web-ci.yml
- 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:
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'
# 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: true

- 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
is1ES: true

- 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: PublishPipelineArtifact@0
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: PublishPipelineArtifact@0
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'
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ 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'
pool:
name: onnxruntime-Ubuntu2204-AMD-CPU
os: linux
variables:
runCodesignValidationInjection: false
ANDROID_AVD_HOME: $(Agent.TempDirectory)
Expand Down Expand Up @@ -195,18 +199,30 @@ 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@0
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,25 @@ 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
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
Expand Down Expand Up @@ -135,8 +148,13 @@ jobs:
- template: jar-maven-signing-linux.yml
parameters:
JarFileDirectory: '$(artifacts_directory)'

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(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.PublishPipelineArtifact@1
inputs:
targetPath: '$(artifacts_directory)'
artifactName: '${{parameters.artifactName}}'
62 changes: 37 additions & 25 deletions tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@ parameters:
type: boolean
default: false

- name: is1ES
displayName: 'Is 1ES pipeline'
type: boolean
default: false

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 }}'
Expand All @@ -61,15 +67,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
Expand All @@ -79,19 +85,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:
Expand Down Expand Up @@ -145,12 +151,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.is1ES, false) }}:
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact'
inputs:
artifactName: '${{ parameters.BuildConfig }}_wasm'
targetPath: '$(Build.ArtifactStagingDirectory)'
- ${{ if eq(parameters.is1ES, 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:
Expand All @@ -159,5 +171,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'
Loading
Loading