Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 18 additions & 34 deletions .github/actions/release-helm-oci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
42 changes: 31 additions & 11 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.<sha> 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:
Expand Down Expand Up @@ -541,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:
Expand All @@ -553,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:
Expand Down
41 changes: 30 additions & 11 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -210,17 +212,24 @@ 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:
VERSION: ${{ inputs.semver }}
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.
Expand Down Expand Up @@ -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

Expand All @@ -287,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:
Expand Down
Loading