From c7ca2a12465ba8e277ebf92c7e3095c9f5ed1e51 Mon Sep 17 00:00:00 2001 From: Simon Scatton Date: Fri, 20 Nov 2026 10:30:21 +0100 Subject: [PATCH 1/2] ci(release): promote release images to Quay Release Dev and Publish Release now copy the SHA-tagged images from the CI registry (ghcr.io//openshell) to quay.io/ai-openshell instead of retagging them in ghcr.io/nvidia/openshell. Stable archives are pushed to Quay directly. Jobs log in to Quay through the org's quay-login action with the job's OIDC token, so they run in the release environment. Dev also pushes the SHA tag so the 0.0.0-dev. chart resolves, and dev and prerelease promotions verify the SBOM on the Quay copy. Refs #4554 Signed-off-by: Simon Scatton --- .github/workflows/release-dev.yml | 35 ++++++++++++++++++++------ .github/workflows/release-publish.yml | 36 +++++++++++++++++++-------- 2 files changed, 53 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 21de33825b..6d301a39d1 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -209,26 +209,45 @@ jobs: checkout-ref: ${{ github.sha }} tag-ghcr-dev: - name: Tag GHCR Images as Dev + name: Promote Dev Images to Quay needs: [build-images, release-dev] runs-on: ubuntu-24.04 timeout-minutes: 10 + # Only jobs in this environment can trade their OIDC token for the Quay robot. + environment: release permissions: - packages: write + contents: read + id-token: write + packages: read steps: - - name: Log in to GHCR + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Log in to the CI registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin - - name: Tag images as dev + - name: Log in to Quay + uses: ai-openshell/workflows/quay-login@96e33d5551ba4e706203648eb90710c48466e543 # main + with: + robot: ai-openshell+openshell_release + clients: docker + + # The SHA tag backs the 0.0.0-dev. chart, which pins appVersion to it. + - name: Promote images as dev + env: + SOURCE_SHA: ${{ github.sha }} run: | set -euo pipefail - REGISTRY="ghcr.io/ai-openshell/openshell" + CI_REGISTRY="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/openshell" for component in gateway sandbox supervisor; do - echo "Tagging ${REGISTRY}/${component}:${{ github.sha }} as dev..." + echo "Promoting ${CI_REGISTRY}/${component}:${SOURCE_SHA} to quay.io/ai-openshell/${component}..." docker buildx imagetools create \ --prefer-index=false \ - -t "${REGISTRY}/${component}:dev" \ - "${REGISTRY}/${component}:${{ github.sha }}" + -t "quay.io/ai-openshell/${component}:${SOURCE_SHA}" \ + -t "quay.io/ai-openshell/${component}:dev" \ + "${CI_REGISTRY}/${component}:${SOURCE_SHA}" + tasks/scripts/verify-image-sbom.sh "quay.io/ai-openshell/${component}:dev" --require-cargo done build-deb: diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 5e101f77ce..08fbefbcca 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -184,17 +184,19 @@ jobs: if-no-files-found: error tag-ghcr-release: - name: Publish GHCR Images + name: Publish Quay Images needs: assemble runs-on: ubuntu-24.04 timeout-minutes: 10 + # Only jobs in this environment can trade their OIDC token for the Quay robot. + environment: release permissions: actions: read contents: read - packages: write + id-token: write + packages: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - if: ${{ !inputs.is-prerelease }} with: persist-credentials: false ref: ${{ inputs.source-sha }} @@ -210,9 +212,16 @@ jobs: path: artifacts/ merge-multiple: true - - name: Log in to GHCR + - name: Log in to the CI registry + if: ${{ inputs.is-prerelease }} run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin + - name: Log in to Quay + uses: ai-openshell/workflows/quay-login@96e33d5551ba4e706203648eb90710c48466e543 # main + with: + robot: ai-openshell+openshell_release + clients: docker + - name: Publish stable image archives if: ${{ !inputs.is-prerelease }} env: @@ -220,7 +229,7 @@ jobs: run: | set -euo pipefail for component in gateway sandbox supervisor; do - image="ghcr.io/nvidia/openshell/${component}:${VERSION}" + image="quay.io/ai-openshell/${component}:${VERSION}" # Never replace a published stable image; a rerun keeps the original. # Only a missing manifest means unpublished; any other lookup error # fails rather than risk overwriting. @@ -264,21 +273,28 @@ jobs: VERSION: ${{ inputs.semver }} run: | set -euo pipefail - REGISTRY="ghcr.io/nvidia/openshell" + REGISTRY="quay.io/ai-openshell" + # Prereleases promote the SHA-tagged build from the CI registry; + # stable images were already published to Quay above. + SOURCE_REGISTRY="${REGISTRY}" + if [[ "${IS_PRERELEASE}" == "true" ]]; then + SOURCE_REGISTRY="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/openshell" + fi for component in gateway sandbox supervisor; do if [[ "${IS_PRERELEASE}" == "true" ]]; then - echo "Tagging ${REGISTRY}/${component}:${SOURCE_TAG} as ${VERSION}..." + echo "Promoting ${SOURCE_REGISTRY}/${component}:${SOURCE_TAG} as ${REGISTRY}/${component}:${VERSION}..." docker buildx imagetools create \ --prefer-index=false \ -t "${REGISTRY}/${component}:${VERSION}" \ - "${REGISTRY}/${component}:${SOURCE_TAG}" + "${SOURCE_REGISTRY}/${component}:${SOURCE_TAG}" + tasks/scripts/verify-image-sbom.sh "${REGISTRY}/${component}:${VERSION}" --require-cargo fi if [[ "${MAKE_LATEST}" == "true" ]]; then - echo "Tagging ${REGISTRY}/${component}:${SOURCE_TAG} as latest..." + echo "Tagging ${SOURCE_REGISTRY}/${component}:${SOURCE_TAG} as latest..." docker buildx imagetools create \ --prefer-index=false \ -t "${REGISTRY}/${component}:latest" \ - "${REGISTRY}/${component}:${SOURCE_TAG}" + "${SOURCE_REGISTRY}/${component}:${SOURCE_TAG}" fi done From c695eb79e91b2db8d763dc1ed1e3a804dc1ed00f Mon Sep 17 00:00:00 2001 From: Simon Scatton Date: Fri, 20 Nov 2026 10:31:00 +0100 Subject: [PATCH 2/2] ci(release): push Helm charts to Quay The release-helm-oci action now logs in to Quay with the org's quay-login action and pushes the gateway and workspace charts to oci://quay.io/ai-openshell/charts, for dev and public releases alike. The gateway chart is published as charts/openshell, so this needs the chart rename from helm-chart. The registry-namespace and image-registry inputs go away: every chart goes to one registry, and the chart's own image defaults name the Quay images, so no values are rewritten at packaging time. Refs #4554 Signed-off-by: Simon Scatton --- .github/actions/release-helm-oci/action.yml | 52 +++++++-------------- .github/workflows/release-dev.yml | 7 +-- .github/workflows/release-publish.yml | 5 +- 3 files changed, 26 insertions(+), 38 deletions(-) diff --git a/.github/actions/release-helm-oci/action.yml b/.github/actions/release-helm-oci/action.yml index e231280a32..35285fde2d 100644 --- a/.github/actions/release-helm-oci/action.yml +++ b/.github/actions/release-helm-oci/action.yml @@ -4,7 +4,8 @@ name: Release Helm OCI description: > Patch chart version/appVersion, package the gateway and workspace charts, and - push them to GHCR OCI. Public releases never overwrite published versions. + push them to oci://quay.io/ai-openshell/charts. Public releases never + overwrite published versions. inputs: chart-version: @@ -20,14 +21,6 @@ inputs: release-kind: description: "dev or public — controls the duplicate-version guard." required: true - registry-namespace: - description: "GHCR namespace without the oci:// prefix." - required: false - default: ghcr.io/nvidia/openshell - image-registry: - description: "Override global.image.registry in the packaged gateway chart." - required: false - default: "" pin-sha: description: > Full commit SHA. When set on dev releases, a second chart is also pushed @@ -41,22 +34,21 @@ inputs: runs: using: composite steps: - - name: Log in to GHCR - uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - name: Install Helm uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 + # Needs id-token: write and the release environment on the calling job. + - name: Log in to Quay + uses: ai-openshell/workflows/quay-login@96e33d5551ba4e706203648eb90710c48466e543 # main + with: + robot: ai-openshell+openshell_release + clients: helm + - name: Stage chart and patch version id: prep env: CHART_VERSION: ${{ inputs.chart-version }} APP_VERSION: ${{ inputs.app-version }} - IMAGE_REGISTRY: ${{ inputs.image-registry }} shell: bash run: | set -euo pipefail @@ -68,10 +60,6 @@ runs: sed -i "s/^version:.*/version: ${CHART_VERSION}/" "${chart_dir}/Chart.yaml" sed -i "s/^appVersion:.*/appVersion: \"${APP_VERSION}\"/" "${chart_dir}/Chart.yaml" done - if [[ -n "${IMAGE_REGISTRY}" ]]; then - sed -i "s|^ registry: ghcr.io/nvidia$| registry: ${IMAGE_REGISTRY}|" "${GATEWAY_CHART_DIR}/values.yaml" - grep -Fxq " registry: ${IMAGE_REGISTRY}" "${GATEWAY_CHART_DIR}/values.yaml" - fi echo "gateway_chart_dir=${GATEWAY_CHART_DIR}" >> "$GITHUB_OUTPUT" echo "workspace_chart_dir=${WORKSPACE_CHART_DIR}" >> "$GITHUB_OUTPUT" echo "chart_version=${CHART_VERSION}" >> "$GITHUB_OUTPUT" @@ -83,18 +71,17 @@ runs: if: inputs.release-kind == 'public' env: CHART_VERSION: ${{ steps.prep.outputs.chart_version }} - REGISTRY_NAMESPACE: ${{ inputs.registry-namespace }} shell: bash run: | set -euo pipefail found=0 - for chart in helm-chart openshell-workspace; do - OCI_CHART="oci://${REGISTRY_NAMESPACE}/${chart}" + for chart in openshell openshell-workspace; do + OCI_CHART="oci://quay.io/ai-openshell/charts/${chart}" # Only "not found" means unpublished; any other lookup error fails # rather than risk overwriting. if lookup_error=$(helm show chart "${OCI_CHART}" --version "${CHART_VERSION}" 2>&1 >/dev/null); then found=$((found + 1)) - elif [[ "${lookup_error}" != *"${REGISTRY_NAMESPACE}/${chart}:${CHART_VERSION}: not found"* ]]; then + elif [[ "${lookup_error}" != *"quay.io/ai-openshell/charts/${chart}:${CHART_VERSION}: not found"* ]]; then echo "::error::Could not check whether ${chart}:${CHART_VERSION} is published: ${lookup_error}" exit 1 fi @@ -120,20 +107,18 @@ runs: helm package "${WORKSPACE_CHART_DIR}" --destination /tmp/helm-charts ls /tmp/helm-charts/*.tgz - - name: Push Helm chart to GHCR OCI + - name: Push Helm chart to Quay if: steps.published.outputs.published != 'true' - env: - REGISTRY_NAMESPACE: ${{ inputs.registry-namespace }} shell: bash run: | set -euo pipefail # Helm pushes the manifest by digest, then fetches it back to tag it. - # GHCR can briefly return 404 for a manifest it just accepted, so - # retry. Re-pushing the same archive is idempotent. + # A registry can briefly return 404 for a manifest it just accepted, + # so retry. Re-pushing the same archive is idempotent. push_chart() { local attempt for attempt in 1 2 3 4; do - if helm push "$1" "oci://${REGISTRY_NAMESPACE}"; then + if helm push "$1" oci://quay.io/ai-openshell/charts; then return 0 fi if [ "${attempt}" -lt 4 ]; then @@ -151,17 +136,16 @@ runs: if: inputs.pin-sha != '' env: PIN_SHA: ${{ inputs.pin-sha }} - REGISTRY_NAMESPACE: ${{ inputs.registry-namespace }} GATEWAY_CHART_DIR: ${{ steps.prep.outputs.gateway_chart_dir }} WORKSPACE_CHART_DIR: ${{ steps.prep.outputs.workspace_chart_dir }} shell: bash run: | set -euo pipefail - # See "Push Helm chart to GHCR OCI" for why pushes retry. + # See "Push Helm chart to Quay" for why pushes retry. push_chart() { local attempt for attempt in 1 2 3 4; do - if helm push "$1" "oci://${REGISTRY_NAMESPACE}"; then + if helm push "$1" oci://quay.io/ai-openshell/charts; then return 0 fi if [ "${attempt}" -lt 4 ]; then diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 6d301a39d1..563f5b1eed 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -560,8 +560,11 @@ jobs: needs: [release-dev, tag-ghcr-dev] runs-on: ubuntu-latest timeout-minutes: 10 + # Only jobs in this environment can trade their OIDC token for the Quay robot. + environment: release permissions: - packages: write + contents: read + id-token: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -572,8 +575,6 @@ jobs: chart-version: 0.0.0-dev app-version: dev release-kind: dev - registry-namespace: ghcr.io/ai-openshell/openshell - image-registry: ghcr.io/ai-openshell pin-sha: ${{ github.sha }} publish-fern-docs: diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 08fbefbcca..9779501707 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -303,8 +303,11 @@ jobs: needs: tag-ghcr-release runs-on: ubuntu-latest timeout-minutes: 10 + # Only jobs in this environment can trade their OIDC token for the Quay robot. + environment: release permissions: - packages: write + contents: read + id-token: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: