-
Notifications
You must be signed in to change notification settings - Fork 52
CHORE: Add OneBranch release pipelines for mssql-python-odbc #664
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
b845621
Add OneBranch release pipelines for mssql-python-odbc
jahnvi480 c19a261
Address PR review: fail-fast on wheel count, armory justification, Li…
jahnvi480 62910b4
Address review: preflight guard for odbcBuildDefinitionId placeholder…
jahnvi480 38b9ff9
Fold mssql-python-odbc build+release into existing pipelines
jahnvi480 d85fd92
Scope consolidate downloads by package to prevent cross-contamination
jahnvi480 e3cf2a9
Correct stale mssql-python wheel count in consolidate diagnostic (27 …
jahnvi480 a4b4e59
Harden odbc release path: pin guard + wheel-content assertions
jahnvi480 b88e169
Hard-fail mssql-python consolidate on wheel-count mismatch
jahnvi480 0346212
Merge branch 'main' into jahnvi/odbc-release-pipelines
jahnvi480 d1b3d46
odbc: add mssql-python-odbc selector to dummy release pipeline
jahnvi480 9f93c36
odbc: align dummy release pipeline mssql-python handling with official
jahnvi480 2d93fe0
odbc: bump mssql-python-odbc pin to 18.6.2 in release pipelines
jahnvi480 a4e3968
build: add buildPackage selector to build pipeline
jahnvi480 9d3097c
build: nightly build always builds both packages
jahnvi480 fdb02cb
Add OneBranch release pipelines for mssql-python-odbc
jahnvi480 79d60ba
Address PR review: fail-fast on wheel count, armory justification, Li…
jahnvi480 d4b82a6
Address review: preflight guard for odbcBuildDefinitionId placeholder…
jahnvi480 68b7ba0
Fold mssql-python-odbc build+release into existing pipelines
jahnvi480 7a1d351
Scope consolidate downloads by package to prevent cross-contamination
jahnvi480 7e5947e
Correct stale mssql-python wheel count in consolidate diagnostic (27 …
jahnvi480 68cba53
Harden odbc release path: pin guard + wheel-content assertions
jahnvi480 0772cc0
Hard-fail mssql-python consolidate on wheel-count mismatch
jahnvi480 52dbd7b
odbc: add mssql-python-odbc selector to dummy release pipeline
jahnvi480 19f1db1
odbc: align dummy release pipeline mssql-python handling with official
jahnvi480 2038ca6
odbc: bump mssql-python-odbc pin to 18.6.2 in release pipelines
jahnvi480 926ba53
build: add buildPackage selector to build pipeline
jahnvi480 72c3c88
build: nightly build always builds both packages
jahnvi480 b15c8ad
CHORE: reconcile GH pipeline Option A both-wheels test with validated…
jahnvi480 3caadc7
Merge branch 'jahnvi/odbc-release-pipelines' of https://github.com/mi…
jahnvi480 9580488
Merge branch 'main' into jahnvi/odbc-release-pipelines
jahnvi480 564ee03
Merge branch 'main' of https://github.com/microsoft/mssql-python into…
jahnvi480 9de3f4d
Merge branch 'jahnvi/odbc-release-pipelines' of https://github.com/mi…
jahnvi480 7795a2d
FIX: resolve DevSkim localhost finding and harden both-wheels test stage
jahnvi480 78f0a02
Merge branch 'main' into jahnvi/odbc-release-pipelines
jahnvi480 6f60f30
FIX: add Windows + macOS both-wheels install tests and krb5 deps for …
jahnvi480 b8f813a
FIX: suppress DevSkim DS162092 (localhost) findings in macOS both-whe…
jahnvi480 433a1fb
FIX: align Linux both-wheels test stage with the ADO-validated version
jahnvi480 d10a199
FIX: align test_000_dependencies with the package-split-aware driver …
jahnvi480 e2647e3
FIX: strengthen odbc-package build-stage wheel-content guards (ADO pa…
jahnvi480 f23df69
FIX: restore GitHub #656 macOS driver relocatability test under packa…
jahnvi480 67ecc86
FIX: make mssql-python-odbc pin guard non-blocking and anchor the ver…
jahnvi480 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,210 @@ | ||
| # ========================================================================================= | ||
| # OneBranch Build Pipeline for mssql-python-odbc | ||
| # ========================================================================================= | ||
| # Builds the standalone ODBC driver-binary package `mssql-python-odbc`. | ||
| # | ||
| # This package ships ONLY the Microsoft ODBC Driver 18 binaries as data. There is | ||
| # NO compiled Python extension, so every wheel is tagged `py3-none-<platform>` and a | ||
| # SINGLE build per platform covers all supported Python versions (3.10+). That is why | ||
| # this pipeline has NO per-Python-version matrix (unlike mssql-python) and produces | ||
| # only 7 wheels total: | ||
| # - Windows: x64, arm64 | ||
| # - macOS: universal2 | ||
| # - Linux: manylinux_2_28 (x86_64, aarch64), musllinux_1_2 (x86_64, aarch64) | ||
| # | ||
| # Publishing to PyPI is handled by the companion official-release-odbc-pipeline.yml | ||
| # using the SAME shared ESRP identity (variable group 'ESRP Federated Creds (AME)'). | ||
| # | ||
| # INFRA PREREQUISITES (see companion release pipeline for the definition ID): | ||
| # - Register this YAML as a new ADO build definition (e.g. 'Build-Release-ODBC-Pipeline'). | ||
| # - Share the 'ESRP Federated Creds (AME)' variable group with the new pipeline. | ||
| # - Ensure the reused pools/images are available: Python-1ES-pool | ||
| # (PYTHON-1ES-MMS2022 for Windows, PYTHON-1ES-UB2404 for Linux) and the | ||
| # 'Magnitude Test-mssql-rs-mssql-python' Azure subscription for ACR login. | ||
| # ========================================================================================= | ||
|
|
||
| # Build number format: YYDDD.r | ||
| name: $(Year:YY)$(DayOfYear)$(Rev:.r) | ||
|
|
||
| # Only trigger when ODBC-package inputs change (path filters are literal prefixes, | ||
| # not globs, in Azure DevOps). Unrelated mssql-python commits do not rebuild this. | ||
| trigger: | ||
| branches: | ||
| include: | ||
| - main | ||
| paths: | ||
| include: | ||
| - setup_odbc.py | ||
| - mssql_python_odbc | ||
| - mssql_python/libs | ||
| - OneBranchPipelines/build-release-odbc-pipeline.yml | ||
| - OneBranchPipelines/stages/build-odbc-windows-stage.yml | ||
| - OneBranchPipelines/stages/build-odbc-macos-stage.yml | ||
| - OneBranchPipelines/stages/build-odbc-linux-stage.yml | ||
| - OneBranchPipelines/jobs/consolidate-odbc-artifacts-job.yml | ||
|
|
||
| pr: | ||
| branches: | ||
| include: | ||
| - main | ||
| paths: | ||
| include: | ||
| - setup_odbc.py | ||
| - mssql_python_odbc | ||
| - mssql_python/libs | ||
| - OneBranchPipelines/build-release-odbc-pipeline.yml | ||
| - OneBranchPipelines/stages/build-odbc-windows-stage.yml | ||
| - OneBranchPipelines/stages/build-odbc-macos-stage.yml | ||
| - OneBranchPipelines/stages/build-odbc-linux-stage.yml | ||
| - OneBranchPipelines/jobs/consolidate-odbc-artifacts-job.yml | ||
|
|
||
| parameters: | ||
| - name: oneBranchType | ||
| displayName: 'OneBranch Template Type' | ||
| type: string | ||
| values: | ||
| - 'Official' | ||
| - 'NonOfficial' | ||
| default: 'NonOfficial' | ||
|
|
||
| - name: runSdlTasks | ||
| displayName: 'Run SDL Security Tasks' | ||
| type: boolean | ||
| default: true | ||
|
|
||
| # Windows: one wheel per architecture (NO per-Python matrix). | ||
| - name: odbcWindowsConfigs | ||
| type: object | ||
| default: | ||
| - arch: 'x64' | ||
| - arch: 'arm64' | ||
|
|
||
| # macOS: single universal2 wheel. | ||
| - name: odbcMacosConfigs | ||
| type: object | ||
| default: | ||
| - name: 'universal2' | ||
|
|
||
| # Linux: one wheel per libc/arch combo. | ||
| - name: odbcLinuxConfigs | ||
| type: object | ||
| default: | ||
| - { tag: 'manylinux_2_28', arch: 'x86_64', platform: 'linux/amd64' } | ||
| - { tag: 'manylinux_2_28', arch: 'aarch64', platform: 'linux/arm64' } | ||
| - { tag: 'musllinux', arch: 'x86_64', platform: 'linux/amd64' } | ||
| - { tag: 'musllinux', arch: 'aarch64', platform: 'linux/arm64' } | ||
|
|
||
| variables: | ||
| # Scheduled builds run as Official; manual/PR builds use the parameter. | ||
| - name: effectiveOneBranchType | ||
| ${{ if eq(variables['Build.Reason'], 'Schedule') }}: | ||
| value: 'Official' | ||
| ${{ else }}: | ||
| value: '${{ parameters.oneBranchType }}' | ||
|
|
||
| - template: /OneBranchPipelines/variables/common-variables.yml@self | ||
| - template: /OneBranchPipelines/variables/onebranch-variables.yml@self | ||
| # Maps 'ESRP Federated Creds (AME)' group vars to the Signing* names used by the | ||
| # per-stage EsrpMalwareScanning tasks. | ||
| - template: /OneBranchPipelines/variables/signing-variables.yml@self | ||
| - group: 'ESRP Federated Creds (AME)' | ||
|
|
||
| resources: | ||
| repositories: | ||
| - repository: templates | ||
| type: git | ||
| name: 'OneBranch.Pipelines/GovernedTemplates' | ||
| ref: 'refs/heads/main' | ||
|
|
||
| extends: | ||
| template: 'v2/OneBranch.${{ variables.effectiveOneBranchType }}.CrossPlat.yml@templates' | ||
|
|
||
| parameters: | ||
| featureFlags: | ||
| WindowsHostVersion: | ||
| Version: '2022' | ||
|
|
||
| globalSdl: | ||
| baseline: | ||
| baselineFile: $(Build.SourcesDirectory)/.gdn/.gdnbaselines | ||
| suppressionSet: default | ||
| suppression: | ||
| suppressionFile: $(Build.SourcesDirectory)/.gdn/.gdnsuppress | ||
| suppressionSet: default | ||
|
|
||
| # This pipeline compiles NO first-party native code — it only packages the | ||
| # pre-built ODBC driver binaries, which are signed and governed by the Microsoft | ||
| # ODBC Driver team's own SDL. Native/binary analyzers are therefore disabled here; | ||
| # every wheel is still malware-scanned per stage (EsrpMalwareScanning@5). | ||
| binskim: | ||
| enabled: false | ||
| justificationForDisabling: 'No first-party native code is built here; the packaged ODBC driver binaries are pre-built/pre-signed and covered by the ODBC Driver team SDL. Wheels are malware-scanned per stage.' | ||
| apiscan: | ||
| enabled: false | ||
| justificationForDisabling: 'No first-party native binaries are produced by this pipeline.' | ||
| armory: | ||
| enabled: false | ||
| codeql: | ||
| enabled: false | ||
| justificationForDisabling: 'This pipeline only packages pre-built driver binaries; no first-party source is compiled.' | ||
|
|
||
| credscan: | ||
| enabled: ${{ parameters.runSdlTasks }} | ||
| policheck: | ||
| enabled: ${{ parameters.runSdlTasks }} | ||
| break: true | ||
| exclusionFile: '$(REPO_ROOT)/.config/PolicheckExclusions.xml' | ||
| publishLogs: | ||
| enabled: ${{ parameters.runSdlTasks }} | ||
| sbom: | ||
| enabled: ${{ parameters.runSdlTasks }} | ||
| packageName: 'mssql-python-odbc' | ||
| tsa: | ||
| enabled: ${{ and(eq(variables.effectiveOneBranchType, 'Official'), parameters.runSdlTasks) }} | ||
| configFile: '$(REPO_ROOT)/.config/tsaoptions.json' | ||
|
|
||
| stages: | ||
| # WINDOWS BUILD STAGES (2: x64, arm64) | ||
| - ${{ each config in parameters.odbcWindowsConfigs }}: | ||
| - template: /OneBranchPipelines/stages/build-odbc-windows-stage.yml@self | ||
| parameters: | ||
| stageName: ODBC_Win_${{ config.arch }} | ||
| jobName: BuildWheel | ||
| architecture: ${{ config.arch }} | ||
| oneBranchType: '${{ variables.effectiveOneBranchType }}' | ||
|
|
||
| # MACOS BUILD STAGE (1: universal2) | ||
| - ${{ each config in parameters.odbcMacosConfigs }}: | ||
| - template: /OneBranchPipelines/stages/build-odbc-macos-stage.yml@self | ||
| parameters: | ||
| stageName: ODBC_MacOS_${{ config.name }} | ||
| jobName: BuildWheel | ||
| oneBranchType: '${{ variables.effectiveOneBranchType }}' | ||
|
|
||
| # LINUX BUILD STAGES (4: manylinux/musllinux x x86_64/aarch64) | ||
| - ${{ each config in parameters.odbcLinuxConfigs }}: | ||
| - template: /OneBranchPipelines/stages/build-odbc-linux-stage.yml@self | ||
| parameters: | ||
| stageName: ODBC_Linux_${{ config.tag }}_${{ config.arch }} | ||
| jobName: BuildWheel | ||
| linuxTag: ${{ config.tag }} | ||
| arch: ${{ config.arch }} | ||
| dockerPlatform: ${{ config.platform }} | ||
| oneBranchType: '${{ variables.effectiveOneBranchType }}' | ||
|
|
||
| # CONSOLIDATE STAGE (waits for all 7 platform stages) | ||
| - stage: Consolidate | ||
| displayName: 'Consolidate All ODBC Artifacts' | ||
| dependsOn: | ||
| - ODBC_Win_x64 | ||
| - ODBC_Win_arm64 | ||
| - ODBC_MacOS_universal2 | ||
| - ODBC_Linux_manylinux_2_28_x86_64 | ||
| - ODBC_Linux_manylinux_2_28_aarch64 | ||
| - ODBC_Linux_musllinux_x86_64 | ||
| - ODBC_Linux_musllinux_aarch64 | ||
| jobs: | ||
| - template: /OneBranchPipelines/jobs/consolidate-odbc-artifacts-job.yml@self | ||
| parameters: | ||
| oneBranchType: '${{ variables.effectiveOneBranchType }}' | ||
| expectedWheelCount: 7 | ||
68 changes: 68 additions & 0 deletions
68
OneBranchPipelines/jobs/consolidate-odbc-artifacts-job.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Consolidate ODBC Artifacts Job Template | ||
| # Downloads the per-platform `mssql-python-odbc` wheels from all build stages and | ||
| # consolidates them into a single dist/ folder for the release pipeline to publish. | ||
| # Expected: 7 wheels (2 Windows + 1 macOS universal2 + 4 Linux). | ||
| parameters: | ||
| - name: oneBranchType | ||
| type: string | ||
| default: 'Official' | ||
| - name: expectedWheelCount | ||
| type: number | ||
| default: 7 | ||
|
|
||
| jobs: | ||
| - job: ConsolidateArtifacts | ||
| displayName: 'Consolidate All ODBC Platform Artifacts' | ||
| condition: succeeded() | ||
|
|
||
| pool: | ||
| type: linux | ||
| isCustom: true | ||
| name: Azure Pipelines | ||
| vmImage: 'ubuntu-latest' | ||
|
|
||
| variables: | ||
| # Consolidation only moves files; no binaries to scan. | ||
| - name: ob_sdl_binskim_enabled | ||
| value: false | ||
| - name: ob_outputDirectory | ||
| value: '$(Build.ArtifactStagingDirectory)' | ||
|
|
||
| steps: | ||
| - checkout: self | ||
| fetchDepth: 1 | ||
|
|
||
| # Download ALL artifacts from the current build (one per platform stage). | ||
| - task: DownloadPipelineArtifact@2 | ||
| displayName: 'Download All ODBC Platform Artifacts' | ||
| inputs: | ||
| buildType: 'current' | ||
| targetPath: '$(Pipeline.Workspace)/all-artifacts' | ||
|
|
||
| - bash: | | ||
| set -e | ||
| mkdir -p $(ob_outputDirectory)/dist | ||
|
|
||
| echo "Finding all .whl files..." | ||
| find $(Pipeline.Workspace)/all-artifacts -name "*.whl" -exec ls -lh {} \; | ||
|
|
||
| echo "Copying all wheels to consolidated dist/..." | ||
| find $(Pipeline.Workspace)/all-artifacts -name "*.whl" -exec cp -v {} $(ob_outputDirectory)/dist/ \; | ||
|
|
||
| echo "Consolidated wheels:" | ||
| ls -lh $(ob_outputDirectory)/dist/ | ||
| WHEEL_COUNT=$(ls -1 $(ob_outputDirectory)/dist/*.whl 2>/dev/null | wc -l) | ||
| echo "Total wheel count: $WHEEL_COUNT (expected ${{ parameters.expectedWheelCount }})" | ||
| if [ "$WHEEL_COUNT" -ne "${{ parameters.expectedWheelCount }}" ]; then | ||
| echo "WARNING: expected ${{ parameters.expectedWheelCount }} wheels but found $WHEEL_COUNT" | ||
| else | ||
| echo "SUCCESS: all ${{ parameters.expectedWheelCount }} ODBC wheels consolidated." | ||
| fi | ||
|
Copilot marked this conversation as resolved.
|
||
| displayName: 'Consolidate ODBC wheels' | ||
|
|
||
| - task: PublishPipelineArtifact@1 | ||
| displayName: 'Publish Consolidated ODBC Artifacts' | ||
| inputs: | ||
| targetPath: '$(ob_outputDirectory)' | ||
| artifact: 'drop_Consolidate_ConsolidateArtifacts' | ||
| publishLocation: 'pipeline' | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.