mirror of
https://github.com/dsx-ai-factory/nvke.git
synced 2026-12-07 04:35:58 +08:00
pull-request/2467
89
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4c9ed2ffb5 |
feat(e2e): run the kaps-bench smoke test on the perf stream (#2361)
* feat(e2e): run kaps-bench on the perf stream's tenant Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * feat(e2e): stage kaps-bench and helm on the perf stream's runner Today a CI perf run stops at the suite's early check: the job leaves E2E_KAPS_BENCH_DIR empty and the runner has neither kaps-bench nor helm. After this, a stream with kaps-bench run specs logs in to NVCR, sets up helm at the pinned version, copies kaps-bench and its folder out of the image pinned in make/tool-versions.mk, and checks them with list-run-specs. Each run also uploads kaps-bench-results.tar.gz with the other suite files. Every new step runs only for a stream with kaps-bench run specs, so other streams run as before and their plans do not change. kaps-bench-results.tar.gz holds kaps-bench's output dir alone: its kubeconfig sits in the suite's temp dir outside it, and kaps-bench never sees the jump hosts or the token issuer that the log scrub withholds. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * fix(e2e): check the kaps-bench binary before a machine is taken requireKapsBenchTools now refuses a kaps-bench folder with no runnable kaps-bench in it, and a folder path that is not absolute, so both fail before the site and tenant are built instead of at the first run spec. Flag help and docs list the binary among the folder contents, say the results archive is absent when no run spec got as far as writing an output dir, and say helm is needed and checked for a stream with kaps-bench run specs. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * feat(e2e): let kaps-bench install what its run specs need Perf stream policy now names the run spec smoke/smoke-prometheus.yaml in place of smoke/smoke.yaml. That run spec lists kube-prometheus-stack as something to install first, so kaps-bench installs it with the helm in its own folder and leaves it for the run specs that follow. nvke no longer installs Prometheus: the helm call and its embedded values file are removed, and the perf stream's runner no longer needs helm on PATH. requireKapsBenchTools also refuses a folder without a runnable bin/helm, so such a folder fails before the site and tenant are built. kapsBenchSetup is the renamed once-per-tenant setup and writes the cluster context. kaps-bench gets 5 minutes between SIGTERM and SIGKILL when a run spec reaches its limit. In that time it stops its engine, writes its final record and removes a chart it had half installed. 5 seconds was too short for that: a stop during a chart install took 11.2 seconds in a hand test. tenantToolRun takes the 5 minutes as a stop grace per tool, and AICR keeps 5 seconds and its 10 second wait. So that the grace fits inside the spec's limit, kaps-bench is stopped 39m50s into the first run spec and 24m50s into a later one. When a canceled command returns, every process group it listed gets SIGKILL straight away, so a child that ignored SIGTERM does not outlive the spec. AICR runs get the same. Each run spec keeps its time limit and token lifetime, and the perf stream keeps its suite timeout. In qualify-e2e.yml, the helm steps run only for the GPU runtime again, as on main. KAPS_BENCH_IMAGE stays at v0.3.1, which has no smoke-prometheus.yaml, so the perf stream stops at its early check until the pin moves to an image that has it. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * feat(e2e): give the perf stream's tenant a monitoring node Today the perf stream's tenant is one control plane and three workers, and nothing keeps the benchmark's Prometheus off the workers it measures. A stream can now ask for monitoring nodes with monitoringWorkers in release/policy.yaml, and the perf stream asks for one, so its tenant is one control plane, three workers and one monitoring node. Planning carries the value into the plan, the summary line and the matrix, and the run step passes it to the suite as -e2e.monitoring-workers. With it above 0, the suite asks the site controller for a second node pool, monitoring, whose nodes are labeled node-role.kubernetes.io/monitoring and tainted monitoring=true:NoSchedule, and labels the workers node-role.kubernetes.io/worker. Only Pods that tolerate the taint can land on the monitoring node. Pool labels and taints are applied by the controller while it provisions a node, before it lifts its own provisioning taint, so no node is schedulable without them. Both label keys sit under kubernetes.io, which the controller refuses unless its nodeMetadata.allowlistedLabelKeys lists them. A site the suite builds allowlists exactly those two keys, and only when the stream asks for a monitoring node. Taint keys under reserved domains are always refused, so the taint key is simply monitoring. Forge and DSX pool specs and the NICo and CAPD request builders now carry a pool's labels and taints where they dropped them, and the capacity check counts the monitoring node with the workers, since it takes the worker shape. A stream without the parameter, or with 0, runs as before: its plan, its run step's flags, the node pools in its create request and the site's controller values are all unchanged. Plans for every other scope are byte identical. Not proven before a real run: the tenant's OVN-Kubernetes DaemonSet comes from a bundle outside this repository. Upstream OVN-Kubernetes tolerates every taint, and this bundle was not read. If it does not tolerate monitoring=true:NoSchedule, the monitoring node never becomes Ready and the tenant create times out. kaps-bench does not place Prometheus on the monitoring node yet, so until its values select the node, Prometheus still lands on a worker. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * chore(e2e): follow the latest kaps-bench image Perf runs stage nvcr.io/j7sbcjl3qgta/kaps-bench:latest and pull it fresh each time, so every run gets the build kaps-bench main published last. A perf result can move with a kaps-bench change and no nvke change. Each run prints the image digest in its Stage kaps-bench step; compare digests before comparing two results. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * fix(e2e): redact the kaps-bench results archive kaps-bench-results.tar.gz now goes through the same substitution as nvkectl-diagnostics.tar.gz, with each withheld value and its base64 form replaced in every file of the archive. In the site lane the list is the one the site's archives get: the values withheldFromEnvironment returns and every credential the deploy places on the node. In the lane that builds no site it is the values withheldFromEnvironment returns. Perf runs follow the newest kaps-bench image, so what kaps-bench writes into its output folder can change with no change in this repository, and a failed connection's error text names the address it tried; a file with nothing to replace keeps its bytes. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * fix(e2e): refuse monitoring nodes on a tenant that gets the GPU runtime A run that installs the GPU runtime on its tenant and also asks for monitoring nodes now fails before a machine is taken: in the site lane's first step at stage full, and at the start of the tenant create in the lane that builds no site. GPU checks expect -e2e.tenant-workers GPU nodes, and the monitoring node takes the worker shape, so on a GPU run it would most likely count as one more. No stream runs that combination, so the suite refuses it up front. A run with the GPU runtime switched on and no GPU to install it on, as on the perf stream, still goes ahead and skips the runtime. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * fix(e2e): check the kaps-bench folder before the nico-forge lane creates a tenant Against a site the suite did not build, the nico-forge lane now checks the kaps-bench folder and its run specs at the start of the tenant create, as the site lane does in its first step at stage full. Until now that lane found a missing folder only once the tenant was up and its checks had run. A run without kaps-bench run specs passes the check as before. In the e2e README, nico-forge is now the only lane named as running on a site the suite did not build, since nico-dsx runs only on a site it builds. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> --------- Signed-off-by: Ganesh Reddy <gputta@nvidia.com> |
||
|
|
5412816acb |
feat(os-image): ship a CycloneDX 1.6 SBOM reconciled with dpkg beside each image (#2393)
* feat(os-image): ship a CycloneDX 1.6 SBOM reconciled with dpkg beside each image The node image now keeps each package's /usr/share/doc/<pkg>/copyright file, which provision.sh used to delete with the rest of /usr/share/doc, so syft can read licenses off the disk. extract-image-sbom.sh writes a CycloneDX 1.6 document beside the existing SPDX one. finish-image-sbom.py reconciles it with the image's dpkg status: each deb component records its dpkg Status, not-installed and config-files stubs are dropped, a package with no license gets an explicit NOASSERTION, license coverage is recorded and logged, and any name, architecture or version mismatch with dpkg fails the build. cyclonedx-cli, pinned in make/tool-versions.mk, then validates the document against the 1.6 schema. The workflow publishes the .cdx.json and its checksum beside the disk and the SPDX document. Part of #2202 Signed-off-by: Noah Kontur <nkontur@nvidia.com> * docs(os-image): describe the config-files exclusion as a policy, not file absence A config-files package can leave its configuration files on the image; the SBOM leaves it out because dpkg does not count it as installed. Signed-off-by: Noah Kontur <nkontur@nvidia.com> * fix(os-image): drop dangling doc symlinks and shorten SBOM comments Signed-off-by: Noah Kontur <nkontur@nvidia.com> * fix(os-image): fail on a package listed twice in the CycloneDX SBOM Signed-off-by: Noah Kontur <nkontur@nvidia.com> * docs(os-image): name only our own debs as shipping no copyright file Signed-off-by: Noah Kontur <nkontur@nvidia.com> --------- Signed-off-by: Noah Kontur <nkontur@nvidia.com> |
||
|
|
a83ace8713 |
refactor(controller): render the release CRDs from the controller chart (#2350)
* refactor(controller): render the release CRDs from the controller chart The NVKE controller and management-engine no longer share CRDs, so the nvke-crds subchart only added a helm dependency build step. Render the three release CRDs from the controller chart's own files/crds and remove the subchart, its Chart.lock and the build plumbing around it. Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> * fix(controller): address review of the chart-owned release CRDs Embed the controller chart file by file, so a stale charts/nvke-crds-*.tgz in an existing checkout is not embedded and rendered a second time. Point the generated-CRD check at the generator's fixed output path instead of the overridable CHART. Keep the .gitignore entries for built chart dependencies and dist/, which existing checkouts and the CLI build still use. Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> --------- Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> |
||
|
|
115a00db4e |
feat(e2e): install the tenant GPU runtime with AICR on the hardware lane (#2012)
* feat(e2e): give tools on the runner a relayed tenant admin kubeconfig AdminKubeconfig serves the suite's own client, which dials the tenant through the lane's endpoint relay in process. A tool the suite runs as a separate program on the runner, such as helm or aicr, reads a kubeconfig file instead, and the published API server address is not reachable from there. RelayedAdminKubeconfig renders the admin kubeconfig with each cluster's server rewritten to the relay's address and tls-server-name pinned to the published host, so certificate verification still holds. With no relay configured it returns the published kubeconfig unchanged. The token it mints can be given a lifetime, so a long-running install does not outlive its credential. mintJWTAs passes it to spire-server as -ttl; zero keeps the server's default. Signed-off-by: Ron Compos <rcompos@nvidia.com> * build: pin aicr for the Forge lane's tenant GPU runtime aicr renders, installs and validates the GPU runtime on the hardware lane's tenant. It runs on the lane's amd64 runner, so amd64 is the only digest needed. The digest is committed, not read from the release's checksums file, as for every other pinned tool. Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(e2e): install the tenant GPU runtime with AICR behind -e2e.tenant-gpu-runtime The hardware lane's tenant checks skip the GPU checks (36 and 37) because nothing installs a GPU runtime on the tenant. -e2e.tenant-gpu-runtime, off by default, adds two specs before the tenant checks: one renders AICR's generic Ubuntu training recipe for the run's gpu capability and deploys its bundle through a relayed admin kubeconfig, and one runs AICR's deployment checks and records each result in the spec's report. The tenant checks then expect every worker to advertise nvidia.com/gpu. AICR's catalog has no generic GB200 leaf, so aicr/ carries one as an overlay passed with --data. A run with no gpu, a gpu with no recipe, or an Ubuntu series other than 24.04 gets one skipped spec saying why, and both specs skip once an earlier check on the tenant failed. With the switch off the suite's specs are unchanged. Signed-off-by: Ron Compos <rcompos@nvidia.com> * ci(qualify-e2e): add the opt-in tenant GPU runtime switch A tenant-gpu-runtime dispatch input, or the QUALIFY_E2E_TENANT_GPU_RUNTIME repository variable on non-push runs, passes -e2e.tenant-gpu-runtime to the suite. qualify local takes the same switch as --tenant-gpu-runtime. The run logic is in release/hack/qualify-e2e.sh, so the switch is there too. The script forwards the stream's ubuntu capability, and with the switch on it adds 65 minutes to the suite's timeout, and so to go test's. The matrix carries a second job timeout 65 minutes longer, which the job takes when the switch is on, so the gaps between the three clocks stay the same. The workflow installs the pinned aicr, helm and kubectl when the switch is on, qualify local checks for them, and the run-inputs record lists the switch. Signed-off-by: Ron Compos <rcompos@nvidia.com> * build: pin aicr 1.2.0 for the NVKE recipe 1.2.0 is the first AICR release with an NVKE leaf, gb200-nvke-ubuntu-training. The digest is the linux_amd64 tarball's, checked against the release's aicr_checksums.txt. Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(e2e): install the tenant GPU runtime from AICR's NVKE recipe without the fabric The install rendered AICR's generic Ubuntu training recipe through a local GB200 overlay, because AICR had no leaf for NVKE. It has one now, and it carries what a generic recipe misses on NVKE: the toolkit reads config.toml directly (RUNTIME_CONFIG_SOURCE=file), without which its drop-in for containerd 2.3's version 3 config stops containerd starting; unprivileged pods cannot claim GPUs through NVIDIA_VISIBLE_DEVICES; and the DRA driver is 0.5.1. The recipe is now rendered with --service nvke. The overlay in aicr/ becomes a child of the NVKE leaf that turns off network-operator, sriov-ib-networks and rdma-modules. The InfiniBand fabric is used by nothing the lane checks, which has one GPU worker and no RDMA checks, and it needs ConnectX-7 firmware and partition membership the lane has not qualified. Turning it off in the recipe rather than at bundle time keeps aicr validate from expecting it. TestAICRRecipeLeavesTheFabricOut renders the recipe offline when aicr is on PATH, so a bump that renames the leaf or a fabric component fails before it reaches hardware. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): satisfy noctx and gofumpt in the AICR recipe test TestAICRRecipeLeavesTheFabricOut runs aicr through exec.CommandContext with the test's context, which the noctx linter requires, and aicrRecipeArgs puts its slice literal's elements on their own lines, as gofumpt does. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(qualify): require timeout or gtimeout for the tenant GPU runtime AICR's nvsentinel install will not apply its CRDs without a bounded timeout, and macOS ships neither timeout nor gtimeout. Check for one in the qualify local preflight and document it. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): expect every hardware tenant worker to advertise a GPU The Forge and DSX tenants leave workerPools out of their shape, since their builder makes -e2e.tenant-workers workers. Counting the shape's pools gave 0, so with the GPU runtime installed the GPU node check expected none and failed on the worker that advertised one. Fall back to -e2e.tenant-workers when the shape has no worker pools. Signed-off-by: Ron Compos <rcompos@nvidia.com> * docs(qualification): list timeout or gtimeout for the tenant GPU runtime Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): kill an AICR command's whole process group when its spec ends deploy.sh starts helm and kubectl, which hold the command's output pipe. Cancelling killed only bash, so Run waited on them and they kept installing into a tenant being torn down. Run the command in its own process group, kill the group on cancel, and bound the wait for the pipe. Also skip with the real reason when the run's capabilities cannot be read, rather than saying the run asks for no GPU, and test that the script's gpu_runtime_minutes matches the two specs' limits. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): make the GPU runtime unit tests hold where the backend lanes run them The backend E2E lanes run this package as a compiled binary away from the checkout, and go test runs every Test in it. TestGPURuntimeMinutesCoverTheSpecs now skips when qualify-e2e.sh is not beside the binary, as TestUnit_SiteNamespacesCoverTheDeployPath does, and the checkout-based unit lane still compares it. TestAICRCommandCancelKillsItsChildren probed the child by pid. In a container nothing may reap a killed child, and a zombie still answers kill -0, so the check failed though the child was dead. The child now beats into a file, and the test checks that the beats stop. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): stop every AICR descendant on cancel and require a deployment report Canceling an AICR command signaled only its own process group. AICR 1.2.0's CRD installer runs its step under GNU timeout without --foreground, which moves into a group of its own and forwards only signals it receives itself, so that step kept touching the tenant after run.try returned. Cancel now reads the command's process tree first (/proc on Linux, ps elsewhere), sends SIGTERM to every group in it, never the suite's own, and SIGKILL after a 5 second grace. The cancellation test gains a case under GNU timeout, forked rather than exec'd so timeout can leave the group, and skips it where the process list cannot be read. aicr validate exits 0 for a phase with no checks, and the spec checked only the exit status. aicrValidateResult now requires a successful exit and a report listing at least one check, keeping the command's own error. Also, from review: try keeps only the last 64 KiB of output for its failure message; kube.KubeconfigTokenExpiry reads the expiry of the admin token actually written, and the spec warns when it lapses before the spec's deadline; and RelayedAdminKubeconfig's relay failure is tested directly. Signed-off-by: Ron Compos <rcompos@nvidia.com> --------- Signed-off-by: Ron Compos <rcompos@nvidia.com> |
||
|
|
ce5887424e |
fix(build): pin an installable setup-envtest release (#2342)
Use the published standalone tool version instead of the release-0.24 branch, which no longer contains the setup-envtest package and fails both Gofail architectures before tests start. Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> |
||
|
|
f41e9b693c |
ci: version and release every component by the bare vX.Y.Z tag (#2164)
* ci: version every artifact by the bare v* describe
Every published artifact is now versioned by
`git describe --tags --always --match 'v*' "${GITHUB_SHA}"`, with no
component prefix, so component versions follow the nvke tag rather than
moving independently. The controller image, chart, provisioned provider
image, agent binaries and packages, nvkectl and the OS image resolve
their version this way, and the version is passed to each build so the
binaries report the same version they are published under.
The release registry describes and resolves components against the
bare v* tags, so a beta qualifies the artifacts its tag published.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: build and publish every component on a bare vX.Y.Z tag
Every component build that a vX.Y.Z-beta.N tag runs now runs on a bare
vX.Y.Z tag too: the controller and provisioned provider images, the
controller chart, the agent binaries and packages, the OS image and
nvkectl. The gates that admitted only beta tags admit any bare v* tag,
and nvkectl is versioned by the bare describe for both.
Beta-only behaviour is unchanged: a beta still skips DSX, stays out of
the apt index and bakes non-FDE images only. A release does all three.
promote-dsx now runs on vX.Y.Z, so it tags DSX with the bare describe
the NVCR copy was published under.
The beta flag in tag-publish.yml is removed, so nvkectl is published to
GHCR for every tag it is built for, betas included. cli-artifact.yml
versions it by the bare describe.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* build: version every module by the bare v* describe
The Makefiles, the root cmd_version and the scripts that derive the
agent version described against component tags (agent/v*, controller/v*,
cli/v*, os-image/v*, cluster-api-provider-provisioned/v*,
management-engine/v*). They now use
`git describe --tags --always --dirty --match 'v*'`, the version the
publish workflows already stamp, so a local or CI build reports the same
version as the artifact published from that commit.
The fallbacks for an untagged checkout and a build outside git are
unchanged, as is the agent's 0.0.0- prefix for an untagged .deb. The
e2e VALIDATE_VERSION now pairs with the nvke-validate image, and the
comments and log lines that named the old describe are updated.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* docs: describe one vX.Y.Z tag releasing every component
Components are no longer tagged on their own. The release docs, the
module AGENTS.md and README files and SECURITY.md now say one signed
vX.Y.Z tag releases the repository and every component built from it,
versioned by `git describe --tags --always --match 'v*'`.
docs/artifact-publication.md lists what each workflow publishes for a
release and for a nightly beta, and that an RC publishes nothing of its
own. The prefixed tag instructions, and the go get example that relied
on them, are removed. Mentions of past component tags that remain true
as history are kept.
The qualification docs and the qualify-e2e resolution input now say a
release, an RC and a beta are all qualified with commitDescribe, which
describes the commit the version marks and so resolves every component
to it. gitTag takes the highest v* tag in the repository and is not for
qualification.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: stop publishing artifacts from component release tags
A component release tag (agent/vX.Y.Z, controller/vX.Y.Z,
cluster-api-provider-provisioned/vX.Y.Z, os-image/vX.Y.Z, cli/vX.Y.Z) no
longer starts a publisher; a release is a bare vX.Y.Z tag. Component
release candidate tags still start the same workflows as before.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: publish every GHCR release artifact on vX.Y.Z
agent-artifact.yml, chart-publish.yml and image-validate-nvcr.yml only ran
on component tags, so a release published none of them. Each now runs on a
bare vX.Y.Z tag and versions by the bare v* describe. The controller and
provider GHCR promotions and the agent .deb GHCR push also run on vX.Y.Z
(not betas), since they were gated on component tags too and the GHCR
chart waits for the controller image there.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: name every tag build by its describe version, not the tag
The publishers versioned the build by the bare v* describe but still took
version aliases, GHCR promotion tags, the agent .deb version, the nvkectl
S3 release path and the os-image version from the tag name. On a component
RC tag the two disagreed, and on a vX.Y.Z tag agent-deb's GHCR push would
have been tagged with the commit SHA. Every one now uses the describe
version, which on the tagged commit is the tag itself.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: pass the describe version to build commands through the environment
The version is git describe output, which a tag name controls. It was
interpolated with ${{ }} into the run script of six build steps, so a tag
containing shell syntax would have run in jobs that hold registry
credentials. Each step now reads it from an environment variable.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: give component RC tags no version alias
A component RC tag still starts the agent and nvkectl publishers, and
they name the build by the bare v* describe. On a commit that already
carries a release tag that is the release's version, so the RC run would
move the release's alias to a new manifest. Only a bare v* tag now adds
the version alias; a component RC tag publishes sha-<commit> only.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: resolve every publisher's version through one checked script
Every publisher resolves its version through
release/hack/describe-version.sh instead of calling git describe itself.
A bare v* tag run is published under its own tag; any other run under
the v* describe. Before anything is pushed, the script refuses:
- a describe that is not a v* release, RC or beta, its describe suffix,
or a bare commit. The describe can name any v* tag on the commit, and
agent/Makefile passes it to the shell inside -ldflags.
- on a v* tag run, a tag that is not a version or does not name the
commit being built.
- on a component tag run, a commit a v* tag already names. Its describe
is that tag, so a component RC there would republish that tag's
.debs, images, charts and nvkectl.
Naming a tag run by its tag rather than the describe matters when the
commit carries several: git describe prefers the annotated release, and
of two lightweight betas the first by name. A beta re-run on a released
commit, or a second beta on one commit, now publishes under its own
version instead of another tag's.
release/hack/test_describe_version.py covers these cases against fixture
repositories, and runs with next-tag-test in the merge gate.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: let only a release version into the apt index and GHCR
agent-deb-publish.yml chose whether to update index.json, and whether to
push the .debs to GHCR, from the ref: anything but a beta tag did both.
An agent/v* RC tag carries no -beta., but its packages are versioned by
the describe, so on a commit past a beta it made that build installable
from apt and pushed it to GHCR.
The build job now reports whether its version is a bare vX.Y.Z, and both
follow that instead. A release enters the index and GHCR; a beta, a
component RC and anything else is uploaded under releases/<version>/ and
pushed to NVCR only.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: stamp the published version into standalone nvkectl builds
A dispatched cli-artifact, cli-artifact-nvcr or cli-s3-publish run with no
dist_artifact builds nvkectl itself. The build took its version from the
Makefile's own git describe, which on a commit with a beta and a signed
release names the release, while the run publishes under the beta it was
dispatched from. Pass the resolved version as NVKECTL_VERSION, as
tag-publish.yml already does, so the binary reports the version it is
published under.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: skip a beta dispatch of the GHCR chart publisher
A beta's controller image is never promoted to GHCR, so a chart-publish.yml
run dispatched from a beta tag waited up to 30 minutes for an image that
would not appear, then failed. Skip beta refs, as the automatic beta trigger
already does.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* test: cover the triggering-tag check and a bare RC in describe-version.sh
Every invalid tag in the existing test was also the commit's describe, so
the describe check refused it before the check on the triggering tag ran,
and disabling that check left every test passing. Tag the bad names beside a
valid signed release, which wins the describe, so only the tag check can
refuse them.
Also pin that the helper names a bare RC run by its tag: the publishers'
tag filters, not the helper, keep an RC from publishing.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
* ci: recover a vX.Y.Z agent package release by dispatch
A failed agent/vX.Y.Z publish could be recovered by dispatching Agent Deb
Publish from that tag with ref set to it. Releases are now vX.Y.Z, which the
ref check refused, and a SHA got past it only for every publish job to skip,
since their bare-tag arm requires a push.
Accept a vX.Y.Z ref when the run is dispatched from that same tag, and let
it into the apt intake, GHCR and NVCR jobs. The tag names the run's version,
so the index.json and GHCR gates still admit only a release. A beta is not
admitted, as before.
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
---------
Signed-off-by: Alex Pelavin <apelavin@nvidia.com>
|
||
|
|
2f31480b36 |
refactor(management-engine): own its CRDs in the service.nvke.nvidia.com group (#2306)
* refactor(management-engine): generate and install its own release CRDs management-engine keeps the MachineImage, ClusterRelease and NodePoolRelease CRDs it generates in config/crd/bases and installs all six from its own kustomization, instead of copying them into the nvke-crds chart directory that the NVKE controller now owns. Its tests, envtest suites and public-gen read only config/crd/bases, and chart-crds-check verifies each generator against its own committed files, so the two sets are free to diverge. Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> * refactor(management-engine): ship the release CRDs in its own Helm chart The management-engine chart carries the three release CRDs itself and drops its dependency on the NVKE controller's nvke-crds chart, along with Chart.lock and the chart-deps target. The release CRDs stay opt-in, as nvke-crds.enabled was, because a cluster can have only one Helm owner per CRD name. Set state.crds.releases.install=true to install them; state.crds.install=false still delegates every CRD to another installer. Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> * refactor(management-engine): move its API group to service.nvke.nvidia.com management-engine's kinds move from internal.nvke.nvidia.com to service.nvke.nvidia.com, so its CRDs are distinct from the NVKE controller's MachineImage, ClusterRelease and NodePoolRelease, which keep the internal group. CRDs, RBAC, registrations, samples and fixtures are regenerated for the new group. Existing objects under the old group are not migrated. Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> * refactor(management-engine): drop state.crds.releases.install The release CRDs no longer share names with the NVKE controller chart's, so the two charts can be installed on one cluster. state.crds.install controls all six CRDs again, as it did before the release CRDs became opt-in. The chart tests and helm-installation docs follow. Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> --------- Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> |
||
|
|
d03bd02584 |
refactor(controller): own the release CRDs in controller/k8s-apis (#2305)
The NVKE controller and nvkectl no longer import MachineImage, ClusterRelease and NodePoolRelease from management-engine. They are defined in a new module, controller/k8s-apis/v1, which generates their CRDs, tests them, and ships them through the nvke-crds chart, so the controller owns its release APIs end to end and no longer depends on management-engine's Go types. The API group is unchanged, so stored objects, RBAC and fixtures keep working. Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> |
||
|
|
c65ced3dca |
chore: remove the in-tree NKTP chart (#2300)
Signed-off-by: Vineeth Bandi <vbandi@nvidia.com> |
||
|
|
01adf8c11a |
feat(cluster-service)!: support combined and split Helm installs (#2145)
* feat(management-engine)!: support combined and split Helm installs Package state resources and manager workloads with independently selectable installation modes, validated configuration and existing credential references. Share canonical CRDs and RBAC across Helm and Kustomize, and document catalog ownership, retention and installation examples. Relates to NKX-19329, NKX-19330 BREAKING CHANGE: The chart separates state and controller configuration and uses the shared catalog CRD chart as an optional dependency. Follow the chart installation guide when upgrading existing values. Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> * fix(cluster-service): clarify catalog and metrics installation Include catalog APIs in the standalone state example and disable remote metrics until its scraper identity is configured. Keep state-only authentication permissions explicit while preserving combined local defaults. Document the co-located CSC target, maintained chart generation and NKTP integration requirements. Relates to NKX-19329, NKX-19330 Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> * refactor(cluster-service): restore Kubebuilder chart generation Generate the runtime chart from canonical Kustomize manifests with the pinned Helm plugin, then apply checked packaging hooks for deployment modes and credential references. Regenerate defaults in fresh staging and enforce chart drift checks. Restore conventional state source paths and package tenant catalog read permissions from the integrated API prerequisite. Prove source workload and RBAC edits propagate through generation into Helm renders. Relates to NKX-19329, NKX-19330 Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> * fix(cluster-service): preserve canonical chart inputs during generation Preserve envFrom and optional environment blocks, replace source connection flags with named chart settings, and distinguish argument values from protected flags. Check canonical state CRDs for drift and extend generation regressions. Relates to CLI-122, CLI-123 Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> * fix(cluster-service): retain current release channel schema after rebase Regenerate the canonical schema from current main so the packaging change preserves selector ordering and validation semantics. Relates to CLI-122, CLI-123 Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> * refactor(helm)!: name the chart cluster-service Use Cluster Service chart metadata, release defaults and example identities. Preserve the module and runtime identifiers for the later service rename; regeneration still uses the pinned Helm plugin. BREAKING CHANGE: chart name and default release, namespace and generated resource names change to cluster-service. This unreleased chart has no external consumers to preserve. Relates to CLI-122, CLI-123 Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> * fix(cluster-service): preserve namespace strings in chart RBAC Quote state and tenant RBAC namespaces, exercise the argument-filter table in chart checks, and document preserving development release names and selectors during the chart rename. Relates to CLI-122, CLI-123 Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> * docs(cluster-service): clarify tenant API integration ownership Map Services, routing, TLS/DNS, network access and internal operator access to chart packaging and site responsibilities. Link the exposure design and contract work and distinguish planned API packaging from current chart behavior. Relates to CLI-122, CLI-123, CLI-129 Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> * docs(cluster-service): define development package compatibility Pair chart source and runtime image by NVKE revision, identify pinned catalog compatibility, and explain repeat application to the same Helm release. Relates to CLI-122, CLI-123 Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> --------- Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> |
||
|
|
08d0bcd575 |
refactor(helm): extract shared NVKE catalog CRDs (#2166)
Extract the shared MachineImage, ClusterRelease and NodePoolRelease definitions into a catalog chart, preserving the NVKE controller’s default installation and ownership. Reuse canonical definitions across Helm, Kustomize, generation and CLI packaging. Closes #2165 Created with AI assistance Signed-off-by: Mark Stillwell <mstillwell@nvidia.com> |
||
|
|
b594eaf4b7 |
ci: deprecate GitHub releases for subcomponents (#2112)
* ci: stop creating GitHub releases and remove the changelog Publishing to GHCR, NVCR, S3 and the apt intake is unchanged. release.yml now only builds nvkectl for the cli publishers. The agent, NKTP and os-image release-page jobs, their checksums and attestations, verify-release-assets, malware-backfill.yml, CHANGELOG.md and cliff.toml are removed, and the docs no longer point at release downloads. Signed-off-by: Alex Pelavin <apelavin@nvidia.com> * ci: remove what the GitHub release removal orphaned ORAS_SHA256_AMD64 was read only by malware-backfill.yml, and os-image's agent_version step output only fed the release body. Two comments still described release-page behavior. Signed-off-by: Alex Pelavin <apelavin@nvidia.com> * ci: rename release.yml to tag-publish.yml It no longer creates releases. It gates every tag on the license checks, builds nvkectl for the cli publishers and records which workflow publishes each component tag. Signed-off-by: Alex Pelavin <apelavin@nvidia.com> * ci: drop the CHANGELOG.md exclusion from removed-settings-check Signed-off-by: Alex Pelavin <apelavin@nvidia.com> #2114 added the check while CHANGELOG.md still existed. It no longer does. * docs: correct publication destinations, fork-tag behavior and stale download notes - os-image tags put only the qcow2s on NVCR; the SBOMs, checksums and the checker go to S3. - A fork tag publishes nothing: every publisher checks the repository ID. - The custom-base-os cloud-init example does not install nvkectl. - SECURITY.md and plan-installation.md still described GitHub release checksums and release pages. Signed-off-by: Alex Pelavin <apelavin@nvidia.com> --------- Signed-off-by: Alex Pelavin <apelavin@nvidia.com> |
||
|
|
55b2a0029a |
refactor(dev)!: remove the deprecated CWE_* and NKE_CONTROLLER_* setting names (#2114)
* refactor(dev)!: remove the deprecated CWE_* and NKE_CONTROLLER_* setting names The controller's development, test and build settings read only their NVKE_CONTROLLER_* names now. The CWE_* and NKE_CONTROLLER_* aliases, deprecated since v0.23.0, are gone from the Makefiles, Tiltfiles, hack and CI scripts, the e2e framework and tests, and the docs. So are CWE_IMAGE (use CONTROLLER_IMAGE), the cwe_image key in tilt_config.json (use nvke_controller_image), --cwe-api in get-kubeconfig.sh (use --controller-api) and the cwe-name input of qualify-e2e.yml (use controller-name). local-backend-e2e.sh reads LOCAL_NVKE_CONTROLLER_IMAGE instead of LOCAL_CWE_IMAGE. BREAKING CHANGE: a value set under an old name, in .env, .env.tilt, tilt_config.json, a shell profile or a repository variable, is now ignored without a warning. Rename CWE_X and NKE_CONTROLLER_X to NVKE_CONTROLLER_X, except CWE_API (use NVKE_CONTROLLER_API_URL) and CWE_IMAGE in make -C cli images (use CONTROLLER_IMAGE). Rename LOCAL_CWE_IMAGE to LOCAL_NVKE_CONTROLLER_IMAGE and the cwe_image key to nvke_controller_image. get-kubeconfig.sh rejects --cwe-api (use --controller-api), and qualify-e2e.yml has no cwe-name input (use controller-name). Signed-off-by: Aaron Patten <apatten@nvidia.com> * ci: fail when a removed controller setting name comes back make name-check, which the merge gate runs, now also runs hack/removed-settings-check.py. It fails on any removed CWE_* or NKE_CONTROLLER_* setting name, LOCAL_CWE_IMAGE, cwe_image, --cwe-api or cwe-name in a tracked file, so a branch cut before the removal cannot bring a reader of an old name back. CHANGELOG.md is not scanned, and two look-alikes that are not controller settings are allowed by file. Signed-off-by: Aaron Patten <apatten@nvidia.com> --------- Signed-off-by: Aaron Patten <apatten@nvidia.com> |
||
|
|
0f48a09aa9 |
build: re-vendor CAPNICo v0.1.0 and local-path-provisioner v0.0.37 (#2100)
* build: bump the docker-images group across 5 directories with 4 updates Bumps the docker-images group with 1 update in the /agent directory: golang. Bumps the docker-images group with 1 update in the /agent/internal-scripts/docker directory: golang. Bumps the docker-images group with 2 updates in the /cli/internal/bootstrap/controllerdeploy/manifests directory: [dsx-ai-factory/cluster-api-provider-nico/controller](https://github.com/dsx-ai-factory/cluster-api-provider-nico) and rancher/local-path-provisioner. Bumps the docker-images group with 1 update in the /deploy/nico/capnico directory: [dsx-ai-factory/cluster-api-provider-nico/controller](https://github.com/dsx-ai-factory/cluster-api-provider-nico). Bumps the docker-images group with 2 updates in the /management-engine directory: golang and distroless/static. Updates `golang` from `9578611` to `2920bb1` Updates `golang` from `5c3e9b4` to `d9b6a1b` Updates `dsx-ai-factory/cluster-api-provider-nico/controller` from v0.0.45 to v0.1.0 - [Release notes](https://github.com/dsx-ai-factory/cluster-api-provider-nico/releases) - [Changelog](https://github.com/dsx-ai-factory/cluster-api-provider-nico/blob/main/CHANGELOG.md) - [Commits](https://github.com/dsx-ai-factory/cluster-api-provider-nico/compare/v0.0.45...v0.1.0) Updates `rancher/local-path-provisioner` from v0.0.31 to v0.0.37 Updates `dsx-ai-factory/cluster-api-provider-nico/controller` from v0.0.45 to v0.1.0 - [Release notes](https://github.com/dsx-ai-factory/cluster-api-provider-nico/releases) - [Changelog](https://github.com/dsx-ai-factory/cluster-api-provider-nico/blob/main/CHANGELOG.md) - [Commits](https://github.com/dsx-ai-factory/cluster-api-provider-nico/compare/v0.0.45...v0.1.0) Updates `golang` from `9578611` to `2920bb1` Updates `distroless/static` from `18f4cc2` to `25ac8f0` --- updated-dependencies: - dependency-name: golang dependency-version: 1.27.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: docker-images - dependency-name: golang dependency-version: 1.27.3-bookworm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: docker-images - dependency-name: dsx-ai-factory/cluster-api-provider-nico/controller dependency-version: v0.1.0 dependency-type: direct:production dependency-group: docker-images - dependency-name: rancher/local-path-provisioner dependency-version: v0.0.37 dependency-type: direct:production dependency-group: docker-images - dependency-name: dsx-ai-factory/cluster-api-provider-nico/controller dependency-version: v0.1.0 dependency-type: direct:production dependency-group: docker-images - dependency-name: golang dependency-version: 1.27.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: docker-images - dependency-name: distroless/static dependency-version: nonroot dependency-type: direct:production dependency-group: docker-images ... Signed-off-by: dependabot[bot] <support@github.com> * build: re-vendor CAPNICo v0.1.0 and local-path-provisioner v0.0.37 The image-only bump moved the tags but left every companion pin behind, which the repository's own guard tests caught. CAPNICo v0.0.45 -> v0.1.0 is a provider bump, not a digest refresh: the release ships a NicoIdentity CRD and controller, operatingSystemID on NicoMachine, primary DPU machine ID, failure-domain status backfill and Cluster API v1.13.6. Re-vendor capnico.yaml from the v0.1.0 infrastructure-components.yaml asset so the CRDs and RBAC match the image, re-apply the one NVKE-local edit (the manager's --reboot-annotation and --repair-annotation arguments, which upstream does not set), and regenerate the embedded copy and the stack template with `make -C cli capnico-manifest`. Move the pins that decide what actually runs: bootstrap-manifest.yaml holds the digest the default offline install uses, so a tag bump without it leaves v0.0.45 running. The digest is the multi-architecture index's, confirmed against the registry. local-path-provisioner v0.0.31 -> v0.0.37 the same way. The file declares itself verbatim from the upstream release, and v0.0.37 adds a health port, startup/liveness/readiness probes, a HEALTH_PORT variable and fully qualified image names that an image-only edit left out. Also move the references neither Dependabot nor the guard tests watch: LOCAL_PATH_PROVISIONER_VERSION, the e2e stack's manifest URL, and the docs that name either version. NicoIdentity is now served by the release the install deploys, so that note changes with it. controller/deploy/capd-e2e/capnico-crds/capnico-crds.yaml and controller/go.mod are deliberately untouched: those track the Go module ref, which is a separate bump. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback The FAQ pointed at a releases/download URL for the local-path-provisioner manifest, which 404s: the project publishes no release assets. Use the tagged raw path instead, the one the vendored manifest header and deploy/nvke-deploy-local.sh already use. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Check that cert-manager is ready before the bootstrap applies CAPNICo. v0.1.0 is the first CAPNICo release whose manifest creates cert-manager Certificate and Issuer resources, and installCAPICore skips clusterctl init, and with it cert-manager, on a kept cluster that already runs CAPI. Update the Helm install example to chart 0.1.0 to match the clusterctl path. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Terry Howe <thowe@nvidia.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
fc47b612f5 |
ci(release): tag a given commit, bump only on feat or fix, and cut an RC after a beta qualifies (NKX-18675) (#1962)
* ci(release): tag a given commit, bump only on feat or fix, and cut an RC after a beta qualifies (NKX-18675)
nightly-beta-tag.yml takes a commit input on workflow_dispatch. The commit
is tagged as the next beta without checking its publishers, but it must be
on main, carry the beta publishers, and not already have a beta tag.
hack/next-tag.sh reads the version from the commit subjects since the
latest GA tag: a feat or a breaking change bumps the minor, a fix bumps the
patch. With neither it prints nothing and exits 3. The nightly then
succeeds with a "nothing releasable" message, and a commit given by hand
fails. It also no longer fails on bash 3.2, which cannot add to a quoted
number.
A new rc job runs when a Qualify e2e run completes. If the run was started
by a beta tag push, succeeded, was not a dry run, and qualified scope
golden-path at stage full, it tags the beta's commit as the next
vX.Y.Z-rc.N of the beta's version, which release.yml publishes as a
pre-release. It skips a commit that already has an RC and a version that
already has a GA tag. It pushes only while the NVKE_AUTO_RC repository
variable is true, and otherwise says what it would tag.
hack/test_next_tag.py tests the bump rules against fixture repositories,
and runs in the shellcheck job as make next-tag-test.
Signed-off-by: Naveen Bhoomakkanavar <nbhoomakkana@nvidia.com>
* ci(release): count BREAKING CHANGE footers when choosing the version bump
next-tag.sh read only the subjects, so a breaking change marked by a
BREAKING CHANGE footer alone, as
|
||
|
|
8eed5173c8 |
feat(deploy)!: move the greenfield overlays and the release namespace to nvke-controller (#1889)
* feat(deploy)!: move the greenfield overlays and the release namespace to nvke-controller This moves them, and with them the persisted identifiers a site carries: the Helm release and its namespace, the database, and the Temporal namespace and task queue. In the three greenfield stacks: nameOverride, fullnameOverride, namespaceOverride, serviceAccount.name, serviceMonitor.name, appDb.dbName, the Temporal namespace and queue, the field managers and the managed-by values, tracing.serviceName, and the objects the stacks render around them -- the Namespace manifest, the Postgres CREATE DATABASE, the SPIRE admin ID and ClusterSPIFFEID namespace selectors, the auth-dev ConfigMap's namespace, the CAPD RBAC ClusterRole and its subject, and the spire-client probe URL. Consumers that move with it: controller/Tiltfile (release name, namespace, SPIRE admin path and the string-matched resource names), deploy/check-site.sh, the e2e site helpers and their collect script, cli/internal/bootstrap/controllerdeploy (including the NodePort Service nvke-controller-external), cli/internal/deploypath's admin path, management-engine/hack/nvke-controller.sh, and the CI lane scripts. The discovery paths search the new name first and keep the old one: nvkectl's authConfigNamespaces, nvke-token.sh, nvke-auth-demo.sh and dev-env-spire.sh now try nvke-controller, then nke-controller, then cloud-workflow-engine. The reference health dashboard matches all three workload names, and Tilt's preflight refuses to take over a cluster that still runs the nke-controller release rather than failing later. The published image keeps its name per #1554 decision 2, as do the nke-controller-config ConfigMap and the nke-controller-chart release artifact; hack/name-check-allowlist.txt now carries one entry per reason rather than one blanket token. Refs #1861, #1554, #1496, #1818 Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Name nke-controller as the intermediate namespace in the authentication docs, matching authConfigNamespaces, and restore the legacy node-agent audience in the exchange mock's test. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(e2e): point the nico bootstrap lane at the nvke-controller namespace The nico lane still asserted the tenant credentials Secret landed in nke-controller, so both e2e (nico) jobs failed after the rename. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(deploy): carry the nvke-controller rename into the rebased files The rebase onto main replayed the rename over two files that gained nke-controller references after the branch was cut: the management-engine dev overlay, which succeeds the hack script this branch had edited and was removed in #1918, and an API-authentication example added in #1935. Refs #1861 Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Continue namespace discovery past a Forbidden lookup in nvke-token.sh and nvke-auth-demo.sh. --ignore-not-found suppresses absence, not denial, so a kubeconfig scoped to nke-controller alone died on the nvke-controller probe before reaching the namespace it can read -- the migration case this branch adds. Keep the first denial, try the remaining candidates, and fail with it only when none was readable, since falling back to cloud-workflow-engine needs a confirmed absence. Refs #1861 Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
62d22e7dbb |
feat(qualification): add credential rotation evidence collector (#1380)
* feat(qualification): add credential rotation demo and evidence collector Redistribute the reviewed five-scenario collector and all evidence fixes from cff67ff5, 2bc9fd9c, 65a1b2d1, 568b1104, 2fafa32c and d9542b83 onto the finished native guides layer. Preserve fresh matching metrics, scheduled due-subset outcomes, required check aggregation, the bounded in-flight observer join and single-operation manual audit contract. Reference the separate immutable #1050 runbook rather than resubmitting it. Document inherited qualified-build, Kubernetes 1.34+, loaded-config/process-start and external-writer prerequisites. Offline validation does not qualify a deployment. Closes #1348 Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): accept an alert resolution received after the mutation started The alert lane required the resolved receipt at or after the collector-observed completion. RenewK8sCertsV2 renews control planes one at a time, so when the alert node renews before the last node, its inspection can resolve the alert while later nodes are still renewing. Alertmanager then delivers the single resolved notification before completion, nothing re-fires, and the lane failed with notification_delivery_incomplete after the forced renewal had consumed the warning-window precondition. Accept a resolved receipt at or after mutation_at, keep the receipt-ID pairing, require no firing receipt between that resolution and completion, and keep the final not-firing check. A test covers a resolution between mutation and completion and a re-fire after it. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): accept per-step T1 operation IDs and reject duplicate events The manual-T1 collector required every row to carry the single configured manual_operation, which removed the only way to keep repeated identical steps distinct: event_id hashes every field except the timestamp, so a repeated failed renew on one node collapsed into one row on export, and the collector also accepted duplicate event_ids. Accept manual_operation itself or with a per-step suffix /<action>-<n>, as the audit guide recommends, and reject a duplicate event_id with audit_event_duplicate. Revert the doc waivers in the audit guide and the credential lifecycle page that told operators to drop the suffix. Both pages and the demo README now also state that --cluster must be the exact kube-system namespace UID, which the collector already required. Links from those navigated pages to the demo README are absolute, like the other links to files outside the navigation. A test covers a repeated identical step, a duplicate event and a foreign run. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): report the collector's reason code and release a rejected output main reserved --output with O_EXCL and then reported every escaped error as one generic line. A config rejected before run's own error handling, or an aggregate error, lost its fixed reason code, and the empty 0600 file blocked a rerun to the same path with the same message. Print the CheckError code (or collector_input_or_protocol_error for other exceptions) to stderr, and remove the reserved file when nothing was serialized. A file that already existed is still never touched. A test reuses the path after a rejected config. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): fail when two control planes report the same node leaf T1 attributes whatever the configured ssh destination returns to that node, and validation only checks that ssh is non-empty. A copy-pasted destination recorded cp-2's certificates as cp-3's and could pass. Every certificate inventory now fails with node_certificate_attribution_ambiguous when two control planes report the same apiserver, etcd-server or etcd-peer fingerprint; shared CAs are unaffected. The existing manual inventory test now gives each node its own leaves, and new tests cover a duplicated leaf and a duplicated ssh destination. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): require the scheduled cycle to start after traffic started The scheduled lane read the prior cycle ID before the baseline metrics wait, and traffic started only afterwards, while scheduled() accepted any new scheduler cycle. A cycle accepted in that window was credited with continuous API traffic it never observed. Require the selected cycle's certificateRenewal.startedAt to be at or after traffic start, and stop at once with cycle_started_before_traffic otherwise. A test covers a cycle that appears during the baseline phase. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): keep polling a partially written T1 completion marker The documented cat > t1-completed.json <<'EOF' creates the marker before writing it, so a two-second poll could read an empty or partial file. read_json then raised ValueError, which wait_for does not retry, and the run failed after the manual maintenance had finished. Map empty or unparseable marker content to manual_completion_not_observed while waiting, so polling continues until the deadline. A test starts with an empty marker that becomes partial and then valid. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): validate kubelet serving inputs before any T2 mutation T2 config validation never checked kubelet_ca_file or each node's kubelet_address. Both are first read in serving_certificates, after the production renewal or rotation, so a missing key failed as collector_input_or_protocol_error only after the mutation ran. Require an existing kubelet_ca_file and a kubelet_address for every node in T2 scenarios during validation; manual T1 still needs neither. The offline config points kubelet_ca_file at an existing fixture file, and a test covers each missing input without contacting the cluster. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): require one deployed build across passed T2 reports The release index bound T2 reports only by checkout revision, cluster, kube-system UID and profile, and never compared the observed deployed_versions_before hashes. If the controller or agents were redeployed between lanes and expected_versions was updated as the README instructs, aggregate still passed scenarios that ran against different builds. Require identical deployed-version sets across passed T2 reports; manual T1 runs on another cluster and is excluded. A regression changes only one version hash. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): require the firing alert receipt before the alert lane mutates The collector accepts only the bundled receiver's nke.alert-receipt.v1 records and read them only after the forced renewal. Using the site's own receiver, or starting the helper after the last firing notification, failed the lane after the renewal had already consumed the warning-window precondition. Before starting the renewal, require a matching firing receipt in alert_receipts_file and fail with firing_notification_not_received otherwise. A test with only a resolved receipt fails before any mutation. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(qualification): state lane order, receiver, timeouts and T1 steps in the demo README Review corrections to hack/rotation-demo/README.md: - State the required T2 lane order (scheduled renewal before the forced and alert lanes) and the alert lane's staggered-expiry precondition before the first T2 command. - The bundled alert receiver is required, and a matching firing receipt must already exist before the alert lane starts; describe the resolved receipt window after the collector change. - Start the scheduled lane only when nextCertRenewalDue plus renewal and the next inspection fit inside timeout_seconds (at most eight hours). - List openssl and base64 as node prerequisites and describe the kubectl config view --raw read of kubeconfigs under sudo. - Show the one-time build before starting manual-t1 and the verify call separately, with a per-step operation ID. - Add timeout_seconds, sized for the whole T1 runbook and post-checks, to the T1 configuration list. - Link the in-tree site certificate renewal runbook instead of the pinned e76ea3db blob. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(operations): name the audit tool as the self-reported operator subject The rotation-demo exception inserted before "Its operator subject is self-reported" made "Its" read as the collector's. The exception now follows that sentence, and the sentence says "The audit tool's operator subject" explicitly. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * chore(qualification): ignore Python bytecode caches Running the rotation demo's tests or the other hack/ Python scripts outside the Makefile, which sets PYTHONDONTWRITEBYTECODE, leaves __pycache__ directories behind. That bytecode is build output, and some of it was nearly committed with the demo. Ignore it next to the other per-checkout scratch and tool caches. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): stop waiting on a duplicate audit event The T1 audit check runs inside wait_for, which retries every reason outside its fatal set until the deadline. A duplicate event_id cannot clear by waiting, because the guide forbids deleting ledger rows, so a run with a duplicate polled for up to timeout_seconds, as long as eight hours, before reporting audit_event_duplicate. Add the reason to the fatal set. The new test fails with must not retry when the reason is removed again. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(qualification): warn about an early scheduled cycle and redeploys in the demo README The scheduled-renewal lane fails with cycle_started_before_traffic when the scheduler accepts the cycle while the lane is still in its baseline checks. That cycle has already renewed the due node, so the next one is a no-op and the cluster cannot qualify until its certificates approach expiry again. Tell operators to start the lane early enough that the baseline checks finish before nextCertRenewalDue. The release-index section also did not mention that passed T2 reports must share the observed deployed versions, which aggregate enforces with release_deployed_versions_mismatch. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(qualification): describe the rotation demo as a collector and name the NVKE controller Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): record an interrupted demo run as failed evidence Ctrl-C raised KeyboardInterrupt past run and main, leaving an empty reserved output file and losing the record that a workflow had started. run now returns a failed report with reason interrupted, mutation_started and the workflow hash. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(rotation-demo): require provenance and pin traffic to the approved cluster Release aggregation now rejects reports without Boolean source cleanliness and passed reports without well-formed hashed deployed versions. Continuous API traffic pins the approved API server and checks the kube-system UID on every sample, so target drift fails independently of the outage budget. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(rotation-demo): accept zero audit counters at baseline The controller creates every credential audit result series at zero and a restart resets them, so a quiet site has no stored writes before the mutation. The baseline now requires the stored series and no failure increase only; positive stored evidence is required after the mutation. A zero-series fixture covers both checks. The README now shows the lanes in run order, keeps the alert node's leaves between thresholdDays and warningDays with a different scheduled candidate, and gates the scheduled lane on nextCertRenewalDue. The three guides state the exact /<action>-<n> suffix form and its 1-99 bound. Addresses review threads r4335395773, r4335396217, r4335396675, r4335397034 and r4335397446. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(qualification): address rotation demo review findings - N1: document that cwe_authorization_file holds "Bearer <token>" for the controller audience, is reread per request, and must stay valid until the lane ends. - F3: release the reserved output only before writing starts, so an fsync failure keeps the written evidence. - F4: time out a stalled alert webhook body. - F5: compare deployed builds independent of node order. - F11: require the node name as --node for demo-observed T1 rows in both guides. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(rotation-demo): address review comments on audit and metric checks Compare the audit-write failure counter, including rate_limited, between the baseline and the final sample instead of a trailing 10m window. Report an absent CSR age series as csr_metric_missing, require cluster_name for T2 lanes, drop the unreachable worker branch and the unrun PromQL sample file, and run the offline tests from name-check so the merge gate runs them. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(rotation-demo): stop on past notification failures and pick receipts deterministically Applies review suggestions: notification_order_invalid and notification_refired_before_completion describe past events that polling cannot clear, so wait_for stops on them; alert_receipts checks receipts in sorted order and keeps the first specific reason, so one invalid receipt no longer hides a valid one depending on set order; public-certificates.sh accepts only the control-plane role, the only one demo.py sends. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(rotation-demo): address review findings on receipts, audit resets and docs Report a specific receipt failure only once no fired receipt still awaits its resolution, fail the lane on any audit failure counter reset since the baseline, document that a controller restart during a lane fails it, require Temporal CLI 1.1.1, anchor the recovery link, and label the name-check job as also running the rotation-demo tests. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> --------- Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> |
||
|
|
d31f15e302 |
fix(ci): run e2e lanes only for pull requests that change their inputs (#1867)
A mirror push to pull-request/<n> carries the base branch's new commits, so each lane's push paths matched files the pull request never changed and docs-only pull requests started self-hosted e2e. The shared filter now matches the pull request's files against the calling lane's own on.push.paths, with GitHub's path-filter rules, after dropping docs, Markdown and unit-test files outside e2e/ and test/ directories. nvkectl-bootstrap, kubeadm-bringup, os-image-efi and nktp are gated on it too. make lint-workflows runs the rules' tests and fails when a self-hosted mirror lane with push paths is not gated on the filter. Signed-off-by: Aaron Patten <apatten@nvidia.com> |
||
|
|
adeb0c3e1e |
feat(controller): monitor credential expiry and lifecycle health (#1377)
* feat(controller): monitor credential expiry and lifecycle health Port the reviewed NKX-15682 inspection RPC, persisted inventory/exporter, direct-API CSR observation and optional alert rules onto the completed rotation layer. Keep monitoring independent of renewal and preserve last-success freshness on failed probes. Retain ParseConfigFromEnv startup and the unmounted current-main config map; render monitoring fields in both surfaces with parity regressions. Regenerate proto and chart documentation using exact pinned tools. Sources: c903c3ca2b24b52d3e4dc563e6e6f81ce0e77af3, 12e425e01dcb7a229ab1bf7caf507fdb44e8ff18 and 00a82a9bb8b4d81e98332a2270f04f991cf20188. Inherit rotation safety and deterministic notices without duplicating their changes. Closes #1345 Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(controller): keep certificate observations available across a failed probe certificate_observation_available used observation.Available, which reflects only the latest attempt. A failed probe keeps the last good ObservedAt and certificates, but every per-credential series dropped to zero, so a firing NVKECertificateExpiring resolved on any transient failure and agent rollouts made it flap fleet-wide. Derive certificate_observation_available from the age of the last successful observation (ObservedAt within observationMaxAge) and keep certificate_inspection_available tied to the latest attempt. A collector test covers a failed attempt within and after observationMaxAge, and a promtool fixture shows the expiry alert staying firing while inspection is unavailable. The monitoring guide describes both series. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(controller): inspect certificates with a bounded worker pool The certificate-inspection controller registered with default options, so it ran one reconcile at a time, each with a 30s probe deadline. Unreachable agents are re-probed every 1-32 minutes and held the only worker, so healthy nodes queued behind them and could age past observationMaxAge. Register through dbreconcile.AddController with eight workers, the agent-readiness controller's default for the same probe pattern. A manager-level test blocks one node's probe and requires another node to be inspected meanwhile. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * ci(chart): assert the credential PrometheusRule is absent when disabled The default-off and global.monitoring.enabled=false renders were asserted only by a Go test that skips without helm, and the charts unit lane installs no helm, so the gate never checked either contract. The assertions script that chart-check runs with the pinned helm now renders the whole chart in both cases and fails if a PrometheusRule appears. The monitoring guide lists the new assertions. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * ci(chart): pin the PrometheusRule schema and trigger the chart job on its inputs chart-check validated the rendered PrometheusRule against a schema fetched from the mutable main branch of datreeio/CRDs-catalog with no digest, so an upstream change could turn the gate red, or change its result, for an unchanged commit. Fetch the schema from catalog commit 501527ab and verify it against a sha256 committed in make/tool-versions.mk, as the promtool download already is. The script's pin() helper printed an empty string for a missing or renamed name, which surfaced only after minutes of 404 retries. Read promtool and schema pins through hack/read-tool-version.sh, which fails at once on an unknown name. The chart.yml push filter did not cover the inputs chart-check now reads, so a main commit touching only them ran no Chart job. Add controller/deploy/monitoring/**, make/tool-versions.mk, hack/check-tool-version.sh and hack/read-tool-version.sh. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * test(controller): allow repeated certificate-inspection manager setup in tests controller-runtime keeps a process-wide registry of controller names, so the manager-level inspection test failed under go test -count=N with "controller with name certificate-inspection already exists". Keep the registered name in an unexported field, unchanged in production, and give the test a unique one. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(controller): fire credential availability alerts only when monitoring is enabled All credential rules ship as one PrometheusRule, so the availability rules cannot be disabled individually. With credentialMonitoring.enabled=false and alerts enabled, the collector still exports unavailable inspection and CSR series while the inspector and observer are off, so NVKECertificateInspectionUnavailable and NVKEKubeletServingCSRObservationUnavailable fired for every node and cluster. Gate both rules on nvke_controller_credential_monitoring_enabled == 1. Promtool fixtures cover the disabled case and keep the existing firing cases enabled. The monitoring guide and the credentialMonitoring.enabled value description state the coupling; the chart README row follows the value comment. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(controller): correct credential monitoring schema, CA and threshold notes - Every run of the alert assertions fetches the pinned PrometheusRule schema, so the check is never fully offline; the guide now says so. - "use manual CA procedure for a CA" pointed nowhere. NVKE ships no CA rotation procedure and does not rotate CAs, so the response is to escalate, linking the renewal guide that says so. - thresholdDays was documented as 7 through 90, but with monitoring enabled warningDays must exceed it by two renewal intervals, which limits it to 44 with the defaults. The values comment, the chart README row and the guide's table state the coupling. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * refactor(controller): append the credential observation fields to their structs CertificateInspection was inserted before ID in db.Node, and CredentialCSRs before the existing ClusterConditions fields. Contributor guidance asks for new fields after existing ones, so move both to the end of their structs. The JSON and bun column names are unchanged and the tree has no positional literals of either struct. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * ci(chart): fail the credential alert absence check when helm fails The disabled-rule check piped helm template into grep inside an if condition. set -e does not apply there and pipefail turns a failed render into a false condition, so a template error in either disabled render read as "no PrometheusRule" and the check passed. Render each case to a file under set -e first, then grep the file. With a helm wrapper that fails only the global.monitoring.enabled=false render, the script now exits 1; before this change it exited 0. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(controller): say expiry alerts stop only after observationMaxAge With monitoring disabled the collector keeps exporting the last successful observation until it is older than observationMaxAge, so the expiry and missing-certificate alerts can keep firing for up to that age (3h by default). The guide said no rule reports them once monitoring is disabled. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * test(controller): require concurrent certificate probes regardless of node order The worker-pool test blocked one named node and required the other to be inspected meanwhile. With a single worker it failed only when the blocked node was dequeued first, which depended on ListNodes returning rows in insertion order, and ListNodes has no ORDER BY. Block every probe instead and require two probes to be in flight at the same time. That needs a second worker whichever node comes first. With inspectionWorkers set to 1 the test fails after 10s. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(controller): gate stale and failed CSR alerts on credential monitoring With credentialMonitoring.enabled=false the CSR observer is not registered, but the collector keeps exporting the last stored CSR inventory and its pending age keeps growing, so NVKEKubeletServingCSRStale and NVKEKubeletServingCSRFailed kept firing on a frozen snapshot. Gate both on nvke_controller_credential_monitoring_enabled like the availability alerts, and cover the disabled case with a promtool test. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * build: run chart-check in preflight for credential alert fixtures controller/deploy/monitoring/credential-alerts-test.yaml is only consumed by promtool inside chart-check, but preflight did not route that directory to chart-check, so a fixture-only change skipped it locally. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(controller): state renewal setting limits in the renewal guide certRenewal.interval and thresholdDays now have enforced ranges, and with credential monitoring enabled warningDays must exceed thresholdDays by two renewal intervals, so installs with thresholdDays above 44 fail to upgrade. Say so where operators configure renewal and link the monitoring rule. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(controller): mark the gated CSR alerts in the response table Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(controller): name the credential monitoring ConfigMap as main now does Main renamed the chart's default controller ConfigMap to nvke-controller-config, so the guide's lookup for these settings found nothing on a default install. The guide now names controllerConfig.name with its default, and the new comments use the current name. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(credential-monitoring): give kubelet certificates their own expiry alert The kubelet rotates its client and serving certificates itself at 70-90% of their lifetime, so NVKECertificateExpiring's warningDays window fired on healthy rotations. NVKECertificateExpiring now excludes kubelet-client and kubelet-serving, and the new NVKEKubeletCertificateExpiring rule warns when either has fewer than a fixed seven days left, which only happens when kubelet rotation has stopped working. Promtool fixtures cover 40 and 6 days for both kubelet certificates and a kubeadm leaf inside warningDays. The monitoring guide also names the metrics NetworkPolicy namespace requirement and says inspection availability keeps its stored value until observationMaxAge when monitoring is disabled. Addresses review threads r4335329332 (seven-day kubelet threshold), r4335329829 and r4335330237. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(credential-monitoring): match controller duration bounds and env inventory Fixes PR #1377 review findings F1 and F2. F1: the chart compared duration bounds in whole seconds, dropping any fractional second, while the controller compares exact time.Duration values. Compare in nanoseconds so the chart refuses exactly what Validate refuses, and add the sub-second refusals and accept render to the assertions script. F2: the CREDENTIAL_MONITORING_ENABLED, CERTIFICATE_INSPECTION_INTERVAL, CERTIFICATE_OBSERVATION_MAX_AGE and CERTIFICATE_WARNING_DAYS variables never existed, so drop them from controller-config-env.yaml and list their keys in configMapOnly. The drift test now refuses a key in both. The guide limits the "no longer reads" sentence to the former CERT_RENEWAL_* variables. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(credential-monitoring): escalate stuck accepted renewals from alerts The renewal Stuck and Overdue alerts told operators to confirm termination and then release ownership or retry. Certificate renewal now treats an accepted cycle whose Temporal execution has closed as stop-and-escalate: the lock must not be released, the cycle ID not restarted and no forced cycle started. The Stuck alert now asks whether the workflow is still running and, if it has closed while the cycle is accepted, to stop maintenance and escalate. The Overdue alert defers to that response when a cycle is still accepted. The alert table matches, and the Failed row states the full automatic retry condition. The promtool fixtures carry the new descriptions. Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * docs(credential-monitoring): correct renewal margin, retry and two-voter notes Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> * fix(credential-monitoring): write certificate inspection column-only and reject zero observed time Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> --------- Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com> |
||
|
|
e7ebbc4b1b |
feat(controller): read chart-rendered API authentication from nvke-controller-config (#1812)
When the chart renders the API authentication configuration (apiAuth.configMap.create), the controller now reads it from an apiAuth section of nvke-controller-config instead of the file at AUTH_CONFIG_PATH. auth/authn stays the only owner of the schema: the section reuses authn.Issuer and is validated with the new Config.ValidateStartup, which authn.Load also uses. The section is required and carries an explicit enabled switch, so a missing section is a startup failure rather than "off". A section filled in but switched off is refused, and enabling it while AUTH_CONFIG_PATH is set is a startup failure. A ConfigMap managed elsewhere keeps the AUTH_CONFIG_PATH path, and the chart still renders the authentication ConfigMap for nvkectl and extraFiles. The CAPD e2e lane moves to the chart-rendered configuration; Tilt and capnico-e2e keep the external ConfigMap, so CI covers both. The e2e suite and the token and demo scripts treat either source as authentication being on, whichever name the settings ConfigMap has. The auth-mode gauge now follows whether authn.Setup built an authenticator. Also renames the remaining references to the settings ConfigMap, nke-controller-config, to nvke-controller-config, the chart's default since #1769, in docs, comments, test messages and help text. Kept: the legacy pins and fallbacks for installs that predate the rename, and the "Loaded nke-controller-config" startup log line, which the e2e OIDC site helper matches and released images still print. Includes the design doc, controller/docs/api-auth-in-controller-config-design.md. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
e8a2f270bc |
feat(cli): scan the bootstrap e2e output for credentials and check its trace ID (#1823)
* ci(cli): scan the bootstrap e2e output for credentials The bootstrap e2e run now scans the bootstrap log and the diagnostics bundle with gitleaks, on success and on failure, so a change that starts printing a secret turns the lane red. The scan uses its own rules, cli/e2e/bootstrap/gitleaks.toml, on top of the defaults. The defaults skip a random 32-character hex password about one time in five, because of their entropy threshold, and have no rule for a password in a Postgres URL. The added rules cover a credential passed to helm, a password in a database URL, and a password field in JSON or YAML, without an entropy threshold, and let nvkectl's <redacted> placeholder through. Three hashes are allowed, because the default generic-api-key rule reads them as credentials and they are not: the SHA-256 of the etcd encryption key that nvkectl logs beside the key file, the fingerprint of the API encryption key that the node agent logs, and kubeadm's public --discovery-token-ca-cert-hash. Each is limited to that rule and matched on its own text. The etcd line is anchored to the end of the line. The other two match the finding, not the line, because the same log line carries the join token and the certificate key, which are credentials and are still reported. Before it trusts a clean result, run.sh proves the rules on a sample of each shape: flagged with a value, clean with the placeholder or an allowed hash, and the same lines under another message, or beside a join token, flagged. CI sets NVKECTL_E2E_REQUIRE_SECRET_SCAN=1 so a runner without gitleaks fails instead of skipping the scan. gitleaks is installed by a new setup-gitleaks action, which verifies a committed digest on amd64 and arm64. The arm64 digest is new. Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * feat(cli): collect bootstrap diagnostics on success with --verbose bootstrap site collected its cluster diagnostics only when it failed, so a healthy run's pod logs and cluster state were never available to inspect. With -v/--verbose the same bundle is written, redacted, on any outcome, before the bootstrap cluster is torn down. Operators get a support bundle from a healthy run, and the e2e lane can scan it for credentials. Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * ci(cli): scan the success-path diagnostics and assert the trace ID in bootstrap e2e The lane runs bootstrap site with -v so a passing run writes its diagnostics bundle, which includes the controller's pod logs, and the credential scan covers it. Before trusting a clean result, the scan is also driven with a secret planted in the log, in a diagnostics file and in a pod log; each must fail it. The lane also checks the trace ID: a Trace ID line first and last with the same value, and that value on every nvkectl log record. Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * ci(cli): allow the SPIRE CA file paths nvkectl logs in the bootstrap secret scan The first CI run flagged the 'SPIRE upstream CA from the environment' line: it names the CA key file's path, not its contents, and the default generic-api-key rule reads the key-like path and the span ID as a credential. Allowlist that one message for that one rule, anchored to the end of the line like the etcd fingerprint line, and add it to the rules' clean samples. Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * ci(cli): correct the bootstrap diagnostics comment now that a passing run writes them Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * ci(cli): test that the SPIRE CA allowlist is needed and stays narrow The clean sample used a trivial span ID, which the default rule does not flag even without the allowlist, so it never exercised it. Use random-looking IDs and add a flagged sample: the same line with a field appended after the span ID, which the end-anchored allowlist must refuse. Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * ci(cli): address review of the bootstrap e2e scan Do not publish a credential the scan found: run.sh removes the diagnostics bundle when the scan reports a finding or cannot run, because the failed job uploads that directory. Cover two forms of a password the existing field rule missed: an unquoted field, as kubectl describe and YAML print it, and a literal environment variable in a JSON pod spec. A boolean or null where a password field is expected is not a credential. The self-check gains flagged and clean samples for both. With -v, a failure after the site cluster is handed over also collects diagnostics, so say so in the troubleshooting page and the handedOver comment. Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * ci(cli): match the etcd and SPIRE allowlist lines from start to end The two allowlists matched the line from its message to its end, with any fields allowed between the message and the path, and nothing checked what came before the message. A credential-shaped field in either place was allowed along with the line. Match the whole line from "time=" to its end and name every field. (?m) is needed because gitleaks hands over every line but the first with a newline in front. The self-check gains flagged samples with a field before the message and between the message and the path, and its clean etcd samples now look like the real line. Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * docs(cli): reword the allowlist comments in the bootstrap e2e scan Say what the samples guard against, and describe the allowlists as matching the whole line rather than anchored to its end. Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> --------- Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> |
||
|
|
8040adbfb4 |
fix(os-image): pin the Ubuntu installer ISO by committed digest (#1703)
* fix(os-image): pin the Ubuntu installer ISO by committed digest
ISO_CHECKSUM defaulted to file:<the mirror's own SHA256SUMS> -- for amd64
releases.ubuntu.com/<series>/SHA256SUMS, for arm64 the cdimage equivalent.
prepare-installer-iso.sh fetched that manifest and verified the downloaded
ISO against it. Both come from the host serving the ISO, so a host that
substitutes the image serves the matching checksum beside it: the check
could confirm an intact download, never reject a substituted one.
make/tool-versions.mk already states the rule this violated -- "A checksum
served by the same host as the artifact shares its compromise boundary; a
committed one does not" -- and every other artifact in the repository
follows it. The installer ISO, the largest single input to the node image,
was the exception.
Commit the four digests the build can ask for, one per point release per
architecture, taken from Canonical's SHA256SUMS and verified against the
SHA256SUMS.gpg beside it with the Ubuntu CD Image Automatic Signing Key
(2012), 8439 38DF 228D 22F7 B374 2BC0 D94A A3F0 EFE2 1092.
ISO_CHECKSUM now carries either form, matching Packer's own iso_checksum
spelling:
sha256:<hex> the committed pin, and the new default
file:<url> a SHA256SUMS-style manifest, kept as the override for a
locally served or non-Canonical ISO
Both consumers branch on the prefix: prepare-installer-iso.sh, and the
os-image-cache workflow, which resolved ISO_CHECKSUM and curled it as a URL
and would otherwise have broken on the new default.
A release with no committed digest leaves nothing after "sha256:", which
prepare-installer-iso turns into a named failure telling the caller which
variable to add, rather than building against an unverified ISO.
This does not touch the material manifest that prepare-packer-inputs writes.
That digest is computed from the already-downloaded and patched ISO, so it
records what was built, and is not a pin; it is now anchored by a verified
input.
Verified: gmake tool-version-check (62 pins, each declared once),
gmake lint-shell, gmake lint-workflows, gmake docs-check, and
print-ISO_CHECKSUM for all four release/arch combinations.
Signed-off-by: Terry Howe <thowe@nvidia.com>
* fix(os-image): resolve the tool-versions include in packer test fixtures
The Makefile now includes ../../make/tool-versions.mk for the committed
installer digests. Both Packer test suites stage a Makefile copy into a
temporary tree that has no such file, so Make stopped at the include
before any contract under test ran.
Stage the real tool-versions.mk in a repo-shaped fixture rather than a
stub, so ISO_CHECKSUM resolves exactly as it does in a checkout, and
update the ISO checksum assertions to the committed sha256 pins. Keep a
case for the file: manifest override and one for the fail-closed empty
digest on an unpinned release.
Signed-off-by: Terry Howe <thowe@nvidia.com>
---------
Signed-off-by: Terry Howe <thowe@nvidia.com>
|
||
|
|
bc75b98193 |
docs(cli): generate the nvkectl command reference from the command tree (#1773)
The repository has a hand-maintained quick reference and workflow guides, but
no complete reference. An operator cannot browse the whole public CLI without
a built binary, and nothing ties the prose to the commands, so the two drift
apart silently.
Add cli/docs/reference: an index and one page per public command, generated
from the cobra tree nvkectl itself runs. Each page carries the command's
purpose, invocation and positional arguments, aliases, examples, local and
inherited options with types and defaults, the required and mutually exclusive
option groups, and a deprecation notice when it has one.
cobra's doc package writes the body of each page. It does not emit aliases,
deprecation notices, flag-group constraints or an index, and it never removes
the page of a deleted command, so internal/clidocs adds those around it. All
of it is read from the command, so there is no second catalogue to maintain.
Deterministic, so repeated generation from unchanged source produces identical
files:
- cobra's generated-on timestamp is switched off on every command.
- The NVKECTL_ and NKECTL_ variables are cleared before the tree is built.
Two of `bootstrap site`'s flag defaults -- --diagnostics-dir and --timeout
-- are read from the environment by the command constructor, through
internal/envalias, which still honours the old prefix. Without this the
pages would record whatever the generating shell happened to have set.
- HOME and the XDG config directory are pinned, and the build metadata is a
fixed placeholder.
Generation runs no command and contacts nothing: it builds the tree and reads
its metadata, so it needs no credential, kubeconfig, configured site or
cluster. newRootCmd is exported for it, which is what the move to an
importable package was for.
`make -C cli docs` regenerates and `make -C cli docs-check` verifies, failing
on output that is stale, missing, obsolete, or newly generated and never
committed. The check joins the generated-artefact gate, which already covers
the provisioned-provider manifest and the generated API code, and joins
`make gate` and `make preflight` locally.
Two commands lazily added by cobra needed initialising before the traversal,
or the root page would link to pages that were never written: `help` and
`completion`. cobra's doc package also calls InitDefaultHelpCmd on every
command it renders, not just the root, which invented a `help` subcommand
under each group command -- `nvkectl bootstrap help` is not a command -- so
each one is given a hidden help command first to decide what cobra adds.
Hidden commands and help topics are excluded, which is why `render` and
`inspect` do not appear; a deprecated command keeps its page for as long as it
still runs.
Constraints enforced inside RunE are invisible to cobra. Those on `config
set-site` and the two patch commands are now stated in the flag usage strings
and Long text, so --help and the reference agree. No behaviour changes: the
checks still run where they did, with the messages they had.
cobra/doc brings go-md2man and blackfriday into cli/go.mod. Neither is
reachable from ./cmd/nvkectl, so the shipped binary is unaffected and
THIRD_PARTY_NOTICES.md is unchanged.
Signed-off-by: Jonathan Meier <jomeier@nvidia.com>
|
||
|
|
df9890c530 |
feat: make local-site-setup prepares the local site for the operator flow (#1725)
hack/local-site.sh setup stands in for what a data center, a build and the lab hand an operator: it starts a container node from the bootstrap substrate and records its hosts.csv and SPIRE CA, builds the controller image and the profile content image from the checkout and stages them into the node's containerd, writes the stack config naming them, the API NetworkPolicy with the lab's networks, the release set and a tenant request for the machine's architecture, starts nico-sim with its container backend and bridges the two container networks, and writes a workspace with env.sh. The operator flow is then typed as on real hardware: nvkectl generate sitespec, nvkectl bootstrap site, clusterctl init, the install, the NetworkPolicy, set-site, the releases, a tenant. deploy/nvke-deploy-local.sh install wraps the executor for that flow: the lab StorageClass before, nvke-deploy.sh install on deploy/nico with the inputs read from NVKE_SITESPEC, NVKE_STACK_CONFIG and NVKE_KUBECONFIG, and the SPIRE exec-auth patch after. The local-site page shows that sequence and links each step's operator page. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> |
||
|
|
ac96cd13f0 |
feat(cli): render a deploy path for the site the site spec describes (#1567)
* feat(cli): render a deploy path for the site the site spec describes nvkectl render deploy-path copies a deploy path and resolves it for the site: the controller, SPIRE, PostgreSQL and Temporal items get a site-values.yaml built from the site spec's controllerStack section (the database password, the OIDC discovery URL, the SPIRE server address and identity, the controller's admin ID, the TPM attestor checksum, the bootstrap CA, a registry mirror), template items are rendered with Go text/template and become manifest items, and site.env names the site. Secrets are read from the files the spec names and written into the result, so it is created 0700 and is for one install. The executor installs the result with no --config. deploy-test joins the merge gate with the executor's dry-run suite; the executor stops on a parser failure instead of installing nothing. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * docs(cli): name the item list file by its current name Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * fix(cli): review fixes for the site render A rendered tree installs from anywhere: a committed chart.path is written absolute, and the executor takes an absolute chart.path as is. Secrets holding a quote, a backslash or a control character are refused by field, since the templates carry no escaping. spire.ca*File resolve from the working directory, as bootstrap site reads them. The OIDC domains are read from the overlay as YAML, so a comment inside the list no longer truncates it. --out is created first with Mkdir, so an existing directory is left alone, and --out inside the deploy path is refused. A manifest item's image: rejects a digest. nktpValuesFile without an nktp item is a problem. The bootstrap's TPM checksum lookup calls the exported one. The test suite's mode check is portable and its order check can fail. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * fix(cli): refuse a checkout path with whitespace in the render The rendered chart.path is one unquoted token for the deploy path reader, so a checkout under a directory with a space rendered and then failed at install time. The render now reports it. The --out guard resolves symlinks before comparing with the deploy path. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * refactor(cli): export the TPM attestor checksum lookup as is Rename tpmPluginChecksum instead of wrapping it; the render tests for an empty checksum like the bootstrap does. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * fix(cli): refuse unknown item types and whitespace in absolute chart paths Items accepts only the four types the executor dispatches. The whitespace check covers an absolute committed chart.path too. The nested --out test runs on a copy of the deploy path. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * feat(cli): keep the database password in the operator's file only controllerStack.database.passwordFile is required. A missing file is created with a generated password, 0600. The rendered tree holds no db-password copy. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * feat(deploy): reference the SPIRE CA with chart.setFile instead of copying it A helm item's release.yaml takes chart.setFile: <helm key>=<absolute path> entries the executor passes as --set-file. The render points the spire item at the operator's CA files; spire/site-values.yaml holds no PEM. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * feat(cli): name the credential files of a rendered deploy path The render lists the files under --out that hold a credential and writes a .gitignore that ignores the tree, so the operator knows what to delete and a repository does not pick it up by accident. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * feat(cli): refuse a rendered deploy path under a shared temp directory --out under /tmp, /var/tmp, their /private forms or the process temp directory is refused before anything is written. Tests opt out through RenderOptions.AllowTempOut; the deploy suite through NVKECTL_RENDER_ALLOW_TEMP_OUT=1. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * fix(cli): keep temporal's passwords under a mirror and refuse incomplete site values A mirror merges into temporal's server values instead of replacing them. The render refuses a missing profiles image when the deploy path enables profiles.image, an empty secret file, a template value the templates cannot carry, an image override with no tag or digest, a template item with no template, and an item named . or ... A symlinked deploy path is resolved; copied files keep their owner exec bit. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> --------- Signed-off-by: Lia Campbell <liac@nvidia.com> |
||
|
|
c72363341c |
ci: update ARG-pinned base image digests weekly (#1245)
* ci: follow ARG-pinned base image digests weekly hack/base-image-check.sh requires the release-relevant Dockerfiles to name their bases by digest, and records the cost in its header: Dependabot's docker ecosystem reads an image named on a FROM and does not resolve an `ARG ..._IMAGE=` default, so the golang and alpine bases of the two published images are watched by nothing. Pinned and unwatched is the worst of both -- the digest that ships is immutable, and it also never moves, so an upstream rebuild never reaches a release until somebody notices by hand. hack/base-image-update.sh re-resolves every ARG-pinned digest in the tree and rewrites the ones whose tag has been republished. It changes digests only, never tags, so the Go version policy in dependabot.yml stays the only thing that decides when a tag moves. base-image-digests.yml runs it weekly and opens a pull request with whatever moved; reviewing that is the same act as reviewing a Dependabot one. Scope is implicit rather than listed: the set of lines this touches is exactly the set that is already digest-pinned through an ARG, so it cannot drift from the EXEMPT list in base-image-check.sh. Verified against Docker Hub while writing this: alpine:3.24.2 and golang:1.27.1-alpine still resolve to the digests pinned here, and golang:1.27.1 does not -- its riscv64 child was rebuilt on 2026-09-30 against a newer buildpack-deps, which no tool in this repository would have reported. Naming the image on the FROM instead would let Dependabot see it, but gives up the --build-arg GOLANG_IMAGE override the e2e lanes use to route Docker Hub pulls through NKE_E2E_DOCKERHUB_MIRROR. That trade-off stays open; this does not depend on how it is settled. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Correct the GITHUB_TOKEN guidance: a pull_request run caused by GITHUB_TOKEN is created in an approval-required state rather than not created at all, so the remedy is approving the queued merge-gate.yml run, not closing and reopening the pull request. Scan every ARG form base-image-check.sh accepts. The check script resolves an ARG default with ARG[[:space:]]+; the update script required a single space, so a tab- or multi-space-separated ARG was skipped and its stale digest reported as current. Signed-off-by: Terry Howe <thowe@nvidia.com> * ci: guard base-image digest bump on repository_id The job was gated on `github.repository == 'dsx-ai-factory/nke'`. The repository has since been renamed to nvke, so the condition never matches and the weekly digest bump silently stops running. Switch to the repository_id guard the other workflows already use, which is rename-proof and satisfies the actionlint rule forbidding a github.repository string compare. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
58e850b9ac |
ci: run the name check in fail mode (#1503)
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
3baba6d1b4 |
ci: give the name check its launch allowlist, and move the stragglers to the new name (#1484)
* chore: move test doubles, examples and stale references to the new name What the name check still reported outside the Tier 2 identifiers: synthetic names in tests (nke-site, nke-old, nke-injected, nke-role, nke-key-1 and friends), registry and path examples in documents and flag help (registry.example.com/nke, ghcr.io/my-org/nke, ~/dev/nke), development defaults (DEV_NAME, kind contexts, the promtail job, the mutagen example), stale references to packages renamed earlier (internal/nke, nke.NewClient, nkecli, nkeutils), the `nke#1399` issue shorthand, the CI image tag nke/capd-reboot-controller, the prune script's package names, and a few comments and messages. The UpdateNKERBAC rpc's errors now start with the rpc name, which no caller parses. Kept: the two synthetic fixture profiles' image URLs, because osprofiles-to-crs refuses to change a published MachineImage spec; the salt of the bring-up VMs' default password hash; the legacy installer path the kubeadm-distro test asserts is absent; the fleet names existing sites carry. The postgresql chart's description changes with a patch bump. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci: give the name check its launch allowlist hack/name-check-allowlist.txt grows from two entries to 48, each with its reason: the Tier 2 identifiers that stay until the post-launch release (PR4 Kubernetes, PR5 node, PR6 OS image and packages), the permanent keeps (migration names and texts, the NKEAuth magic and its package, fleet release and profile names, the identity of existing sites), the settings-coupled names (the old NGC token secret, the CODEOWNERS team slugs, the S3 and apt names, the old CLI name), and the files that keep the bare word (the agent version line the updater parses, the OIDC upstream CA subject, the Keycloak lab, the two NVCR workflows whose NGC organisation is named NKE). With it, NAME_CHECK_MODE=fail make name-check passes on this tree: 5,908 hits, all allowed, every entry in use. The make target keeps report mode until the launch flips it (W4). Closes #1483 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
67fea25612 |
ci: fail the gate when a deploy-list item has no directory (#1477)
deploy/nvke-deploy.sh stops at the first nvke-deploy.yaml item whose directory is missing, after applying the ones before it; #1453 renamed two directories under their lists and every CAPD and NICo lane failed there until #1471. The check reads the lists with the installer's parser and runs in go-build and make gate. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
668bc38a9b |
feat(cli)!: rename nkectl to nvkectl, keeping the old names for one release (#1456)
The binary, its directory, its config directory and its environment variables take the new name. For one release the previous names still work: every NVKECTL_* setting is also read under its NKECTL_* name with a deprecation warning (the NKECTL_CWE_* names of the generation before are no longer read), a config file left under nkectl/ is read and copied to nvkectl/ once, and releases publish both nvkectl-<os>-<arch> and nkectl-<os>-<arch>, to GitHub and to S3 under the existing prefix. The e2e helper package, the e2e test, the smoke and fetch scripts and the bootstrap e2e workflow follow the binary; the fetch script accepts a release that carries only the old asset name. The CLI's own documents and the two installation documents that print the download URLs change with it. Kept on purpose: the NVCR repository name until an nvkectl repository exists in the NGC org, the S3 prefix the publishing role's policy names, and the prose in the other documents. BREAKING CHANGE: the CLI is installed and invoked as nvkectl. The previous binary name, environment variable names and config directory are honoured for one release, as described above. Closes #1455 Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
8c98679d99 |
ci: report tokens that carry a banned name, outside an allowlist (#1444)
Hand sweeps of a name do not converge: the sweeps that changed "CWE" to "controller" landed no check, and hundreds of lines still say cwe. This adds hack/name-check.py, a merge-gate member that lists every token in the tree carrying a banned name and, once the list is meant to be empty, fails on it. Tokens rather than lines, because a line-based stoplist for `linked` or `encryptionKey` hides the real token beside them: the label-key constants in controller/internal/constants/constants.go sit on lines that also say `AnnotationKey`. A token counts only when the name sits where a product name would, after the start of the token, a separator, a digit or a camel-case boundary, and before the end, a separator, a digit, a case change or a known product suffix. That drops `linked`, `encryptionKey`, `nats-io/nkeys` and base64 runs, and keeps a CRD kind, a CLI name and a path under /etc. A path that carries the name is a hit too, because a rename leaves it to git mv. Report mode summarises and exits 0, which is what the gate needs while the tree still carries the name everywhere (13248 hits today); fail mode lists every hit outside hack/name-check-allowlist.txt and exits 1. NAME_CHECK_MODE in make/checks.mk picks the mode. An allowlist entry that matches nothing fails in both modes, so the list cannot outlive what it covered. Only tracked files are scanned, excluding sum and lock files, vendor/, generated/, CHANGELOG.md and the check's own files, as docs-check does. The check needs python3 and git only; no ripgrep. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
0621bf69cf |
ci: guard workflows by repository id and require success from every gate member (#1442)
The 85 repository guards compared github.repository to the slug 'dsx-ai-factory/nke'. A rename or a transfer turns every one of them false, every gate member skips, and `gate` tolerated `skipped`, so it passed with nothing run. That is what happened during the move to this organization, until #716 pointed the guards at the new slug. Compare github.repository_id instead, which survives a rename, and make `gate` require `success` from every member, because the only job-level condition a member carries is the guard. `make lint-workflows` now rejects a workflow that compares github.repository to a string, and the workflows README documents the rule. The next rename or transfer then needs no change to any workflow, and no pull request can pass a gate that ran nothing. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
3fe0dffbb4 |
test(controller): cover control-plane failure domains end to end (#1167)
* test(controller): cover control-plane failure domains end to end Signed-off-by: Eric Staples <estaples@nvidia.com> * test(controller): enforce failure-domain E2E coverage Wire the CAPD spread row to its domain-aware fixture and fail before creation when a CAPD control-plane-controller row advertises no domains. Check observed Machine placement and scale-down balance, and simplify the related test helpers. Signed-off-by: Eric Staples <estaples@nvidia.com> * test(controller): satisfy E2E constant lint Keep the shared CAPI name key because the E2E module goconst rule requires a constant for its repeated uses. Signed-off-by: Eric Staples <estaples@nvidia.com> * test(controller): clarify CAPD failure-domain coverage Document CAPD observed-domain mirroring, make placement diagnostics deterministic, and state the two-domain assumption of the replacement check. Signed-off-by: Eric Staples <estaples@nvidia.com> * Refactor common checks Signed-off-by: Eric Staples <estaples@nvidia.com> * test(controller): verify CAPD container failure domains Signed-off-by: Eric Staples <estaples@nvidia.com> * ci(e2e): pin CAPD and CAPI core to v1.13.6 Use the provider version that publishes Machine failure-domain status and matches the CAPI API dependency compiled into NKE. Update both clusterctl architecture checksums and document the provider contract. Signed-off-by: Eric Staples <estaples@nvidia.com> * fix(e2e): share CAPI release and clusterctl verification pins Signed-off-by: Eric Staples <estaples@nvidia.com> * test(controller): harden failure-domain fixtures and placement snapshots Signed-off-by: Eric Staples <estaples@nvidia.com> * test(controller): advertise failure domains on the no-VIP cp-controller row initCluster requires every CAPD control-plane-controller row to advertise failure domains; the no-VIP row from #1149 used capdSpec, which advertises none. Signed-off-by: Eric Staples <estaples@nvidia.com> * test(e2e): check only balance after control-plane scale-up KCP's tie-break decides which eligible domain receives the extra Machine when the control plane scales from one to three, so exact per-domain counts can flake. Create keeps the exact-count check. The README drops the controller-managed leg and flag-on wording that #1084 retired. Signed-off-by: Eric Staples <estaples@nvidia.com> * docs(e2e): trim the failure-domain README section Signed-off-by: Eric Staples <estaples@nvidia.com> --------- Signed-off-by: Eric Staples <estaples@nvidia.com> |
||
|
|
4aad5da486 |
feat(ci): generate an SBOM for every released artifact (#1135)
* feat(ci): generate an SBOM for every released artifact anchore/sbom-action ran in two workflows, so an SBOM existed for the nke-controller and cluster-api-provider-provisioned images and for nothing else. nkectl is the user-facing binary and the agent .deb lands on every managed node, and neither shipped one: "which of our artifacts contains this component" was answerable for two container images, and otherwise only by rebuilding. Add SPDX 2.3 JSON documents for the three artifact classes that had none: - nkectl-<os>-<arch>, from the binary's embedded Go build info - nke-agent_<version>_<arch>.deb, from the binary inside the package - the eight node qcow2s, from the image's own dpkg database Every document is generated from the built artifact rather than from the source tree. For a binary that is the difference between what this build linked and what go.mod would select; for a node image it is the difference between the real package set and the Packer templates, which cannot predict what the archive served on build day or what provision.sh purged back out. Each is named in its release's checksums.txt, so the build-provenance attestation already made over that file covers the SBOMs too. The qcow2 path reads the package database out of the finished disk with libguestfs, which needs no root and no modprobe nbd, and which walks the FDE variant's LVM-inside-LUKS stack itself rather than having us reimplement it on a shared runner. It runs before the GHCR push, so an unreadable disk fails while nothing has been published, and so pull-request runs exercise it. Pin the syft version in make/tool-versions.mk rather than leaving it to the action's bundled default, so re-running an old tag reproduces the document a consumer already has. Document the format, the per-artifact subject granularity and the consumer retrieval path in RELEASE.md. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(ci): open the FDE image's LUKS container explicitly for the SBOM The first version of extract-image-sbom.sh used guestfish --inspector and looked for the LUKS container by scanning list-filesystems for a crypto_LUKS entry. That rejected every FDE disk with "carries no crypto_LUKS device", failing all four os-image legs. list-filesystems does not report a LUKS partition at all -- the device is absent from the listing rather than carrying an unexpected type -- so the container is now found with vfs-type on each partition. cryptsetup-open then opens it, which also needs --keys-from-stdin: it will not take the passphrase as an argument and otherwise prompts, which on a runner fails with "getline: Inappropriate ioctl for device". Dropping --inspector means the same explicit sequence serves both variants and, unlike inspection, every step of it can be exercised without a real encrypted build. The root filesystem is found by looking for the one that carries /var/lib/dpkg/status rather than by device path, which differs between the two variants and between Ubuntu releases. Verified against real fixtures rather than the source tree: a genuine Ubuntu cloud qcow2 yields 665 packages, a genuine LUKS+LVM disk opens and yields its package set from /dev/vg0/root, and a wrong passphrase fails loudly instead of emitting an empty document. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(ci): count every release attachment in the os-image asset check expected-count is a floor, so "2" let a release that dropped all eight SBOMs pass on the checker binary, checksums.txt and its attestation alone. Name all eleven attachments. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(ci): require every expected SBOM asset before publishing the release The publish gate named only checksums.txt and nke-os-image-check, and the verify step's expected-count is a floor, so a release that lost one SBOM but gained a stray attachment still cleared both checks. Derive the required asset names from checksums.txt, which the eight build legs each append their own disk and SBOM to, so a new Ubuntu flavor or architecture does not need a second edit here. Signed-off-by: Terry Howe <thowe@nvidia.com> * docs(ci): name the SBOM example after the real qcow2 version UBUNTU_VERSION is read back out of the ISO filename, so the disks are nke-node-fde-ubuntu-26.04.1-amd64.qcow2, not -26.04-. The release notes' worked example dropped the patch segment. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(ci): pin syft in the image SBOM jobs and fix the qcow2 SBOM example The image rows used anchore/sbom-action's bundled syft, so RELEASE.md's claim that every SBOM comes from the make/tool-versions.mk pin held for the three release-asset workflows only. Read the pin and pass syft-version, and unify all five sbom-action pins on v0.24.3. The os-image download example named a release that is never built: the qcow2s carry the Ubuntu point release, 26.04.1, not 26.04. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
3d42313827 |
ci: machine-check the .grype.yaml exception policy (#1252)
* ci: machine-check the .grype.yaml exception policy
.grype.yaml has always stated three rules in its preamble: scope an entry to
the narrowest thing describing the root cause, say who can remove it, and
re-check it on a date. All three were prose. Nothing enforced them, so they
held only for as long as everyone remembered to read a comment before adding
an entry -- which is precisely the failure mode the preamble describes.
The list is empty today. That is why this is cheap to add now and expensive to
add later, after the first entries have landed without it.
hack/grype-ignore-check.sh enforces the rules:
- Every entry names one advisory and one package. An entry naming neither
suppresses the next, unrelated finding in the same place.
- Owner and review date are required, as `owner=` and `review=` tokens at
the head of `reason`. Past the review date the build fails and names the
owner. Unlike the govulncheck waiver date, which only warns, this one
fails: that waiver has an independent un-waive check to catch rot, and
here the date is the check.
- `scope=source|image|both` says which of the two scans is entitled to call
an entry stale, because neither sees the other's packages.
The metadata lives inside `reason` rather than in keys of its own because
grype owns the schema for an ignore rule, and a key it does not know is a key
it is free to reject -- turning a policy annotation into a broken scan.
`reason` is the one field it carries verbatim.
Static validation reads files only, so it runs in `make gate` and in the merge
gate via go-build.yml, alongside go-version-check and base-image-check. The
grype scans need a vulnerability database and an NVIDIA runner, so they gate
nothing on a fork pull request; the policy on the entry that is being added
should gate the pull request adding it.
Staleness needs the scanner. security-scan.yml and image.yml each re-scan in
JSON -- SARIF omits suppressed matches, which are the thing to read -- and
assert that every entry in their scope still suppresses something. Both skip
the re-scan entirely while the list is empty, so this costs nothing today.
Signed-off-by: Terry Howe <thowe@nvidia.com>
* fix: match grype staleness on advisory and package together
The --applied check collected only the advisory id of each applied ignore
rule, so two entries sharing an advisory across different packages vouched
for each other: if either one still suppressed a finding, both passed. The
same advisory is routinely ignored once per affected package, so this is
the ordinary case, not a corner one -- and a stale entry surviving it is
exactly the no-op entry the check exists to catch.
Signed-off-by: Terry Howe <thowe@nvidia.com>
---------
Signed-off-by: Terry Howe <thowe@nvidia.com>
|
||
|
|
dac61a99a7 |
feat(qualify): qualify NKE from one resolved plan, one e2e job per stream (#1352)
* feat(release): add the qualify tool, starting with plan A Go module at release/ implementing the qualification tool from the SADD. Five verbs are designed; plan is the one that exists. It resolves what qualifying a candidate would involve -- dependency versions over the three latest tiers, scope expansion into streams, and skip from prior outcomes -- and emits it as JSON. It qualifies nothing. The policy lives in qualification.yaml: components, streams and scopes at release/, and each component's dependencies in its own file next to the code. internal/policy reads and validates both, rejecting unknown fields and selectors naming a capability no stream declares. Wired into the workspace the same way every other module is: go.work, the Makefile module lists, lint.yml's matrix, and a test step in go-build.yml. That last one is what makes TestRepositoryPolicyFilesAreValid a merge-gate check -- it loads every qualification.yaml in the tree, so a malformed policy fails a pull request instead of waiting for someone to notice. release-qualify.yml runs plan on dispatch. It is advisory and deliberately not a gate member: qualification is per-candidate, not per-commit. Signed-off-by: Ron Compos <rcompos@nvidia.com> * ci(release-qualify): drop the temporary push trigger It existed only because workflow_dispatch reads its trigger definition from the default branch, so this workflow could not be dispatched before it merged and something had to exercise it first. It has: the run on b1994074 succeeded against exactly the code in this pull request, and since the upload step sets if-no-files-found: error, a green run means `plan` resolved and wrote its output rather than doing nothing quietly. Leaving it would put a branch name on main that stops matching anything the day the branch is deleted. workflow_dispatch is now the only trigger, which is what README.md's invariants call for. cancel-in-progress goes with it. Superseding a run was the right answer for a push, which is a step in an edit loop; two dispatches are two questions about two candidates and both deserve an answer, so a second run queues. Signed-off-by: Ron Compos <rcompos@nvidia.com> * style(release): wrap error call closings the way gofumpt wants golangci-lint's gofumpt formatter wants a trailing comma and the closing paren on its own line for these multi-line fmt.Errorf calls. Whitespace only. Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(release): carry stream capabilities in the plan artifact A cell named only its stream, so the run executing it would have had to read the capabilities back out of the policy. Resolution is supposed to happen once: a policy edit landing between the plan job and the last cell must not change what that cell runs. Signed-off-by: Ron Compos <rcompos@nvidia.com> * docs(agents): stop calling the release module build output AGENTS.md listed release/ beside bin/ as output not to commit, which contradicts the .gitignore negation added to track it. Signed-off-by: Ron Compos <rcompos@nvidia.com> * refactor(release): qualify nke as a subject resolved through a registry Qualification is now about one subject, nke, whose components are qualified together as a release, instead of one component at a time. - Merge the plan and policy packages into internal/qualification and split the files by concern: a registry (how each component resolves), a policy (streams and scopes) and a subject (what is qualified). - Add internal/resolve with the gitTag, lockedPackage and makeVar strategies. Resolvers take plain inputs and know nothing about streams, and the planner decides whether a dependency is resolved once for the combination or once per stream from its constraint. - Resolve kube and nke-cni-ovn from the lock files the os-image release commits, so a plan names versions the image carries. - Key a combination by controller, cli, os-image and capi-provisioned, and name it by those versions sorted by name and made path-safe. - Declare the forge gb200 streams on kube 1.36 in place of the nico ones. - Drop the history and outcome machinery and versionConstraint. - Add NERDCTL_VERSION to make/tool-versions.mk. - Delete the per-component qualification files and the dispatch-only release-qualify workflow, and document usage in the README. - Update the go-build comment for the renamed repository files test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * fix(release): keep the release module in image builds and on the workspace Go version Two checks on the pull request failed after the release module was added to the workspace. - The root .dockerignore excluded release/ as build output, but go.work now lists the module, so an image built from the workspace could not load it. Re-include the root release/ and keep a nested one excluded. - release/go.mod declared Go 1.26.6 while go.work is on 1.27.1. Sync it with make go-version-sync. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * feat(release): choose versions with --version-overrides A person can replace what a component or dependency resolves to with comma-separated name=version pairs, the format the e2e suite takes for -e2e.versions. - An override goes through the same resolver as a resolved version, so the strategy checks it. A git tag must exist, a locked package must be locked for every architecture and match the stream's constraint, and a tool pin is taken as given. - The plan lists the overridden names under overrides, so a person's choice is never recorded as if a strategy had made it. - An unknown name, the subject itself, a malformed pair and a duplicate are rejected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * feat(qualify): resolve os-image artifacts as dependencies The node images and bootloaders a run needs are now dependencies in the plan, named by the keys the e2e suite reads. - A dependency declares its inputs with constraint, constraintFrom, releases and value, each with one meaning. constraintFrom takes the constraint from a stream capability and is what makes a dependency per stream. releases lists the versions a strategy cannot list itself, and the strategy picks the highest the constraint matches. - Strategies return a version, a url, or both. An image carries the os-image release it was built from and its url, and a bootloader carries only its url. - New osImage and url strategies. The url strategy always checks that the URL exists, so a stale point release fails the plan. - Each strategy validates the inputs a subject declares for it, and Check asks the resolver, so strategy details stay in the strategy. - The registry lists named sources, and a component names one instead of repeating a host. - Overrides reach a strategy as override, and the flag is --overrides. - Streams for Ubuntu 26.04 and L40S, GPU model in the stream name, and a golden-path scope for Ubuntu 24.04 in place of active. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * feat(qualify): run the e2e lane once per stream of the plan The e2e workflow is now qualify-e2e.yml. A plan job runs qualify plan and a matrix job qualifies each stream of it. - The plan job passes the dispatch inputs and QUALIFY_E2E_* variables that name a version as --overrides, uploads plan.json and outputs a flat matrix with one entry per stream. An os-image-version input overrides the os-image release. - Each matrix job takes its versions, architecture and GPU model from its entry, and is named by the stream. Siblings are never cancelled, because a cancelled lane leaks a bare-metal node. - The Ginkgo invocation is commented out while the wiring is tested, and the job prints what it would have run. - The suite requires every Forge version and fails before a machine exists, naming each one missing. The defaults for kube, cni-ovn, kind, clusterctl, nerdctl and capi-provisioned are removed. - A component resolves to the highest version of any kind, ordered by semver. The registry component for the OVN CNI is cni-ovn, the key the suite reads. - The repository variables are QUALIFY_E2E_*, the trigger label is qualify-e2e, and the run artifacts are qualify-e2e.log, qualify-e2e.junit.xml, qualify-e2e.report.json and nkectl-diagnostics.tar.gz. - The L40S GPU is l40s in the Forge environment, matching the plan. - The unimplemented verbs are removed from the qualify help. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * feat(qualify): resolve the nke subject like every other component With no --version the subject resolves to its highest version of any kind, the way each component does. The candidate-only selection stays available to a strategy that asks for it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * build(release): use Go 1.27.2 like the rest of the workspace main moved go.work and every module to Go 1.27.2, so the release module follows, or go-version-check fails. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * build: declare each tool pin once, in make/tool-versions.mk tool-version-check rejects a second declaration of a pin that make/tool-versions.mk owns. - nkectl-bootstrap-e2e.yml reads NERDCTL_VERSION and the two nerdctl-full checksums from the file instead of restating them. The checksums move into the file beside the version, so a bump moves both. - The makeVar test fixture uses names that are not pins. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * feat(qualify): summarise the plan as tables on the run page The plan job's summary now shows the nke version, scope and overrides, a table of the components and one of the dependencies for each combination, and one row per stream with a column for each value resolved per stream. An entry says when a person's override chose it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * build(release): collect coverage in the release module main now requires every module with tests to write a coverage profile and be listed in the coverage registry. The release module includes make/coverage.mk, its test target writes the profile, and hack/coverage.sh lists it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * docs(coverage): count the release module among those that collect Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * feat(qualify): add a dry run to the qualify-e2e workflow A dry-run dispatch input, or the qualify-e2e-dry-run label on a pull request, runs everything except the Teleport join and the suite, so it takes no Forge machine. - The plan job decides once and the stream jobs follow it. Each stream still builds the site inputs, which confirms every image and archive exists, and writes the e2e config. It prints the suite invocation it would have made. - A dry run has its own concurrency group, can run from any branch, and its jobs are named <stream> (dry run). - The Ginkgo run is on by default again and is skipped only in a dry run. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * refactor(qualify): name the suite step for what it does in the run The step that runs Ginkgo is now Run the e2e suite, and Print the e2e suite invocation in a dry run, so a dry run's log does not claim the suite ran. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * feat(qualify): limit golden-path to GB200 and mark a dry run's suite step - The golden-path scope selects Ubuntu 24.04 on GB200, so the L40S streams are only in the full scope. - The suite step is named Run the e2e suite, with (dry run) added in a dry run, as the job name has it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> * fix(ci): stop the nerdctl pin step on a pin make does not set set -e does not catch a failing make inside the argument of echo, so an empty pin was written to GITHUB_ENV and failed later in the install. The step now reads each pin into a variable and fails when it is empty. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> --------- Signed-off-by: Ron Compos <rcompos@nvidia.com> Signed-off-by: Harish Sampath <hasampath@nvidia.com> Co-authored-by: Ron Compos <rcompos@nvidia.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
9c7c2d09a8 |
ci: collect coverage in every module that has tests (#1260)
Coverage was collected in three of the eleven workspace modules and read in
none. controller/ wrote coverage.txt and said so in a comment, nico-sim and
management-engine wrote their own, and the six other modules that have tests
ran `go test` with no -coverprofile at all. No workflow read any of it, there
is no Codecov configuration, and no threshold is enforced.
The missing signal is not the percentage. It is that nothing notices when a
refactor drops a test file or a build tag stops compiling a suite: the run
still passes, nothing goes red, and the absence looks exactly like success.
Two cloudinit tests under controller/test/kubeadm pointed at a path that does
not exist and failed on every invocation while CI stayed green, because the
tag that gates them was set nowhere.
What this adds:
make/coverage.mk single owner of the profile path, directory and
-covermode, the way make/tool-versions.mk owns the
tool pins. Included by the nine collecting modules.
hack/coverage.sh the registry of which modules collect, the checks,
and the report.
coverage.yml a `policy` job in the merge gate (the registry
against the tree, about a second) and a `report` job
on main, weekly and on demand that runs the suites,
writes a per-module table to the job summary and
uploads the profiles.
docs/coverage-policy.md what the number is and is not.
Profiles move from controller/coverage.txt and management-engine/cover-*.out
to coverage/<module>.out at the root, so one directory holds all of them.
What fails: a missing, malformed or empty profile; a module that gains its
first test and does not start collecting; a test recipe that loses its
-coverprofile; a package whose tests a build tag keeps out of the build and
which is not declared as such; and a stale declaration for a package that
compiles again. A package of nothing but _test.go files is exempt from the
profile check -- it has no statements of its own to attribute.
What deliberately does not fail: a percentage. Coverage measures which lines a
test binary executed, not whether anything was asserted about them, so it is
not evidence of test adequacy and no threshold gates a merge. The policy
document says so in those words, and AGENTS.md repeats it, because a number in
a job summary invites exactly that reading.
The `report` job skips itself when the gate calls it: re-running the nine
suites the gate's own lanes have already run would roughly double its wall
clock to re-measure the same thing.
Signed-off-by: Terry Howe <thowe@nvidia.com>
|
||
|
|
a0326eec29 |
build: bump Go to 1.27.2 and golangci-lint to v2.14.0 (#1349)
Go 1.27.2 carries security fixes in html/template, net/http, HTTP/2, net/textproto, crypto/tls, and two cmd/go checksum bypasses. golangci-lint moves with it. Go 1.27.2 writes compiler export data version 5, which v2.13.2 cannot read, so lint failed on every module. v2.14.0's loggercheck flags slog values that may panic when nil; agent now logs bundle versions through a nil-safe utils.VersionString. Signed-off-by: dbudris <dbudris@nvidia.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
cfc32de7f4 |
feat(chart): expose oidc.providers as a chart value (#1326)
Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
c3984a2e4e |
feat(api): gate openapi.yaml on backward compatibility (#1249)
* feat(api): gate openapi.yaml on backward compatibility `generate-check` proves the committed *.gen.go match api/openapi.yaml. It says nothing about whether the specification change itself is safe. A removed field, a narrowed type or a newly required property regenerates perfectly -- the generated code matches the new spec exactly -- and breaks every client already built against the old one. Regeneration correctness and compatibility are different questions, and only the first was being asked. Adds `make -C controller api-compat-check`, a member of the merge gate. It compares the working-tree specification against the newest published controller/api version tag and fails on any breaking change that is not waived. The baseline is the tag, not the merge base. controller-api-tag.yml publishes controller/api/vX.Y.Z on every main commit that touches the directory, and that tag is what a consumer pins. It is also only ever a patch bump, so no tag has ever signalled a break -- which is why the gate has to hold the contract that the version number does not. Breaking changes are waived one at a time in controller/api/openapi-compat-waivers.yaml, each with a reason, a named person and a review date, and a waiver that matches nothing fails the gate. That is the rule GOVULNCHECK_WAIVED is already held to: an entry cannot outlive its reason. Waivers match on change kind, JSONPath and property rather than on the engine's changeHash, which covers the shape of a change and not its location -- in one sample diff 89 of 91 breaking changes shared five hashes. It fails closed throughout. A missing baseline (a shallow checkout has no tags), an unparsable specification, an empty or unrecognized engine report, and a missing waiver file are all errors. A gate that could not run has not found the change compatible, and the workflow checks out with fetch-depth: 0 so the usual cause cannot arise silently. The change engine is pb33f/openapi-changes, pinned as OPENAPI_CHANGES_VERSION and run with `go run` so nothing is installed. It is from the same author as vacuum, over the same libopenapi parser already lints this specification, so the gate and the linter agree on what the document says. Its breaking/additive classification is used as-is; what this repository owns is what happens next. Documents the versioning and deprecation behaviour in controller/api/README.md: there is one unversioned /api surface, the Go module tag is the pinnable artifact, and deprecation is additive while removal is the breaking step that needs a waiver. Also separates the authored files in that directory from the generated ones. Signed-off-by: Terry Howe <thowe@nvidia.com> * feat(api): let a sunset deprecation discharge a removal The gate landed with one route past it: every breaking change is waived, including a removal. That makes the patient route -- announce it, wait, then remove -- cost a reviewer exactly what the abrupt one costs, which is the wrong incentive for the one operation a compatibility gate exists to encourage. So removal gets a second route. An operation marked `deprecated: true`, carrying an `x-sunset` date, whose date has passed, may now be removed with no waiver at all: the promise was made, kept and discharged, and there is nothing left for anyone to sign. Removing it early, or without having deprecated it, is unchanged -- still breaking, still waivable. The price of offering that route is that the deprecation has to be real, which is what the new rules enforce. `deprecated: true` with no `x-sunset`, an `x-sunset` that is not a YYYY-MM-DD date, a date less than 180 days out, and an `x-sunset` on an operation that is not marked deprecated all fail. Each is a deprecation that announces nothing a consumer can act on. Every rule is scoped to what changed, never to the state of the document. An operation whose deprecation fields are identical on both sides is not examined at all, however they are set. A state rule would fail a pull request that never touched the specification the moment some older deprecation drifted out of compliance, and a gate that fails unrelated work is a gate someone turns off. The findings are plain `change` values, so everything already built for the engine's findings works on them: the waiver file matches them the same way, the failure message prints the same pasteable stub, and a waiver for one goes stale the same way. They are deliberately not emitted for removals, which the engine already reports -- two findings for one edit would mean two waivers for one decision. Discharge covers operations only. The engine reports a removed operation as a single change naming it, which is what makes "this exact removal was announced" decidable; a removed property or parameter is reported in a shape where it is not. The two removal shapes were confirmed against the engine rather than assumed. --report now resolves both specifications too. It replaces the engine, not the documents, and a mode that skipped them would be a mode in which a removal looked sanctioned because nothing had checked. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
0fd781f278 |
ci: verify provenance before promoting an image (#1256)
Promotion is the moment a candidate becomes authoritative. The binary release path already treats it that way -- release.yml re-hashes every uploaded asset against checksums.txt and leaves the release a draft on any mismatch -- but the two image paths promoted by crane with nothing checked, because there was no evidence to check: the only attestation either workflow made was the one promote-ghcr writes *after* it has already copied the image. Attest the NVCR index in the manifest job, so the candidate carries evidence from the moment it exists. push-to-registry is false there: NVCR answers /v2/<repo>/referrers/<digest> with a route-level 404, so the bundle goes to GitHub's attestation store and is looked up by subject digest, which works for any registry. Add .github/actions/verify-attestation, a fail-closed wrapper around `gh attestation verify` that pins the repository, the signer workflow, the source commit and the source ref, and re-reads the attested subject digest out of the verified statement. Every outcome other than "an attestation from the expected signer, over this exact digest, verified" is an error. Call it in three places per workflow: before the GHCR copy, before the DSX promotion, and after the GHCR copy with --bundle-from-oci so the check reads the referrer GHCR serves rather than the GitHub API, which would have answered from the NVCR attestation over the same digest and proved nothing about what landed. Mutable aliases move last. sha-<commit> on GHCR and edge on DSX are now written only after every gate above them passes, so an alias never points at an image the run has not finished vouching for. Neither path rebuilds what it promotes, and the GHCR copy now asserts its digest on the far side the way the DSX copy already did. gh is pinned in make/tool-versions.mk and installed by a new setup-gh action rather than taken from the runner. The promotion jobs run on self-hosted runners where gh may be absent or old, and --signer-workflow, --source-digest and --source-ref are not in every release; a gate whose strictness depends on the runner image is not a gate. Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
38e594c247 |
build: make go.work the one authoritative Go version (#978)
* build: make go.work the one authoritative Go version The `go` directive had drifted to three values across the eleven workspace members -- 1.26.0, 1.26.5 and 1.26.6 -- while go.work required 1.27.1 to build any of them. Nothing checked the directives, and no document named an authoritative source or a supported-version policy, so a contributor's local build and CI could resolve different compilers and the first sign would be a stdlib behaviour change landing in one module's tests and not another's. go.work owns it. Every member's directive is now 1.27.1, and hack/go-version-check.sh asserts that alongside the Dockerfile and Flox copies it already covered. A deliberately mismatched go.mod fails with the file, the value it declares and the value go.work declares. The check takes its module list from the Makefile's WORK_MODULES and PRIVATE_MODULES rather than rediscovering it. A second copy of that list would be one more thing to drift, which is the failure this check exists to prevent. A tracked go.mod on neither list is an error, so a new module cannot be added and go unchecked; PRIVATE_MODULES are left alone, since go.work makes no claim about a module outside the workspace. A bump moves go.work and then eleven directives, so 'make go-version-sync' rewrites them; a fix applied by hand eleven times is a fix applied ten times. The Dependabot comment about moving directives by hand now points at it. The Dockerfile and Flox copies cannot be rewritten from a script, so --fix reports them and exits non-zero rather than reporting success on a job it only half did. docs/go-workspace.md gains 'The Go version': what derives, what is hand-kept and checked, and why a minor bump is a decision rather than a merge -- it changes the minimum Go a consumer of controller/api needs, which for this move goes from 1.26.5 to 1.27.1. Two generated artefacts move with the directive, and both are consequences rather than drift. controller/api/server.gen.go is regenerated: the generate-check job pins setup-go to controller/api/go.mod, so the toolchain that gzips the embedded swagger spec changes with the directive and the blob re-encodes. The decoded spec is byte-identical -- only the compression output differs. controller/go.mod is re-tidied: the language version feeds module graph pruning, so `go work sync` reclassifies several dependencies between the direct and indirect blocks. No dependency version changes. `make work-check` passes on main and fails without this, so it is required, not optional. All eight buildable modules compile on 1.27.1. The directive equality is stricter than Go requires, since a directive is a minimum; the three values it replaces were drift rather than a compatibility statement. Signed-off-by: Terry Howe <thowe@nvidia.com> * style: use promoted-field init in management-engine apis/v1 tests The Go 1.27 toolchain enables the modernize embedlit analyzer, which flags metav1.ObjectMeta composite literals that can initialise the promoted fields directly. Apply golangci-lint --fix so lint passes under the pinned version. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
7beaf77b8f | feat(chart): render the nke-controller-config ConfigMap (#1163) | ||
|
|
25d0b24d1e |
build: give every tool pin a single owner in make/tool-versions.mk (#977)
* build: give every tool pin a single owner in make/tool-versions.mk make/tool-versions.mk already owned most of the repository's pins, but nine tools still declared their own where they were used, and two of those were declared twice: controller-tools v0.20.1 in both cluster-api-provider-provisioned/ and management-engine/, and the TPM plugin 1.9.0 in both the spire-agent package and the CAPD bundle script. The second pair was held in step by a comment reading 'move them together'. Moved in: addlicense, buf, controller-tools, ginkgo, gofail, gofumpt, goimports, setup-envtest, the envtest Kubernetes version, and the SPIRE and TPM-plugin releases the node .deb wraps. golangci-lint stays in make/golangci.mk, beside the bootstrap logic that consumes it, and is the one recorded exception. prepare-capd-bundles.sh cannot include a makefile, so it now reads the two pins out of make/tool-versions.mk instead of restating them. hack/tool-version-check.sh makes this hold: for every name the owner declares, a literal re-declaration anywhere else in the tree fails with the tool, both values, and both locations. A derivation -- any right-hand side that reads the value from somewhere -- is the wanted shape and passes. Wired into 'make gate' and go-build.yml. The envtest cache key in gofail-e2e.yml now hashes make/tool-versions.mk too, since that is where ENVTEST_K8S_VERSION moved. Signed-off-by: Terry Howe <thowe@nvidia.com> * build: close the tool-pin gaps review found build-image.sh still defaulted SPIRE_AGENT_VERSION and TPM_ATTESTOR_VERSION to literal 1.14.1 / 1.9.0 -- the same two pins this branch centralised, in the sibling of the script it fixed. The checker could not see them: the names differ from the owned ones, and `: "${X:=v}"` is not the `X=` shape it greps. Both readers now share hack/read-tool-version.sh rather than each carrying a copy of the sed. Env overrides still win; the pin is only the default, and an unknown name is a hard error so a rename fails loudly instead of downloading an empty version. The comment this branch deleted from the spire-agent Makefile was the only in-tree pointer to the places nothing can check -- controller/Tiltfile, hack/mirror-bootstrap-images.sh and create-forge-nico-cluster.sh embed the version inside an image tag or an apt package spec. That list now sits above the pin it constrains, split into what the check enforces and what a human still has to move. Also from review: - The checker now reads YAML `NAME: value`, which is how a workflow or a composite action declares a pin. Every current occurrence is a `${{ }}` derivation and still passes; a literal one now fails. - EXEMPT_FILES described golangci.mk as "the one recorded exception", but GOLANGCI_LINT_VERSION is not declared in the owner file, so the check never looks for it. Reworded to what it is: room for the pin to move here later. - Quote the pin count instead of relying on word splitting (SC2086). - Drop the double blank lines the moved declarations left behind. Signed-off-by: Terry Howe <thowe@nvidia.com> * build: route every addlicense pin through ADDLICENSE_VERSION, catch `+=` Review found `controller/Makefile` still invoking `addlicense@v1.1.1` while `agent/Makefile` used the variable. It was five sites, not one: the root `Makefile`, `cli/`, `controller/`, `controller/nico-sim/` and `os-image/` all restated the literal, so moving ADDLICENSE_VERSION into the owner file had converted exactly one of six consumers. `controller/nico-sim/` and `os-image/` did not include the owner file at all, so the variable was empty there -- substituting it without the include would have produced `addlicense@` and a broken target rather than a wrong version. Both now include it. It is assignments only, so neither module's default goal moves. The check could not have caught any of these: a version inside a `go run` module path is not an assignment, the same reason the Tiltfile image tags are listed as unreachable in make/tool-versions.mk. Separately, the check now reads `+=`. Appending to a pin the owner already set yields a two-word value no consumer can use, and it is a second declaration by any reading. Kept `[[:space:]]*` rather than the suggested `[[:space:]]`: the latter requires a space before the operator and would have stopped matching `GINKGO_VERSION?=v1.0.0`, which is the form the check most needs to catch. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
5577f5cc1d |
feat(chart): install the release CRDs with the controller chart (#1144)
Package the MachineImage, ClusterRelease and NodePoolRelease CRDs in the controller chart so a Helm install carries the schema the releases need, and grant the controller read access to the three kinds. The CRDs stay controller-gen output in management-engine/config/crd/bases. controller/deploy/release-crds is a kustomize overlay that picks the three the chart installs and adds the deployment annotations, and `make chart-crds` renders it into files/crds.yaml, which the chart template installs and which fails when it is missing or empty. The rendered file is committed, as the provisioned provider's embedded manifest is, so Helm, Tilt and chart packaging work from a clean checkout. `make chart-crds-check` fails when it is stale and runs in generate-check, beside provider-manifest-check, with the same pinned kubectl. Only the chart needs the deployment annotations, so the CRD definitions in management-engine stay free of them: helm.sh/resource-policy: keep makes `helm uninstall` leave the CRDs in place, since deleting a CRD deletes every custom resource of its kind, and the Argo CD sync-wave -2 and Prune=false annotations order the CRDs before the resources and keep them from being pruned. The chart identity assertions cover the new resources, and the regenerate skill, AGENTS.md and the management-engine README list the new generated file and its command. Signed-off-by: Miancheng Lin <mianchengl@nvidia.com> |
||
|
|
d638b3d0d6 |
ci(os-image): build FDE and non-FDE images in parallel on ARC KVM runners (#1100)
* ci(os-image): build FDE and non-FDE images in parallel on ARC KVM runners Move the amd64 bake to the new arc-amd64-kvm scale set and add a variant axis to the build matrix, so every (arch, Ubuntu flavor, variant) builds in its own job instead of one job baking FDE then non-FDE back to back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cullen McDermott <9535761+cullenmcdermott@users.noreply.github.com> * test(os-image): follow the one-image-per-job workflow in the static checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cullen McDermott <9535761+cullenmcdermott@users.noreply.github.com> * test(os-image): stop the wrong-TPM FDE check at the LUKS prompt The moved-to-different-tpm-fails scenario waited out the full 360s BOOT_TIMEOUT for SSH that never comes, making it ~6 of the ~8 minutes demo-fde.sh adds to every FDE job. Watch the serial console instead: pass once the guest has sat at cryptroot's passphrase prompt for LOCKED_GRACE seconds, fail if it reaches systemd in the real root or SSH. The old timeout pass stays as a fallback if the prompt never shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(os-image): restore installer ISOs from the S3 build cache The four Ubuntu installer ISOs are 2 to 3 GiB each, too large together for the 10 GiB GitHub cache, and arm64's comes from cdimage.ubuntu.com at a couple of MB/s. The bake now assumes the cache's read role, installs a pinned s5cmd, and restores the ISO into os-image/packer/iso-cache/ before Packer runs. prepare-installer-iso.sh still checks it against Ubuntu's SHA256SUMS, so the cache cannot change what gets baked. Every cache step is best-effort: a miss or an AWS failure falls back to Ubuntu's mirror. os-image-cache.yml is the only writer. It runs on main (push, weekly, and dispatch), because the write role trusts only refs/heads/main. It refreshes any object older than two weeks, so nothing reaches the bucket's 30-day expiry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(os-image): check the wrong-TPM grace against a real unlock moved-to-different-tpm-fails passes once the guest has sat at the LUKS prompt for LOCKED_GRACE seconds. A Clevis unlock that arrived later than that would read as a pass. The same-TPM boot that follows now goes through wait_locked too, so a genuine unlock that takes longer than the grace fails the run and says the wrong-TPM result proves nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(os-image): name the build cache bucket and roles in the workflows A bucket name and role ARNs are not secrets, and keeping them in the workflow's env leaves them in review and history rather than in repository settings. The bake no longer needs a gate for unset variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(os-image): report how fast the ISO came back from the build cache Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(os-image): run each build on arc-<arch>-kvm with a 90-minute budget Both arches now use the same runner pattern and timeout, so the matrix no longer carries them per arch. One variant per job takes 14 to 27 minutes on a warm ISO cache, and a cold arm64 ISO adds about 25, so 180 minutes only kept a hung bake on a bare-metal KVM runner for three hours. Drops the comments that still described one job baking FDE then non-FDE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cullen McDermott <9535761+cullenmcdermott@users.noreply.github.com> * ci(os-image): stop calling every failed cache restore a miss s5cmd also fails on a 403 or a network error, and the notice said the ISO was not in the cache for all of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cullen McDermott <9535761+cullenmcdermott@users.noreply.github.com> * test(os-image): pass the wrong-TPM check only on a held LUKS prompt A boot that never reached the passphrase prompt still passed moved-to-different-tpm-fails, so a dead QEMU or a firmware hang read as a sealed disk. Only "locked" passes now. wait_locked also reports a QEMU that exited or a kernel panic instead of waiting out BOOT_TIMEOUT. LOCKED_GRACE defaults to 300s under tcg, as the same-TPM control fails if an unlock takes longer than the grace after the prompt. stop_vm now reaps QEMU so the next boot can bind SSH_PORT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cullen McDermott <9535761+cullenmcdermott@users.noreply.github.com> * fix(ci): avoid org ID matches inside checksums Match standalone sixteen-digit tokens instead of numeric substrings in hexadecimal hashes. Exercise the real scanner with checksum, org ID, token-boundary, and placeholder fixtures whenever internal-config-check runs. Co-Authored-By: Codex <noreply@openai.com> Signed-off-by: Cullen McDermott <9535761+cullenmcdermott@users.noreply.github.com> * fix(ci): skip pinned checksum lines instead of widening the org id match Restore the digit-only boundaries on the sixteen-digit org id shape, so an id glued to a letter or underscore fails the gate again, and skip *_SHA256* make variable lines instead. The test uses a synthetic checksum and a GIT_*-free environment rather than reading make/tool-versions.mk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(os-image): resume the cache refresh download after a reset Match prepare-installer-iso.sh: curl -C - resumes rather than restarting the 2.9 GB arm64 ISO, and only the first SHA256SUMS entry is taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(os-image): tighten what counts as locked or unlocked in the FDE check Match systemd's 'Welcome to Ubuntu' banner rather than any 'Welcome to', which GRUB also prints, and report an initramfs ALERT shell as inconclusive instead of locked. --help prints the whole header comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(os-image): say both architectures build on the ARC KVM runners Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(os-image): read the build cache bucket and roles from repository variables This reverts the hardcoding from earlier in this branch, so the account ID, bucket and role ARNs stay out of the public tree, as the S3 publish workflows already do. An unset read role skips the cache rather than assuming ambient credentials. The read role's credentials are now passed to the restore step only instead of being exported to the whole build, and the annotations name the object, not the bucket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(os-image): run the os-image tests once per run, not in every build make test and make -C packer test move to validate-packer on ubuntu-latest. The eight bare-metal KVM builds only build nke-os-image-check, which the release assets need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(os-image): pin the build matrix and the per-variant step guards Run the matrix step's own script and check it yields each arch, Ubuntu flavor and variant exactly once, and check every bake and check step is gated on its variant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(os-image): bound the wait for qemu to exit in demo-fde.sh Give qemu 30s after SIGTERM, then SIGKILL, so one stuck on shutdown cannot hang the job until its timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ci): tell org ids from hex digests by their hex neighbours Replace the *_SHA256* line skip with hex-digit boundaries. A digest's sixteen-digit run always borders hex, however it is written (export, YAML, JSON, upper case), while an id next to an underscore or a non-hex letter still fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(os-image): see systemd's coloured banner in the wrong-TPM check systemd colours the OS name, so an escape sequence sits between 'Welcome to ' and 'Ubuntu' and the previous match never fired, leaving SSH as the only unlocked signal. Match across it. The doc comment now describes what wait_locked checks, and stop_vm only sends SIGKILL to a qemu still running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(os-image): actually resume the cache refresh download curl's --retry truncates back to where the transfer started, so -C - under it never resumed. Retry in a loop that resumes from what the last attempt wrote, and fail before the download if the bucket variable is unset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(os-image): build nke-os-image-check only where the release uses it Only the amd64 default-flavor non-FDE build ships the binary. Also say plainly that id-token: write stays job-wide, so the credential scoping is limited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(os-image): pin each build's tag suffix and time budget Compare whole matrix entries, not just their (arch, release, variant) tuple. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Signed-off-by: Cullen McDermott <9535761+cullenmcdermott@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Codex <noreply@openai.com> |
||
|
|
2a7c3fb2cc |
docs(api): generate the REST API Reference from openapi.yaml (#1172)
* chore(api): lint openapi.yaml and mark the internal surface for Fern Fern builds the REST API Reference tab of the documentation site from controller/api/openapi.yaml, and the docs team is about to move the prose of the "NKE REST API Reference" into that file. This is the tooling that has to be in place first. Lint gate. `make -C controller/api lint` now also runs `lint-spec`, which lints openapi.yaml with vacuum against openapi-lint.yaml. vacuum is a Spectral-compatible linter written in Go, so `go run` pins it the way generate.go pins gofumpt, with no install step; the version lives in make/tool-versions.mk with the other tools. Errors fail the gate: every example matches its schema, no component is unused, operationIds are unique. Warnings measure the prose the spec still lacks (16 operations and 40 properties without a description, 31 schemas, no tags) and fail nothing yet; each is raised to error once the prose port lands, so that coverage cannot regress afterwards. Rules the API breaks on purpose (camelCase paths and properties, a DELETE with a body, extensions beside `$ref`) are off, with the reason beside each. The one error it found is fixed here: the `nodePools` example on CreateClusterRequest named a `namePrefix` field that does not exist and had neither `name` nor `nodeNamePrefix`, both required. Internal surface. The `infra` provider, `teleportEnabled`, the legacy `controlPlane` node-pool flag, the `/osProfiles` and `/configProfiles` endpoints, and the schemas only they reach now carry `x-fern-ignore: true`. Fern leaves them out of the published reference; Swagger UI at /api/docs/ and the generated Go are unchanged. `x-fern-audiences` was the first choice and does not fit: `fern ir --audience public` returns an empty API unless every element is tagged, so a new endpoint would vanish from the customer docs by default. The ignore marker is opt-out, and the IR confirms it removes exactly the listed items. The two "exactly one of `nico` or `infra`" sentences move from the schema descriptions onto the `infra` properties, so the published reference, which does not show `infra`, no longer refers to it. Only comments change in the generated Go. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(api): keep `infra` out of the text the customer reference shows The previous commit moved the "exactly one of `nico` or `infra`" sentences onto the `infra` properties and said the published reference no longer refers to `infra`. That was wrong on two counts, found by rendering the spec with Redoc and dumping Fern's intermediate representation. A description written beside a `$ref` is read by Fern and ignored by Redoc, Swagger UI and oapi-codegen, which show the referenced schema's description instead. So is `x-go-type-skip-optional-pointer` beside a `$ref`: the generated field was a pointer all along. And six schema descriptions that Fern does show still named `infra`: the control-plane create and update configs, the node pool update request, and the three NICo provider schemas. Those six no longer mention the other provider. The exclusivity rule now lives on the Infra* schemas, which the published reference omits and Swagger UI shows. The four `nico` and `infra` properties touched before wrap their `$ref` in `allOf`, so every reader applies the description, and drop the pointer extension that was never in effect; the generated Go changes only in comments. no-$ref-siblings moves from off to warn, with an accurate note, so the docs port can work the remaining 28 down. Verified: Fern IR has 0 docs strings mentioning `infra`; Redoc shows the new `nico` text and none of the old sentences; make -C controller/api lint passes with 0 errors. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(api): port the REST API Reference prose into openapi.yaml The docs team wrote "NKE REST API Reference (Alpha) - Customer Edition" by hand. This moves its language into the spec, so the reference is generated from the file the code is generated from. The text is taken as written; claims the code contradicts are corrected in the commits that follow, each with its evidence, so the review can see both. What moved: the info block (title, version, and the conventions: base URL, authentication, errors, asynchronous operations, PATCH merge semantics, lists, unauthenticated endpoints); tags carrying the concept text (infrastructure provider, Kubernetes versions, networking, control plane, OS releases); a summary, a description and the documented 400 and 409 rules for each of the 22 operations; request examples for the five writes and response examples for the error cases the PDF shows; path and query parameter text; and a description for every schema and property. Structure is unchanged: no required list, enum, pattern or bound moved, no schema was renamed, and the health endpoints stay out of `paths`. They are described in the info block instead, because the generated router would mount them under /api. Every property whose `$ref` had sibling keys now wraps the `$ref` in `allOf`: Redoc, Swagger UI and oapi-codegen ignore the siblings and Fern reads them, so this is the only form all four render. The `x-order` and `x-go-type-skip-optional-pointer` keys beside those `$ref`s are dropped, since neither ever applied there. The generated Go changes only in comments; struct fields keep their order. vacuum reports no warnings left. Its coverage rules are raised to errors in a later commit. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(api): configProfile is required, the PDF left it out The PDF never mentions `nico.configProfile`, and its create examples omit it. The server requires it: a NICo node pool without one is rejected ("nico.configProfile is required when creating a nico node pool", controller/internal/server/node_pools.go:298), and so is a control plane ("controlPlaneConfig.nico.configProfile is required for a nico cluster control plane", cluster_control_plane_config.go:206 and :239). Every example in the PDF would have failed with 400. The field is now described as required on the node pool and control-plane create schemas, the two create operations list it among their 400 causes, and the three request examples carry it. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(api): describe OS profiles as the controller resolves them today The PDF describes `osProfile` as the name of a release in an Operator curated catalog of MachineImage, ClusterRelease and NodePoolRelease entries, managed with nkectl. Those kinds exist as CRDs in management-engine/ (#1085, 2026-09-29), but nothing consumes them yet: management-engine/README.md says lifecycle reconciliation and the public API are not implemented, and the controller still reads OS profiles from its profiles directory (controller/internal/server/os_profiles.go:35), supplied by the Operator as described in controller/profiles/README.md. The reference now says what the API does today: `osProfile` and `configProfile` name profiles the Operator supplies to the management plane, and changing `osProfile` rolls the affected nodes. The catalog text returns when the controller resolves names against it. Example names follow the example bundle in controller/profiles/example. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(api): use the server's real error messages in the examples Three error examples in the PDF are paraphrases. The server says: "cluster update rejected: <op> in progress since <time>" (controller/internal/server/clusters.go:67), "Cannot create node pool when parent cluster is deleting" (node_pools.go:173), and for a control-plane delete that would breach the minimum, the sentence in controller/internal/nodes/control_plane_delete_request.go:57. ClusterConditions also listed `upgrading` as required, a property the schema does not define. The PDF's required list (provisioning, provisioned, deleting) is the correct one. Nothing in the generated Go refers to it, so only the spec changes. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * chore(api): make the OpenAPI prose coverage rules errors With the REST API Reference prose in the spec, vacuum reports nothing. The coverage rules that were warnings so the gate could land first now fail the gate: every operation, parameter, schema and property has a description, and no description sits beside a bare `$ref`. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(api): quote the node-name pattern so renderers do not eat the angle brackets Redoc rendered "Node names are <cluster>-<prefix>-<NNNN>" as "Node names are --": markdown treats the angle brackets as HTML tags. Backticks keep them. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: make fern check pass and pin the Fern CLI `fern check` could not run: fern/docs.yml named a `components` directory that does not exist in the repository, so the checker failed to initialize. With that line gone it ran, and reported three broken links, all pointing at repository directories the documentation site cannot serve. They now point at the directories on GitHub. fern/fern.config.json pinned the CLI to `latest`; it now pins the version CI runs, which make/tool-versions.mk carries as FERN_VERSION. Related: Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> #330. * ci(api): render the REST API Reference with Redocly and check the docs site `make -C controller/api docs` renders openapi.yaml into one self-contained HTML page with Redocly. It bundles first, because `build-docs` applies no decorators, and redocly.yaml's `remove-x-internal` decorator is pointed at `x-fern-ignore`, so the page drops the same surface the Fern site drops. The output lands in controller/.local/, which git ignores. Node is required; npx fetches the pinned CLI. The new `API docs` workflow is advisory: it builds that page on every pull request that touches the spec or the docs and uploads it as the `api-reference` artifact, runs `fern check`, and on main publishes the Fern site when FERN_TOKEN is set. The secret is not configured yet, so that step is skipped and says so. Publishing needs a secret, which the workflow design guide keeps out of the required gate; that is why this is not a merge-gate member. Both CLIs are pinned in make/tool-versions.mk. The runner's preinstalled Node is used rather than a new pinned setup action. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(api): keep request-schema $ref properties bare Wrapping a request property's `$ref` in `allOf` changed the 400 body. kin-openapi reports a failure inside an `allOf` as a raw schema error, "Error at \"/controlPlaneConfig\": Doesn't match schema \"not\"" followed by a dump of the schema, instead of the one-line "request body has an error: ..." message, and the middleware passes it through whole. TestOpenAPIValidator_CreateRequiresExactlyOneProvider caught it: the control-plane cases no longer carried the request-body prefix the test uses to tell a schema rejection from a handler rejection. The fifteen `$ref` properties in request schemas are bare again, with their prose on the referenced schemas, which every renderer shows. The response schemas keep the `allOf` form; nothing validates responses. The sibling rule is an error, with the five deliberate `x-fern-ignore` siblings on the `infra` properties listed in openapi-lint-ignore.yaml. The generated Go changes only in comments. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * build(api): regenerate with the Go toolchain api/go.mod declares generate-check failed on the pull request while passing locally and on the Linux box. The embedded copy of openapi.yaml in server.gen.go is gzip-compressed, and compress/flate output differs between Go releases: the workspace asks for Go 1.27.1, so a developer regenerating in the workspace produces one blob, while generate-check.yml installs the 1.26.5 that controller/api/go.mod declares and produces another. `make -C controller generate-api` now runs the generator with GOWORK=off, since the api module is self-contained, and GOTOOLCHAIN pinned to the version api/go.mod declares, so every developer regenerates the bytes the gate expects. server.gen.go is regenerated that way here; only the embedded blob changes. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: render the tag descriptions in the Fern API tab controller/api/openapi.yaml now carries the concept text on its tags. `tag-description-pages: true` makes Fern render each tag description as the intro of its section in the REST API Reference, so that text ships with the reference instead of only in Swagger UI. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci(api): publish a Fern preview of the site for pull requests The `API docs` workflow now publishes a Fern preview, API Reference tab included, on every pull request and manual run that has FERN_TOKEN, and writes the preview URL to the job summary and as a notice. A stable id, pr-<number>, makes a later push overwrite the same preview, and a cleanup job deletes it when the pull request closes. FERN_TOKEN is an organization secret, but GitHub withholds secrets from `pull_request` runs of fork pull requests, so those runs say why no preview was published instead. Push the branch to this repository and dispatch the workflow to preview a fork pull request. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(api): give Fern an absolute server and order the reference sections The spec's only server was the relative `/api`, which is right for the embedded Swagger UI and the request validator but left Fern rendering request examples against `https:/https://api/...`. A second server with the placeholder host the PDF uses, `https://nke.acme.example/api`, now carries the examples; the relative one stays first, so Swagger UI's default and the validator's routing are unchanged, and is marked `x-fern-ignore`, so Fern and the Redocly page show only the absolute one. The validator still accepts requests on any host through the relative server; the server tests cover it. In docs/index.yml the API tab is flattened, so the path no longer repeats `rest-api-reference`, and the sections are laid out in reading order, Clusters first, instead of in order of first appearance, which put the one-endpoint Catalog section at the top. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: do not repeat rest-api-reference in the API tab's URL The tab slug and the api item's slug were both derived from the same title, so every reference page lived under /nke/rest-api-reference/rest-api-reference/. skip-slug on the tab keeps one segment. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: skip the api item's slug, not the tab's skip-slug on the tab left the path unchanged on the preview; the duplicated segment comes from the api item, so skip that one. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
59fbffc8bb |
feat(e2e): run the Forge site controller lane in GitHub Actions (#1152)
* feat(e2e): add the nico-forge tenant backend The suite has three backends and all of them are simulators. This adds a fourth that runs on real Forge infrastructure, so a qualification run can create a tenant cluster the way a customer does. It builds the same CAPI manifests nico-containers builds. CAPNico reconciles both, so buildNicoRequest is now a thin caller of a shared builder and the two backends differ in what they name rather than in how they ask. The manifests follow hack/create-forge-nico-cluster.sh, the one path known to have created a cluster on this site, which is also where the identifiers come from. Two payloads are the real difference. A container reaches kubeadm whatever its iPXE script says and needs no packages, so both were hardcoded stubs; a Forge instance boots the script it is given and comes up with only what it was told to install. Both are now templates, and both name component versions, which is why a nico-forge run has to be told what it is qualifying. Three flags carry that. -e2e.environment names infrastructure that exists and has no default, since a site and a VPC cannot be inferred. -e2e.versions pins what is under test. -e2e.capabilities says what the run needs, and the environment's instance types answer it, so the machine is chosen by what the run requires rather than pinned in the table. Capability matching does not fall back: a site with no GB200 fails a GB200 request instead of running it on an L40 and calling that qualified. No control-plane VIP. CWE reads an empty one as "do not configure kube-vip", which is what the working Forge script relies on, so initCluster now skips the VIP search for a backend that declares no preference. The simulator backends advertise theirs over a BGP speaker the runner hosts and are unchanged. The entry is opt-in behind the nico-forge label and provisioning-only. Create, node readiness and delete are what a first run on hardware has to get through before a deeper assertion is worth attempting, and unlike every entry above it this one spends real money. Signed-off-by: Ron Compos <rcompos@nvidia.com> * docs(e2e): say what a Forge SSH key group actually governs forge.yaml and the Site field said nothing about what sshKeyGroupID does, and the obvious reading is the wrong one: SADD 3.5.3 passes the same field to CreateInstance beside a wait-for-SSH step, which invites reading it as access. A key group governs Serial-over-LAN console access, not the OS account's authorized_keys, so attaching one grants no shell on a node. That comes from the account baked into the image, or from an authorized_keys written by cloud-init. Nothing here logs into a tenant node; the field is carried for parity with what a Forge node normally gets. Comments only. Carried over from the retired feat/e2e-forge-tenant branch, which is the one thing on it not superseded by this one. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): point nico-forge at the Forge site that has actually worked The environment file named a site taken from create-forge-nico-cluster.sh, whose defaults arrived with the original cloud-workflow-engine import and have never changed. Nothing records a cluster ever being created there; the only evidence it exists is a comment preserving one instance-type list. Two recorded provisioning exercises used az61 in Forge-Tenant-RelEng instead, and between them built a site controller and three tenant clusters that all reached CoreDNS Ready. The file now carries az61's site, VPC, subnet and key group, and the two instance types that have each carried a tenant. This also means the site key is a real name rather than "default", and that az61 has no GB200 while ytl does. The same exercises caught two omissions in the pre-kubeadm payload. It installed nke-cni-ovn-images but not nke-cni-ovn-charts, which the agent requires to be present already and never installs itself, and it never installed openvswitch-switch, which OVN needs on the host before the agent will run helm. Either one fails InstallCNI, and that failure terminates the provisioning workflow rather than retrying, so the node has to be reset and the run repeated. The payload now installs all three and the test asserts each by name. Two smaller things. The Kubernetes default was the container simulator's 1.34.2, which decided which nke-kubeadm-distro package the payload asked for; it is now 1.36.3, beside the existing CNI and SPIRE defaults, matching what az61 ran. And the table entry carried a "happy-path" label alongside "nico-forge", which put it inside test-e2e-happy-path -- a target whose own help text says CAPD and NICo VMs, and which a developer runs expecting a simulator rather than real hardware. Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(e2e): provision a site controller node on Forge Add the SADD 3.5.3 contract (internal/infra) and its Forge implementation on the vendored ncx-infra-controller-rest SDK. ProvisionNode matches an instance type from the site's declared capabilities, reads the tenant from GET /tenant/current, and creates the instance with phone-home disabled, since new instances cannot reach the metadata endpoint. It polls by id until Ready, dials through the site's jump host until the node answers, and holds until cloud-init reports done. Any failure after create deletes the instance on a detached context, and Session.Teardown deletes it too. The bootstrap node's cloud-init is marshaled rather than templated. It authorizes a per-run ed25519 key, starts the bundled containerd, and installs nerdctl-full, kind and clusterctl at the repository's pins, plus the IPv4-only kind network. The jump-host transport is an interface; its implementation follows. Also add jumpHost to the Forge environment schema (SADD 3.5.2) and let callers set the node agent's arguments, so --disable-mtls can agree with the bootstrap flags. Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(e2e): reach Forge nodes through the site jump host Add internal/infra/teleport. tsh ssh to the site's jump host runs a byte relay to the node's sshd (nc, or bash /dev/tcp where nc is absent), and the runner negotiates SSH with the node itself using the per-run key. The jump host holds no credential for the node, and forwards ride the node's own sshd rather than Teleport port forwarding. The first host key a node presents is pinned per address and client key. Run returns combined output and kills the command on cancel; Put and Fetch act as root through sudo, Put writing beside the target and renaming. The Forge provider takes the transport through a Teleport adapter, and Target moves to the teleport package. Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(e2e): bootstrap and deploy a site controller on a provisioned node Add internal/site, which turns a provisioned machine into a site controller over the provider's session: - Bootstrap stages nkectl, a checkout subset and image archives onto the node, generates the site spec, runs nkectl bootstrap site as root, hands off to a Deployer, forwards the API server, and waits for CWE to report healthy at the expected version. The forwarded kubeconfig keeps the node address as tls-server-name, since the API server certificate does not cover loopback. - SBOM is a Deployer for the nke-sbom deploy path: untaint, clusterctl init and a default StorageClass before, apply-capi-spiffe-exec-auth.sh after, and the per-site values and BootstrapConfig rendered in Go. Credentials go into root-only files on the node, removed afterward. - SweepTenants deletes every tenant through CWE before the site is released. - ExportRef stages the deploy path from a pinned commit while it exists only on its pull request (#812). Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(e2e): build a site controller on Forge and run a tenant against it Add the site lane (label site-controller). -e2e.site-stage picks how far it goes: provision a Forge node through the site's jump host, bootstrap the site controller with nkectl, or also deploy the SBOM stack and run the nico-forge tenant specs against the site it built. The node is torn down afterwards, tenants first, unless -e2e.keep-site or preserveOnFailure keeps it. Without a stage the lane is skipped. The tenant specs now take the management cluster from a resolver, so the same subtree runs against the configured kube context or a site the suite built. The existing spec tree is unchanged. Site inputs are identifiers in the suite config (site:); secrets come only from FORGE_API_KEY, GHCR_USERNAME and GHCR_TOKEN. The jump host is configured per run and the Teleport proxy is left to tsh, so neither is checked in. `make site-inputs` builds nkectl and the image archives the lane stages, outside the clone. Also check the SBOM deployer's values against the pinned deploy path's charts offline, and clear the goconst and unparam findings in internal/site and internal/infra/teleport. Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(e2e): run the Forge site controller lane in CI, over a password jump host Adds the workflow that drives the site controller lane on real Forge hardware, and an interim way to reach the jump host until it is enrolled in Teleport. SSHJumpHost logs into the jump host with a password and asks its sshd to forward, replacing only teleport.Dialer's relay: the session to the machine beyond it is still negotiated on the runner with the ed25519 key the run generates, so no node ever sees a password. The route is selected by JUMP_HOST_PASSWORD being set, which makes enrolling the jump host later a matter of dropping the secret. The host key is pinned by SHA256 fingerprint when site.jumpHostKey- Fingerprint is set, and accepted with a warning on every dial when it is not -- unpinned means the password is offered to whatever answers. The workflow is workflow_dispatch only, serialised repository-wide and never cancelled: a run holds a bare-metal instance for an hour and teardown is the suite's, so a killed runner leaks hardware. * ci(e2e): probe the Forge lane's network path from an ARC runner Three things the site controller lane depends on have never been tested from an ARC runner: reaching the Forge API, reaching the Teleport proxy, and reaching the jump host's sshd. The last one also decides whether the interim password route is possible at all, since the documented procedure only ever reaches that host through tsh. Reports rather than fails, because a red result is the finding. Takes no secrets. Prints the jump host's SHA256 host key, which is the value site.jumpHostKeyFingerprint wants, and asks sshd which authentication methods it accepts without offering one. Carries a scaffolding push trigger: workflow_dispatch reads its trigger from the default branch, and the probe exists to answer these questions before anything merges. * ci(e2e): re-run the Forge connectivity probe with the jump host and proxy set * ci(e2e): probe on every push to the branch, not only on its own edits * test(e2e): probe the Teleport route end to end, not just the proxy * fix(ci): install tbot, which teleport-actions/auth shells out to * ci(e2e): default the Forge site lane to Teleport, and record what the probe measured * ci(e2e): drop the dead password route and let a labelled PR run the lane Signed-off-by: Ron Compos <rcompos@nvidia.com> * test(e2e): probe the OS image URLs the node boots from Signed-off-by: Ron Compos <rcompos@nvidia.com> * test(e2e): prove tbot daemon renewal against nv-prd-dgxc Signed-off-by: Ron Compos <rcompos@nvidia.com> * ci(e2e): renew the Teleport identity with a tbot daemon instead of one 2h cert Signed-off-by: Ron Compos <rcompos@nvidia.com> * ci(e2e): pull from GHCR with the job token, as every other workflow does Signed-off-by: Ron Compos <rcompos@nvidia.com> * chore(e2e): drop the #812 fetch now that the deploy path is on main Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): pin a node's host key only after a handshake succeeds waitReachable polls a Forge node for 20 minutes while it is being imaged, and several different sshds answer on its address in that window: whatever is left on a recycled address, the imager, then the installed OS. The pin recorded the first host key any of them presented, from the callback, which runs before authentication -- so the first connection to fail auth still pinned a key, and every attempt after the real image booted was refused for the rest of the run. Run 35953715491 spent its whole 20 minutes that way. Commit the pin from Dial instead, after ssh.NewClientConn returns cleanly. That keeps what the pin is for, refusing a substitution mid-run, and adds a property it did not have: the key is generated per run and placed by cloud-init, so a completed handshake is evidence the machine that ran this run's cloud-init answered, not a leftover OS at the same address. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): stage the deploy path from the commit under test DeployPathRef was the head commit of pull request 812, staged that way while the nke-sbom deploy path existed only there. 812 was squash-merged, so that commit is on no branch, and the previous commit removed the refs/pull/812/head fetch that used to put it in the runner's clone. Both the bootstrap and full stages call ExportRef, so the next run of either would have failed in seconds on a fresh checkout. HEAD is what the comment always said this should become. On a pull_request run that is the merge commit, which is the deploy path under test; config's deployPathRef still overrides it to stage an older one against a newer suite. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): build the site lane's CWE from the checkout, not a published tag nkectl is built from the checkout and is a client of the CWE it bootstraps, so the two have to come from one commit. A published tag cannot give that today: GHCR carries release tags only and its newest, v0.1.1-rc.8, is 43 commits before #850, which removed infra.spireAttestationMethod from the cluster API. Run 35999250795 got through the kind cluster, postgres, Temporal, SPIRE, CAPI and a healthy CWE before failing on the first API call with 400 Bad Request: infra.spireAttestationMethod is required. controller/deploy/nke-sbom/controller/overlay.yaml had already hit this and pinned an NVCR per-commit tag to get around it. site-inputs now builds the image with controller's docker-build-local, which is vendored and needs no credential, and the workflow tags it with the commit under test. One value feeds the archive staged onto the node, the NKECTL_CWE_IMAGE the bootstrap runs, and the tag the SBOM deploys, so the bootstrap CWE and the site controller are the same binary. Not git describe for the tag: a CI checkout is shallow and carries no tags, so it would report v0.0.0 and stop being unique. Naming controller-version still pulls that published tag, for qualifying a release past #850. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): give the controller image build a GIT_VERSION under GitHub Actions The controller Makefile takes GIT_VERSION from CI_COMMIT_SHA whenever CI is set. That is GitLab's variable. Under GitHub Actions CI is set and CI_COMMIT_SHA is not, so GIT_VERSION was empty and docker-build-local died on one of its own tags: ERROR: failed to build: invalid tag "nvcr.io/j7sbcjl3qgta/nke-controller:" image-nvcr.yml already passes GITHUB_SHA for this; site-inputs now passes the commit it builds from, which also stamps the binary correctly. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): bootstrap the site without mTLS, and keep the node's diagnostics Run 36016817952 created the site cluster and then watched it sit in Provisioning for the full thirty minutes with no error. Two lines say why: SPIRE installed with tpmThumbprints=0, and the node reported an empty tpmEkThumbprint. That is the production SPIRE path without the one input it needs -- with no thumbprint nkectl deploys no TPM attestor at all, so the node agent can never attest and CWE can never drive kubeadm on it. The procedure that has actually built a site on az61 takes the other path on both sides, --disable-mtls in the agent's arguments and on the bootstrap. site.disableMTLS now decides both, in one place, because a mismatch between them surfaces as an opaque TLS handshake error. SPIRE and TPM are still exercised: the deploy path turns them on, which is the full stage. That run also lost everything nkectl collected. It writes cluster diagnostics on the node, the node is released minutes later, and nothing copied them off -- 48 minutes of hardware and no evidence from the cluster side. CollectDiagnostics tars them and the spec pulls them into the run artifact on failure, best effort, on a detached context so a spec that timed out can still use it. Signed-off-by: Ron Compos <rcompos@nvidia.com> * ci(e2e): keep the site lane's log when the run is green go test buffers a passing package's stdout and discards it, so run 36033032946 -- the first bootstrap to succeed on Forge hardware -- uploaded a 1.7 KB artifact with no Ginkgo output in it. The upload step describes a green run as the reference for diagnosing the next red one, which needs the run to have been kept. Signed-off-by: Ron Compos <rcompos@nvidia.com> * test(e2e): collect the node's diagnostics when a tenant fails too Only the bootstrap spec collected them, which was enough while the lane stopped at bootstrap. The full stage runs tenants against the site it built, and a tenant that never reaches Ready is a failure of that site's control plane -- whose evidence leaves with the node that teardown releases moments later. Collection is idempotent, so the bootstrap archive still wins when both paths run: it was written closest to the failure. Signed-off-by: Ron Compos <rcompos@nvidia.com> * ci(release): record what each publisher published, by digest Precondition for assembling a release candidate: every artifact has to be addressable by a digest that outlives the run that made it. The plan assumed the publishers already computed digests and discarded them into step summaries, so this would be a matter of promoting an existing value to a job output. Reading all fifteen, that is true of two. image-nvcr and image-provisioned-nvcr compute per-arch and index digests; agent-artifact parses one from oras and keeps it only long enough to build an index. The other nine capture no registry digest at all -- the cli, chart and nvcr publishers push and record nothing but success. So this resolves rather than parses. One mechanism covers images, OCI artifacts and Helm charts alike, because at this layer they are all manifests behind a reference, and it avoids teaching the release layer the output format of three different clients. It is also the stronger claim: a parsed digest is what the client said it pushed, a resolved one is what the registry will serve the next consumer, and those differ exactly when something is wrong. Two adopters here, one of each kind. image-nvcr had the index digest and no way to keep it. chart-publish had nothing, and needed a docker login as well, because helm writes its own registry config where crane cannot see it. Signed-off-by: Ron Compos <rcompos@nvidia.com> * ci(release): record digests from the remaining seven publishers Completes the digest capture started for the controller image and its chart. Nine components are now addressable by a digest that outlives the run that published them. Three things the remaining publishers forced: The recorder takes a list of references, not one. The CLI publishers tag by OS and architecture and build no index, so four references are one component with no single manifest to point at; a candidate pinning only linux/amd64 would claim a coverage it does not have. Both helm publishers and the nktp one needed a docker login added. helm registry login writes helm's own config, which crane cannot see, so the existing login left the recorder unauthenticated against a registry the job had just pushed to. The component carries the destination wherever a job has a matrix. The nvcr chart and cli publishers each run twice over nke and dsx, and two legs uploading the same artifact name collide. nktp is worth calling out: its checksums.txt hashes the local archive, and its reuse branch can publish nothing at all, leaving a checksum of a file that was never pushed. The record says what GHCR actually serves on both branches. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): build the CWE with a version it will report back Run 36045936723 deployed the whole stack on Forge hardware and then failed on CWE reports version "cd95099", want "cd9509990c8f" which is one commit written two ways. GIT_VERSION only names the image. BUILD_VERSION is what the ldflags bake into version.Version, so it is what the running CWE answers with, and the site lane was setting only the first. Left alone the controller Makefile derives BUILD_VERSION from `git describe --always`, which abbreviates to seven characters on a checkout with no controller/v* tag within reach. Also stops reporting an absent diagnostics directory as a failure to collect diagnostics. nkectl writes that directory when it fails, so its absence is the ordinary case -- here it meant the deploy had worked -- and the error sent the reader looking for a second fault that was not there. A directory that exists and cannot be archived is still an error, and now a distinguishable one. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): relay the tenant API server through the site node Run 36051890151 brought up a working tenant cluster on Forge and then failed to look at it. CWE reported KubernetesReady for every desired node, and 0.6 seconds later the spec that confirms the same thing from the cluster side timed out on Get "https://10.91.194.69:6443/api": dial tcp ...: i/o timeout That address is the tenant's control plane VIP. It is reachable inside the site and not from a GitHub runner, so every tenant client in the Forge lane was dialing somewhere it cannot go. The site's own kubeconfig has been going through a tunnel since this lane was written; the tenant's never was. Forward now takes a host:port rather than a port. It always dialed through the site node, so it could already reach anything the node can, but hardcoding loopback left no way to say so. The site's own API server is still loopback and passes it explicitly. WithEndpointRelay substitutes a reachable address for each tenant API server and pins tls-server-name to the host the kubeconfig published, without which TLS fails verification instead of connecting. It hooks in at tenantRESTConfigAs, the single point both GetClient and GetAdminClient resolve an endpoint through, so all twenty-odd tenant specs are covered rather than just node readiness. Lanes that share a network with their clusters set no relay and are unaffected. Also raise the Forge tenant's delete timeout from 30 to 45 minutes. The same run failed the delete at 1800.306s while its instances were still reporting Terminating, which Forge takes 20 to 40 minutes to finish. That one was a budget, not a route. Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(e2e): record the run's resolved inputs as an artifact A green run says seven specs passed. It does not say what they passed against. The controller SHA, the OS image, the stage and where each of them came from are all in the job log, but only because Actions echoes every step's env block, and only until GitHub drops the log. The GitLab lifecycle pipelines solved this in their generate job, and for the same reason its comments give: a summary is worth having only if it reports what the run resolved rather than what its last editor remembered, and only if it outlives the log. So this collects the inputs once, into run-inputs.txt, uploaded beside site-e2e.log. Each value carries its provenance, because the same `full` can come from a dispatch input, a repository variable or the default, and which one it was is usually the question. The generated e2e-config.yaml is appended so the artifact stands on its own. The table would rot the first time someone adds an input and forgets a row, so it does not have to be remembered: the step scans the workflow for every inputs.* and vars.FORGE_* it references and fails if the table does not cover them. Signed-off-by: Ron Compos <rcompos@nvidia.com> * feat(e2e): fail on an empty filter, and write JUnit, in the Forge lane backend-e2e-lib.sh has passed all three of these since it was written. This lane passes none of them, which was not a decision. fail-on-empty is the one that matters. A label filter matching nothing is otherwise a pass, and this lane spends half an hour of bare metal before its first assertion -- rename the site-controller label and the result is a green run that provisioned hardware and qualified nothing. That is the single result a qualification lane must be unable to report, and the SADD asks for the flag by name for this reason. junit-report gives the run a machine-readable statement of which specs it ran, beside the log a person reads. no-color stops Ginkgo's escapes from landing in an artifact; reading site-e2e.log currently means stripping them first. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): stop waiting three times on one stuck tenant delete Run 36147423536 spent 112 of its 150-minute suite waiting on a single tenant that never deleted, and the suite timeout then fired inside the site teardown, before it released the Forge instance. The instance was still Ready two and a half hours later and had to be deleted by hand. Three waiters, each with a full budget, on the same cluster: deletes the cluster spec 45m tenant_test.go tenant AfterAll 45m tenant_test.go site AfterAll sweep 22m cut short by the suite timeout The second was the bug. deleted is set only after the wait succeeds, so a wait that timed out left it false and the AfterAll ran the identical delete-and-wait again. Track that the delete was requested and waited separately from whether it succeeded, and skip the repeat: the cluster is not moving, and the time belongs to the site teardown. The sweep budgets were the other half. At 40 minutes inside a 45-minute NodeTimeout they left the site release five minutes, so a slow sweep starved the one step that must not be skipped. A leaked site is worse than a leaked tenant -- it is the larger instance, and its CWE is the only thing that can still delete the tenants. Raising the delete budget would not have helped: the tenant did not go in 112 minutes, so it was stuck, not slow. Signed-off-by: Ron Compos <rcompos@nvidia.com> * docs(qualification): document the hardware qualification lane The lane had no entry point. Someone arriving at docs/qualification found three reference pages and nothing telling them what the lane is, what it proves, or what it does not. overview.md is that front door: qualification against CI lanes, the four layers, how a run is triggered, the three stages and what each costs, the artifacts a run leaves, and a plain statement of what is qualified today and what is not. The other three are the references it points at. hardware-lane.md explains how each layer actually works, environments.md the schema and capability matching behind environments/forge.yaml, and triage.md how to tell a failure of ours from a failure of the site -- including the DHCP signature that cost a day to recognise the first time. Indexed in docs/README.md, which is the index of record. Signed-off-by: Ron Compos <rcompos@nvidia.com> * ci(e2e): remove the Forge connectivity probe scaffolding The probe existed to answer four questions before anything merged: whether the ARC fleet could reach the Forge API and the Teleport proxy at all, whether the documented password jump-host route worked, and whether the join token would mint a certificate for a feature branch. All four are answered, and the site lane has since run green on hardware end to end, which answers them more convincingly than the probe did. Its own header said SCAFFOLDING -- remove before merge, and its triggers were the scaffolding: push on this branch, because workflow_dispatch reads its trigger from the default branch and the probe had to run before it was there, and pull_request on main, because the join token accepts refs/pull/*/merge but no feature-branch ref. Both fire on every push, so the probe has been adding two check runs per commit to a pull request that no longer needs it. Signed-off-by: Ron Compos <rcompos@nvidia.com> * DCO Remediation Commit for Ron Compos <rcompos@nvidia.com> I, Ron Compos <rcompos@nvidia.com>, hereby add my Signed-off-by to this commit: |
||
|
|
04fc5722ae |
feat(nktp): issue webhook and allocator certificates from cert-manager (#1114)
Signed-off-by: Vineeth Bandi <vbandi@nvidia.com> |
||
|
|
6b494863dc |
build: remove committed Go workspace vendoring (#1055)
- Resolve public dependencies through Go modules across builds and CI - Remove vendor-only checks and the remote test bundle - Refresh third-party notices and contributor documentation Signed-off-by: Vivin Wilson <vwilson@nvidia.com> |