From 0930c17a426e7259f143f0689c8f4f485916d0e2 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 11:05:37 +0800 Subject: [PATCH 01/27] ci: add 1ES official build pipeline for ModelKit Add modelkit-official-build.yml using 1ES Pipeline Templates. Includes lint, test (unit/integration/regression matrix), and wheel build stages with PyPI-ready artifact drop. --- .pipelines/modelkit-official-build.yml | 137 +++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 .pipelines/modelkit-official-build.yml diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml new file mode 100644 index 000000000..a634db41d --- /dev/null +++ b/.pipelines/modelkit-official-build.yml @@ -0,0 +1,137 @@ +# 1ES Official Build Pipeline for WinML-ModelKit +# Runs lint, tests (unit, integration, regression), and builds the Python wheel. + +trigger: + branches: + include: + - main + +pr: + branches: + include: + - main + +variables: + pythonVersion: '3.10' + +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + parameters: + pool: + name: Azure-Pipelines-1ESPT-ExDShared + image: windows-2022 + os: windows + + stages: + # ──────────────────────────────────────── + # Stage 1: Lint + # ──────────────────────────────────────── + - stage: Lint + jobs: + - job: LintCheck + displayName: 'Lint & License Headers' + timeoutInMinutes: 10 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: $(pythonVersion) + displayName: 'Use Python $(pythonVersion)' + + - script: pip install ruff pre-commit + displayName: 'Install lint tools' + + - script: pre-commit run insert-license --all-files + displayName: 'Check license headers' + + - script: ruff check src/ tests/ + displayName: 'Ruff lint' + + # ──────────────────────────────────────── + # Stage 2: Tests (unit, integration, regression) + # ──────────────────────────────────────── + - stage: Test + dependsOn: Lint + jobs: + - job: TestMatrix + displayName: 'Test' + timeoutInMinutes: 30 + + strategy: + matrix: + analyze: + testPaths: 'tests/unit/analyze' + models: + testPaths: 'tests/unit/models tests/unit/loader tests/unit/datasets tests/unit/export' + optim: + testPaths: 'tests/unit/optim' + commands: + testPaths: 'tests/unit/commands tests/unit/config tests/unit/build tests/unit/compiler tests/unit/session tests/unit/eval' + remaining: + testPaths: 'tests/unit/core tests/unit/onnx tests/unit/cache tests/unit/utils tests/unit/sysinfo tests/unit/inspect tests/unit/optracing tests/regression' + integration: + testPaths: 'tests/integration' + maxParallel: 6 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: $(pythonVersion) + displayName: 'Use Python $(pythonVersion)' + + - script: pip install -e ".[dev]" + displayName: 'Install dependencies' + + - script: > + pytest $(testPaths) --tb=short + -m "not e2e and not npu and not gpu" + --junitxml=$(Build.StagingDirectory)/test-results.xml + displayName: 'Run tests' + + - task: PublishTestResults@2 + condition: always() + inputs: + testResultsFormat: JUnit + testResultsFiles: '$(Build.StagingDirectory)/test-results.xml' + testRunTitle: 'Tests - $(System.JobDisplayName)' + mergeTestResults: true + displayName: 'Publish test results' + + # ──────────────────────────────────────── + # Stage 3: Build Wheel + # ──────────────────────────────────────── + - stage: Build + dependsOn: Lint + jobs: + - job: BuildWheel + displayName: 'Build Python Package' + timeoutInMinutes: 10 + + templateContext: + outputs: + - output: pipelineArtifact + targetPath: $(Build.ArtifactStagingDirectory)/dist + artifactName: drop + displayName: 'Publish PyPI artifacts' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: $(pythonVersion) + displayName: 'Use Python $(pythonVersion)' + + - script: pip install build twine + displayName: 'Install build tools' + + - script: python -m build --outdir $(Build.ArtifactStagingDirectory)/dist + displayName: 'Build sdist and wheel' + + - script: twine check $(Build.ArtifactStagingDirectory)/dist/* + displayName: 'Validate packages for PyPI' From 7be16472e72ba6cbc90a565796aecd3d31355ed0 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 11:09:08 +0800 Subject: [PATCH 02/27] ci: skip GitHub workflows when only .pipelines/ files change --- .github/workflows/lint.yml | 4 ++++ .github/workflows/modelkit-ci.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ce0ef0c5c..573b74cf1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,8 +3,12 @@ name: Lint on: pull_request: branches: [main] + paths-ignore: + - '.pipelines/**' push: branches: [main] + paths-ignore: + - '.pipelines/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/modelkit-ci.yml b/.github/workflows/modelkit-ci.yml index a3e7ecba1..8d2f587ab 100644 --- a/.github/workflows/modelkit-ci.yml +++ b/.github/workflows/modelkit-ci.yml @@ -3,8 +3,12 @@ name: ModelKit CI on: pull_request: branches: [main] + paths-ignore: + - '.pipelines/**' push: branches: [main] + paths-ignore: + - '.pipelines/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 5a243c0f3253f7bb2fcf0145a1e7aa44a78e32f7 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 11:46:16 +0800 Subject: [PATCH 03/27] ci: switch to OneBranch template with manual trigger and Azure Artifacts feed --- .pipelines/modelkit-official-build.yml | 73 ++++++++++++++++---------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index a634db41d..9f474e5a4 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -1,50 +1,50 @@ -# 1ES Official Build Pipeline for WinML-ModelKit +# OneBranch Official Build Pipeline for WinML-ModelKit # Runs lint, tests (unit, integration, regression), and builds the Python wheel. -trigger: - branches: - include: - - main - -pr: - branches: - include: - - main +trigger: none +pr: none variables: pythonVersion: '3.10' resources: repositories: - - repository: 1esPipelines + - repository: templates type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release + name: OneBranch.Pipelines/GovernedTemplates extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + template: v2/OneBranch.Official.CrossPlat.yml@templates parameters: - pool: - name: Azure-Pipelines-1ESPT-ExDShared - image: windows-2022 - os: windows + featureFlags: + windowsEsrpSigning: false stages: # ──────────────────────────────────────── # Stage 1: Lint # ──────────────────────────────────────── - stage: Lint + displayName: Lint jobs: - job: LintCheck displayName: 'Lint & License Headers' + pool: + type: windows timeoutInMinutes: 10 steps: + - checkout: self + - task: UsePythonVersion@0 inputs: versionSpec: $(pythonVersion) displayName: 'Use Python $(pythonVersion)' + - task: PipAuthenticate@1 + inputs: + artifactFeeds: 'windows.ai.toolkit/Modelkit' + displayName: 'Authenticate pip with Azure Artifacts' + - script: pip install ruff pre-commit displayName: 'Install lint tools' @@ -58,10 +58,13 @@ extends: # Stage 2: Tests (unit, integration, regression) # ──────────────────────────────────────── - stage: Test + displayName: Test dependsOn: Lint jobs: - job: TestMatrix displayName: 'Test' + pool: + type: windows timeoutInMinutes: 30 strategy: @@ -81,11 +84,18 @@ extends: maxParallel: 6 steps: + - checkout: self + - task: UsePythonVersion@0 inputs: versionSpec: $(pythonVersion) displayName: 'Use Python $(pythonVersion)' + - task: PipAuthenticate@1 + inputs: + artifactFeeds: 'windows.ai.toolkit/Modelkit' + displayName: 'Authenticate pip with Azure Artifacts' + - script: pip install -e ".[dev]" displayName: 'Install dependencies' @@ -108,30 +118,37 @@ extends: # Stage 3: Build Wheel # ──────────────────────────────────────── - stage: Build + displayName: Build Python Package dependsOn: Lint jobs: - job: BuildWheel - displayName: 'Build Python Package' + displayName: 'Build' + pool: + type: windows timeoutInMinutes: 10 - templateContext: - outputs: - - output: pipelineArtifact - targetPath: $(Build.ArtifactStagingDirectory)/dist - artifactName: drop - displayName: 'Publish PyPI artifacts' - steps: + - checkout: self + - task: UsePythonVersion@0 inputs: versionSpec: $(pythonVersion) displayName: 'Use Python $(pythonVersion)' + - task: PipAuthenticate@1 + inputs: + artifactFeeds: 'windows.ai.toolkit/Modelkit' + displayName: 'Authenticate pip with Azure Artifacts' + - script: pip install build twine displayName: 'Install build tools' - - script: python -m build --outdir $(Build.ArtifactStagingDirectory)/dist + - script: python -m build displayName: 'Build sdist and wheel' - - script: twine check $(Build.ArtifactStagingDirectory)/dist/* + - script: twine check dist/* displayName: 'Validate packages for PyPI' + + - publish: dist + artifact: drop + displayName: 'Publish PyPI artifacts' From 9c2980977190fbae61ecc61de4dff83d1db7b88e Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 11:53:00 +0800 Subject: [PATCH 04/27] =?UTF-8?q?ci:=20address=20review=20feedback=20?= =?UTF-8?q?=E2=80=94=20Build=20depends=20on=20Test,=20safer=20license=20ch?= =?UTF-8?q?eck,=20python=20-m=20pip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pipelines/modelkit-official-build.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 9f474e5a4..56652016d 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -45,10 +45,12 @@ extends: artifactFeeds: 'windows.ai.toolkit/Modelkit' displayName: 'Authenticate pip with Azure Artifacts' - - script: pip install ruff pre-commit + - script: python -m pip install ruff pre-commit displayName: 'Install lint tools' - - script: pre-commit run insert-license --all-files + - script: | + pre-commit run insert-license --all-files + git diff --exit-code displayName: 'Check license headers' - script: ruff check src/ tests/ @@ -96,7 +98,7 @@ extends: artifactFeeds: 'windows.ai.toolkit/Modelkit' displayName: 'Authenticate pip with Azure Artifacts' - - script: pip install -e ".[dev]" + - script: python -m pip install ".[dev]" displayName: 'Install dependencies' - script: > @@ -119,7 +121,7 @@ extends: # ──────────────────────────────────────── - stage: Build displayName: Build Python Package - dependsOn: Lint + dependsOn: Test jobs: - job: BuildWheel displayName: 'Build' @@ -140,7 +142,7 @@ extends: artifactFeeds: 'windows.ai.toolkit/Modelkit' displayName: 'Authenticate pip with Azure Artifacts' - - script: pip install build twine + - script: python -m pip install build twine displayName: 'Install build tools' - script: python -m build From 765c8e4603ec7107319130f1f82a0669c2cf0ae5 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 11:54:17 +0800 Subject: [PATCH 05/27] ci: add ob_outputDirectory to all jobs for OneBranch compatibility --- .pipelines/modelkit-official-build.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 56652016d..ae1419894 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -32,6 +32,9 @@ extends: type: windows timeoutInMinutes: 10 + variables: + ob_outputDirectory: '$(Build.SourcesDirectory)/out' + steps: - checkout: self @@ -69,6 +72,9 @@ extends: type: windows timeoutInMinutes: 30 + variables: + ob_outputDirectory: '$(Build.SourcesDirectory)/out' + strategy: matrix: analyze: @@ -129,6 +135,10 @@ extends: type: windows timeoutInMinutes: 10 + variables: + ob_outputDirectory: '$(Build.SourcesDirectory)/out' + ob_artifactBaseName: 'drop' + steps: - checkout: self @@ -145,12 +155,8 @@ extends: - script: python -m pip install build twine displayName: 'Install build tools' - - script: python -m build + - script: python -m build --outdir $(ob_outputDirectory) displayName: 'Build sdist and wheel' - - script: twine check dist/* + - script: twine check $(ob_outputDirectory)/* displayName: 'Validate packages for PyPI' - - - publish: dist - artifact: drop - displayName: 'Publish PyPI artifacts' From 412c4a334e3625fc1a6adc702d0cb26ed0d684d5 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 12:36:11 +0800 Subject: [PATCH 06/27] ci: add OneBranch container image and feature flags from reference pipeline --- .pipelines/modelkit-official-build.yml | 41 +++++++++++++++++++++----- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index ae1419894..307ee2c0c 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -1,23 +1,48 @@ -# OneBranch Official Build Pipeline for WinML-ModelKit -# Runs lint, tests (unit, integration, regression), and builds the Python wheel. - -trigger: none -pr: none +################################################################################# +# OneBranch Pipelines # +# This pipeline was created by EasyStart from a sample located at: # +# https://aka.ms/obpipelines/easystart/samples # +# Documentation: https://aka.ms/obpipelines # +# Yaml Schema: https://aka.ms/obpipelines/yaml/schema # +# Retail Tasks: https://aka.ms/obpipelines/tasks # +# Support: https://aka.ms/onebranchsup # +################################################################################# + +trigger: none # https://aka.ms/obpipelines/triggers + +parameters: # parameters are shown up in ADO UI in a build queue time +- name: 'debug' + displayName: 'Enable debug output' + type: boolean + default: false variables: - pythonVersion: '3.10' + CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning + DEBIAN_FRONTEND: noninteractive + WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' # https://aka.ms/obpipelines/containers resources: repositories: - repository: templates type: git name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main extends: - template: v2/OneBranch.Official.CrossPlat.yml@templates + template: v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates parameters: + git: + fetchDepth: -1 featureFlags: - windowsEsrpSigning: false + EnableCDPxPAT: false + WindowsHostVersion: + Version: '2022' + Network: KS1 + networkisolation: + policy: Permissive,CFSClean + globalSdl: + tsa: + enabled: false stages: # ──────────────────────────────────────── From dac8d9a0c711941365b2a9ff06b68f61d99f5e48 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 12:44:33 +0800 Subject: [PATCH 07/27] ci: merge into single stage with Lint, Test, Build jobs --- .pipelines/modelkit-official-build.yml | 44 ++++++++++---------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 307ee2c0c..24d5d1ce1 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -45,13 +45,11 @@ extends: enabled: false stages: - # ──────────────────────────────────────── - # Stage 1: Lint - # ──────────────────────────────────────── - - stage: Lint - displayName: Lint + - stage: Build + displayName: 'Lint, Test & Build' jobs: - - job: LintCheck + # ── Lint ── + - job: Lint displayName: 'Lint & License Headers' pool: type: windows @@ -65,8 +63,8 @@ extends: - task: UsePythonVersion@0 inputs: - versionSpec: $(pythonVersion) - displayName: 'Use Python $(pythonVersion)' + versionSpec: '3.10' + displayName: 'Use Python 3.10' - task: PipAuthenticate@1 inputs: @@ -84,15 +82,10 @@ extends: - script: ruff check src/ tests/ displayName: 'Ruff lint' - # ──────────────────────────────────────── - # Stage 2: Tests (unit, integration, regression) - # ──────────────────────────────────────── - - stage: Test - displayName: Test - dependsOn: Lint - jobs: - - job: TestMatrix + # ── Test (6-group matrix) ── + - job: Test displayName: 'Test' + dependsOn: Lint pool: type: windows timeoutInMinutes: 30 @@ -121,8 +114,8 @@ extends: - task: UsePythonVersion@0 inputs: - versionSpec: $(pythonVersion) - displayName: 'Use Python $(pythonVersion)' + versionSpec: '3.10' + displayName: 'Use Python 3.10' - task: PipAuthenticate@1 inputs: @@ -147,15 +140,10 @@ extends: mergeTestResults: true displayName: 'Publish test results' - # ──────────────────────────────────────── - # Stage 3: Build Wheel - # ──────────────────────────────────────── - - stage: Build - displayName: Build Python Package - dependsOn: Test - jobs: + # ── Build Wheel ── - job: BuildWheel - displayName: 'Build' + displayName: 'Build Python Package' + dependsOn: Test pool: type: windows timeoutInMinutes: 10 @@ -169,8 +157,8 @@ extends: - task: UsePythonVersion@0 inputs: - versionSpec: $(pythonVersion) - displayName: 'Use Python $(pythonVersion)' + versionSpec: '3.10' + displayName: 'Use Python 3.10' - task: PipAuthenticate@1 inputs: From 14a1f043d9fdf8cb93923b8c67cb879b91b0e5d5 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 12:54:29 +0800 Subject: [PATCH 08/27] ci: remove UsePythonVersion task, use container pre-installed Python --- .pipelines/modelkit-official-build.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 24d5d1ce1..5ec8d1892 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -61,11 +61,6 @@ extends: steps: - checkout: self - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.10' - displayName: 'Use Python 3.10' - - task: PipAuthenticate@1 inputs: artifactFeeds: 'windows.ai.toolkit/Modelkit' @@ -112,11 +107,6 @@ extends: steps: - checkout: self - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.10' - displayName: 'Use Python 3.10' - - task: PipAuthenticate@1 inputs: artifactFeeds: 'windows.ai.toolkit/Modelkit' @@ -155,11 +145,6 @@ extends: steps: - checkout: self - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.10' - displayName: 'Use Python 3.10' - - task: PipAuthenticate@1 inputs: artifactFeeds: 'windows.ai.toolkit/Modelkit' From 6f9ce75bafe9b2093ee7dbcfdd5311c1d38bb449 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 13:05:53 +0800 Subject: [PATCH 09/27] ci: remove pre-commit license check, keep ruff only for OneBranch lint --- .pipelines/modelkit-official-build.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 5ec8d1892..22dec3b58 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -50,7 +50,7 @@ extends: jobs: # ── Lint ── - job: Lint - displayName: 'Lint & License Headers' + displayName: 'Ruff Lint' pool: type: windows timeoutInMinutes: 10 @@ -66,13 +66,8 @@ extends: artifactFeeds: 'windows.ai.toolkit/Modelkit' displayName: 'Authenticate pip with Azure Artifacts' - - script: python -m pip install ruff pre-commit - displayName: 'Install lint tools' - - - script: | - pre-commit run insert-license --all-files - git diff --exit-code - displayName: 'Check license headers' + - script: python -m pip install ruff + displayName: 'Install ruff' - script: ruff check src/ tests/ displayName: 'Ruff lint' From 9076ba42c86e0eee44e3b71d845f5d845714d38a Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 13:23:18 +0800 Subject: [PATCH 10/27] ci: add workingDirectory to all script steps for OneBranch container --- .pipelines/modelkit-official-build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 22dec3b58..b144c8ea6 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -67,9 +67,11 @@ extends: displayName: 'Authenticate pip with Azure Artifacts' - script: python -m pip install ruff + workingDirectory: $(Build.SourcesDirectory) displayName: 'Install ruff' - script: ruff check src/ tests/ + workingDirectory: $(Build.SourcesDirectory) displayName: 'Ruff lint' # ── Test (6-group matrix) ── @@ -108,12 +110,14 @@ extends: displayName: 'Authenticate pip with Azure Artifacts' - script: python -m pip install ".[dev]" + workingDirectory: $(Build.SourcesDirectory) displayName: 'Install dependencies' - script: > pytest $(testPaths) --tb=short -m "not e2e and not npu and not gpu" --junitxml=$(Build.StagingDirectory)/test-results.xml + workingDirectory: $(Build.SourcesDirectory) displayName: 'Run tests' - task: PublishTestResults@2 @@ -146,10 +150,13 @@ extends: displayName: 'Authenticate pip with Azure Artifacts' - script: python -m pip install build twine + workingDirectory: $(Build.SourcesDirectory) displayName: 'Install build tools' - script: python -m build --outdir $(ob_outputDirectory) + workingDirectory: $(Build.SourcesDirectory) displayName: 'Build sdist and wheel' - script: twine check $(ob_outputDirectory)/* + workingDirectory: $(Build.SourcesDirectory) displayName: 'Validate packages for PyPI' From d473c1394296761f254102360286fef32e79d596 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 13:32:43 +0800 Subject: [PATCH 11/27] ci: use absolute paths for ruff and add debug dir listing --- .pipelines/modelkit-official-build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index b144c8ea6..0126b51b9 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -70,8 +70,10 @@ extends: workingDirectory: $(Build.SourcesDirectory) displayName: 'Install ruff' - - script: ruff check src/ tests/ - workingDirectory: $(Build.SourcesDirectory) + - script: | + echo "Source directory: $(Build.SourcesDirectory)" + dir $(Build.SourcesDirectory) + ruff check $(Build.SourcesDirectory)/src/ $(Build.SourcesDirectory)/tests/ displayName: 'Ruff lint' # ── Test (6-group matrix) ── From 9e950f160f43e7d7561e844ce7cfab2fa6ff779f Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 13:37:07 +0800 Subject: [PATCH 12/27] =?UTF-8?q?ci:=20rewrite=20pipeline=20following=20On?= =?UTF-8?q?eBranch=20patterns=20=E2=80=94=20no=20checkout,=20no=20workingD?= =?UTF-8?q?irectory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pipelines/modelkit-official-build.yml | 49 +++++++++++--------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 0126b51b9..ec9771e22 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -40,40 +40,37 @@ extends: Network: KS1 networkisolation: policy: Permissive,CFSClean - globalSdl: - tsa: - enabled: false + globalSdl: + tsa: + enabled: false stages: - stage: Build displayName: 'Lint, Test & Build' + dependsOn: [] jobs: # ── Lint ── - job: Lint displayName: 'Ruff Lint' pool: type: windows - timeoutInMinutes: 10 variables: - ob_outputDirectory: '$(Build.SourcesDirectory)/out' + ob_outputDirectory: '$(Build.SourcesDirectory)\out' steps: - - checkout: self + - script: python --version + displayName: 'Check Python version' - task: PipAuthenticate@1 inputs: artifactFeeds: 'windows.ai.toolkit/Modelkit' displayName: 'Authenticate pip with Azure Artifacts' - - script: python -m pip install ruff - workingDirectory: $(Build.SourcesDirectory) + - script: pip install ruff displayName: 'Install ruff' - - script: | - echo "Source directory: $(Build.SourcesDirectory)" - dir $(Build.SourcesDirectory) - ruff check $(Build.SourcesDirectory)/src/ $(Build.SourcesDirectory)/tests/ + - script: ruff check src/ tests/ displayName: 'Ruff lint' # ── Test (6-group matrix) ── @@ -85,7 +82,7 @@ extends: timeoutInMinutes: 30 variables: - ob_outputDirectory: '$(Build.SourcesDirectory)/out' + ob_outputDirectory: '$(Build.SourcesDirectory)\out' strategy: matrix: @@ -104,29 +101,28 @@ extends: maxParallel: 6 steps: - - checkout: self + - script: python --version + displayName: 'Check Python version' - task: PipAuthenticate@1 inputs: artifactFeeds: 'windows.ai.toolkit/Modelkit' displayName: 'Authenticate pip with Azure Artifacts' - - script: python -m pip install ".[dev]" - workingDirectory: $(Build.SourcesDirectory) + - script: pip install -e .[dev] displayName: 'Install dependencies' - script: > pytest $(testPaths) --tb=short -m "not e2e and not npu and not gpu" - --junitxml=$(Build.StagingDirectory)/test-results.xml - workingDirectory: $(Build.SourcesDirectory) + --junitxml=$(Build.StagingDirectory)\test-results.xml displayName: 'Run tests' - task: PublishTestResults@2 condition: always() inputs: testResultsFormat: JUnit - testResultsFiles: '$(Build.StagingDirectory)/test-results.xml' + testResultsFiles: '$(Build.StagingDirectory)\test-results.xml' testRunTitle: 'Tests - $(System.JobDisplayName)' mergeTestResults: true displayName: 'Publish test results' @@ -137,28 +133,25 @@ extends: dependsOn: Test pool: type: windows - timeoutInMinutes: 10 variables: - ob_outputDirectory: '$(Build.SourcesDirectory)/out' + ob_outputDirectory: '$(Build.SourcesDirectory)\out' ob_artifactBaseName: 'drop' steps: - - checkout: self + - script: python --version + displayName: 'Check Python version' - task: PipAuthenticate@1 inputs: artifactFeeds: 'windows.ai.toolkit/Modelkit' displayName: 'Authenticate pip with Azure Artifacts' - - script: python -m pip install build twine - workingDirectory: $(Build.SourcesDirectory) + - script: pip install build twine displayName: 'Install build tools' - - script: python -m build --outdir $(ob_outputDirectory) - workingDirectory: $(Build.SourcesDirectory) + - script: python -m build --outdir "$(ob_outputDirectory)" displayName: 'Build sdist and wheel' - - script: twine check $(ob_outputDirectory)/* - workingDirectory: $(Build.SourcesDirectory) + - script: twine check "$(ob_outputDirectory)\*" displayName: 'Validate packages for PyPI' From eb9b8d58ff92fb26836cd7ca8442c9bca807ca4c Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 14:11:53 +0800 Subject: [PATCH 13/27] ci: use unique ob_outputDirectory per job to avoid artifact name collision --- .pipelines/modelkit-official-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index ec9771e22..71dafa2a0 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -56,7 +56,7 @@ extends: type: windows variables: - ob_outputDirectory: '$(Build.SourcesDirectory)\out' + ob_outputDirectory: '$(Build.SourcesDirectory)\out\lint' steps: - script: python --version @@ -82,7 +82,7 @@ extends: timeoutInMinutes: 30 variables: - ob_outputDirectory: '$(Build.SourcesDirectory)\out' + ob_outputDirectory: '$(Build.SourcesDirectory)\out\test_$(System.JobPositionInPhase)' strategy: matrix: From b1d0e86f70aaedf78faf5eee92a947819ac9d195 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 14:16:21 +0800 Subject: [PATCH 14/27] ci: temporarily keep only Build job to validate wheel packaging --- .pipelines/modelkit-official-build.yml | 84 +------------------------- 1 file changed, 2 insertions(+), 82 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 71dafa2a0..b5398e0db 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -46,91 +46,11 @@ extends: stages: - stage: Build - displayName: 'Lint, Test & Build' + displayName: 'Build Python Package' dependsOn: [] jobs: - # ── Lint ── - - job: Lint - displayName: 'Ruff Lint' - pool: - type: windows - - variables: - ob_outputDirectory: '$(Build.SourcesDirectory)\out\lint' - - steps: - - script: python --version - displayName: 'Check Python version' - - - task: PipAuthenticate@1 - inputs: - artifactFeeds: 'windows.ai.toolkit/Modelkit' - displayName: 'Authenticate pip with Azure Artifacts' - - - script: pip install ruff - displayName: 'Install ruff' - - - script: ruff check src/ tests/ - displayName: 'Ruff lint' - - # ── Test (6-group matrix) ── - - job: Test - displayName: 'Test' - dependsOn: Lint - pool: - type: windows - timeoutInMinutes: 30 - - variables: - ob_outputDirectory: '$(Build.SourcesDirectory)\out\test_$(System.JobPositionInPhase)' - - strategy: - matrix: - analyze: - testPaths: 'tests/unit/analyze' - models: - testPaths: 'tests/unit/models tests/unit/loader tests/unit/datasets tests/unit/export' - optim: - testPaths: 'tests/unit/optim' - commands: - testPaths: 'tests/unit/commands tests/unit/config tests/unit/build tests/unit/compiler tests/unit/session tests/unit/eval' - remaining: - testPaths: 'tests/unit/core tests/unit/onnx tests/unit/cache tests/unit/utils tests/unit/sysinfo tests/unit/inspect tests/unit/optracing tests/regression' - integration: - testPaths: 'tests/integration' - maxParallel: 6 - - steps: - - script: python --version - displayName: 'Check Python version' - - - task: PipAuthenticate@1 - inputs: - artifactFeeds: 'windows.ai.toolkit/Modelkit' - displayName: 'Authenticate pip with Azure Artifacts' - - - script: pip install -e .[dev] - displayName: 'Install dependencies' - - - script: > - pytest $(testPaths) --tb=short - -m "not e2e and not npu and not gpu" - --junitxml=$(Build.StagingDirectory)\test-results.xml - displayName: 'Run tests' - - - task: PublishTestResults@2 - condition: always() - inputs: - testResultsFormat: JUnit - testResultsFiles: '$(Build.StagingDirectory)\test-results.xml' - testRunTitle: 'Tests - $(System.JobDisplayName)' - mergeTestResults: true - displayName: 'Publish test results' - - # ── Build Wheel ── - job: BuildWheel - displayName: 'Build Python Package' - dependsOn: Test + displayName: 'Build' pool: type: windows From b99345cb94df66e8713ec468a492b5b2409363e6 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 14:24:11 +0800 Subject: [PATCH 15/27] ci: remove twine check due to PEP 639 license-file compatibility issue --- .pipelines/modelkit-official-build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index b5398e0db..054961a27 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -67,11 +67,8 @@ extends: artifactFeeds: 'windows.ai.toolkit/Modelkit' displayName: 'Authenticate pip with Azure Artifacts' - - script: pip install build twine + - script: pip install build displayName: 'Install build tools' - script: python -m build --outdir "$(ob_outputDirectory)" displayName: 'Build sdist and wheel' - - - script: twine check "$(ob_outputDirectory)\*" - displayName: 'Validate packages for PyPI' From d469481013e5a03078eb3052ae65d29b3ce721b7 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 14:36:13 +0800 Subject: [PATCH 16/27] ci: add twine check back with continueOnError for diagnostics --- .pipelines/modelkit-official-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 054961a27..ae5628e8f 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -67,8 +67,12 @@ extends: artifactFeeds: 'windows.ai.toolkit/Modelkit' displayName: 'Authenticate pip with Azure Artifacts' - - script: pip install build + - script: pip install build twine displayName: 'Install build tools' - script: python -m build --outdir "$(ob_outputDirectory)" displayName: 'Build sdist and wheel' + + - script: twine check "$(ob_outputDirectory)\*" + continueOnError: true + displayName: 'Validate packages for PyPI' From 138fd5e6a129abebba465573d8082889d2f3c747 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 14:49:43 +0800 Subject: [PATCH 17/27] ci: add DownloadRules job to fetch runtime check rules from ModelKitArtifacts --- .pipelines/modelkit-official-build.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index ae5628e8f..107f1f473 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -27,6 +27,10 @@ resources: type: git name: OneBranch.Pipelines/GovernedTemplates ref: refs/heads/main + - repository: artifacts + type: github + name: gim-home/ModelKitArtifacts + endpoint: github.com_yuesu_microsoft extends: template: v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates @@ -49,8 +53,34 @@ extends: displayName: 'Build Python Package' dependsOn: [] jobs: + # ── Download Runtime Check Rules ── + - job: DownloadRules + displayName: 'Download Runtime Check Rules' + pool: + type: windows + + variables: + ob_outputDirectory: '$(Build.SourcesDirectory)\out\rules' + + steps: + - checkout: artifacts + fetchDepth: 1 + lfs: true + + - powershell: | + $outDir = "$(ob_outputDirectory)" + New-Item -ItemType Directory -Path $outDir -Force | Out-Null + $repoDir = "$(Pipeline.Workspace)\artifacts" + $zips = Get-ChildItem "$repoDir\op_check_results\rules\*.zip" + Write-Host "Found $($zips.Count) rule zips" + $zips | Copy-Item -Destination $outDir + Write-Host "Copied $($zips.Count) rule zips to $outDir" + displayName: 'Copy runtime check rules' + + # ── Build Wheel ── - job: BuildWheel displayName: 'Build' + dependsOn: DownloadRules pool: type: windows @@ -62,6 +92,13 @@ extends: - script: python --version displayName: 'Check Python version' + - task: DownloadPipelineArtifact@2 + inputs: + buildType: current + artifactName: 'drop_Build_DownloadRules' + targetPath: 'src\winml\modelkit\analyze\rules\runtime_check_rules' + displayName: 'Copy runtime check rules' + - task: PipAuthenticate@1 inputs: artifactFeeds: 'windows.ai.toolkit/Modelkit' From b1a48e010be03097ada59ed6f209f589d341cb54 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 15:04:04 +0800 Subject: [PATCH 18/27] ci: debug listing to find artifacts checkout path --- .pipelines/modelkit-official-build.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 107f1f473..a7b98d344 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -68,14 +68,16 @@ extends: lfs: true - powershell: | - $outDir = "$(ob_outputDirectory)" - New-Item -ItemType Directory -Path $outDir -Force | Out-Null - $repoDir = "$(Pipeline.Workspace)\artifacts" - $zips = Get-ChildItem "$repoDir\op_check_results\rules\*.zip" - Write-Host "Found $($zips.Count) rule zips" - $zips | Copy-Item -Destination $outDir - Write-Host "Copied $($zips.Count) rule zips to $outDir" - displayName: 'Copy runtime check rules' + $repoDir = "$(Build.SourcesDirectory)\artifacts" + Write-Host "Listing repo dir: $repoDir" + if (Test-Path $repoDir) { + Get-ChildItem $repoDir -Depth 2 | ForEach-Object { Write-Host $_.FullName } + } else { + Write-Host "Directory not found: $repoDir" + Write-Host "Listing Build.SourcesDirectory:" + Get-ChildItem "$(Build.SourcesDirectory)" -Depth 1 | ForEach-Object { Write-Host $_.FullName } + } + displayName: 'Debug: list checkout paths' # ── Build Wheel ── - job: BuildWheel From 1482b3ef43ce2adf98700ce5c75687345c217487 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 15:06:21 +0800 Subject: [PATCH 19/27] ci: fix artifacts checkout path to ModelKitArtifacts --- .pipelines/modelkit-official-build.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index a7b98d344..2e989f2f2 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -68,16 +68,15 @@ extends: lfs: true - powershell: | - $repoDir = "$(Build.SourcesDirectory)\artifacts" - Write-Host "Listing repo dir: $repoDir" - if (Test-Path $repoDir) { - Get-ChildItem $repoDir -Depth 2 | ForEach-Object { Write-Host $_.FullName } - } else { - Write-Host "Directory not found: $repoDir" - Write-Host "Listing Build.SourcesDirectory:" - Get-ChildItem "$(Build.SourcesDirectory)" -Depth 1 | ForEach-Object { Write-Host $_.FullName } - } - displayName: 'Debug: list checkout paths' + $outDir = "$(ob_outputDirectory)" + New-Item -ItemType Directory -Path $outDir -Force | Out-Null + $rulesDir = "$(Build.SourcesDirectory)\ModelKitArtifacts\op_check_results\rules" + Write-Host "Looking for rules in: $rulesDir" + $zips = Get-ChildItem "$rulesDir\*.zip" + Write-Host "Found $($zips.Count) rule zips" + $zips | Copy-Item -Destination $outDir + Write-Host "Copied $($zips.Count) rule zips to $outDir" + displayName: 'Copy runtime check rules' # ── Build Wheel ── - job: BuildWheel From 4631be37a9429096be97745a2fdfba5bb87eb478 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 15:10:37 +0800 Subject: [PATCH 20/27] ci: add DownloadRules job with parameterized artifacts branch --- .pipelines/modelkit-official-build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 2e989f2f2..44e0775cb 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -15,6 +15,9 @@ parameters: # parameters are shown up in ADO UI in a build queue time displayName: 'Enable debug output' type: boolean default: false +- name: 'artifactsBranch' + displayName: 'ModelKitArtifacts branch (e.g. release/v0.0.1)' + type: string variables: CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning @@ -31,6 +34,7 @@ resources: type: github name: gim-home/ModelKitArtifacts endpoint: github.com_yuesu_microsoft + ref: refs/heads/${{ parameters.artifactsBranch }} extends: template: v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates @@ -65,13 +69,11 @@ extends: steps: - checkout: artifacts fetchDepth: 1 - lfs: true - powershell: | $outDir = "$(ob_outputDirectory)" New-Item -ItemType Directory -Path $outDir -Force | Out-Null $rulesDir = "$(Build.SourcesDirectory)\ModelKitArtifacts\op_check_results\rules" - Write-Host "Looking for rules in: $rulesDir" $zips = Get-ChildItem "$rulesDir\*.zip" Write-Host "Found $($zips.Count) rule zips" $zips | Copy-Item -Destination $outDir From ea078428107a85d1320b9beb2003c6652cbdd347 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 15:12:38 +0800 Subject: [PATCH 21/27] ci: remove artifactsBranch parameter, use ADO UI resource branch picker --- .pipelines/modelkit-official-build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 44e0775cb..0571cafd9 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -15,9 +15,6 @@ parameters: # parameters are shown up in ADO UI in a build queue time displayName: 'Enable debug output' type: boolean default: false -- name: 'artifactsBranch' - displayName: 'ModelKitArtifacts branch (e.g. release/v0.0.1)' - type: string variables: CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning @@ -34,7 +31,7 @@ resources: type: github name: gim-home/ModelKitArtifacts endpoint: github.com_yuesu_microsoft - ref: refs/heads/${{ parameters.artifactsBranch }} + ref: refs/heads/main extends: template: v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates From 43d62c4866bc84f30b9d878e51d50705f44305b7 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 17:06:00 +0800 Subject: [PATCH 22/27] ci: add debug step to verify rules are downloaded before wheel build --- .pipelines/modelkit-official-build.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 0571cafd9..2528018ec 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -97,7 +97,19 @@ extends: buildType: current artifactName: 'drop_Build_DownloadRules' targetPath: 'src\winml\modelkit\analyze\rules\runtime_check_rules' - displayName: 'Copy runtime check rules' + displayName: 'Download runtime check rules' + + - powershell: | + $rulesDir = "src\winml\modelkit\analyze\rules\runtime_check_rules" + Write-Host "Rules directory: $rulesDir" + if (Test-Path $rulesDir) { + $files = Get-ChildItem $rulesDir + Write-Host "Files: $($files.Count)" + $files | ForEach-Object { Write-Host " $($_.Name) ($([math]::Round($_.Length/1KB, 1)) KB)" } + } else { + Write-Host "Directory does not exist!" + } + displayName: 'Debug: verify rules downloaded' - task: PipAuthenticate@1 inputs: From 8ee4ff88921007ecfeb01aa05a21b16e35bd3383 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 17:07:44 +0800 Subject: [PATCH 23/27] ci: enable LFS for artifacts checkout and remove debug step --- .pipelines/modelkit-official-build.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 2528018ec..474560485 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -66,6 +66,7 @@ extends: steps: - checkout: artifacts fetchDepth: 1 + lfs: true - powershell: | $outDir = "$(ob_outputDirectory)" @@ -99,18 +100,6 @@ extends: targetPath: 'src\winml\modelkit\analyze\rules\runtime_check_rules' displayName: 'Download runtime check rules' - - powershell: | - $rulesDir = "src\winml\modelkit\analyze\rules\runtime_check_rules" - Write-Host "Rules directory: $rulesDir" - if (Test-Path $rulesDir) { - $files = Get-ChildItem $rulesDir - Write-Host "Files: $($files.Count)" - $files | ForEach-Object { Write-Host " $($_.Name) ($([math]::Round($_.Length/1KB, 1)) KB)" } - } else { - Write-Host "Directory does not exist!" - } - displayName: 'Debug: verify rules downloaded' - - task: PipAuthenticate@1 inputs: artifactFeeds: 'windows.ai.toolkit/Modelkit' From 15dea57c005769641f898149b5499db0761d68ce Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 17:08:25 +0800 Subject: [PATCH 24/27] ci: use absolute path for DownloadPipelineArtifact targetPath --- .pipelines/modelkit-official-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 474560485..bfc206d8f 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -97,7 +97,7 @@ extends: inputs: buildType: current artifactName: 'drop_Build_DownloadRules' - targetPath: 'src\winml\modelkit\analyze\rules\runtime_check_rules' + targetPath: '$(Build.SourcesDirectory)\src\winml\modelkit\analyze\rules\runtime_check_rules' displayName: 'Download runtime check rules' - task: PipAuthenticate@1 From bb97090417a042a0400a1f2f756065181942cab6 Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 17:47:22 +0800 Subject: [PATCH 25/27] ci: merge build into single job and fix license format (#349) - Merge DownloadRules and BuildWheel into one job - Update license to SPDX string format (setuptools 82+ compat) - Remove deprecated License classifier Fixes #349 --- .pipelines/modelkit-official-build.yml | 41 +++++++------------------- pyproject.toml | 3 +- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index bfc206d8f..3f0e17041 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -54,52 +54,33 @@ extends: displayName: 'Build Python Package' dependsOn: [] jobs: - # ── Download Runtime Check Rules ── - - job: DownloadRules - displayName: 'Download Runtime Check Rules' + - job: BuildWheel + displayName: 'Build' pool: type: windows variables: - ob_outputDirectory: '$(Build.SourcesDirectory)\out\rules' + ob_outputDirectory: '$(Build.SourcesDirectory)\out' + ob_artifactBaseName: 'drop' steps: - checkout: artifacts fetchDepth: 1 lfs: true + - script: python --version + displayName: 'Check Python version' + - powershell: | - $outDir = "$(ob_outputDirectory)" - New-Item -ItemType Directory -Path $outDir -Force | Out-Null $rulesDir = "$(Build.SourcesDirectory)\ModelKitArtifacts\op_check_results\rules" + $destDir = "$(Build.SourcesDirectory)\src\winml\modelkit\analyze\rules\runtime_check_rules" $zips = Get-ChildItem "$rulesDir\*.zip" Write-Host "Found $($zips.Count) rule zips" - $zips | Copy-Item -Destination $outDir - Write-Host "Copied $($zips.Count) rule zips to $outDir" + $zips | Copy-Item -Destination $destDir + $zips | Copy-Item -Destination "$(ob_outputDirectory)" + Write-Host "Copied $($zips.Count) rule zips to $destDir and output" displayName: 'Copy runtime check rules' - # ── Build Wheel ── - - job: BuildWheel - displayName: 'Build' - dependsOn: DownloadRules - pool: - type: windows - - variables: - ob_outputDirectory: '$(Build.SourcesDirectory)\out' - ob_artifactBaseName: 'drop' - - steps: - - script: python --version - displayName: 'Check Python version' - - - task: DownloadPipelineArtifact@2 - inputs: - buildType: current - artifactName: 'drop_Build_DownloadRules' - targetPath: '$(Build.SourcesDirectory)\src\winml\modelkit\analyze\rules\runtime_check_rules' - displayName: 'Download runtime check rules' - - task: PipAuthenticate@1 inputs: artifactFeeds: 'windows.ai.toolkit/Modelkit' diff --git a/pyproject.toml b/pyproject.toml index e2a2a64a3..0ff3d4b2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,14 +8,13 @@ version = "0.0.1.dev1" description = "Accelerate Model Deployment on WinML" readme = "README.md" keywords = [ "onnx", "winml" ] -license = { text = "MIT" } +license = "MIT" authors = [ { name = "WinML Team" } ] requires-python = ">=3.10,<3.11" classifiers = [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering :: Artificial Intelligence", From 98cb9e8114631ee363aea2fe76f7bf67f8619d1e Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 21:53:34 +0800 Subject: [PATCH 26/27] ci: create ob_outputDirectory before copying rules --- .pipelines/modelkit-official-build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.pipelines/modelkit-official-build.yml b/.pipelines/modelkit-official-build.yml index 3f0e17041..6cd8243f4 100644 --- a/.pipelines/modelkit-official-build.yml +++ b/.pipelines/modelkit-official-build.yml @@ -74,11 +74,13 @@ extends: - powershell: | $rulesDir = "$(Build.SourcesDirectory)\ModelKitArtifacts\op_check_results\rules" $destDir = "$(Build.SourcesDirectory)\src\winml\modelkit\analyze\rules\runtime_check_rules" + $outDir = "$(ob_outputDirectory)" + New-Item -ItemType Directory -Path $outDir -Force | Out-Null $zips = Get-ChildItem "$rulesDir\*.zip" Write-Host "Found $($zips.Count) rule zips" $zips | Copy-Item -Destination $destDir - $zips | Copy-Item -Destination "$(ob_outputDirectory)" - Write-Host "Copied $($zips.Count) rule zips to $destDir and output" + $zips | Copy-Item -Destination $outDir + Write-Host "Copied $($zips.Count) rule zips to $destDir and $outDir" displayName: 'Copy runtime check rules' - task: PipAuthenticate@1 From c0302d913eff958a2bee30e39e4a407b817d9dca Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Tue, 14 Apr 2026 22:41:48 +0800 Subject: [PATCH 27/27] revert: restore original license format in pyproject.toml --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0ff3d4b2d..e2a2a64a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,13 +8,14 @@ version = "0.0.1.dev1" description = "Accelerate Model Deployment on WinML" readme = "README.md" keywords = [ "onnx", "winml" ] -license = "MIT" +license = { text = "MIT" } authors = [ { name = "WinML Team" } ] requires-python = ">=3.10,<3.11" classifiers = [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering :: Artificial Intelligence",