Repository navigation
revert(nvca): restore the nvca-operator chart copies and the previous chart publish check #2271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1216fae
8369b73
3e497b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../ai-tooling/dev/skills/nvca-chart-release |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../ai-tooling/dev/skills/nvca-chart-release |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../ai-tooling/dev/skills/nvca-chart-release |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| --- | ||
| name: nvca-chart-release | ||
| description: Release NVCA Operator chart changes from the native monorepo source to the vendored Helm chart. Use when updating the vendored NVCA Operator chart, changing NVCA image refs, publishing helm-nvca-operator, or validating the chart against a self-managed control plane. | ||
| license: Apache-2.0 | ||
| compatibility: Requires a local checkout of the NVCF monorepo with deploy/helm/nvca-operator/ and src/compute-plane-services/nvca/ present, plus helm and yq. | ||
| author: "nvcf-core-eng <nvcf-core-eng@exchange.nvidia.com>" | ||
| version: "1.0.0" | ||
| tags: [nvcf, nvca, helm, chart-release, self-managed] | ||
| tools: [Read, Grep, Glob, Shell] | ||
| metadata: | ||
| internal: false | ||
| author: "nvcf-core-eng <nvcf-core-eng@exchange.nvidia.com>" | ||
| version: "1.0" | ||
| tags: [nvcf, nvca, helm, chart-release] | ||
| languages: [bash] | ||
| frameworks: [helm] | ||
| domain: cloud-infrastructure | ||
| --- | ||
|
|
||
| # NVCA Operator Chart Release Workflow | ||
|
|
||
| Propagates Helm chart changes through the native monorepo paths: | ||
|
|
||
| | Component | Path | Purpose | | ||
| |-----------|------|---------| | ||
| | NVCA source | `src/compute-plane-services/nvca` | Operator and agent source plus source chart at `deployments/nvca-operator/` | | ||
| | Vendored chart | `deploy/helm/nvca-operator` | Vendors the source chart, applies self-managed defaults, publishes `helm-nvca-operator` | | ||
| | Self-managed stack | `deploy/stacks/self-managed` | Control-plane Helmfile deployment and environment defaults | | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. Make source changes in `src/compute-plane-services/nvca` when operator, | ||
| agent, or source chart behavior changes. Test them there. | ||
| 2. Vendor from the monorepo source chart at | ||
| `src/compute-plane-services/nvca/deployments/nvca-operator/`. | ||
| 3. Set the version inputs, either in the environment or in | ||
| `deploy/helm/nvca-operator/.env`: | ||
|
|
||
| ```bash | ||
| NVCA_OPERATOR_VERSION=<operator-image-tag> | ||
| NVCA_VERSION=<agent-image-tag> | ||
| NVCA_SHARED_STORAGE_IMAGE_TAG=<shared-storage-tag> | ||
| NVCA_OTEL_COLLECTOR_IMAGE_TAG=<byoo-otel-collector-image-tag> | ||
| ``` | ||
|
|
||
| `NVCA_OTEL_COLLECTOR_IMAGE_TAG` is normally left alone: it moves on its own | ||
| when `byoo-otel-collector` releases, driven by `tools/chart-version-bumper` | ||
| against the vendored chart directly rather than through this source-first | ||
| flow. Set it explicitly only when vendoring by hand; otherwise pass the | ||
| value already committed in `deploy/helm/nvca-operator/nvca-operator/values.yaml` | ||
| (`otelCollector.imageTag`) so an unrelated vendor run does not revert it. | ||
|
|
||
| 4. Vendor and validate from `deploy/helm/nvca-operator`: | ||
|
|
||
| ```bash | ||
| make vendor-chart | ||
| make lint | ||
| make template | ||
| make validate | ||
| ``` | ||
|
|
||
| 5. If the chart is tested against a local self-managed control plane, render | ||
| stack-aware values and install from this chart subtree: | ||
|
|
||
| ```bash | ||
| make render-values-from-stack stack_repo=../../../deploy/stacks/self-managed stack_env=local | ||
| make install-from-stack stack_repo=../../../deploy/stacks/self-managed stack_env=local | ||
| ``` | ||
|
|
||
| Use `additional_values=override.yml` for one-off validation. Do not edit the | ||
| stack just to test this chart. | ||
|
|
||
| ## CI and Release | ||
|
|
||
| Umbrella CI is declared in `tools/ci/subproject-validations.yaml` with | ||
| subproject id `nvca-operator`. Do not add a chart-local `.gitlab-ci.yml`. | ||
|
|
||
| Run the repository-wide Helm validation used by CI: | ||
|
|
||
| ```bash | ||
| tools/ci/check-helm-charts | ||
| ``` | ||
|
|
||
| ## Local Image Testing | ||
|
|
||
| When testing local images in k3d, build them from `src/compute-plane-services/nvca` | ||
| and import them into the test cluster. Keep tags explicit and match them in the | ||
| chart values: | ||
|
|
||
| ```bash | ||
| export NVCA_OPERATOR_VERSION=dev-local | ||
| export NVCA_VERSION=dev-local | ||
|
|
||
| # Run from src/compute-plane-services/nvca. | ||
| docker build -f docker/Dockerfile.nvca-operator \ | ||
| -t nvca-operator:$NVCA_OPERATOR_VERSION . | ||
| docker build -f docker/Dockerfile.nvca \ | ||
| -t nvca:$NVCA_VERSION . | ||
| ``` | ||
|
|
||
| Use the local-dev safety guidance before creating or deleting k3d clusters. | ||
|
|
||
| ## Gotchas | ||
|
|
||
| - `make vendor-chart` overwrites the vendored `nvca-operator/` chart. | ||
| - Chart release generation depends on Conventional Commit semantics at the | ||
| umbrella level. Use `feat` or `fix` when a chart release is required. | ||
| - Keep `image.*`, `nvcaImage.*`, `ngcConfig.*`, and `selfManaged.*` values in | ||
| sync with the stack and source image tags. | ||
| - Never commit service keys, kubeconfigs, rendered secrets, or local registry | ||
| credentials. | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,35 +23,37 @@ Use this skill from `deploy/helm/nvca-operator`. | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Values Flow | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Two install paths, and only one of them renders values from a stack. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ```text | ||||||||||||||||||||||||||||||||
| nvca-operator/values.yaml the chart's own defaults | ||||||||||||||||||||||||||||||||
| -> make install values=<path> the values file, used directly | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| stack environment | ||||||||||||||||||||||||||||||||
| -> scripts/render_values_from_stack_env.sh stack-aware generated values | ||||||||||||||||||||||||||||||||
| -> make install-from-stack the generated values | ||||||||||||||||||||||||||||||||
| src/compute-plane-services/nvca/deployments/nvca-operator/ source chart | ||||||||||||||||||||||||||||||||
| -> scripts/ci_vendor_nvca_operator_chart applies self-managed defaults | ||||||||||||||||||||||||||||||||
| -> nvca-operator/values.yaml vendored chart values | ||||||||||||||||||||||||||||||||
| -> scripts/render_values_from_stack_env.sh stack-aware generated values | ||||||||||||||||||||||||||||||||
| -> make install or make install-from-stack optional additional overrides | ||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Either accepts `additional_values=<path>` for further overrides. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Permanent Defaults | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Edit `nvca-operator/values.yaml` directly. There is one chart and no vendoring | ||||||||||||||||||||||||||||||||
| step, so that file is the source of truth. | ||||||||||||||||||||||||||||||||
| For defaults that every self-managed deployment should receive, edit | ||||||||||||||||||||||||||||||||
| `scripts/ci_vendor_nvca_operator_chart` and re-vendor: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Only defaults that suit every consumer belong there. Values tied to one | ||||||||||||||||||||||||||||||||
| deployment are supplied by whoever installs the chart: | ||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||
| make vendor-chart | ||||||||||||||||||||||||||||||||
| git diff nvca-operator/values.yaml | ||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| The vendoring script already applies defaults such as: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - the compute-plane stack sets them under | ||||||||||||||||||||||||||||||||
| `deploy/stacks/nvcf-compute-plane/`, including `nameOverride`, | ||||||||||||||||||||||||||||||||
| `fullnameOverride` and `selfManaged.nvcaVersion` | ||||||||||||||||||||||||||||||||
| - an ngc-managed install passes `ngcConfig.serviceKey` and the `helmManaged.*` | ||||||||||||||||||||||||||||||||
| values on the command line | ||||||||||||||||||||||||||||||||
| - `ngcConfig.clusterSource = "self-managed"` | ||||||||||||||||||||||||||||||||
| - `ngcConfig.serviceKey = "dummy-api-key"` | ||||||||||||||||||||||||||||||||
| - `image.tag` remains empty so templates use the published chart version | ||||||||||||||||||||||||||||||||
| - `selfManaged.nvcaVersion = "$NVCA_VERSION"` | ||||||||||||||||||||||||||||||||
| - `generateImagePullSecret = false` | ||||||||||||||||||||||||||||||||
| - `selfManaged.sharedStorage.imageTag = "$NVCA_SHARED_STORAGE_IMAGE_TAG"` | ||||||||||||||||||||||||||||||||
| - `nameOverride = "nvca-operator"` | ||||||||||||||||||||||||||||||||
| - `fullnameOverride = "nvca-operator"` | ||||||||||||||||||||||||||||||||
|
Comment on lines
+46
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Fix the listed vendoring defaults so they match Two listed defaults are wrong:
An agent that follows this list will assume the wrong cluster source and pull-secret behavior. 📝 Proposed fix-- `ngcConfig.clusterSource = "self-managed"`
+- `ngcConfig.clusterSource = "ngc-managed"`
- `ngcConfig.serviceKey = "dummy-api-key"`
- `image.tag` remains empty so templates use the published chart version
- `selfManaged.nvcaVersion = "$NVCA_VERSION"`
-- `generateImagePullSecret = false`
- `selfManaged.sharedStorage.imageTag = "$NVCA_SHARED_STORAGE_IMAGE_TAG"`📝 Committable suggestion
Suggested change
🧰 Tools🪛 SkillSpector (2.11.2)[error] 72: [PE3] Credential Access: Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts. Remediation: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths. (Privilege Escalation (PE3)) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| `image.tag` ships empty so templates fall back to `appVersion`, which the | ||||||||||||||||||||||||||||||||
| release stamps at packaging time. | ||||||||||||||||||||||||||||||||
| Do not edit `nvca-operator/values.yaml` directly for a permanent default. The | ||||||||||||||||||||||||||||||||
| next vendor run will overwrite it. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Deploy-time Overrides | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
@@ -67,6 +69,19 @@ make install-from-stack \ | |||||||||||||||||||||||||||||||
| Use deploy-time overrides for secrets, credentials, cluster-specific IDs, and | ||||||||||||||||||||||||||||||||
| temporary validation changes. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Adding .env Inputs | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| For version-like values that the vendoring script needs, add a variable to | ||||||||||||||||||||||||||||||||
| `.env`, require it in `scripts/ci_vendor_nvca_operator_chart`, and re-vendor: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||
| MY_NEW_CONFIG=some-value | ||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||
| update_yaml_key ".myConfig = \"${MY_NEW_CONFIG:?MY_NEW_CONFIG is not set}\"" "${TARGET_DIR}/values.yaml" | ||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Validation | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||
|
|
@@ -81,8 +96,6 @@ tools/ci/validate-helm-chart deploy/helm/nvca-operator/nvca-operator \ | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - Install-time values are layered after generated stack-aware values. | ||||||||||||||||||||||||||||||||
| - Use `yq` carefully for nested keys and quoted strings. | ||||||||||||||||||||||||||||||||
| - `Chart.yaml` name stays in git and must match the subproject's service_name; | ||||||||||||||||||||||||||||||||
| the release refuses to publish when they differ. Only the version is set at | ||||||||||||||||||||||||||||||||
| packaging time, and `appVersion` is stamped from the nvca release the chart | ||||||||||||||||||||||||||||||||
| installs. | ||||||||||||||||||||||||||||||||
| - Keep `Chart.yaml` name/version changes in the vendoring script when they are | ||||||||||||||||||||||||||||||||
| part of the self-managed packaging contract. | ||||||||||||||||||||||||||||||||
| - Never commit real service keys or rendered secret material. | ||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,7 +44,7 @@ OCI_REGISTRY_NAMESPACE ?= <your-org> | |||||||||||||||||||||||||||||||||||||||||||||||||||
| CHART_NAME := $(shell yq -r .name $(helm_dir)/Chart.yaml) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| CHART_VERSION := $(shell yq -r .version $(helm_dir)/Chart.yaml) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| .PHONY: install uninstall status lint template validate clean package push-oci render-values-from-stack install-from-stack test-render-values test-build-release-assets test-release-image-manifest test-release-artifact-permissions test-package-release-assets test-attach-release-assets test-release-sbom-wrapper test-self-managed-nvca-image-reference test-otel-collector-compatibility test-image-pull-secret-defaults test-pod-disruption-budget test-first-class-byoo-values test-first-class-storage-worker-values test-default-ownership test-resource-quantity-schema | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| .PHONY: install uninstall status lint template validate clean package push-oci sync-chart check-synced-chart render-values-from-stack install-from-stack test-render-values test-vendor-chart-image-tag test-build-release-assets test-release-image-manifest test-release-artifact-permissions test-package-release-assets test-attach-release-assets test-release-sbom-wrapper test-self-managed-nvca-image-reference test-otel-collector-compatibility test-image-pull-secret-defaults test-pod-disruption-budget test-first-class-byoo-values test-first-class-storage-worker-values test-default-ownership test-resource-quantity-schema | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| install: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ifndef values | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -92,6 +92,9 @@ install-from-stack: render-values-from-stack | |||||||||||||||||||||||||||||||||||||||||||||||||||
| test-render-values: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @bash ./tests/render_values_from_stack_env_test.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-vendor-chart-image-tag: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @bash ./tests/vendor_chart_image_tag_test.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-build-release-assets: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @bash ./tests/build_release_assets_test.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -188,3 +191,25 @@ push-oci: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "[push-oci] Cleaning up temporary package directory..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @rm -rf ./packaged-charts | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "[push-oci] Cleanup complete." | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Sync NVCA Operator chart from monorepo source chart | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| vendor-chart: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "🚀 [vendor-chart] Vendor NVCA Operator chart from local monorepo source..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @./scripts/ci_vendor_nvca_operator_chart | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "🎉 [vendor-chart] Vendor complete. Deployments available in $(helm_dir)/" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| check-vendor-chart: vendor-chart | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "🚀 [check-vendor-chart] Checking if chart is synced..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| @if ! git diff --ignore-space-at-eol --exit-code -- .; then \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "❌ [check-vendor-chart] Chart is NOT synced with source chart!"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "📋 To fix this issue:"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " 1. Run: make vendor-chart"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " 2. Review and commit the changes"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " 3. Update your merge request"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "💡 This ensures your deployment matches the monorepo source NVCA Operator chart."; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+203
to
+214
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Make
🐛 Proposed fix- @if ! git diff --ignore-space-at-eol --exit-code -- .; then \
+ @if ! git diff --ignore-space-at-eol --exit-code -- . || [ -n "$$(git status --porcelain --untracked-files=all -- .)" ]; then \
+ git status --porcelain --untracked-files=all -- .; \📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo "🎉 [check-vendor-chart] Chart is synced." | ||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: NVIDIA/nvcf
Length of output: 149
🏁 Script executed:
Repository: NVIDIA/nvcf
Length of output: 41028
🏁 Script executed:
Repository: NVIDIA/nvcf
Length of output: 7841
🏁 Script executed:
Repository: NVIDIA/nvcf
Length of output: 1897
🏁 Script executed:
Repository: NVIDIA/nvcf
Length of output: 12489
🏁 Script executed:
Repository: NVIDIA/nvcf
Length of output: 5696
🏁 Script executed:
Repository: NVIDIA/nvcf
Length of output: 1580
Use the Bazel image-load targets for local images.
The README says the legacy Dockerfile path is retired, and neither referenced Dockerfile is tracked. These commands can fail in a clean checkout. Load the Bazel images and retag them to preserve the
dev-localchart values:Suggested fix
🧰 Tools
🪛 SkillSpector (2.11.2)
[error] 110: [PE3] Credential Access: Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Remediation: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
(Privilege Escalation (PE3))
🤖 Prompt for AI Agents