Open-source inference server and production cluster for all the models your agent needs.
Python bgecolbertdata-pipelinedeep-learningembeddingsinferenceinference-serverinformation-retrievalllmmlmlopsnatural-language-processingnlppythonrerankingretrievalretrieval-augmented-generationsemantic-searchspladevector-search
fix(release): rehearse all artifacts before publication (#342)
Marton Mayercf2b73202870
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex ad928a2e0..1e3d8bf2c 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -190,7 +190,7 @@ jobs:run: mise exec -- uv run --frozen --project . pytest -q tools/ci/tests/test_helm_render.py- run: |destination="$(mktemp -d)"- mise exec -- helm package deploy/helm/sie-cluster --destination "$destination"+ mise run helm -- package --destination "$destination"git diff --exit-code -- deploy/helm/sie-cluster/Chart.locklive-sdk:diff --git a/.github/workflows/publish-audio.yml b/.github/workflows/publish-audio.ymlnew file mode 100644index 000000000..78bb7ff8a--- /dev/null+++ b/.github/workflows/publish-audio.yml@@ -0,0 +1,87 @@+name: Publish native audio asset++on:+ workflow_call:+ inputs:+ version:+ required: true+ type: string+ tag_name:+ required: true+ type: string+ sha:+ required: true+ type: string+ publish:+ required: true+ type: boolean++permissions:+ contents: read++defaults:+ run:+ shell: bash++jobs:+ publish:+ if: >-+ inputs.publish == true &&+ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&+ github.event_name == 'release' &&+ github.event.action == 'published' &&+ github.event.release.draft == false &&+ github.event.release.prerelease == false &&+ github.ref_protected == true &&+ github.ref == format('refs/tags/{0}', inputs.tag_name) &&+ github.repository == 'superlinked/sie' &&+ github.sha == inputs.sha+ runs-on: blacksmith-8vcpu-ubuntu-2404+ timeout-minutes: 15+ environment: github-release+ permissions:+ contents: write+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ ref: ${{ inputs.sha }}+ fetch-depth: 1+ persist-credentials: false+ - name: Validate trusted publication context and tag binding+ env:+ RELEASE_VERSION: ${{ inputs.version }}+ RELEASE_TAG: ${{ inputs.tag_name }}+ RELEASE_SHA: ${{ inputs.sha }}+ PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}+ GH_TOKEN: ${{ github.token }}+ run: >-+ python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"+ --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4+ with:+ name: audio-prep-${{ inputs.version }}+ path: artifact+ - name: Attach and verify exact GitHub Release asset+ env:+ AUDIO_WHEEL_FILENAME: ${{ format('sie_audio_prep-{0}-cp312-abi3-manylinux_2_28_x86_64.whl', inputs.version) }}+ GH_TOKEN: ${{ github.token }}+ RELEASE_TAG: ${{ inputs.tag_name }}+ run: |+ set -euo pipefail+ wheel="artifact/$AUDIO_WHEEL_FILENAME"+ test -f "$wheel"+ python3 -m tools.ci.release_artifact check --directory artifact --kind audio --version '${{ inputs.version }}' --tag-name '${{ inputs.tag_name }}' --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'+ python3 -c 'import runpy,sys; runpy.run_path("packages/sie_audio_prep/build_wheel.py")["_validate_wheel"](__import__("pathlib").Path(sys.argv[1]))' "$wheel"+ tools/ci/upload_audio_prep_release_asset.bash "$wheel"++ complete:+ if: always() && inputs.publish+ needs: publish+ runs-on: blacksmith-2vcpu-ubuntu-2404+ timeout-minutes: 5+ steps:+ - name: Require every release build and publisher to succeed+ env:+ RESULTS: ${{ toJSON(needs) }}+ run: |+ python3 -c 'import json,os; results=json.loads(os.environ["RESULTS"]); failed={name: job["result"] for name,job in results.items() if job["result"] != "success"}; print(failed); assert not failed'diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.ymlnew file mode 100644index 000000000..c7e41b12f--- /dev/null+++ b/.github/workflows/publish-docker.yml@@ -0,0 +1,276 @@+name: Publish retained release Docker artifacts++on:+ workflow_call:+ inputs:+ version:+ required: true+ type: string+ tag_name:+ required: true+ type: string+ sha:+ required: true+ type: string+ publish:+ required: true+ type: boolean++permissions:+ contents: read++jobs:+ matrix:+ runs-on: blacksmith-2vcpu-ubuntu-2404+ timeout-minutes: 10+ outputs:+ server: ${{ steps.resolve.outputs.server }}+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ ref: ${{ inputs.sha }}+ persist-credentials: false+ - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2+ with:+ version: 2026.5.5+ install_args: --jobs=1+ - id: resolve+ name: Validate source closure and coordinated versions+ env:+ RELEASE_VERSION: ${{ inputs.version }}+ RELEASE_TAG: ${{ inputs.tag_name }}+ RELEASE_SHA: ${{ inputs.sha }}+ run: |+ set -euo pipefail+ test "$RELEASE_TAG" = "v$RELEASE_VERSION"+ test "$(git rev-parse HEAD)" = "$RELEASE_SHA"+ matrix="$(mise run docker -- matrix --version "$RELEASE_VERSION")"+ echo "server=$(jq -c . <<<"$matrix")" >> "$GITHUB_OUTPUT"++ push-server:+ needs: matrix+ if: >-+ inputs.publish == true &&+ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&+ github.event_name == 'release' &&+ github.event.action == 'published' &&+ github.event.release.draft == false &&+ github.event.release.prerelease == false &&+ github.ref_protected == true &&+ github.ref == format('refs/tags/{0}', inputs.tag_name) &&+ github.repository == 'superlinked/sie' &&+ github.sha == inputs.sha+ runs-on: blacksmith-8vcpu-ubuntu-2404+ timeout-minutes: 90+ environment: ghcr+ permissions:+ contents: read+ packages: write+ strategy:+ fail-fast: false+ matrix: ${{ fromJSON(needs.matrix.outputs.server) }}+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ ref: ${{ inputs.sha }}+ persist-credentials: false+ - name: Validate trusted publication context and tag binding+ env:+ RELEASE_VERSION: ${{ inputs.version }}+ RELEASE_TAG: ${{ inputs.tag_name }}+ RELEASE_SHA: ${{ inputs.sha }}+ PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}+ GH_TOKEN: ${{ github.token }}+ run: >-+ python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"+ --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2+ with:+ version: 2026.5.5+ install_args: --jobs=1+ - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4+ with:+ name: docker-server-${{ matrix.platform }}-${{ matrix.bundle }}-${{ inputs.version }}+ path: artifact+ - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3+ with:+ registry: ghcr.io+ username: ${{ github.actor }}+ password: ${{ github.token }}+ - name: Publish only the retained tested image; reject different existing bytes+ run: >-+ mise run docker-push-loaded --+ --image 'ghcr.io/superlinked/sie-server:v${{ inputs.version }}-${{ matrix.platform }}-${{ matrix.bundle }}'+ --archive-dir artifact --version '${{ inputs.version }}'+ --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'++ push-service:+ needs: matrix+ if: >-+ inputs.publish == true &&+ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&+ github.event_name == 'release' &&+ github.event.action == 'published' &&+ github.event.release.draft == false &&+ github.event.release.prerelease == false &&+ github.ref_protected == true &&+ github.ref == format('refs/tags/{0}', inputs.tag_name) &&+ github.repository == 'superlinked/sie' &&+ github.sha == inputs.sha+ runs-on: blacksmith-8vcpu-ubuntu-2404+ timeout-minutes: 90+ environment: ghcr+ permissions:+ contents: read+ packages: write+ strategy:+ fail-fast: false+ matrix:+ service: [sie-gateway, sie-config, sie-mcp, sie-server-sidecar, sie-server-rust]+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ ref: ${{ inputs.sha }}+ persist-credentials: false+ - name: Validate trusted publication context and tag binding+ env:+ RELEASE_VERSION: ${{ inputs.version }}+ RELEASE_TAG: ${{ inputs.tag_name }}+ RELEASE_SHA: ${{ inputs.sha }}+ PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}+ GH_TOKEN: ${{ github.token }}+ run: >-+ python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"+ --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2+ with:+ version: 2026.5.5+ install_args: --jobs=1+ - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4+ with:+ name: docker-service-${{ matrix.service }}-${{ inputs.version }}+ path: artifact+ - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3+ with:+ registry: ghcr.io+ username: ${{ github.actor }}+ password: ${{ github.token }}+ - name: Publish only the retained tested image; reject different existing bytes+ run: >-+ mise run docker-push-loaded --+ --image 'ghcr.io/superlinked/${{ matrix.service }}:v${{ inputs.version }}${{ matrix.service == 'sie-server-rust' && '-cuda12-sm89' || '' }}'+ --archive-dir artifact --version '${{ inputs.version }}'+ --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'++ verify:+ needs: [matrix, push-server, push-service]+ if: >-+ inputs.publish == true &&+ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&+ github.event_name == 'release' &&+ github.event.action == 'published' &&+ github.event.release.draft == false &&+ github.event.release.prerelease == false &&+ github.ref_protected == true &&+ github.ref == format('refs/tags/{0}', inputs.tag_name) &&+ github.repository == 'superlinked/sie' &&+ github.sha == inputs.sha+ runs-on: blacksmith-2vcpu-ubuntu-2404+ timeout-minutes: 25+ permissions:+ contents: read+ packages: read+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ ref: ${{ inputs.sha }}+ persist-credentials: false+ - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2+ with:+ version: 2026.5.5+ install_args: --jobs=1+ - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4+ with:+ pattern: docker-evidence-*-${{ inputs.version }}+ path: evidence+ - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3+ with:+ registry: ghcr.io+ username: ${{ github.actor }}+ password: ${{ github.token }}+ - name: Verify every versioned image against source-bound build evidence+ run: >-+ mise run docker -- verify --registry ghcr.io/superlinked+ --version '${{ inputs.version }}' --source-revision '${{ inputs.sha }}'+ --run-id '${{ github.run_id }}' --evidence-dir evidence++ alias:+ needs: [matrix, verify]+ if: >-+ inputs.publish == true &&+ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&+ github.event_name == 'release' &&+ github.event.action == 'published' &&+ github.event.release.draft == false &&+ github.event.release.prerelease == false &&+ github.ref_protected == true &&+ github.ref == format('refs/tags/{0}', inputs.tag_name) &&+ github.repository == 'superlinked/sie' &&+ github.sha == inputs.sha+ runs-on: blacksmith-2vcpu-ubuntu-2404+ timeout-minutes: 25+ environment: ghcr+ permissions:+ contents: read+ packages: write+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ ref: ${{ inputs.sha }}+ persist-credentials: false+ - name: Validate trusted publication context and tag binding+ env:+ RELEASE_VERSION: ${{ inputs.version }}+ RELEASE_TAG: ${{ inputs.tag_name }}+ RELEASE_SHA: ${{ inputs.sha }}+ PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}+ GH_TOKEN: ${{ github.token }}+ run: >-+ python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"+ --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2+ with:+ version: 2026.5.5+ install_args: --jobs=1+ - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4+ with:+ pattern: docker-evidence-*-${{ inputs.version }}+ path: evidence+ - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3+ with:+ registry: ghcr.io+ username: ${{ github.actor }}+ password: ${{ github.token }}+ - name: Reverify the complete versioned set before moving any alias+ env:+ GH_TOKEN: ${{ github.token }}+ run: >-+ mise run docker -- alias --registry ghcr.io/superlinked+ --version '${{ inputs.version }}' --source-revision '${{ inputs.sha }}'+ --run-id '${{ github.run_id }}' --evidence-dir evidence++ complete:+ if: always() && inputs.publish+ needs: [matrix, push-server, push-service, verify, alias]+ runs-on: blacksmith-2vcpu-ubuntu-2404+ timeout-minutes: 5+ steps:+ - name: Require every release build and publisher to succeed+ env:+ RESULTS: ${{ toJSON(needs) }}+ run: |+ python3 -c 'import json,os; results=json.loads(os.environ["RESULTS"]); failed={name: job["result"] for name,job in results.items() if job["result"] != "success"}; print(failed); assert not failed'diff --git a/.github/workflows/publish-helm.yml b/.github/workflows/publish-helm.ymlnew file mode 100644index 000000000..44b00ade5--- /dev/null+++ b/.github/workflows/publish-helm.yml@@ -0,0 +1,85 @@+name: Publish Helm++on:+ workflow_call:+ inputs:+ version:+ required: true+ type: string+ tag_name:+ required: true+ type: string+ sha:+ required: true+ type: string+ publish:+ required: true+ type: boolean++permissions:+ contents: read++jobs:+ publish:+ if: >-+ inputs.publish == true &&+ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&+ github.event_name == 'release' &&+ github.event.action == 'published' &&+ github.event.release.draft == false &&+ github.event.release.prerelease == false &&+ github.ref_protected == true &&+ github.ref == format('refs/tags/{0}', inputs.tag_name) &&+ github.repository == 'superlinked/sie' &&+ github.sha == inputs.sha+ runs-on: blacksmith-2vcpu-ubuntu-2404+ timeout-minutes: 20+ environment: helm+ permissions:+ contents: read+ packages: write+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ ref: ${{ inputs.sha }}+ persist-credentials: false+ - name: Validate trusted publication context and tag binding+ env:+ RELEASE_VERSION: ${{ inputs.version }}+ RELEASE_TAG: ${{ inputs.tag_name }}+ RELEASE_SHA: ${{ inputs.sha }}+ PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}+ GH_TOKEN: ${{ github.token }}+ run: >-+ python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"+ --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4+ with:+ name: helm-sie-cluster-${{ inputs.version }}+ path: artifact+ - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2+ with:+ version: 2026.5.5+ install_args: --jobs=1+ - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3+ with:+ registry: ghcr.io+ username: ${{ github.actor }}+ password: ${{ github.token }}+ - name: Publish and verify the same chart bytes without replacing a version+ run: >-+ mise exec -- python -m tools.ci.publish_helm_archive+ --directory artifact --version '${{ inputs.version }}'+ --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'++ complete:+ if: always() && inputs.publish+ needs: publish+ runs-on: blacksmith-2vcpu-ubuntu-2404+ timeout-minutes: 5+ steps:+ - name: Require release publication to succeed+ env:+ RESULTS: ${{ toJSON(needs) }}+ run: |+ python3 -c 'import json,os; results=json.loads(os.environ["RESULTS"]); failed={name: job["result"] for name,job in results.items() if job["result"] != "success"}; print(failed); assert not failed'diff --git a/.github/workflows/publish-native.yml b/.github/workflows/publish-native.ymlnew file mode 100644index 000000000..c69b0af3a--- /dev/null+++ b/.github/workflows/publish-native.yml@@ -0,0 +1,82 @@+name: Publish native sidecar asset++on:+ workflow_call:+ inputs:+ version:+ required: true+ type: string+ tag_name:+ required: true+ type: string+ sha:+ required: true+ type: string+ publish:+ required: true+ type: boolean++permissions:+ contents: read++jobs:+ publish:+ if: >-+ inputs.publish == true &&+ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&+ github.event_name == 'release' &&+ github.event.action == 'published' &&+ github.event.release.draft == false &&+ github.event.release.prerelease == false &&+ github.ref_protected == true &&+ github.ref == format('refs/tags/{0}', inputs.tag_name) &&+ github.repository == 'superlinked/sie' &&+ github.sha == inputs.sha+ runs-on: blacksmith-2vcpu-ubuntu-2404+ timeout-minutes: 15+ environment: github-release+ permissions:+ contents: write+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ ref: ${{ inputs.sha }}+ persist-credentials: false+ - name: Validate trusted publication context and tag binding+ env:+ RELEASE_VERSION: ${{ inputs.version }}+ RELEASE_TAG: ${{ inputs.tag_name }}+ RELEASE_SHA: ${{ inputs.sha }}+ PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}+ GH_TOKEN: ${{ github.token }}+ run: >-+ python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"+ --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4+ with:+ name: native-sidecar-${{ inputs.version }}+ path: artifact+ - name: Revalidate and attach only missing or byte-identical sidecar assets+ env:+ GH_TOKEN: ${{ github.token }}+ RELEASE_TAG: ${{ inputs.tag_name }}+ RELEASE_VERSION: ${{ inputs.version }}+ run: |+ set -euo pipefail+ python3 -m tools.ci.release_artifact check --directory artifact --kind native-sidecar --version '${{ inputs.version }}' --tag-name '${{ inputs.tag_name }}' --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'+ binary="sie-server-sidecar-v$RELEASE_VERSION-linux-amd64"+ for filename in "$binary" "$binary.sha256" "$binary.json"; do+ RELEASE_ASSET_FILENAME="$filename" bash tools/ci/upload_native_release_asset.bash "artifact/$filename"+ done++ complete:+ if: always() && inputs.publish+ needs: publish+ runs-on: blacksmith-2vcpu-ubuntu-2404+ timeout-minutes: 5+ steps:+ - name: Require release publication to succeed+ env:+ RESULTS: ${{ toJSON(needs) }}+ run: |+ python3 -c 'import json,os; results=json.loads(os.environ["RESULTS"]); failed={name: job["result"] for name,job in results.items() if job["result"] != "success"}; print(failed); assert not failed'diff --git a/.github/workflows/release-audio.yml b/.github/workflows/release-audio.ymlindex 5cfd26383..f4f30d2d1 100644--- a/.github/workflows/release-audio.yml+++ b/.github/workflows/release-audio.yml@@ -12,9 +12,6 @@ on:sha:required: truetype: string- publish:- required: true- type: booleanpermissions:contents: read@@ -33,7 +30,7 @@ jobs:steps:- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5with:- ref: ${{ inputs.sha }}+ ref: ${{ github.sha }}persist-credentials: false- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2with:@@ -74,66 +71,3 @@ jobs:path: dist/if-no-files-found: errorretention-days: 30-- publish:- needs: build- if: >-- inputs.publish == true &&- vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&- github.event_name == 'release' &&- github.event.action == 'published' &&- github.event.release.draft == false &&- github.event.release.prerelease == false &&- github.ref_protected == true &&- github.ref == format('refs/tags/{0}', inputs.tag_name) &&- github.repository == 'superlinked/sie' &&- github.sha == inputs.sha- runs-on: blacksmith-8vcpu-ubuntu-2404- timeout-minutes: 15- environment: github-release- permissions:- contents: write- steps:- - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5- with:- ref: ${{ inputs.sha }}- fetch-depth: 1- persist-credentials: false- - name: Validate trusted publication context and tag binding- env:- RELEASE_VERSION: ${{ inputs.version }}- RELEASE_TAG: ${{ inputs.tag_name }}- RELEASE_SHA: ${{ inputs.sha }}- PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}- GH_TOKEN: ${{ github.token }}- run: >-- python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"- --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"- - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4- with:- name: audio-prep-${{ inputs.version }}- path: artifact- - name: Attach and verify exact GitHub Release asset- env:- AUDIO_WHEEL_FILENAME: ${{ needs.build.outputs.filename }}- GH_TOKEN: ${{ github.token }}- RELEASE_TAG: ${{ inputs.tag_name }}- run: |- set -euo pipefail- wheel="artifact/$AUDIO_WHEEL_FILENAME"- test -f "$wheel"- python3 -m tools.ci.release_artifact check --directory artifact --kind audio --version '${{ inputs.version }}' --tag-name '${{ inputs.tag_name }}' --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'- python3 -c 'import runpy,sys; runpy.run_path("packages/sie_audio_prep/build_wheel.py")["_validate_wheel"](__import__("pathlib").Path(sys.argv[1]))' "$wheel"- tools/ci/upload_audio_prep_release_asset.bash "$wheel"-- complete:- if: always() && inputs.publish- needs: [build, publish]- runs-on: blacksmith-2vcpu-ubuntu-2404- timeout-minutes: 5- steps:- - name: Require every release build and publisher to succeed- env:- RESULTS: ${{ toJSON(needs) }}- run: |- python3 -c 'import json,os; results=json.loads(os.environ["RESULTS"]); failed={name: job["result"] for name,job in results.items() if job["result"] != "success"}; print(failed); assert not failed'diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.ymlnew file mode 100644index 000000000..491590236--- /dev/null+++ b/.github/workflows/release-candidate.yml@@ -0,0 +1,155 @@+name: Release candidate++on:+ pull_request:+ paths:+ - .github/workflows/release*.yml+ - .github/workflows/publish-*.yml+ - .github/release-matrix.json+ - .dockerignore+ - .release-please-manifest.json+ - release-please-config.json+ - mise.toml+ - pyproject.toml+ - uv.lock+ - package.json+ - pnpm-lock.yaml+ - pnpm-workspace.yaml+ - Cargo.toml+ - Cargo.lock+ - tools/ci/**+ - tools/mise_tasks/docker*+ - tools/mise_tasks/helm*+ - packages/**/Dockerfile*+ - packages/**/pyproject.toml+ - packages/**/package.json+ - packages/**/Cargo.toml+ - packages/**/Cargo.lock+ - packages/sie_audio_prep/**+ - packages/sie_server_rust/**+ - packages/sie_telemetry/**+ - packages/sie_server/bundles/**+ - integrations/**/pyproject.toml+ - integrations/**/package.json+ - deploy/helm/**+ workflow_dispatch:++permissions:+ contents: read++concurrency:+ group: release-candidate-${{ github.event.pull_request.number || github.ref }}+ cancel-in-progress: true++jobs:+ prepare:+ runs-on: ubuntu-24.04+ timeout-minutes: 5+ outputs:+ sha: ${{ steps.identity.outputs.sha }}+ version: ${{ steps.identity.outputs.version }}+ tag_name: ${{ steps.identity.outputs.tag_name }}+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ ref: ${{ github.sha }}+ persist-credentials: false+ - id: identity+ name: Read coordinated versions from the exact candidate source+ run: |+ python3 - <<'PY'+ import json, os, re, subprocess, tomllib+ from pathlib import Path+ from tools.ci.distributions import manifests++ sha = os.environ["GITHUB_SHA"]+ if not re.fullmatch(r"[0-9a-f]{40}", sha):+ raise SystemExit("Candidate requires a full source SHA")+ if subprocess.check_output(["git", "rev-parse", "HEAD"], text=True).strip() != sha:+ raise SystemExit("Candidate checkout differs from the workflow source")+ version = tomllib.loads(Path("packages/sie_sdk/pyproject.toml").read_text())["project"]["version"]+ if not re.fullmatch(r"(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)", version):+ raise SystemExit("Candidate metadata must contain a stable package version")+ if json.loads(Path(".release-please-manifest.json").read_text()) != {".": version}:+ raise SystemExit("Candidate release manifest and package version differ")+ for family in ("python", "npm"):+ manifests(family, version)+ with Path(os.environ["GITHUB_OUTPUT"]).open("a") as output:+ output.write(f"sha={sha}\nversion={version}\ntag_name=v{version}\n")+ PY++ python:+ needs: prepare+ uses: ./.github/workflows/release-python.yml+ with:+ source_ref: ${{ needs.prepare.outputs.sha }}+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ build_only: true++ npm:+ needs: prepare+ uses: ./.github/workflows/release-npm.yml+ with:+ source_ref: ${{ needs.prepare.outputs.sha }}+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ build_only: true++ docker:+ needs: prepare+ permissions:+ contents: read+ actions: read+ uses: ./.github/workflows/release-docker.yml+ with:+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ sha: ${{ needs.prepare.outputs.sha }}++ audio:+ needs: prepare+ uses: ./.github/workflows/release-audio.yml+ with:+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ sha: ${{ needs.prepare.outputs.sha }}++ helm:+ needs: prepare+ uses: ./.github/workflows/release-helm.yml+ with:+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ sha: ${{ needs.prepare.outputs.sha }}++ native:+ needs: [prepare, docker]+ uses: ./.github/workflows/release-native.yml+ with:+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ sha: ${{ needs.prepare.outputs.sha }}++ complete:+ name: Release candidate / Complete+ needs: [prepare, python, npm, docker, audio, helm, native]+ if: ${{ always() }}+ runs-on: ubuntu-24.04+ timeout-minutes: 5+ steps:+ - name: Require every candidate artifact family to finish successfully+ env:+ RESULTS: ${{ toJSON(needs) }}+ run: |+ python3 - <<'PY'+ import json, os++ results = json.loads(os.environ["RESULTS"])+ expected = {"prepare", "python", "npm", "docker", "audio", "helm", "native"}+ if set(results) != expected:+ raise SystemExit("Candidate completion is missing a required artifact family")+ bad = {name: job["result"] for name, job in results.items() if job["result"] != "success"}+ if bad:+ raise SystemExit(f"Incomplete release candidate: {bad}")+ PYdiff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.ymlindex 467ff8bc5..fc76d2948 100644--- a/.github/workflows/release-docker.yml+++ b/.github/workflows/release-docker.yml@@ -1,4 +1,4 @@-name: Release Docker+name: Build release Docker artifactson:workflow_call:@@ -12,9 +12,6 @@ on:sha:required: truetype: string- publish:- required: true- type: booleanpermissions:contents: read@@ -28,7 +25,7 @@ jobs:steps:- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5with:- ref: ${{ inputs.sha }}+ ref: ${{ github.sha }}persist-credentials: false- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2with:@@ -60,7 +57,7 @@ jobs:steps:- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5with:- ref: ${{ inputs.sha }}+ ref: ${{ github.sha }}persist-credentials: false- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2with:@@ -117,64 +114,6 @@ jobs:if-no-files-found: errorretention-days: 30- push-server:- needs: [matrix, build-server, build-service]- if: >-- inputs.publish == true &&- vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&- github.event_name == 'release' &&- github.event.action == 'published' &&- github.event.release.draft == false &&- github.event.release.prerelease == false &&- github.ref_protected == true &&- github.ref == format('refs/tags/{0}', inputs.tag_name) &&- github.repository == 'superlinked/sie' &&- github.sha == inputs.sha- runs-on: blacksmith-8vcpu-ubuntu-2404- timeout-minutes: 90- environment: ghcr- permissions:- contents: read- packages: write- strategy:- fail-fast: false- matrix: ${{ fromJSON(needs.matrix.outputs.server) }}- steps:- - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5- with:- ref: ${{ inputs.sha }}- persist-credentials: false- - name: Validate trusted publication context and tag binding- env:- RELEASE_VERSION: ${{ inputs.version }}- RELEASE_TAG: ${{ inputs.tag_name }}- RELEASE_SHA: ${{ inputs.sha }}- PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}- GH_TOKEN: ${{ github.token }}- run: >-- python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"- --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"- - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2- with:- version: 2026.5.5- install_args: --jobs=1- - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4- with:- name: docker-server-${{ matrix.platform }}-${{ matrix.bundle }}-${{ inputs.version }}- path: artifact- - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3- with:- registry: ghcr.io- username: ${{ github.actor }}- password: ${{ github.token }}- - name: Publish only the retained tested image; reject different existing bytes- run: >-- mise run docker-push-loaded --- --image 'ghcr.io/superlinked/sie-server:v${{ inputs.version }}-${{ matrix.platform }}-${{ matrix.bundle }}'- --archive-dir artifact --version '${{ inputs.version }}'- --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'-build-service:needs: matrixruns-on: blacksmith-16vcpu-ubuntu-2404@@ -189,7 +128,7 @@ jobs:steps:- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5with:- ref: ${{ inputs.sha }}+ ref: ${{ github.sha }}persist-credentials: false- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2with:@@ -245,173 +184,3 @@ jobs:path: evidence/if-no-files-found: errorretention-days: 30-- push-service:- needs: [matrix, build-server, build-service]- if: >-- inputs.publish == true &&- vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&- github.event_name == 'release' &&- github.event.action == 'published' &&- github.event.release.draft == false &&- github.event.release.prerelease == false &&- github.ref_protected == true &&- github.ref == format('refs/tags/{0}', inputs.tag_name) &&- github.repository == 'superlinked/sie' &&- github.sha == inputs.sha- runs-on: blacksmith-8vcpu-ubuntu-2404- timeout-minutes: 90- environment: ghcr- permissions:- contents: read- packages: write- strategy:- fail-fast: false- matrix:- service: [sie-gateway, sie-config, sie-mcp, sie-server-sidecar, sie-server-rust]- steps:- - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5- with:- ref: ${{ inputs.sha }}- persist-credentials: false- - name: Validate trusted publication context and tag binding- env:- RELEASE_VERSION: ${{ inputs.version }}- RELEASE_TAG: ${{ inputs.tag_name }}- RELEASE_SHA: ${{ inputs.sha }}- PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}- GH_TOKEN: ${{ github.token }}- run: >-- python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"- --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"- - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2- with:- version: 2026.5.5- install_args: --jobs=1- - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4- with:- name: docker-service-${{ matrix.service }}-${{ inputs.version }}- path: artifact- - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3- with:- registry: ghcr.io- username: ${{ github.actor }}- password: ${{ github.token }}- - name: Publish only the retained tested image; reject different existing bytes- run: >-- mise run docker-push-loaded --- --image 'ghcr.io/superlinked/${{ matrix.service }}:v${{ inputs.version }}${{ matrix.service == 'sie-server-rust' && '-cuda12-sm89' || '' }}'- --archive-dir artifact --version '${{ inputs.version }}'- --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'-- verify:- needs: [matrix, push-server, push-service]- if: >-- inputs.publish == true &&- vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&- github.event_name == 'release' &&- github.event.action == 'published' &&- github.event.release.draft == false &&- github.event.release.prerelease == false &&- github.ref_protected == true &&- github.ref == format('refs/tags/{0}', inputs.tag_name) &&- github.repository == 'superlinked/sie' &&- github.sha == inputs.sha- runs-on: blacksmith-2vcpu-ubuntu-2404- timeout-minutes: 25- permissions:- contents: read- packages: read- steps:- - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5- with:- ref: ${{ inputs.sha }}- persist-credentials: false- - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2- with:- version: 2026.5.5- install_args: --jobs=1- - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4- with:- pattern: docker-evidence-*-${{ inputs.version }}- path: evidence- - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3- with:- registry: ghcr.io- username: ${{ github.actor }}- password: ${{ github.token }}- - name: Verify every versioned image against source-bound build evidence- run: >-- mise run docker -- verify --registry ghcr.io/superlinked- --version '${{ inputs.version }}' --source-revision '${{ inputs.sha }}'- --run-id '${{ github.run_id }}' --evidence-dir evidence-- complete:- if: always() && inputs.publish- needs: [matrix, build-server, build-service, push-server, push-service, verify, alias]- runs-on: blacksmith-2vcpu-ubuntu-2404- timeout-minutes: 5- steps:- - name: Require every release build and publisher to succeed- env:- RESULTS: ${{ toJSON(needs) }}- run: |- python3 -c 'import json,os; results=json.loads(os.environ["RESULTS"]); failed={name: job["result"] for name,job in results.items() if job["result"] != "success"}; print(failed); assert not failed'-- alias:- needs: [matrix, verify]- if: >-- inputs.publish == true &&- vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&- github.event_name == 'release' &&- github.event.action == 'published' &&- github.event.release.draft == false &&- github.event.release.prerelease == false &&- github.ref_protected == true &&- github.ref == format('refs/tags/{0}', inputs.tag_name) &&- github.repository == 'superlinked/sie' &&- github.sha == inputs.sha- runs-on: blacksmith-2vcpu-ubuntu-2404- timeout-minutes: 25- environment: ghcr- permissions:- contents: read- packages: write- steps:- - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5- with:- ref: ${{ inputs.sha }}- persist-credentials: false- - name: Validate trusted publication context and tag binding- env:- RELEASE_VERSION: ${{ inputs.version }}- RELEASE_TAG: ${{ inputs.tag_name }}- RELEASE_SHA: ${{ inputs.sha }}- PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}- GH_TOKEN: ${{ github.token }}- run: >-- python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"- --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"- - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2- with:- version: 2026.5.5- install_args: --jobs=1- - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3- - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4- with:- pattern: docker-evidence-*-${{ inputs.version }}- path: evidence- - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3- with:- registry: ghcr.io- username: ${{ github.actor }}- password: ${{ github.token }}- - name: Reverify the complete versioned set before moving any alias- env:- GH_TOKEN: ${{ github.token }}- run: >-- mise run docker -- alias --registry ghcr.io/superlinked- --version '${{ inputs.version }}' --source-revision '${{ inputs.sha }}'- --run-id '${{ github.run_id }}' --evidence-dir evidencediff --git a/.github/workflows/release-helm.yml b/.github/workflows/release-helm.ymlindex 50d49a271..9dcf130cc 100644--- a/.github/workflows/release-helm.yml+++ b/.github/workflows/release-helm.yml@@ -12,9 +12,6 @@ on:sha:required: truetype: string- publish:- required: true- type: booleanpermissions:contents: read@@ -26,7 +23,7 @@ jobs:steps:- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5with:- ref: ${{ inputs.sha }}+ ref: ${{ github.sha }}persist-credentials: false- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2with:@@ -47,7 +44,7 @@ jobs:mise run helm -- lint --set payloadStore.enabled=falsemise run helm -- template --set payloadStore.enabled=false >/dev/nullmkdir -p artifact- mise exec -- helm package deploy/helm/sie-cluster --destination artifact+ mise run helm -- package --destination artifactpython3 -m tools.ci.release_artifact stamp --directory artifact --kind helm --version '${{ inputs.version }}' --tag-name '${{ inputs.tag_name }}' --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4with:@@ -55,68 +52,3 @@ jobs:path: artifact/if-no-files-found: errorretention-days: 30-- publish:- needs: build- if: >-- inputs.publish == true &&- vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&- github.event_name == 'release' &&- github.event.action == 'published' &&- github.event.release.draft == false &&- github.event.release.prerelease == false &&- github.ref_protected == true &&- github.ref == format('refs/tags/{0}', inputs.tag_name) &&- github.repository == 'superlinked/sie' &&- github.sha == inputs.sha- runs-on: blacksmith-2vcpu-ubuntu-2404- timeout-minutes: 20- environment: helm- permissions:- contents: read- packages: write- steps:- - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5- with:- ref: ${{ inputs.sha }}- persist-credentials: false- - name: Validate trusted publication context and tag binding- env:- RELEASE_VERSION: ${{ inputs.version }}- RELEASE_TAG: ${{ inputs.tag_name }}- RELEASE_SHA: ${{ inputs.sha }}- PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}- GH_TOKEN: ${{ github.token }}- run: >-- python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"- --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"- - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4- with:- name: helm-sie-cluster-${{ inputs.version }}- path: artifact- - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2- with:- version: 2026.5.5- install_args: --jobs=1- - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3- with:- registry: ghcr.io- username: ${{ github.actor }}- password: ${{ github.token }}- - name: Publish and verify the same chart bytes without replacing a version- run: >-- mise exec -- python -m tools.ci.publish_helm_archive- --directory artifact --version '${{ inputs.version }}'- --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'-- complete:- if: always() && inputs.publish- needs: [build, publish]- runs-on: blacksmith-2vcpu-ubuntu-2404- timeout-minutes: 5- steps:- - name: Require every release build and publisher to succeed- env:- RESULTS: ${{ toJSON(needs) }}- run: |- python3 -c 'import json,os; results=json.loads(os.environ["RESULTS"]); failed={name: job["result"] for name,job in results.items() if job["result"] != "success"}; print(failed); assert not failed'diff --git a/.github/workflows/release-native.yml b/.github/workflows/release-native.ymlindex d5506e325..19fc7b2ff 100644--- a/.github/workflows/release-native.yml+++ b/.github/workflows/release-native.yml@@ -12,9 +12,6 @@ on:sha:required: truetype: string- publish:- required: true- type: booleanpermissions:contents: read@@ -26,7 +23,7 @@ jobs:steps:- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5with:- ref: ${{ inputs.sha }}+ ref: ${{ github.sha }}persist-credentials: false- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2with:@@ -54,65 +51,3 @@ jobs:path: artifact/if-no-files-found: errorretention-days: 30-- publish:- needs: build- if: >-- inputs.publish == true &&- vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&- github.event_name == 'release' &&- github.event.action == 'published' &&- github.event.release.draft == false &&- github.event.release.prerelease == false &&- github.ref_protected == true &&- github.ref == format('refs/tags/{0}', inputs.tag_name) &&- github.repository == 'superlinked/sie' &&- github.sha == inputs.sha- runs-on: blacksmith-2vcpu-ubuntu-2404- timeout-minutes: 15- environment: github-release- permissions:- contents: write- steps:- - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5- with:- ref: ${{ inputs.sha }}- persist-credentials: false- - name: Validate trusted publication context and tag binding- env:- RELEASE_VERSION: ${{ inputs.version }}- RELEASE_TAG: ${{ inputs.tag_name }}- RELEASE_SHA: ${{ inputs.sha }}- PUBLIC_RELEASE_PUBLISHING_ENABLED: ${{ vars.PUBLIC_RELEASE_PUBLISHING_ENABLED }}- GH_TOKEN: ${{ github.token }}- run: >-- python3 tools/ci/release_guard.py publish --source-ref "$RELEASE_SHA"- --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"- - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4- with:- name: native-sidecar-${{ inputs.version }}- path: artifact- - name: Revalidate and attach only missing or byte-identical sidecar assets- env:- GH_TOKEN: ${{ github.token }}- RELEASE_TAG: ${{ inputs.tag_name }}- RELEASE_VERSION: ${{ inputs.version }}- run: |- set -euo pipefail- python3 -m tools.ci.release_artifact check --directory artifact --kind native-sidecar --version '${{ inputs.version }}' --tag-name '${{ inputs.tag_name }}' --source-revision '${{ inputs.sha }}' --run-id '${{ github.run_id }}'- binary="sie-server-sidecar-v$RELEASE_VERSION-linux-amd64"- for filename in "$binary" "$binary.sha256" "$binary.json"; do- RELEASE_ASSET_FILENAME="$filename" bash tools/ci/upload_native_release_asset.bash "artifact/$filename"- done-- complete:- if: always() && inputs.publish- needs: [build, publish]- runs-on: blacksmith-2vcpu-ubuntu-2404- timeout-minutes: 5- steps:- - name: Require every release build and publisher to succeed- env:- RESULTS: ${{ toJSON(needs) }}- run: |- python3 -c 'import json,os; results=json.loads(os.environ["RESULTS"]); failed={name: job["result"] for name,job in results.items() if job["result"] != "success"}; print(failed); assert not failed'diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.ymlindex 845e780f9..a6548bc20 100644--- a/.github/workflows/release-npm.yml+++ b/.github/workflows/release-npm.yml@@ -26,7 +26,7 @@ jobs:steps:- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5with:- ref: ${{ inputs.source_ref }}+ ref: ${{ github.sha }}persist-credentials: false- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2with:@@ -42,8 +42,12 @@ jobs:BUILD_ONLY: ${{ inputs.build_only }}run: |set -euo pipefail- if [ "$BUILD_ONLY" = false ]; then test -n "$RELEASE_VERSION"; fi- mise exec -- python tools/ci/release_guard.py build --source-ref "$SOURCE_REF" --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ if [ "$BUILD_ONLY" = true ]; then+ mise exec -- python tools/ci/release_guard.py build --source-ref "$SOURCE_REF"+ else+ test -n "$RELEASE_VERSION"+ mise exec -- python tools/ci/release_guard.py build --source-ref "$SOURCE_REF" --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ fi- name: Build complete archives and test clean packed consumersenv:RELEASE_VERSION: ${{ inputs.version }}diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.ymlindex f1a49bdab..8187ab54c 100644--- a/.github/workflows/release-python.yml+++ b/.github/workflows/release-python.yml@@ -26,7 +26,7 @@ jobs:steps:- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5with:- ref: ${{ inputs.source_ref }}+ ref: ${{ github.sha }}persist-credentials: false- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2with:@@ -42,8 +42,12 @@ jobs:BUILD_ONLY: ${{ inputs.build_only }}run: |set -euo pipefail- if [ "$BUILD_ONLY" = false ]; then test -n "$RELEASE_VERSION"; fi- mise exec -- python tools/ci/release_guard.py build --source-ref "$SOURCE_REF" --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ if [ "$BUILD_ONLY" = true ]; then+ mise exec -- python tools/ci/release_guard.py build --source-ref "$SOURCE_REF"+ else+ test -n "$RELEASE_VERSION"+ mise exec -- python tools/ci/release_guard.py build --source-ref "$SOURCE_REF" --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"+ fi- name: Build complete archives and test clean packed consumersenv:RELEASE_VERSION: ${{ inputs.version }}diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex fda3c4ecc..cbf70af1d 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -180,9 +180,10 @@ jobs:build_only: falsepython-publish:- needs: [prepare, python]+ needs: [prepare, artifacts-ready]if: >-needs.prepare.result == 'success' &&+ needs.artifacts-ready.result == 'success' &&vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&github.event_name == 'release' &&github.event.action == 'published' &&@@ -229,9 +230,10 @@ jobs:packages-dir: pendingnpm-publish:- needs: [prepare, npm]+ needs: [prepare, artifacts-ready]if: >-needs.prepare.result == 'success' &&+ needs.artifacts-ready.result == 'success' &&vars.PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true' &&github.event_name == 'release' &&github.event.action == 'published' &&@@ -277,27 +279,94 @@ jobs:- name: Publish absent versions or verify identical existing bytesrun: python3 tools/ci/distributions.py publish-npm npm --directory artifacts --version "$RELEASE_VERSION"- docker:+ docker-build:needs: prepareif: github.event_name == 'release' && needs.prepare.result == 'success'permissions:contents: read- packages: writeactions: readuses: ./.github/workflows/release-docker.ymlwith:version: ${{ needs.prepare.outputs.version }}tag_name: ${{ needs.prepare.outputs.tag_name }}sha: ${{ needs.prepare.outputs.sha }}++ helm-build:+ needs: prepare+ if: github.event_name == 'release' && needs.prepare.result == 'success'+ permissions:+ contents: read+ uses: ./.github/workflows/release-helm.yml+ with:+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ sha: ${{ needs.prepare.outputs.sha }}++ audio-build:+ needs: prepare+ if: github.event_name == 'release' && needs.prepare.result == 'success'+ permissions:+ contents: read+ uses: ./.github/workflows/release-audio.yml+ with:+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ sha: ${{ needs.prepare.outputs.sha }}++ native-build:+ needs: [prepare, docker-build]+ if: github.event_name == 'release' && needs.prepare.result == 'success'+ permissions:+ contents: read+ uses: ./.github/workflows/release-native.yml+ with:+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ sha: ${{ needs.prepare.outputs.sha }}++ artifacts-ready:+ needs: [prepare, python, npm, docker-build, helm-build, audio-build, native-build]+ if: always() && github.event_name == 'release' && needs.prepare.result == 'success'+ runs-on: ubuntu-24.04+ timeout-minutes: 5+ steps:+ - name: Require every tested artifact family before any publication+ env:+ RESULTS: ${{ toJSON(needs) }}+ run: |+ python3 - <<'PYCODE'+ import json, os+ results = json.loads(os.environ["RESULTS"])+ failed = {name: job["result"] for name, job in results.items() if job["result"] != "success"}+ if failed:+ raise SystemExit(f"Release artifacts are not ready: {failed}")+ PYCODE++ docker:+ needs: [prepare, artifacts-ready]+ if: >-+ github.event_name == 'release' && needs.prepare.result == 'success' &&+ needs.artifacts-ready.result == 'success'+ permissions:+ contents: read+ packages: write+ actions: read+ uses: ./.github/workflows/publish-docker.yml+ with:+ version: ${{ needs.prepare.outputs.version }}+ tag_name: ${{ needs.prepare.outputs.tag_name }}+ sha: ${{ needs.prepare.outputs.sha }}publish: truehelm:- needs: [prepare, docker]- if: github.event_name == 'release' && needs.prepare.result == 'success'+ needs: [prepare, artifacts-ready, docker]+ if: >-+ github.event_name == 'release' && needs.prepare.result == 'success' &&+ needs.artifacts-ready.result == 'success'permissions:contents: readpackages: write- uses: ./.github/workflows/release-helm.yml+ uses: ./.github/workflows/publish-helm.ymlwith:version: ${{ needs.prepare.outputs.version }}tag_name: ${{ needs.prepare.outputs.tag_name }}@@ -305,11 +374,13 @@ jobs:publish: trueaudio:- needs: prepare- if: github.event_name == 'release' && needs.prepare.result == 'success'+ needs: [prepare, artifacts-ready]+ if: >-+ github.event_name == 'release' && needs.prepare.result == 'success' &&+ needs.artifacts-ready.result == 'success'permissions:contents: write- uses: ./.github/workflows/release-audio.yml+ uses: ./.github/workflows/publish-audio.ymlwith:version: ${{ needs.prepare.outputs.version }}tag_name: ${{ needs.prepare.outputs.tag_name }}@@ -317,11 +388,13 @@ jobs:publish: truenative:- needs: [prepare, docker]- if: github.event_name == 'release' && needs.prepare.result == 'success'+ needs: [prepare, artifacts-ready, docker]+ if: >-+ github.event_name == 'release' && needs.prepare.result == 'success' &&+ needs.artifacts-ready.result == 'success'permissions:contents: write- uses: ./.github/workflows/release-native.yml+ uses: ./.github/workflows/publish-native.ymlwith:version: ${{ needs.prepare.outputs.version }}tag_name: ${{ needs.prepare.outputs.tag_name }}@@ -329,7 +402,7 @@ jobs:publish: truecomplete:- needs: [prepare, python-publish, npm-publish, docker, helm, audio, native]+ needs: [prepare, artifacts-ready, python-publish, npm-publish, docker, helm, audio, native]if: >-always() && github.event_name == 'release' &&github.event.action == 'published' &&diff --git a/.github/workflows/rust-cuda-image.yml b/.github/workflows/rust-cuda-image.ymlnew file mode 100644index 000000000..eb6dff774--- /dev/null+++ b/.github/workflows/rust-cuda-image.yml@@ -0,0 +1,67 @@+name: Rust CUDA image compatibility++on:+ pull_request:+ paths:+ - .github/workflows/rust-cuda-image.yml+ - .github/workflows/release-docker.yml+ - .dockerignore+ - mise.toml+ - packages/sie_server_rust/**+ - packages/sie_telemetry/**+ - tools/ci/rust_cuda_image_smoke.py+ - tools/ci/tests/test_rust_cuda_image_smoke.py+ - tools/ci/tests/test_required_ci.py+ - tools/ci/tests/test_docker_task.py+ - tools/mise_tasks/docker_task.py+ push:+ branches: [main]+ paths:+ - .github/workflows/rust-cuda-image.yml+ - .github/workflows/release-docker.yml+ - .dockerignore+ - mise.toml+ - packages/sie_server_rust/**+ - packages/sie_telemetry/**+ - tools/ci/rust_cuda_image_smoke.py+ - tools/ci/tests/test_rust_cuda_image_smoke.py+ - tools/ci/tests/test_required_ci.py+ - tools/ci/tests/test_docker_task.py+ - tools/mise_tasks/docker_task.py++permissions:+ contents: read++concurrency:+ group: rust-cuda-image-${{ github.event.pull_request.number || github.ref }}+ cancel-in-progress: true++jobs:+ compatibility:+ runs-on: blacksmith-8vcpu-ubuntu-2404+ timeout-minutes: 90+ steps:+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5+ with:+ persist-credentials: false+ - uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2+ with:+ version: 2026.5.5+ install_args: --jobs=1+ cache: false+ - uses: useblacksmith/setup-docker-builder@9309da73a81f66976a6d750572e221508b1e2682 # v1+ - name: Build the production Rust CUDA image without publishing+ uses: useblacksmith/build-push-action@9b0579bbec7a6cad2f171596c57e7ac1e7658850 # v1+ with:+ context: .+ file: packages/sie_server_rust/Dockerfile.candle+ platforms: linux/amd64+ build-args: CUDA_COMPUTE_CAP=89+ labels: |+ org.opencontainers.image.revision=${{ github.sha }}+ org.opencontainers.image.source=https://github.com/superlinked/sie+ tags: sie-rust-cuda:ci+ load: true+ push: false+ - name: Validate image identity and dependencies without a GPU driver+ run: mise exec -- python tools/ci/rust_cuda_image_smoke.py sie-rust-cuda:ci --source-revision "$GITHUB_SHA"diff --git a/RELEASE.md b/RELEASE.mdindex 4cfb38fba..dad7bc22c 100644--- a/RELEASE.md+++ b/RELEASE.md@@ -105,6 +105,20 @@ PR and candidate builds produce archives without publishing. They use theactual package versions in that source tree. Release builds additionallyrequire the complete package set to match the release version.+The `Release candidate` workflow rehearses all six artifact families without+registry credentials or release-writing permissions. It runs on release+pipeline changes and release version updates, and can be dispatched manually+against a reviewed branch. It builds the full image matrix and extracts the+native sidecar from its tested image, as well as building Python, npm, audio,+and the packaged Helm chart. Require its final `Release candidate / Complete`+check on the final release PR head before merging that PR.++On a stable release, every builder must pass the `artifacts-ready` gate before+any publisher can start. Publishers consume the retained archives. This keeps+a failed image or chart build from leaving packages partially published.+Registry failures can still interrupt publication; recovery resumes the+original failed publisher with its same version, source and retained bytes.+Build outputs are tested before upload. Publisher jobs consume those samearchives or images; they do not independently rebuild them. Before a releaseupload, the run commit, release output commit, checked-out source, and stable@@ -112,6 +126,18 @@ tag must identify the same revision. Versioned outputs are immutable: anexisting matching upload may be accepted, but different bytes at the sameversion are a failure.+The Candle CUDA image is checked on driverless runners using its source-bound+image configuration, extracted ELF executable, and image-local shared-library+resolution. Only the host-provided `libcuda.so.1` may be unresolved; all other+missing libraries and loader diagnostics fail validation. The same check runs+in Rust CUDA image PR CI. These checks do not exercise GPU inference. CPU Rust+and the other service images retain their executable `--help` smoke checks.++Package Helm charts with `mise run helm -- package --destination DIR`. This+stages the checked-in model and bundle catalogs, checks their exact bytes in+the archive, and lints and renders that archive after staging is removed,+including the embedded-config mode. CI and publication use this same path.+Floating image aliases move only after the full versioned image set verifies.An older release recovery keeps those aliases unchanged when a newer stablerelease exists; it repairs only the requested versioned outputs.diff --git a/tools/ci/check_release_contract.py b/tools/ci/check_release_contract.pyindex e78ea10f2..ceab4bd1c 100755--- a/tools/ci/check_release_contract.py+++ b/tools/ci/check_release_contract.py@@ -171,12 +171,12 @@ TRUSTED_WRITE_CONDITION_TERMS = (PUBLISHER_JOBS = ((".github/workflows/release.yml", "python-publish", "pypi", {"contents": "read", "id-token": "write"}),(".github/workflows/release.yml", "npm-publish", "npm", {"contents": "read", "id-token": "write"}),- (".github/workflows/release-audio.yml", "publish", "github-release", {"contents": "write"}),- (".github/workflows/release-native.yml", "publish", "github-release", {"contents": "write"}),- (".github/workflows/release-docker.yml", "push-server", "ghcr", {"contents": "read", "packages": "write"}),- (".github/workflows/release-docker.yml", "push-service", "ghcr", {"contents": "read", "packages": "write"}),- (".github/workflows/release-docker.yml", "alias", "ghcr", {"contents": "read", "packages": "write"}),- (".github/workflows/release-helm.yml", "publish", "helm", {"contents": "read", "packages": "write"}),+ (".github/workflows/publish-audio.yml", "publish", "github-release", {"contents": "write"}),+ (".github/workflows/publish-native.yml", "publish", "github-release", {"contents": "write"}),+ (".github/workflows/publish-docker.yml", "push-server", "ghcr", {"contents": "read", "packages": "write"}),+ (".github/workflows/publish-docker.yml", "push-service", "ghcr", {"contents": "read", "packages": "write"}),+ (".github/workflows/publish-docker.yml", "alias", "ghcr", {"contents": "read", "packages": "write"}),+ (".github/workflows/publish-helm.yml", "publish", "helm", {"contents": "read", "packages": "write"}),)CANDLE_PATHS = (@@ -540,13 +540,18 @@ def release_workflow_errors() -> list[str]:for family in ("python", "npm", "audio", "docker", "helm", "native"):if f"uses: ./.github/workflows/release-{family}.yml" not in top:errors.append(f"top-level release does not call {family} directly")- for family in ("python", "npm"):+ for family in ("python", "npm", "docker", "helm", "audio", "native"):text = (ROOT / f".github/workflows/release-{family}.yml").read_text()- if "id-token:" in text or "environment:" in text or " publish:" in text:+ if "id-token:" in text or "environment:" in text or ": write" in text or " publish:" in text:errors.append(f"{family} reusable must only build and test")- if f"distributions.py build {family}" not in text or "inputs.source_ref" not in text:+ if family in ("python", "npm") and (+ f"distributions.py build {family}" not in text or "inputs.source_ref" not in text+ ):errors.append(f"{family} reusable lacks exact-source distribution checks")- for path in sorted((ROOT / ".github/workflows").glob("release*.yml")):+ paths = set((ROOT / ".github/workflows").glob("release*.yml")) | set(+ (ROOT / ".github/workflows").glob("publish-*.yml")+ )+ for path in sorted(paths):text = path.read_text()for token_name in ("PYPI_TOKEN", "NPM_TOKEN", "NODE_AUTH_TOKEN"):if token_name in text:@@ -554,15 +559,54 @@ def release_workflow_errors() -> list[str]:for retention in re.findall(r"retention-days:\s*(\d+)", text):if int(retention) < ARTIFACT_RETENTION_DAYS:errors.append(f"{path.name} expires retry artifacts before 30 days")- if path.name != "release.yml" and "workflow_dispatch" in text:+ if path.name not in {"release.yml", "release-candidate.yml"} and "workflow_dispatch" in text:errors.append(f"{path.name} must not expose a separate recovery writer")blocks = workflow_job_blocks(".github/workflows/release.yml")prepare = blocks.get("prepare", "")if "release_guard.py prepare" not in prepare or "ref: ${{ github.sha }}" not in prepare:errors.append("publication must prepare the exact published tag event")- for family in ("python", "npm", "docker", "helm", "audio", "native", "python-publish", "npm-publish"):+ for family in (+ "python",+ "npm",+ "docker-build",+ "helm-build",+ "audio-build",+ "native-build",+ "docker",+ "helm",+ "audio",+ "native",+ "python-publish",+ "npm-publish",+ ):if "needs.prepare" not in blocks.get(family, "") or "needs.release-please" in blocks.get(family, ""):errors.append(f"{family} must consume the published-release prepare identity")+ barrier = blocks.get("artifacts-ready", "")+ if (+ job_scalar(barrier, "needs") != "[prepare, python, npm, docker-build, helm-build, audio-build, native-build]"+ or "always()" not in barrier+ or 'job["result"] != "success"' not in barrier+ or "raise SystemExit" not in barrier+ ):+ errors.append("every artifact family must succeed before the publication barrier opens")+ for family in ("python-publish", "npm-publish", "docker", "helm", "audio", "native"):+ block = blocks.get(family, "")+ if "artifacts-ready" not in (+ job_scalar(block, "needs") or ""+ ) or "needs.artifacts-ready.result == 'success'" not in (job_scalar(block, "if") or ""):+ errors.append(f"{family} must wait for the complete tested artifact set")+ for family in ("docker", "helm", "audio", "native"):+ if f"uses: ./.github/workflows/publish-{family}.yml" not in blocks.get(family, ""):+ errors.append(f"{family} must publish retained archives through its guarded publisher")+ for family in ("helm", "native"):+ if job_scalar(blocks.get(family, ""), "needs") != "[prepare, artifacts-ready, docker]":+ errors.append(f"{family} publication must follow verified versioned images")+ candidate = (ROOT / ".github/workflows/release-candidate.yml").read_text()+ if any(+ item in candidate+ for item in (": write", "environment:", "id-token:", "uses: ./.github/workflows/publish-", "secrets.")+ ):+ errors.append("release candidate rehearsal must be read-only and unable to publish")errors.extend(release_queue_errors(top, (ROOT / ".github/workflows/ci.yml").read_text()))recover = blocks.get("recover", "")if "release_recovery" not in recover or "id-token:" in recover or "publish-" in recover:@@ -570,7 +614,10 @@ def release_workflow_errors() -> list[str]:complete = blocks.get("complete", "")if "always()" not in complete or 'job["result"] != "success"' not in complete:errors.append("release completion must reject every non-success result")- if job_scalar(complete, "needs") != "[prepare, python-publish, npm-publish, docker, helm, audio, native]":+ if (+ job_scalar(complete, "needs")+ != "[prepare, artifacts-ready, python-publish, npm-publish, docker, helm, audio, native]"+ ):errors.append("release completion must include every artifact family")if (ROOT / ".github/workflows/repair-audio-asset.yml").exists():errors.append("obsolete audio repair workflow must be removed")@@ -718,6 +765,7 @@ def audio_release_errors() -> list[str]:errors.extend(audio_checkout_errors(workflow_job_blocks(".github/workflows/release-audio.yml").get("build", ""), workflow))+ workflow += (ROOT / ".github/workflows/publish-audio.yml").read_text()required = ("ref: ${{ inputs.sha }}",AUDIO_MANYLINUX_IMAGE,@@ -892,7 +940,7 @@ def docker_release_errors() -> list[str]:if chart_images != PUBLIC_IMAGE_NAMES:errors.append(f"chart-advertised SIE repositories differ from release set: {sorted(chart_images)}")- workflow = (ROOT / ".github/workflows/release-docker.yml").read_text()+ workflow = (ROOT / ".github/workflows/publish-docker.yml").read_text()if "inputs.publish == true" not in workflow or "PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true'" not in workflow:errors.append("Docker release is missing its dual publication latch")if "needs: [matrix, verify]" not in workflow:@@ -916,13 +964,13 @@ def helm_release_errors() -> list[str]:errors.append("Helm Chart version and appVersion must share the vX.Y.Z release identity")workflow = (ROOT / ".github/workflows/release-helm.yml").read_text()+ workflow += (ROOT / ".github/workflows/publish-helm.yml").read_text()required = ("ref: ${{ inputs.sha }}","mise run helm -- dependencies","mise run helm -- lint --set payloadStore.enabled=false","mise run helm -- template --set payloadStore.enabled=false",- "helm package deploy/helm/sie-cluster",- "needs: build",+ "mise run helm -- package --destination artifact","inputs.publish == true","PUBLIC_RELEASE_PUBLISHING_ENABLED == 'true'","packages: write",diff --git a/tools/ci/release_recovery.py b/tools/ci/release_recovery.pyindex d47a28bf9..0fef2d9e9 100755--- a/tools/ci/release_recovery.py+++ b/tools/ci/release_recovery.py@@ -22,7 +22,7 @@ from tools.ci.release_guard import (FAMILIES = ("python", "npm", "docker", "helm", "audio", "native")FAILED = {"failure", "timed_out", "cancelled", "action_required"}PUBLISH_JOB = re.compile(- r"^(python-publish|npm-publish)$|^(docker|helm|audio|native) / "+ r"^(python-publish|npm-publish)$|^docker / matrix$|^(docker|helm|audio|native) / "r"(push-server|push-service|publish|verify|alias)(?:\s|\(|$)")diff --git a/tools/ci/restore_release_artifact.py b/tools/ci/restore_release_artifact.pyindex 6931f2834..a2d523eea 100755--- a/tools/ci/restore_release_artifact.py+++ b/tools/ci/restore_release_artifact.py@@ -6,6 +6,7 @@ from __future__ import annotationsimport argparseimport jsonimport os+import reimport subprocessfrom pathlib import Path@@ -34,8 +35,17 @@ def restore(return Falseif len(matches) != 1 or matches[0].get("expired") is not False:raise ValueError("original release artifact is duplicated or expired")+ expected_head = source_revision+ if os.environ.get("GITHUB_EVENT_NAME") == "pull_request":+ # Actions records the PR head, while the tested bytes come from GITHUB_SHA's merge commit.+ if os.environ.get("GITHUB_SHA") != source_revision:+ raise ValueError("candidate artifact source must match the workflow merge SHA")+ event = json.loads(Path(os.environ["GITHUB_EVENT_PATH"]).read_text())+ expected_head = event.get("pull_request", {}).get("head", {}).get("sha")+ if not isinstance(expected_head, str) or re.fullmatch(r"[0-9a-f]{40}", expected_head) is None:+ raise ValueError("candidate artifact requires a full pull request head SHA")original = matches[0].get("workflow_run", {})- if str(original.get("id")) != str(run_id) or original.get("head_sha") != source_revision:+ if str(original.get("id")) != str(run_id) or original.get("head_sha") != expected_head:raise ValueError("original release artifact source/run mismatch")subprocess.run( # noqa: S603[ # noqa: S607diff --git a/tools/ci/rust_cuda_image_smoke.py b/tools/ci/rust_cuda_image_smoke.pynew file mode 100644index 000000000..90eb1bf86--- /dev/null+++ b/tools/ci/rust_cuda_image_smoke.py@@ -0,0 +1,150 @@+"""Validate the shipped Candle CUDA image on a runner without an NVIDIA driver.++This checks the executable and its runtime dependencies, not GPU inference. Only+libcuda.so.1 may be supplied by the host's NVIDIA container runtime.+"""++from __future__ import annotations++import argparse+import json+import re+import stat+import struct+import subprocess+import tempfile+from pathlib import Path++DRIVER_LIBRARY = "libcuda.so.1"+++def validate_config(records: list[dict], source_revision: str) -> None:+ if re.fullmatch(r"[0-9a-f]{40}", source_revision) is None:+ raise ValueError("expected a full source revision")+ if len(records) != 1:+ raise ValueError("expected exactly one loaded CUDA image")+ record = records[0]+ if (record.get("Os"), record.get("Architecture")) != ("linux", "amd64"):+ raise ValueError("Candle CUDA image must be linux/amd64")+ config = record.get("Config", {})+ labels = config.get("Labels", {})+ if labels.get("org.opencontainers.image.revision") != source_revision:+ raise ValueError("Candle CUDA image source revision mismatch")+ if labels.get("org.opencontainers.image.source") != "https://github.com/superlinked/sie":+ raise ValueError("Candle CUDA image source repository mismatch")+ if config.get("Entrypoint") != ["/sie-server-rust"] or config.get("User") != "sie:sie":+ raise ValueError("Candle CUDA image entrypoint/user mismatch")+ environment = dict(item.split("=", 1) for item in config.get("Env", []) if "=" in item)+ for key, expected in {+ "CUDA_VERSION": "12.4.1",+ "CUDA_COMPUTE_CAP": "89",+ "SIE_BUNDLE": "candle",+ "NVIDIA_DRIVER_CAPABILITIES": "compute,utility",+ }.items():+ if environment.get(key) != expected:+ raise ValueError(f"Candle CUDA image {key} must be {expected}")+++def validate_binary(binary: Path) -> None:+ info = binary.lstat()+ if not stat.S_ISREG(info.st_mode) or not info.st_mode & 0o111 or info.st_size <= 1_000_000:+ raise ValueError("Candle worker must be a regular executable larger than 1 MB")+ with binary.open("rb") as stream:+ header = stream.read(64)+ if (+ len(header) != 64+ or header[:7] != b"\x7fELF\x02\x01\x01"+ or struct.unpack_from("<H", header, 16)[0] not in (2, 3)+ or struct.unpack_from("<H", header, 18)[0] != 62+ or struct.unpack_from("<I", header, 20)[0] != 1+ or struct.unpack_from("<Q", header, 24)[0] == 0+ or struct.unpack_from("<H", header, 52)[0] != 64+ ):+ raise ValueError("Candle worker must be an ELF64 little-endian x86_64 executable")+ program_offset = struct.unpack_from("<Q", header, 32)[0]+ program_size, program_count = struct.unpack_from("<HH", header, 54)+ if (+ program_offset < 64+ or program_size != 56+ or program_count == 0+ or program_offset + program_size * program_count > info.st_size+ ):+ raise ValueError("Candle worker has an invalid ELF program header table")+++def validate_dependencies(output: str) -> None:+ libraries: set[str] = set()+ missing: set[str] = set()+ loader = False+ for line in output.splitlines():+ line = line.strip()+ if not line:+ continue+ match = re.fullmatch(r"([\w.+-]+) => (not found|/\S+ \(0x[0-9a-f]+\))", line)+ if match:+ name, destination = match.groups()+ if name in libraries:+ raise ValueError(f"duplicate runtime dependency: {name}")+ libraries.add(name)+ if destination == "not found":+ missing.add(name)+ elif re.fullmatch(r"linux-vdso\.so\.1 \(0x[0-9a-f]+\)", line):+ continue+ elif re.fullmatch(r"/\S*/ld-linux-x86-64\.so\.2 \(0x[0-9a-f]+\)", line):+ loader = True+ else:+ raise ValueError(f"unexpected runtime dependency diagnostic: {line}")+ if missing - {DRIVER_LIBRARY}:+ raise ValueError(f"missing image runtime libraries: {sorted(missing - {DRIVER_LIBRARY})}")+ if not loader or not {DRIVER_LIBRARY, "libc.so.6"} <= libraries:+ raise ValueError("expected CUDA driver, libc and x86_64 loader dependencies")+++def capture(command: list[str]) -> str:+ result = subprocess.run(command, check=True, capture_output=True, text=True) # noqa: S603+ if result.stderr.strip():+ raise ValueError(f"image validation diagnostic: {result.stderr.strip()}")+ return result.stdout.strip()+++def validate(image: str, *, source_revision: str) -> None:+ validate_config(json.loads(capture(["docker", "image", "inspect", image])), source_revision)+ with tempfile.TemporaryDirectory(prefix="sie-rust-cuda-smoke-") as temporary:+ container = capture(["docker", "create", "--pull", "never", "--network", "none", image])+ try:+ binary = Path(temporary) / "sie-server-rust"+ capture(["docker", "cp", f"{container}:/sie-server-rust", str(binary)])+ validate_binary(binary)+ finally:+ capture(["docker", "rm", container])+ output = capture(+ [+ "docker",+ "run",+ "--rm",+ "--pull",+ "never",+ "--network",+ "none",+ "--env",+ "LC_ALL=C",+ "--entrypoint",+ "/bin/sh",+ image,+ "-ec",+ "test -f /sie-server-rust; test -x /sie-server-rust; ldd /sie-server-rust",+ ]+ )+ validate_dependencies(output)+ print("Candle CUDA executable and driverless runtime dependency checks passed")+++def main() -> None:+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("image")+ parser.add_argument("--source-revision", required=True)+ validate(**vars(parser.parse_args()))+++if __name__ == "__main__":+ main()diff --git a/tools/ci/tests/test_helm_task.py b/tools/ci/tests/test_helm_task.pyindex 7da5f6498..5dbce8b98 100644--- a/tools/ci/tests/test_helm_task.py+++ b/tools/ci/tests/test_helm_task.py@@ -1,7 +1,13 @@from __future__ import annotations+import io+import subprocess+import tarfilefrom pathlib import Path+import pytest+import yaml+from tools.mise_tasks import helm@@ -45,3 +51,116 @@ def test_config_staging_is_removed_after_render(tmp_path: Path, monkeypatch) ->helm._cleanup_helm_configs()assert not (staged / "bundles").exists()assert not (staged / "models").exists()+++def package_source(tmp_path: Path, monkeypatch) -> Path:+ chart = tmp_path / "deploy/helm/sie-cluster"+ (chart / "templates").mkdir(parents=True)+ (chart / "Chart.yaml").write_text("apiVersion: v2\nname: sie-cluster\nversion: 0.8.1\n")+ (chart / "values.yaml").write_text("gateway:\n embeddedConfigs:\n enabled: false\n")+ for kind in ("bundles", "models"):+ source = tmp_path / "packages/sie_server" / kind+ source.mkdir(parents=True)+ (source / "example.yaml").write_text(f"name: {kind}\n")+ (chart / "templates" / f"{kind}.yaml").write_text(+ "{{- if .Values.gateway.embeddedConfigs.enabled }}\n"+ "apiVersion: v1\nkind: ConfigMap\nmetadata:\n"+ f" name: {{{{ .Release.Name }}}}-{kind}\ndata:\n"+ f'{{{{- range $path, $_ := .Files.Glob "files/{kind}/*.yaml" }}}}\n'+ " {{ base $path }}: |\n {{- $.Files.Get $path | nindent 4 }}\n"+ "{{- end }}\n{{- end }}\n"+ )+ monkeypatch.setattr(helm, "resolve_project_root", lambda: tmp_path)+ monkeypatch.setattr(helm, "CHART_DIR", chart)+ monkeypatch.setattr(helm, "get_usage_flag", lambda _: "package")+ monkeypatch.setattr(helm.sys, "argv", ["helm.py", "package", "--destination", str(tmp_path / "retained")])+ return tmp_path+++def test_package_retains_catalogs_and_renders_archive_after_cleanup(package_source: Path, monkeypatch) -> None:+ execute = helm.subprocess.run+ rendered = []+ embedded_configs = []++ def check_archive(command, **kwargs):+ if "template" in command:+ archive = Path(command[command.index("template") + 2])+ assert archive.suffix == ".tgz"+ assert archive.is_file()+ assert not (package_source / "deploy/helm/sie-cluster/files/bundles").exists()+ assert not (package_source / "deploy/helm/sie-cluster/files/models").exists()+ rendered.append(command)+ result = execute(command, **kwargs)+ if "gateway.embeddedConfigs.enabled=true" in command:+ embedded_configs.extend(doc for doc in yaml.safe_load_all(result.stdout) if doc)+ return result++ monkeypatch.setattr(helm.subprocess, "run", check_archive)+ assert helm.main() == 0+ archive = package_source / "retained/sie-cluster-0.8.1.tgz"+ helm.validate_packaged_configs(archive)+ assert len(rendered) == 2+ assert "gateway.embeddedConfigs.enabled=true" in rendered[1]+ assert "config.enabled=false" in rendered[1]+ assert {doc["metadata"]["name"]: doc["data"] for doc in embedded_configs} == {+ "sie-bundles": {"example.yaml": "name: bundles\n"},+ "sie-models": {"example.yaml": "name: models\n"},+ }++[email protected]("damage", ["missing", "changed", "extra", "duplicate", "symlink"])+def test_packaged_catalog_must_match_exact_source(package_source: Path, damage: str) -> None:+ archive = package_source / "bad.tgz"+ contents = {+ "sie-cluster/files/bundles/example.yaml": b"name: bundles\n",+ "sie-cluster/files/models/example.yaml": b"name: models\n",+ }+ target = "sie-cluster/files/models/example.yaml"+ if damage == "missing":+ contents.pop(target)+ elif damage == "changed":+ contents[target] = b"name: different\n"+ elif damage == "extra":+ contents["sie-cluster/files/models/unreviewed.yaml"] = b"name: extra\n"+ with tarfile.open(archive, "w:gz") as chart:+ for name, data in contents.items():+ member = tarfile.TarInfo(name)+ member.size = len(data)+ if damage == "symlink" and name == target:+ member.type = tarfile.SYMTYPE+ member.linkname = "other.yaml"+ chart.addfile(member, io.BytesIO(data))+ if damage == "duplicate" and name == target:+ chart.addfile(member, io.BytesIO(data))+ with pytest.raises(ValueError, match="packaged chart"):+ helm.validate_packaged_configs(archive)++[email protected]("failure", ["package", "archive-check", "lint", "embedded-render"])+def test_failed_package_checks_clean_staging_and_never_retain_archive(+ package_source: Path, monkeypatch, failure+) -> None:+ execute = helm.subprocess.run++ def fail(command, **kwargs):+ if (failure in {"package", "lint"} and failure in command) or (+ failure == "embedded-render" and "gateway.embeddedConfigs.enabled=true" in command+ ):+ return subprocess.CompletedProcess(command, 1, "", "deliberate chart validation failure")+ return execute(command, **kwargs)++ monkeypatch.setattr(helm.subprocess, "run", fail)+ if failure == "archive-check":++ def invalid(_archive):+ raise ValueError("invalid retained chart")++ monkeypatch.setattr(helm, "validate_packaged_configs", invalid)+ with pytest.raises(ValueError, match="invalid retained chart"):+ helm.main()+ else:+ assert helm.main() == 1+ assert not (package_source / "retained").exists()+ assert not (package_source / "deploy/helm/sie-cluster/files/bundles").exists()+ assert not (package_source / "deploy/helm/sie-cluster/files/models").exists()diff --git a/tools/ci/tests/test_release_artifact.py b/tools/ci/tests/test_release_artifact.pyindex c6dbfac19..594369d4d 100644--- a/tools/ci/tests/test_release_artifact.py+++ b/tools/ci/tests/test_release_artifact.py@@ -125,6 +125,7 @@ def test_chart_publisher_only_uploads_missing_exact_archive(tmp_path, monkeypatc@pytest.mark.parametrize("mode", ["missing", "valid", "wrong_sha", "expired"])def test_retry_restores_only_original_retained_bytes(tmp_path, monkeypatch, mode):+ monkeypatch.setenv("GITHUB_EVENT_NAME", "release")(tmp_path / "image.tar").write_bytes(b"retained tested bytes")artifact.create_manifest(tmp_path, kind="docker", **IDENTITY)record = {@@ -146,6 +147,7 @@ def test_retry_restores_only_original_retained_bytes(tmp_path, monkeypatch, modedef test_retry_evidence_must_match_retained_image_archive(tmp_path, monkeypatch):+ monkeypatch.setenv("GITHUB_EVENT_NAME", "release")archive_dir = tmp_path / "archive"archive_dir.mkdir()(archive_dir / "image.tar").write_bytes(b"retained tested bytes")@@ -168,3 +170,43 @@ def test_retry_evidence_must_match_retained_image_archive(tmp_path, monkeypatch)provenance.write_text("different image evidence")with pytest.raises(ValueError, match="differs from its retained archive"):restore.restore(evidence, **kwargs)+++def test_candidate_retry_binds_api_pr_head_and_retained_merge_source(tmp_path, monkeypatch):+ event_path = tmp_path / "event.json"+ event_path.write_text(json.dumps({"pull_request": {"head": {"sha": "b" * 40}}}))+ monkeypatch.setenv("GITHUB_EVENT_NAME", "pull_request")+ monkeypatch.setenv("GITHUB_EVENT_PATH", str(event_path))+ monkeypatch.setenv("GITHUB_SHA", IDENTITY["source_revision"])+ directory = tmp_path / "archive"+ directory.mkdir()+ (directory / "image.tar").write_bytes(b"tested candidate image")+ manifest = artifact.create_manifest(directory, kind="docker", **IDENTITY)+ record = {+ "name": "docker-service-sie-config-0.7.4",+ "expired": False,+ "workflow_run": {"id": 1234, "head_sha": "b" * 40},+ }+ monkeypatch.setattr(+ restore.subprocess, "check_output", lambda *_args, **_kwargs: json.dumps([{"artifacts": [record]}])+ )+ commands = []+ monkeypatch.setattr(restore.subprocess, "run", lambda command, **_kwargs: commands.append(command))+ kwargs = {"name": record["name"], "kind": "docker", **IDENTITY}+ assert restore.restore(directory, **kwargs)+ assert len(commands) == 1++ monkeypatch.setenv("GITHUB_SHA", "c" * 40)+ with pytest.raises(ValueError, match="workflow merge SHA"):+ restore.restore(directory, **kwargs)+ monkeypatch.setenv("GITHUB_SHA", IDENTITY["source_revision"])+ event_path.write_text(json.dumps({"pull_request": {"head": {"sha": "not-a-sha"}}}))+ with pytest.raises(ValueError, match="full pull request head SHA"):+ restore.restore(directory, **kwargs)+ assert len(commands) == 1++ event_path.write_text(json.dumps({"pull_request": {"head": {"sha": "b" * 40}}}))+ manifest["source_revision"] = "b" * 40+ (directory / "provenance.json").write_text(json.dumps(manifest))+ with pytest.raises(ValueError, match="provenance mismatch: source_revision"):+ restore.restore(directory, **kwargs)diff --git a/tools/ci/tests/test_release_candidate.py b/tools/ci/tests/test_release_candidate.pynew file mode 100644index 000000000..6ab3c7704--- /dev/null+++ b/tools/ci/tests/test_release_candidate.py@@ -0,0 +1,123 @@+from __future__ import annotations++import fnmatch+import json+import os+import re+import subprocess+import sys+from pathlib import Path++import pytest+import yaml++ROOT = Path(__file__).resolve().parents[3]+FAMILIES = ("python", "npm", "docker", "audio", "helm", "native")+++def workflow() -> dict:+ return yaml.safe_load((ROOT / ".github/workflows/release-candidate.yml").read_text())+++def step_python(job: str) -> str:+ run = workflow()["jobs"][job]["steps"][-1]["run"]+ match = re.fullmatch(r"python3 - <<'PY'\n(.*)\nPY\n?", run, re.DOTALL)+ assert match is not None+ return match[1]+++def run_step(job: str, environment: dict[str, str]) -> subprocess.CompletedProcess[str]:+ return subprocess.run( # noqa: S603 - execute the checked-in candidate workflow script+ [sys.executable, "-c", step_python(job)],+ cwd=ROOT,+ env={**os.environ, **environment},+ capture_output=True,+ text=True,+ check=False,+ )+++def test_candidate_uses_every_pure_builder_at_one_source_without_publication():+ candidate = workflow()+ triggers = candidate.get("on", candidate.get(True))+ assert set(triggers) == {"pull_request", "workflow_dispatch"}+ for path in (+ ".github/workflows/release-candidate.yml",+ ".github/workflows/release.yml",+ ".github/workflows/publish-docker.yml",+ ".github/release-matrix.json",+ ".release-please-manifest.json",+ "tools/ci/rust_cuda_image_smoke.py",+ "tools/mise_tasks/docker_task.py",+ "tools/mise_tasks/helm.py",+ "packages/sie_server/Dockerfile.cuda13",+ "packages/sie_audio_prep/build_wheel.py",+ "packages/sie_server_rust/Cargo.lock",+ "deploy/helm/sie-cluster/Chart.yaml",+ ):+ assert any(fnmatch.fnmatchcase(path, pattern) for pattern in triggers["pull_request"]["paths"]), path+ assert candidate["permissions"] == {"contents": "read"}+ jobs = candidate["jobs"]+ assert set(jobs) == {"prepare", *FAMILIES, "complete"}+ assert jobs["prepare"]["steps"][0]["with"] == {"ref": "${{ github.sha }}", "persist-credentials": False}+ for family in FAMILIES:+ job = jobs[family]+ assert job["uses"] == f"./.github/workflows/release-{family}.yml"+ assert job["needs"] == (["prepare", "docker"] if family == "native" else "prepare")+ expected: dict[str, str | bool] = {+ "version": "${{ needs.prepare.outputs.version }}",+ "tag_name": "${{ needs.prepare.outputs.tag_name }}",+ }+ expected["source_ref" if family in ("python", "npm") else "sha"] = "${{ needs.prepare.outputs.sha }}"+ if family in ("python", "npm"):+ expected["build_only"] = True+ assert job["with"] == expected+ for job in jobs.values():+ assert not {"environment", "secrets", "continue-on-error"} & job.keys()+ assert all(value == "read" for value in job.get("permissions", {}).values())+ assert jobs["docker"]["permissions"] == {"contents": "read", "actions": "read"}+ assert set(jobs["complete"]["needs"]) == {"prepare", *FAMILIES}+ assert jobs["complete"]["if"] == "${{ always() }}"+ for forbidden in (+ "pull_request_target",+ "id-token",+ "secrets.",+ "release-please-action",+ "docker push",+ "gh release",+ ):+ assert forbidden not in json.dumps(candidate)+++def test_candidate_has_no_transitive_publisher_permissions():+ for family in FAMILIES:+ builder = yaml.safe_load((ROOT / f".github/workflows/release-{family}.yml").read_text())+ assert all(value == "read" for value in builder.get("permissions", {}).values())+ for job in builder["jobs"].values():+ assert not {"environment", "secrets"} & job.keys()+ assert all(value == "read" for value in job.get("permissions", {}).values())+ for forbidden in ("id-token", "secrets."):+ assert forbidden not in json.dumps(builder)++[email protected]("wrong_source", [False, True])+def test_candidate_identity_reads_real_metadata_and_requires_exact_checkout(tmp_path, wrong_source):+ sha = subprocess.check_output(["/usr/bin/git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip()+ output = tmp_path / "outputs"+ result = run_step("prepare", {"GITHUB_SHA": "0" * 40 if wrong_source else sha, "GITHUB_OUTPUT": str(output)})+ if wrong_source:+ assert result.returncode != 0+ assert not output.exists()+ else:+ assert result.returncode == 0, result.stderr+ version = json.loads((ROOT / ".release-please-manifest.json").read_text())["."]+ assert output.read_text() == f"sha={sha}\nversion={version}\ntag_name=v{version}\n"++[email protected]("family", [None, "prepare", *FAMILIES])+def test_actual_candidate_completion_requires_all_families(family):+ needs = {name: {"result": "success"} for name in ("prepare", *FAMILIES)}+ if family is not None:+ needs[family]["result"] = "failure"+ completed = run_step("complete", {"RESULTS": json.dumps(needs)})+ assert (completed.returncode == 0) is (family is None), completed.stderrdiff --git a/tools/ci/tests/test_release_contract.py b/tools/ci/tests/test_release_contract.pyindex d70ef995a..8140d0d96 100644--- a/tools/ci/tests/test_release_contract.py+++ b/tools/ci/tests/test_release_contract.py@@ -455,7 +455,16 @@ def test_actual_release_completion_script_rejects_non_success(monkeypatch, resulassert script is not Noneresults = {family: {"result": "success"}- for family in ("prepare", "python-publish", "npm-publish", "docker", "helm", "audio", "native")+ for family in (+ "prepare",+ "artifacts-ready",+ "python-publish",+ "npm-publish",+ "docker",+ "helm",+ "audio",+ "native",+ )}results["native"]["result"] = resultmonkeypatch.setenv("RESULTS", json.dumps(results))@@ -477,6 +486,22 @@ def test_helm_release_follows_verified_images() -> None:assert contract.helm_release_errors() == []+def test_helm_release_must_package_the_staged_and_validated_catalog(monkeypatch) -> None:+ read_text = Path.read_text++ def unstaged_package(path, *args, **kwargs):+ text = read_text(path, *args, **kwargs)+ if path == contract.ROOT / ".github/workflows/release-helm.yml":+ text = text.replace(+ "mise run helm -- package --destination artifact",+ "mise exec -- helm package deploy/helm/sie-cluster --destination artifact",+ )+ return text++ monkeypatch.setattr(Path, "read_text", unstaged_package)+ assert any("mise run helm -- package" in error for error in contract.helm_release_errors())++def test_public_release_app_hands_final_pr_head_to_ci() -> None:assert contract.release_app_errors() == []diff --git a/tools/ci/tests/test_release_guard.py b/tools/ci/tests/test_release_guard.pyindex ba72e8828..860284f63 100644--- a/tools/ci/tests/test_release_guard.py+++ b/tools/ci/tests/test_release_guard.py@@ -308,6 +308,17 @@ def test_recovery_cannot_change_original_provenance(key, value, message):)+def test_failed_publisher_matrix_can_resume_after_all_images_are_retained():+ jobs = [+ {"id": 1, "name": "prepare", "conclusion": "success"},+ {"id": 2, "name": "artifacts-ready", "conclusion": "success"},+ {"id": 3, "name": "docker / matrix", "conclusion": "failure"},+ {"id": 4, "name": "docker / push-server (cpu, default)", "conclusion": "skipped"},+ {"id": 5, "name": "docker-build / build-service (sie-server-rust)", "conclusion": "success"},+ ]+ assert recovery.retry_endpoint(jobs, "docker", 123) == "actions/jobs/3/rerun"++def artifact():return {"name": "python-distributions",diff --git a/tools/ci/tests/test_required_ci.py b/tools/ci/tests/test_required_ci.pyindex c44c81cce..cd2a79a57 100644--- a/tools/ci/tests/test_required_ci.py+++ b/tools/ci/tests/test_required_ci.py@@ -374,3 +374,70 @@ def test_cuda13_workflows_have_no_privileged_or_unrelated_behavior():uses = [job.get("uses", ""), *(step.get("uses", "") for step in job.get("steps", []))]for action in filter(None, uses):assert action.startswith("./") or re.fullmatch(r"[\w/-]+@[a-f0-9]{40}", action)+++def test_rust_cuda_image_workflow_covers_production_sources_on_pr_and_main_push():+ workflow = yaml.safe_load((ROOT / ".github/workflows/rust-cuda-image.yml").read_text())+ triggers = workflow.get("on", workflow.get(True))+ assert set(triggers) == {"pull_request", "push"}+ assert triggers["push"]["branches"] == ["main"]+ expected_paths = {+ ".github/workflows/rust-cuda-image.yml",+ ".github/workflows/release-docker.yml",+ ".dockerignore",+ "mise.toml",+ "packages/sie_server_rust/**",+ "packages/sie_telemetry/**",+ "tools/ci/rust_cuda_image_smoke.py",+ "tools/ci/tests/test_rust_cuda_image_smoke.py",+ "tools/ci/tests/test_required_ci.py",+ "tools/ci/tests/test_docker_task.py",+ "tools/mise_tasks/docker_task.py",+ }+ assert set(triggers["pull_request"]["paths"]) == expected_paths+ assert set(triggers["push"]["paths"]) == expected_paths+ assert workflow["concurrency"] == {+ "group": "rust-cuda-image-${{ github.event.pull_request.number || github.ref }}",+ "cancel-in-progress": True,+ }+++def test_rust_cuda_image_workflow_validates_same_loaded_production_image_without_publication():+ workflow = yaml.safe_load((ROOT / ".github/workflows/rust-cuda-image.yml").read_text())+ assert workflow["permissions"] == {"contents": "read"}+ assert set(workflow["jobs"]) == {"compatibility"}+ job = workflow["jobs"]["compatibility"]+ assert job["runs-on"] == "blacksmith-8vcpu-ubuntu-2404"+ assert job["timeout-minutes"] == 90+ for key in ("if", "continue-on-error", "environment", "secrets", "permissions"):+ assert key not in job+ steps = job["steps"]+ assert [step["uses"] for step in steps if "uses" in step] == [+ "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd",+ "jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac",+ "useblacksmith/setup-docker-builder@9309da73a81f66976a6d750572e221508b1e2682",+ "useblacksmith/build-push-action@9b0579bbec7a6cad2f171596c57e7ac1e7658850",+ ]+ assert steps[0]["with"] == {"persist-credentials": False}+ build = steps[-2]+ assert build["with"] == {+ "context": ".",+ "file": "packages/sie_server_rust/Dockerfile.candle",+ "platforms": "linux/amd64",+ "build-args": "CUDA_COMPUTE_CAP=89",+ "labels": (+ "org.opencontainers.image.revision=${{ github.sha }}\n"+ "org.opencontainers.image.source=https://github.com/superlinked/sie\n"+ ),+ "tags": "sie-rust-cuda:ci",+ "load": True,+ "push": False,+ }+ assert steps[-1]["run"] == (+ 'mise exec -- python tools/ci/rust_cuda_image_smoke.py sie-rust-cuda:ci --source-revision "$GITHUB_SHA"'+ )+ for step in steps:+ assert not {"if", "continue-on-error", "shell"}.intersection(step)+ serialized = json.dumps(workflow)+ for forbidden in ("pull_request_target", "id-token", "secrets.", "docker login", "docker push"):+ assert forbidden not in serializeddiff --git a/tools/ci/tests/test_rust_cuda_image_smoke.py b/tools/ci/tests/test_rust_cuda_image_smoke.pynew file mode 100644index 000000000..fd6dd5b65--- /dev/null+++ b/tools/ci/tests/test_rust_cuda_image_smoke.py@@ -0,0 +1,288 @@+from __future__ import annotations++import json+import struct+import subprocess+from pathlib import Path+from unittest.mock import Mock++import pytest++from tools.ci import rust_cuda_image_smoke as smoke+from tools.mise_tasks import docker_task++SHA = "a" * 40+IMAGE = "sie-rust-cuda:local"+DEPENDENCIES = """+linux-vdso.so.1 (0x00007fff12340000)+libcuda.so.1 => not found+libcudart.so.12 => /usr/local/cuda/lib64/libcudart.so.12 (0x00007fff12340000)+libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007fff12340000)+libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fff12340000)+/lib64/ld-linux-x86-64.so.2 (0x00007fff12340000)+"""+++def config():+ return [+ {+ "Os": "linux",+ "Architecture": "amd64",+ "Config": {+ "Entrypoint": ["/sie-server-rust"],+ "User": "sie:sie",+ "Labels": {+ "org.opencontainers.image.revision": SHA,+ "org.opencontainers.image.source": "https://github.com/superlinked/sie",+ },+ "Env": [+ "CUDA_VERSION=12.4.1",+ "CUDA_COMPUTE_CAP=89",+ "SIE_BUNDLE=candle",+ "NVIDIA_DRIVER_CAPABILITIES=compute,utility",+ ],+ },+ }+ ]+++def executable(path: Path) -> Path:+ header = bytearray(64)+ header[:7] = b"\x7fELF\x02\x01\x01"+ struct.pack_into("<HHIQQ", header, 16, 3, 62, 1, 4096, 64)+ struct.pack_into("<HHH", header, 52, 64, 56, 1)+ with path.open("wb") as stream:+ stream.write(header)+ stream.truncate(1_000_001)+ path.chmod(0o755)+ return path+++def test_valid_loaded_image_and_executable(config, tmp_path):+ smoke.validate_config(config, SHA)+ smoke.validate_binary(executable(tmp_path / "worker"))+++ "field,value",+ [+ ("Architecture", "arm64"),+ ("Os", "windows"),+ ("Entrypoint", ["/bin/true"]),+ ("User", "root"),+ ("revision", "b" * 40),+ ("source", "https://github.com/other/repo"),+ ("CUDA_VERSION", "13.0.0"),+ ("CUDA_COMPUTE_CAP", "80"),+ ("SIE_BUNDLE", "default"),+ ],+)+def test_wrong_image_contract_fails(config, field, value):+ if field in ("Os", "Architecture"):+ config[0][field] = value+ elif field in ("Entrypoint", "User"):+ config[0]["Config"][field] = value+ elif field in ("revision", "source"):+ config[0]["Config"]["Labels"][f"org.opencontainers.image.{field}"] = value+ else:+ config[0]["Config"]["Env"] = [+ f"{field}={value}" if item.startswith(f"{field}=") else item for item in config[0]["Config"]["Env"]+ ]+ with pytest.raises(ValueError):+ smoke.validate_config(config, SHA)+++ "change", ["empty", "truncated", "text", "arm64", "elf32", "not-executable", "symlink", "no-entry", "bad-programs"]+)+def test_bad_executable_fails(tmp_path, change):+ binary = executable(tmp_path / "worker")+ if change in ("empty", "truncated", "text"):+ binary.write_bytes({"empty": b"", "truncated": b"\x7fELF", "text": b"shell script"}[change])+ elif change == "not-executable":+ binary.chmod(0o644)+ elif change == "symlink":+ target = binary.rename(tmp_path / "target")+ binary.symlink_to(target)+ else:+ offset, data = {+ "arm64": (18, struct.pack("<H", 183)),+ "elf32": (4, b"\x01"),+ "no-entry": (24, b"\0" * 8),+ "bad-programs": (32, struct.pack("<Q", 2_000_000)),+ }[change]+ with binary.open("r+b") as stream:+ stream.seek(offset)+ stream.write(data)+ with pytest.raises(ValueError):+ smoke.validate_binary(binary)+++def test_only_host_driver_may_be_missing():+ smoke.validate_dependencies(DEPENDENCIES)+ smoke.validate_dependencies(+ DEPENDENCIES.replace("libcuda.so.1 => not found", "libcuda.so.1 => /usr/lib/libcuda.so.1 (0x1234)")+ )+++ "library", ["libc.so.6", "libstdc++.so.6", "libssl.so.3", "libcudart.so.12", "libcublas.so.12", "libnvrtc.so.12"]+)+def test_missing_image_library_is_fatal_even_when_ldd_exits_zero(library):+ lines = [line for line in DEPENDENCIES.splitlines() if not line.startswith(f"{library} =>")]+ with pytest.raises(ValueError, match="missing image runtime libraries"):+ smoke.validate_dependencies("\n".join([*lines, f"{library} => not found"]))+++ "output",+ [+ "",+ "not a dynamic executable",+ "statically linked",+ "garbage",+ DEPENDENCIES.replace("libcuda.so.1 => not found", ""),+ DEPENDENCIES + "/sie-server-rust: version `GLIBC_2.39' not found\n",+ DEPENDENCIES + "libcuda.so.1 => not found\n",+ ],+)+def test_absent_cuda_or_loader_diagnostics_fail(output):+ with pytest.raises(ValueError):+ smoke.validate_dependencies(output)+++def test_actual_image_binary_is_checked_without_running_it(config, monkeypatch):+ commands = []++ def capture(command):+ commands.append(command)+ if command[1:3] == ["image", "inspect"]:+ return json.dumps(config)+ if command[1] == "create":+ return "container"+ if command[1] == "cp":+ executable(Path(command[-1]))+ if command[1] == "run":+ return DEPENDENCIES+ return ""++ monkeypatch.setattr(smoke, "capture", capture)+ smoke.validate(IMAGE, source_revision=SHA)+ assert [command[1] for command in commands] == ["image", "create", "cp", "rm", "run"]+ for command in (commands[1], commands[-1]):+ assert command[command.index("--pull") + 1] == "never"+ assert command[command.index("--network") + 1] == "none"+ assert IMAGE in command+ assert commands[-1][commands[-1].index("--entrypoint") + 1] == "/bin/sh"+ assert "--help" not in commands[-1]+++def test_bad_extracted_binary_still_removes_container(config, monkeypatch):+ commands = []++ def capture(command):+ commands.append(command)+ if command[1:3] == ["image", "inspect"]:+ return json.dumps(config)+ if command[1] == "create":+ return "container"+ if command[1] == "cp":+ Path(command[-1]).write_bytes(b"bad")+ return ""++ monkeypatch.setattr(smoke, "capture", capture)+ with pytest.raises(ValueError):+ smoke.validate(IMAGE, source_revision=SHA)+ assert commands[-1] == ["docker", "rm", "container"]+ assert not any(command[1] == "run" for command in commands)++[email protected]("failure", [ValueError("bad dependencies"), subprocess.CalledProcessError(1, ["ldd"])])+def test_failed_cuda_worker_validation_prevents_release_export(monkeypatch, tmp_path, failure):+ monkeypatch.setattr(docker_task, "run", Mock())+ validator = Mock(side_effect=failure)+ monkeypatch.setattr(smoke, "validate", validator)+ export = Mock()+ monkeypatch.setattr(docker_task, "export_image", export)+ monkeypatch.setattr(+ docker_task.sys,+ "argv",+ [+ "docker_task.py",+ "build-service",+ "--registry",+ "ghcr.io/superlinked",+ "--version",+ "0.8.2",+ "--service",+ "sie-server-rust",+ "--source-revision",+ SHA,+ "--run-id",+ "1234",+ "--archive-dir",+ str(tmp_path / "artifact"),+ ],+ )+ assert docker_task.main() == 1+ validator.assert_called_once_with("ghcr.io/superlinked/sie-server-rust:v0.8.2-cuda12-sm89", source_revision=SHA)+ export.assert_not_called()+ assert not (tmp_path / "artifact").exists()+++ "service", ["sie-server-rust-cpu", "sie-server-sidecar", "sie-gateway", "sie-config", "sie-mcp"]+)+def test_other_services_keep_cli_smoke_before_export(service, monkeypatch, tmp_path):+ commands = []+ monkeypatch.setattr(docker_task, "run", commands.append)+ validator = Mock()+ monkeypatch.setattr(smoke, "validate", validator)+ monkeypatch.setattr(docker_task, "export_image", Mock())+ monkeypatch.setattr(+ docker_task.sys,+ "argv",+ [+ "docker_task.py",+ "build-service",+ "--registry",+ "local/test",+ "--version",+ "0.8.2",+ "--service",+ service,+ "--source-revision",+ SHA,+ "--run-id",+ "1234",+ "--archive-dir",+ str(tmp_path / "artifact"),+ ],+ )+ assert docker_task.main() == 0+ validator.assert_not_called()+ assert commands[-1] == [+ "docker",+ "run",+ "--rm",+ "--pull",+ "never",+ "--network",+ "none",+ docker_task.singleton_image("local/test", "0.8.2", service),+ "--help",+ ]+++def test_probe_nonzero_and_stderr_are_fatal(monkeypatch):+ monkeypatch.setattr(smoke.subprocess, "run", Mock(side_effect=subprocess.CalledProcessError(1, ["ldd"])))+ with pytest.raises(subprocess.CalledProcessError):+ smoke.capture(["ldd"])+ monkeypatch.setattr(+ smoke.subprocess,+ "run",+ Mock(return_value=subprocess.CompletedProcess(["ldd"], 0, DEPENDENCIES, "loader warning")),+ )+ with pytest.raises(ValueError, match="loader warning"):+ smoke.capture(["ldd"])diff --git a/tools/mise_tasks/docker_task.py b/tools/mise_tasks/docker_task.pyindex 9e84e34b4..0122035c5 100755--- a/tools/mise_tasks/docker_task.py+++ b/tools/mise_tasks/docker_task.py@@ -17,7 +17,7 @@ from typing import Anyimport yaml-from tools.ci import cuda13_image_smoke+from tools.ci import cuda13_image_smoke, rust_cuda_image_smokefrom tools.ci.release_artifact import create_manifest, validate_manifestfrom tools.ci.release_guard import api, stable_version@@ -605,7 +605,10 @@ def main() -> int:if args.command == "build-server"else singleton_image(args.registry, args.version, args.service))- smoke_image(image, bundle=args.bundle if args.command == "build-server" else None)+ if args.command == "build-service" and args.service == "sie-server-rust":+ rust_cuda_image_smoke.validate(image, source_revision=args.source_revision)+ else:+ smoke_image(image, bundle=args.bundle if args.command == "build-server" else None)export_image(image, args.archive_dir, version=args.version, source_revision=args.source_revision, run_id=args.run_id)diff --git a/tools/mise_tasks/helm.py b/tools/mise_tasks/helm.pyindex 84283a819..03090ab96 100755--- a/tools/mise_tasks/helm.py+++ b/tools/mise_tasks/helm.py@@ -1,7 +1,7 @@#!/usr/bin/env python3# fmt: off#MISE description="Helm chart operations for SIE cluster deployment"-#USAGE arg "[command]" help="Command: dependencies, lint, template, install, upgrade, uninstall, status"+#USAGE arg "[command]" help="Command: dependencies, lint, template, package, install, upgrade, uninstall, status"#USAGE arg "[args]..." help="Additional arguments to pass to helm"# fmt: on@@ -15,6 +15,7 @@ This task handles:from __future__ import annotations+import argparseimport fcntlimport hashlibimport os@@ -22,6 +23,7 @@ import shutilimport statimport subprocessimport sys+import tarfileimport tempfilefrom collections.abc import Iteratorfrom contextlib import contextmanager@@ -164,6 +166,7 @@ def show_help() -> None:log(" dependencies Build dependencies from Chart.yaml and Chart.lock")log(" lint Lint the Helm chart")log(" template Render templates locally")+ log(" package Package and validate a chart with embedded configs (--destination DIR)")log(" install Install to cluster (dry-run by default)")log(" install --apply Actually install to cluster")log(" upgrade Upgrade existing installation")@@ -217,6 +220,77 @@ def cmd_template(extra_args: list[str]) -> int:)+def validate_packaged_configs(archive: Path) -> None:+ """Require the retained chart to contain the exact checked-in catalogs."""+ root = resolve_project_root()+ chart_name = CHART_DIR.name+ expected = {+ f"{chart_name}/files/{kind}/{path.name}": path.read_bytes()+ for kind in ("bundles", "models")+ for path in (root / "packages/sie_server" / kind).glob("*.yaml")+ }+ actual = {}+ with tarfile.open(archive, "r:gz") as chart:+ for member in chart.getmembers():+ if not any(member.name.startswith(f"{chart_name}/files/{kind}/") for kind in ("bundles", "models")):+ continue+ if not member.isfile() or member.name in actual:+ raise ValueError("packaged chart catalog must contain unique regular files")+ contents = chart.extractfile(member)+ if contents is None:+ raise ValueError("packaged chart catalog member has no contents")+ actual[member.name] = contents.read()+ if not expected or actual != expected:+ raise ValueError("packaged chart catalogs differ from the checked-in bundle/model configs")+++def cmd_package(extra_args: list[str]) -> int:+ """Retain only an archive that passes checks after config staging is removed."""+ parser = argparse.ArgumentParser(prog="mise run helm -- package")+ parser.add_argument("--destination", type=Path, required=True)+ args = parser.parse_args(extra_args)+ with tempfile.TemporaryDirectory(prefix="sie-helm-package-") as temporary:+ if run_helm(["package", str(CHART_DIR), "--destination", temporary]) != 0:+ return 1+ archives = list(Path(temporary).glob("*.tgz"))+ if len(archives) != 1:+ raise ValueError("Helm package must produce exactly one chart archive")+ archive = archives[0]+ validate_packaged_configs(archive)+ # Validation must depend on the archive, never on loose staged files.+ _cleanup_helm_configs()+ if run_helm(["lint", str(archive), *validation_args([])]) != 0:+ return 1+ for options in ([], ["--set", "config.enabled=false", "--set", "gateway.embeddedConfigs.enabled=true"]):+ result = subprocess.run( # noqa: S603+ [ # noqa: S607 - use the repository's mise-managed Helm executable+ "mise",+ "exec",+ "--",+ "helm",+ "template",+ RELEASE_NAME,+ str(archive),+ "--namespace",+ NAMESPACE,+ *validation_args(options),+ ],+ check=False,+ capture_output=True,+ text=True,+ )+ if result.returncode:+ log_error(result.stderr)+ return result.returncode+ args.destination.mkdir(parents=True, exist_ok=True)+ destination = args.destination / archive.name+ if destination.exists() and destination.read_bytes() != archive.read_bytes():+ raise ValueError("refusing to replace a different retained chart archive")+ shutil.copyfile(archive, destination)+ log_success(f"Validated chart retained at {destination}")+ return 0++def cmd_install(extra_args: list[str]) -> int:"""Install to cluster."""apply = "--apply" in extra_args@@ -334,6 +408,7 @@ def main() -> int:"dependencies": cmd_dependencies,"lint": cmd_lint,"template": cmd_template,+ "package": cmd_package,"install": cmd_install,"upgrade": cmd_upgrade,"uninstall": cmd_uninstall,@@ -347,7 +422,7 @@ def main() -> int:return 1# Commands that render templates need bundle/model configs in files/- needs_configs = command in ("lint", "template", "install", "upgrade")+ needs_configs = command in ("lint", "template", "package", "install", "upgrade")if needs_configs:if cmd_dependencies([]) != 0:return 1