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

Make onnxscript release 1ES compliant #2071

Merged
merged 23 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
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
21 changes: 0 additions & 21 deletions .azure-pipelines/_release-template.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .azure-pipelines/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ pool:
variables:
CI: 'true'
steps:
- template: _release-template.yml
- template: stages/_release-template-stage.yml
30 changes: 22 additions & 8 deletions .azure-pipelines/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@

trigger: none

pool:
vmImage: ubuntu-latest
variables:
CI: 'true'
# Set the release environment variable to build a release version of the wheel
ONNX_SCRIPT_RELEASE: 1
steps:
- template: _release-template.yml
# Test the wheels. This needs to happen after PublishBuildArtifacts
# to avoid interference with the artifacts
- script: python -m pip install dist/*.whl --no-deps
displayName: 'Install wheel'

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
pool:
name: 'onnxruntime-Ubuntu2204-AMD-CPU'
os: 'linux'
stages:
- template: stages/release_stage.yml
33 changes: 33 additions & 0 deletions .azure-pipelines/stages/_release-template-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Template steps for the release pipeline

parameters:
- name: is1ES
displayName: 'Is 1ES pipeline'
type: boolean
default: false
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.11'
displayName: 'Set Up Python'
- script: python -m pip install --upgrade pip build wheel
displayName: 'Install Python build dependencies'
- script: python -m build
displayName: 'Build ONNX Script wheel'
- task: CopyFiles@2
displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: 'dist'
Contents: '*.*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- ${{ if eq(parameters.is1ES, false) }}:
- task: PublishPipelineArtifact@1
displayName: 'Publish Python Wheel'
inputs:
ArtifactName: 'onnxscript'
- ${{ if eq(parameters.is1ES, true) }}:
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Python Wheel'
inputs:
ArtifactName: 'onnxscript'
targetPath: '$(Build.ArtifactStagingDirectory)'
14 changes: 14 additions & 0 deletions .azure-pipelines/stages/release_stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#As 2/21/2025, 1ES doesn't like non-stage templates, so we need to wrap all non-stage templates with a stage template

stages:
- stage: Stage
jobs:
- job: Job
steps:
- template: _release-template-stage.yml
parameters:
is1ES: true
# Test the wheels. This needs to happen after PublishBuildArtifacts
# to avoid interference with the artifacts
- script: python -m pip install dist/*.whl --no-deps
displayName: 'Install wheel'
Loading