Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
55 changes: 50 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ on:
required: false
type: boolean
default: false
helm-version:
description: "Optional exact Helm chart version override for stable Helm-only releases."
required: false
type: string
default: ""
update-ngc-metadata:
description: "Synchronize NGC metadata from the this branch."
required: false
Expand Down Expand Up @@ -148,6 +153,7 @@ jobs:
has_wheels: ${{ steps.plan.outputs.has_wheels }}
has_containers: ${{ steps.plan.outputs.has_containers }}
include_helm: ${{ steps.plan.outputs.include_helm }}
helm_version_override: ${{ steps.plan.outputs.helm_version_override }}
Comment thread
crookedstorm marked this conversation as resolved.
Resolved
update_ngc_metadata: ${{ steps.plan.outputs.update_ngc_metadata }}
send_notifications: ${{ steps.plan.outputs.send_notifications }}
dry_run: ${{ steps.plan.outputs.dry_run }}
Expand All @@ -173,6 +179,7 @@ jobs:
const updateNgcMetadata = isManual && inputs["update-ngc-metadata"] === "true";
const sendNotifications = inputs["send-notifications"] !== "false";
const dryRun = isManual && inputs["dry-run"] === "true";
const helmVersionOverride = isManual ? (inputs["helm-version"] ?? "").trim() : "";

let sourceSha = isManual ? (inputs["source-sha"] ?? "").trim() : context.sha;
const version = releaseType === "stable" ? (inputs.version ?? "").trim() : "";
Expand Down Expand Up @@ -271,6 +278,20 @@ jobs:
const wheelIds = wheels.map((wheel) => wheel.id);
const containerIds = containers.map((container) => container.id);

if (helmVersionOverride) {
if (
releaseType !== "stable"
|| !includeHelm
|| wheelIds.length > 0
|| containerIds.length > 0
) {
throw new Error("helm-version can only be used for stable Helm-only releases.");
}
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(helmVersionOverride)) {
throw new Error("helm-version must be a SemVer chart version.");
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
}
}

const nightlyTimestamp = releaseType === "nightly"
? new Date().toISOString().replace(/\D/g, "").slice(0, 14)
: "";
Expand All @@ -291,6 +312,7 @@ jobs:
core.setOutput("has_wheels", String(wheelIds.length > 0));
core.setOutput("has_containers", String(containerIds.length > 0));
core.setOutput("include_helm", String(includeHelm));
core.setOutput("helm_version_override", helmVersionOverride);
core.setOutput("update_ngc_metadata", String(updateNgcMetadata));
core.setOutput("send_notifications", String(sendNotifications));
core.setOutput("dry_run", String(dryRun));
Expand Down Expand Up @@ -643,6 +665,8 @@ jobs:
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ needs.plan-release.outputs.source_sha }}
fetch-depth: 0
Comment thread
mckornfield marked this conversation as resolved.
Resolved
fetch-tags: true
persist-credentials: false

- name: Set up Helm
Expand All @@ -669,6 +693,7 @@ jobs:
RELEASE_VERSION: ${{ needs.plan-release.outputs.version }}
RELEASE_LABEL: ${{ needs.plan-release.outputs.release_label }}
NIGHTLY_TIMESTAMP: ${{ needs.plan-release.outputs.nightly_timestamp }}
HELM_VERSION_OVERRIDE: ${{ needs.plan-release.outputs.helm_version_override }}
run: |
set -euo pipefail

Expand All @@ -680,17 +705,37 @@ jobs:
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm dependency build "${chart_dir}"

chart_version="$(yq -r '.version' "${chart_dir}/Chart.yaml")"
if [[ "${RELEASE_TYPE}" == "nightly" ]]; then
chart_version="${chart_version}-nightly-${NIGHTLY_TIMESTAMP}"
release_registry="${NIGHTLY_IMAGE_REGISTRY}"
else
# TODO: Decide whether stable chart versions should track the platform
# release version or remain independently managed in Chart.yaml.
chart_version="${RELEASE_VERSION}"
release_registry="${STABLE_IMAGE_REGISTRY}"
fi

chart_version="${HELM_VERSION_OVERRIDE}"
Comment thread
mckornfield marked this conversation as resolved.
Resolved
if [[ -z "${chart_version}" ]]; then
if [[ "${RELEASE_TYPE}" == "nightly" ]]; then
# Nightlies align to the release core from the latest release or
# RC tag. Build-metadata chart fixes use helm-version instead.
base_version="$(
git tag --merged HEAD --list \
| awk '
/^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$/ {
sub(/-rc[0-9]+$/, "")
print
}
' \
| sort -V -u \
| tail -n 1
)"
if [[ -z "${base_version}" ]]; then
base_version="$(yq -r '.version' "${chart_dir}/Chart.yaml")"
fi
chart_version="${base_version}-nightly-${NIGHTLY_TIMESTAMP}"
else
chart_version="${RELEASE_VERSION}"
fi
fi

yq -i ".platformConfig.platform.image_registry = \"${release_registry}\"" "${chart_dir}/values.yaml"
yq -i ".api.image.repository = \"${release_registry}/nmp-api\"" "${chart_dir}/values.yaml"
yq -i ".core.image.repository = \"${release_registry}/nmp-api\"" "${chart_dir}/values.yaml"
Expand Down
11 changes: 7 additions & 4 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ and select **Run workflow**. The form shows the allowed custom artifact IDs.
| `release-scope` | `all` by default. Select `wheels`, `containers`, `helm`, or `custom` for a subset. |
| `wheel-ids`, `container-ids` | Comma-separated IDs used only with `release-scope: custom`. Each ID must be in the catalog above; duplicates and empty entries fail validation. |
| `include-helm` | Includes the Helm chart in a custom release. |
| `helm-version` | Optional exact SemVer Helm chart version for stable Helm-only releases. The stable release label still comes from `version`. |
| `update-ngc-metadata` | Also runs the reusable NGC metadata workflow for `nemo-platform` and `nemo-platform-dev`. It checks out the workflow ref, normally `main`. |
| `send-notifications` | Sends Slack start and final-status notifications. Defaults to `true`. |
| `dry-run` | Validates the selected source and packages the selected Helm chart, but does not publish, dispatch external work, poll, create a GitHub release, or signal deployment. The start notification intentionally still runs when notifications are enabled. |
Expand All @@ -68,6 +69,7 @@ Examples:
| Stable full release | `release-type: stable`, `source-sha: <40-character SHA>`, `version: <MAJOR.MINOR.PATCH>`, `release-scope: all`. |
| One container | `release-scope: custom`, `container-ids: nmp-automodel-tasks`. |
| Helm-only validation | `release-scope: helm`, `dry-run: true`. |
| Stable Helm-only chart override | `release-type: stable`, `source-sha: <40-character SHA>`, `version: 0.1.0`, `release-scope: helm`, `helm-version: 0.1.0+helmfix1`. |

Nightlies also run automatically Monday through Friday at 8:00 PM
America/Los_Angeles.
Expand All @@ -84,10 +86,11 @@ America/Los_Angeles.
4. Dispatches wheel, container, and stable-release registration work to the
configured internal release repository. The selected source SHA, release
type, version, and selected IDs are passed with the dispatch.
5. Packages the Helm chart. A nightly chart uses the `Chart.yaml` version with
`-nightly-<UTC timestamp>` appended. A stable chart currently uses the
stable release version. Whether stable chart versions should instead remain
independently managed in `Chart.yaml` is an open policy decision.
5. Packages the Helm chart. A nightly chart uses the latest release or RC Git
tag core reachable from the selected source with `-nightly-<UTC timestamp>`
appended, falling back to the `Chart.yaml` version if no such tag exists. A
stable chart uses the stable release version unless `helm-version` is set for
a stable Helm-only release.
6. Waits for every selected final artifact to become public before continuing.
The polling job times out after four hours and sends a Slack alert after two
hours if it is still waiting.
Expand Down
Loading