Skip to content

Commit

Permalink
Add pipauth to more ADO pipelines and enable CSV (microsoft#22612)
Browse files Browse the repository at this point in the history
### Description
1. Add pipauth to more ADO pipeline. (We will use a private ADO feed to
fetch python packages in these pipeline, to improve security)
2. Enforce codeSignValidation(CSV).

### Motivation and Context
Fulfill some internal compliance requirements.
  • Loading branch information
snnn authored Oct 28, 2024
1 parent dcf9126 commit 3641d18
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 12 deletions.
3 changes: 3 additions & 0 deletions tools/ci_build/github/azure-pipelines/nuget-windows-ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ extends:
sdl:
tsa:
enabled: true
codeSignValidation:
enabled: true
break: true
policheck:
enabled: true
exclusionsFile: '$(Build.SourcesDirectory)\tools\ci_build\policheck_exclusions.xml'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ extends:
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
# Update the pool with your team's 1ES hosted pool.
sdl:
tsa:
enabled: true
codeSignValidation:
enabled: true
break: true
policheck:
enabled: true
exclusionsFile: '$(Build.SourcesDirectory)\tools\ci_build\policheck_exclusions.xml'
pool:
name: 'onnxruntime-Win-CPU-2022' # Name of your hosted pool
os: windows # OS of the image. This value cannot be a variable. Allowed values: windows, linux, macOS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ extends:
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
# Update the pool with your team's 1ES hosted pool.
sdl:
tsa:
enabled: true
codeSignValidation:
enabled: true
break: true
policheck:
enabled: true
exclusionsFile: '$(Build.SourcesDirectory)\tools\ci_build\policheck_exclusions.xml'
pool:
name: 'onnxruntime-Win-CPU-2022' # Name of your hosted pool
os: windows # OS of the image. This value cannot be a variable. Allowed values: windows, linux, macOS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ extends:
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
# Update the pool with your team's 1ES hosted pool.
sdl:
tsa:
enabled: true
codeSignValidation:
enabled: true
break: true
policheck:
enabled: true
exclusionsFile: '$(Build.SourcesDirectory)\tools\ci_build\policheck_exclusions.xml'

pool:
name: 'onnxruntime-Win-CPU-2022' # Name of your hosted pool
os: windows # OS of the image. This value cannot be a variable. Allowed values: windows, linux, macOS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ stages:
addToPath: true
architecture: 'x64'

- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: 'Lotus'


- template: ../templates/download-deps.yml

- ${{ if ne(parameters.ENV_SETUP_SCRIPT, '') }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ jobs:
addToPath: true
architecture: 'arm64'

- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: 'Lotus'

- task: onebranch.pipeline.tsaoptions@1
displayName: 'OneBranch TSAOptions'
inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ jobs:
addToPath: true
architecture: 'x64'

- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: 'Lotus'

- task: onebranch.pipeline.tsaoptions@1
displayName: 'OneBranch TSAOptions'
inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ jobs:
addToPath: true
architecture: 'x64'

- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: 'Lotus'

- task: onebranch.pipeline.tsaoptions@1
displayName: 'OneBranch TSAOptions'
inputs:
Expand Down
21 changes: 16 additions & 5 deletions tools/ci_build/github/azure-pipelines/templates/win-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,26 @@ stages:
clean: true
submodules: none

- task: UsePythonVersion@0
inputs:
versionSpec: '3.12'
addToPath: true
architecture: ${{ parameters.buildArch }}

- template: telemetry-steps.yml

- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: 'Lotus'

- ${{ if eq(parameters['buildJava'], 'true') }}:
- task: JavaToolInstaller@0
inputs:
versionSpec: "11"
jdkArchitectureOption: ${{ parameters.buildArch }}
jdkSourceOption: 'PreInstalled'

- task: UsePythonVersion@0
inputs:
versionSpec: '3.12'
addToPath: true
architecture: ${{ parameters.buildArch }}

- task: NodeTool@0
condition: and(succeeded(), eq('${{ parameters.buildNodejs}}', true))
Expand Down Expand Up @@ -364,6 +370,11 @@ stages:
addToPath: true
architecture: ${{ parameters.buildArch }}

- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: 'Lotus'

- task: NodeTool@0
condition: and(succeeded(), eq('${{ parameters.buildNodejs}}', true))
inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: 'PublicPackages/ORT-Nightly'
artifactFeeds: 'Lotus'

- template: telemetry-steps.yml

Expand Down Expand Up @@ -87,10 +87,8 @@ jobs:
# must call vsdevcmd first to add cmake to PATH
- script: |
curl -O -L https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-windows-x86_64.zip
7z x cmake-3.28.3-windows-x86_64.zip
python --version
python "$(Build.SourcesDirectory)\tools\ci_build\build.py" --build_dir $(Build.BinariesDirectory) --parallel --use_binskim_compliant_compile_flags --build_shared_lib --enable_onnx_tests --ms_experimental --use_dml --use_winml --cmake_generator "Visual Studio 17 2022" --update --config RelWithDebInfo --enable_lto --use_telemetry --disable_rtti --enable_wcos --windows_sdk_version "10.0.22621.0" $(BuildFlags) --cmake_extra_defines "CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO=/PROFILE" "CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO=/PROFILE" --cmake_path $(Build.BinariesDirectory)\cmake-3.28.3-windows-x86_64\bin\cmake.exe --ctest_path $(Build.BinariesDirectory)\cmake-3.28.3-windows-x86_64\bin\ctest.exe
python "$(Build.SourcesDirectory)\tools\ci_build\build.py" --build_dir $(Build.BinariesDirectory) --parallel --use_binskim_compliant_compile_flags --build_shared_lib --enable_onnx_tests --ms_experimental --use_dml --use_winml --cmake_generator "Visual Studio 17 2022" --update --config RelWithDebInfo --enable_lto --use_telemetry --disable_rtti --enable_wcos --windows_sdk_version "10.0.22621.0" $(BuildFlags) --cmake_extra_defines "CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO=/PROFILE" "CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO=/PROFILE"
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'Generate cmake config'
Expand Down

0 comments on commit 3641d18

Please sign in to comment.