mirror of
https://github.com/dsx-ai-factory/nvke.git
synced 2026-12-07 04:35:58 +08:00
pull-request/2414
33
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0493582197 |
test(e2e): scan CI clusters with kube-bench (#2156)
Scan the clusters the CAPD and bootstrap e2e lanes build with kube-bench, and fail the lane on any FAIL or WARN the exception register does not cover, or on an entry for a check kube-bench does not report. The scan runs the kube-bench v0.16.0 image as published, with cis-1.12, the newest benchmark it ships. The release maps no Kubernetes version after 1.34, so the scan names the benchmark rather than rely on kube-bench falling back to it. A scan runs the policies checks first and alone, in a pod that takes nothing from the host but the admin kubeconfig and runs as a service account that mounts no token, so section 5 does not report the scan itself. It then runs one pod per node, reads each report from its log, and deletes everything it created. A policies report whose audits returned no rows is an error, not a list of findings. NVKE now sets kube-controller-manager's --terminated-pod-gc-threshold to 12500, Kubernetes' own default, on every cluster it creates. The scan's check 1.3.1 looks for the flag; setting the default explicitly satisfies it without changing how many finished pods a cluster keeps. Existing clusters keep the configuration they were created with. Like the other flags NVKE sets, a cluster-create request cannot override it through extraArgs. The register, exceptions.yaml, lists each accepted check by ID, with a title and a reason in our own words. An entry applies on every node of every cluster. One whose check passed on every node is listed as unneeded, since the other kind of cluster may still need it. The CAPD lane scans "CAPD core" on pull requests and "CAPD with etcd encryption" on full runs, once their nodes are ready, and copies the results out with its diagnostics, as the local entrypoint runner now does too. Both create encrypted clusters, so the scan checks the encryption configuration NVKE renders; CAPD core now creates one. The bootstrap lane scans the site cluster in stage 4d of run.sh; a scan that failed or never reached a verdict fails the run after the teardown, and the workflow uploads the results on every provisioned run. The substrate now mounts its etcd tmpfs with mode 0700, the mode kubeadm gives the directory it creates, instead of tmpfs's default 1777. The CAPD node image, which the bootstrap image builds on, now creates the etcd user and, at every boot, gives it /var/lib/etcd, as the production node image does; the node containers mount a root-owned tmpfs there. The scan pods mount each host's /etc/passwd and /etc/group, so kube-bench names the directory's owner as the host does: its own image has no etcd user and reported UNKNOWN:UNKNOWN. Check 1.1.12 then passes on the CI clusters and on production nodes. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@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>
|
||
|
|
ba862e2f62 |
test(e2e): move CI and dev defaults to 1.36 (#2132)
Moves CI and local development off Kubernetes 1.34, which reached end of life on 2026-10-27. The CAPD node image's kindest/node base, which supplies the kubelet and kubeadm of every container node, moves from v1.34.8 to v1.36.4. kubeadm deploys a control plane at most one minor version older than itself, so every cluster version on that base moves with it: tenant defaults to 1.36.3, and site clusters and the control-plane roll target to the base's 1.36.4. The other 1.34.2 defaults move to 1.36.3: the nico-vms entries, the sample scripts and Tilt buttons, the nvkectl smoke suite and the kind smoke lane's site spec. The upgrade test starts at 1.35.3 and upgrades to 1.36.3, and the no-VIP spec, which took its target from that chain, asks for the roll target instead. The e2e kubectl image moves to alpine/k8s 1.36.4. The local development channel keys its release under "1.36". Implements part of #2041. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
46b0a6272d |
fix(e2e): probe openvswitch before the builds, not after them (#1561)
* fix(e2e): probe openvswitch before the builds, not after them The CAPD and NICo e2e entrypoints asked whether the host can load the openvswitch module only after building the CAPD node image -- the last and most expensive step before the suite starts. On the arc-arm64-cpu16 runners, which cannot load it (#1515), both jobs therefore spent four to six minutes of a cpu16 runner building an image they were about to throw away. Nothing built in between can change the answer. The module lives in the host's /lib/modules and the probe reads /sys/module, so the result is a property of the runner's kernel; the image argument supplies only /bin/sh and modprobe. Passing the CAPD node image made it look like a check on that image, which is what put the call after the build. So it moves ahead of the first build in both entrypoints and runs against alpine:3.22 -- already pinned and pulled later in the same CI script, so no new image enters the run. A host that cannot load the module now fails in seconds. This does not fix #1515: those runners still cannot load the module and the arm64 jobs still fail. It makes them fail fast and stop burning runner time. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(e2e): probe with the node image's own base, not alpine Review feedback on #1561. The probe has to run the same modprobe the nodes run. kindest/node carries kmod 34.2 built +ZSTD, which is what reads Ubuntu's compressed modules; alpine's modprobe is busybox's, a different implementation, so its answer would not be the one that decides whether the suite can pass. (The review said alpine has no modprobe at all -- it does, at /sbin/modprobe -> /bin/busybox. The conclusion holds for the other reason.) So the probe now uses the kindest/node image the CAPD node image is built FROM. build-image.sh already owns that pin and the mirror prefix, so it gains a --print-base-image mode and both entrypoints ask it rather than restating either: a tag bump there reaches the probe with no second edit. The image is one the node image build pulls minutes later anyway, so this still adds no image to the run -- it moves one pull earlier. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
4b7866bde7 |
fix(e2e): get amd64 tenant nodes to join on the site lane (#1358)
* fix(agent): report which cloud-init stage failed, not just that it did `cloud-init status` prints one word. When a node fails it, the preflight check reports "status: error" and the reason stays on the node. Run 37745107586 is what that costs. A tenant node failed cloud-init two minutes after the cluster was created; the check reported the same four words 44 times over the next 90 minutes until the suite's provision wait expired, and the node was released on teardown before anyone could log in. The run produced 97KB of diagnostics and not one byte saying what cloud-init had failed to do. The node was reachable throughout -- all 44 checks got a reply -- so the answer was sitting on a healthy machine the whole time, unasked for. `--long` adds the failing stage and its message after the status line. evaluateCloudInitStatus matches on substrings, so the longer report parses exactly as before and the extra lines ride along into the error the controller logs. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): export the deploy assets the way the ref under test lays them out The lane exports its deploy assets from the release tag being qualified, but asked every tag for a top-level deploy/ that #1291 created on 8 October. Run 37830345659 died on `git archive controller/v0.1.1: fatal: pathspec 'deploy' did not match any files`, so no existing controller release could be qualified on main, and no dispatch input worked around it: the ref is a config field with no workflow input. Replace the one hardcoded asset list and executor with a Layout, holding the four things that moved together -- the directories to export, the executor's name, the customer deploy path, and the flag spelling that executor takes. Two so far: deploy/nke-deploy.sh with --deploy-path from #1291 onwards, and build/use-nke-sbom.sh with --sbom/--target on every tag before it. What is inside a deploy path did not move, so both read controller/release.yaml from the same place within it. ResolveLayout probes for each executor rather than reading the version, because the move is a property of the tree and a version string only correlates with it: a backport, a branch or a hand-cut tag can carry either shape. A ref older than both layouts now says which executors were looked for and that a layout is owed, rather than failing in git plumbing. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): take the controller's name from the deploy path that installs it The deploy path decides the name the controller is installed under, and a configured name is a second place to say the same thing. Nothing kept the two in step: the suite default tracks main, the lane's job is qualifying release tags, and since #1271 the default is nke-controller while every tag cut before the rename installs cloud-workflow-engine. Run 37828716287 stopped before provisioning for exactly that reason, with neither CWE_NAMESPACE nor CWE_SERVICE set in the repository. Read the name out of the exported deploy path and point the suite at it. An explicitly configured name still wins and still has to agree, which is what the old check was worth -- someone who pins one has a reason, and a wrong one costs an hour on a machine. What it no longer does is fail on a name nobody chose. The environment carries it rather than a package variable because that is how the value already reaches subprocesses. It has to be set before anything reads controller.Namespace(); nothing reads it at init and the suite is serial, so newStack in BeforeAll is that point, and the doc comment says so. Also correct the workflow's own account of this. Its comment said an empty cwe-name leaves the suite on "the older name", which stopped being true at #1271 and is what makes leaving the field blank look safe. Signed-off-by: Ron Compos <rcompos@nvidia.com> * refactor(e2e): address review of the layout and controller-name fixes Three things a reader would stop on. ResolveLayout now runs ahead of ExportRef, which is where the "does this ref exist" check lives, so a version with a typo in it reported that the executor had moved and a layout was owed -- sending the reader to add an entry for a ref that does not exist. Check the ref resolves first. Stack.DeployPath was set by no caller and had become a second spelling of Layout.DeployPath, and TargetArgs took the path as an argument purely to support overriding it. Drop both, and the test that asserted the override, which defended a capability nothing uses. TestLayoutsMatchTheReleaseTags is the only test that checks the layout table against the tags the lane exports from, and it skipped in CI forever: the unit-test job checks out shallow with no tags, so it found none and quietly passed. Fetch tags there, and tell a tag that is absent from the clone apart from one that genuinely carries no executor, so the test is honest in both places. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): decode node labels from controllers either side of #1306 #1306 changed nodeLabels from a list of "key=value" strings to an object. The suite's API client is generated from the checkout and the controller it talks to is the release under qualification, so across that change the two disagree and no single generated client is right for both. NodePool declares nodeLabels required, so a controller older than #1306 sends "nodeLabels": [] on every node-pool list and the whole response fails to decode -- including on the readiness path, which reads nothing but pool names. That is what stopped run 37854934923 after the site controller came up and the tenant cluster provisioned. Reshape the field at the transport instead of the model: the generated code stays generated, the controller is untouched, and the whole accommodation is one file to delete once the oldest release the lane qualifies carries #1306. Responses only -- nothing here sends labels, and the field is omitempty everywhere it would be sent. Also stop polling a disagreement. A node becomes ready with time; a client and a controller that disagree about a schema never do. The readiness spec retried that decode once a second for 45 minutes on a held GB200 and then reported a timeout rather than the mismatch. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): wait for a default route before tenant nodes download anything Tenant pre-kubeadm commands opened with set -eu and then fetched the apt key, with nothing waiting for the network. On a node whose default route was not up yet the fetch failed at once, set -eu stopped the script, and the node never installed what it needs to join. Run 37873467928 hit this on an amd64 control plane, whose kernel line lacks the ip=dhcp the arm64 one carries; an arm64 worker running the same commands passed. The site node already waited for a route in its own user data. Move that bounded wait into the shared template, ahead of the first download, so the site node and every tenant node get it from one place. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): count node milestones as provisioning progress WaitForClusterReady called a cluster stuck when its provisioning message had not changed for the stall window. That message reads "Waiting for a control plane node to be ready to join" for the whole of the control plane's boot, which on bare metal can outlast the window while the node is still advancing. Run 37882425829 stopped an amd64 control plane sixteen minutes into a 45-minute budget, after it had gained an address and a reachable agent and while its setup script was running. Progress is now the cluster message plus each node's milestones: an address, agent ready, ready to join, joined, provisioned and Kubernetes ready. Statuses, not messages, since a node's provisioning message changes on every retry and would hide a node retrying forever. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(ci): keep a failed tenant's nodes when keep-site is set -e2e.keep-site held only the site node. The tenant cleanup still deleted a failed tenant's cluster, releasing the instances the site was kept to inspect. When KEEP_SITE is true the generated e2e config now also sets lifecycle.preserveOnFailure. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): address review of the stall check, schema check and route wait A failed node list skipped the stall check for that poll, so repeated failures could hide a stall until the deadline. It now reuses the last nodes seen, which neither hides a stall nor looks like progress when the next list succeeds. SchemaMismatch matched JSON syntax errors as well as type errors, so a truncated response stopped the readiness poll instead of being retried. Only a type error means the client and controller will never agree. The site node's user data relied on its node commands opening with the route wait. It waits on its own again; the second wait returns at once. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(capd): answer cloud-init status --long in the container-node shim The node agent now runs `cloud-init status --long`. The CAPD node image's shim accepted only the bare form and exited 2 with a usage line, which the agent treats as not done, so NodePreflight never passed on a container node and the e2e clusters never provisioned. The shim now accepts `status` and `status --long`, prints the status line first, and with --long adds extended_status, boot_status_code and detail lines. Anything else still exits 2. The shim test runs every state through both forms and checks the rejections. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(agent): decide cloud-init status from the status line alone The check searched the whole report for "status: done" before "status: error". With --long the report carries free-text detail and error lines, so a failed node whose detail contained "status: done" would have been reported ready. The state now comes from the first line that starts with "status:"; the rest is reported, not evaluated. The proto comment for check_cloud_init_status said the agent runs `cloud-init status` and matches anywhere in the output. Updated and regenerated; node_agent.pb.go changes in comments only. Signed-off-by: Ron Compos <rcompos@nvidia.com> * refactor(e2e): name deploy layouts plainly and export assets in one constructor Rename Layout to DeployLayout, LayoutDeploy/LayoutBuild to CurrentLayout/LegacyLayout, and sbomStyleTarget to legacyTargetFlags. Add ExportDeployAssets, which resolves the layout, exports the ref and adopts the controller name, returning one DeployAssets value and a cleanup. Stack carries that value instead of Assets, AssetPaths and Layout. It is still called from BeforeAll so a conflicting controller name fails before any machine is taken. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(ci): clear name-check and gitleaks on the site lane name-check failed on the old deploy path names the site lane's layout table has to carry, build/use-nke-sbom.sh and controller/deploy/nke-sbom, because every controller release tag before #1291 ships them. Allowlist the token with that reason, and reword the CurrentLayout comment so it no longer names the old script. gitleaks flagged the synthetic nats-io/nkeys module hash in the CLEAN fixture of hack/test_name_check.py, which reaches this branch's scan through the merge of main. Allow that one literal in that one file. Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): restore the controller name when the site lane cleans up ExportDeployAssets adopts the qualified release's controller name into NKE_CONTROLLER_NAMESPACE and NKE_CONTROLLER_SERVICE, and nothing put them back, so in an unfiltered run every spec after the site container read the qualified release's name instead of the suite's. Record both before adopting and restore them, set or unset, in the cleanup that already removes the export. The cleanup runs after the container's AfterAll, so teardown diagnostics still see the adopted name. Signed-off-by: Ron Compos <rcompos@nvidia.com> * refactor(e2e): drop support for controller releases before v0.2.0-rc.1 The site lane qualifies the latest controller tag, which is now controller/v0.2.0-rc.1, and nothing pins an older one. Remove what only older releases needed: - the second deploy layout, for tags that keep the executor under build/. A tag without deploy/nvke-deploy.sh now fails before any machine is taken, saying the lane qualifies v0.2.0-rc.1 and later. - the node-label shim for controllers older than #1306, and the fail-fast on a response schema mismatch that only it needed. - controller-name adoption and the cleanup that restored it. The check main had, CheckControllerName, comes back: it reads the name the release installs and fails early when the suite is not looking for it. Signed-off-by: Ron Compos <rcompos@nvidia.com> --------- Signed-off-by: Ron Compos <rcompos@nvidia.com> |
||
|
|
7c7c02949e |
chore: Rename nke to nvnke for images segment of codebase https://github.com/dsx-ai-factory/nvke/issues/1498 (#1548)
* chore: Rename nke to nvnke for images segment of codebase #1498 This is a "brute force" grep/replace approach to the image related occurences of the nke name. The goal is basically just a s/nke/nvnke/g for everything in the repo that is associated with os-images. This replacement bleeds into some other components (controller and agent) that includes references to os-image names. Closes #1498 * Keep existing image names valid * Chore: Fix/Add DCO Signed-off-by: jgriffith <jgriffith@nvidia.com> --------- Signed-off-by: jgriffith <jgriffith@nvidia.com> |
||
|
|
6bc0e1c9e8 |
fix(agent): rename node agent package and contracts to nvke (#1565)
* fix(agent): rename node agent package and contracts to nvke Signed-off-by: Chao Chen <chaoch@nvidia.com> |
||
|
|
991e236304 |
fix(e2e): retry mirror 404s in host builds and the node image pull (#1532)
mirror.gcr.io sometimes 404s a base image blob it has not cached yet; the profiles fixture build and the kindest/node pull failed on it. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
674abec4a6 |
fix(e2e): stop ovs-ctl unloading the host bridge module (#1524)
Load openvswitch or fail ovs-vswitchd first. Without the module, ovs-ctl runs rmmod bridge, which deletes every bridge on the runner, the kind network's included. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
6029bf16ab |
chore: say NVKE in the comments and display text that still said NKE (#1470)
* chore: say NVKE in the comments that still said NKE The word NKE in comments becomes NVKE: Go comments through the token scanner, so no string literal moves; proto doc comments, with the generated *.pb.go files regenerated by `make -C agent protos`; and the comment lines of YAML, shell, Make, Tilt, systemd, Packer, Nix and template files. The provisioned provider's CRD description comes from a doc comment, so `make -C cluster-api-provider-provisioned manifests` and `make -C cli provider-manifest` regenerated the CRD and the CLI's embedded copy of it. Kept on purpose: the comment quoting the "NKE Agent Version:" line the updater parses, and the comments about the NGC organisation that is named NKE. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * chore: say NVKE in the display text that still said NKE User-facing text that carried the word NKE now says NVKE: nvkectl help text; log, error and condition messages; Ginkgo suite and spec names; deb and OCI package metadata; systemd unit descriptions; workflow step names and input descriptions; Helm render failures; and the nine Markdown lines the prose sweep (#1462) missed. The tests that assert these strings move with them. Kept on purpose, because something parses or persists them: the "NKE Agent Version:" and "NKE Agent Updater Version:" lines the updater reads; the "update NKE RBAC:" errors of the UpdateNKERBAC rpc; the 2025 migration text; the OIDC upstream CA's CN and OU, since re-issuing that CA would break tenant trust; the nico-sim tenant "Forge-Tenant-NKE"; the Keycloak lab realm; and the NGC organisation that is named NKE. 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> |
||
|
|
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> |
||
|
|
418ed5c55c |
chore(e2e): say controller, not CWE, in the e2e harness, CI and Tilt (#1394)
Signed-off-by: Aaron Patten <apatten@nvidia.com> |
||
|
|
92a3039bae |
feat: default CNI to ovn-kubernetes (#1303)
* feat: default omitted CNI to ovn-kubernetes Empty cniPlugin and cniName now select ovn-kubernetes, and local images, examples, and create scripts follow that default. calico remains an explicit override. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: build OVN packages outside the gitignored bin directory crane was installed into the package tree's bin directory, which a checkout sync can delete while the download is still running. Stage the tool in the build scratch directory and create its destination immediately before moving it. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): complete pod checksums on the userspace datapath veth pods send partial checksums, and the netdev datapath forwarded them unfinished, so receivers dropped pod traffic to services and the node. Enable userspace TSO and restart ovs-vswitchd only when the setting changes. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(tilt): label the local NICo cluster button inputs The create dialog showed the defaults with no captions because text_input was called without label. Signed-off-by: Alex Greene <algreene@nvidia.com> * feat(controller): ensure host vTPM proxy for nico-containers on Linux Share ensure-vtpm-proxy.sh between Colima and bare Linux hosts, fail fast from Tilt and nico-sim when /dev/vtpmx is missing, and document the one-time host prep so remote Tilt targets do not hang waiting for kubeconfig secrets. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: load the vTPM proxy on the kernel that runs Docker Container nodes need /dev/vtpmx. Without it, swtpm never starts and nke-agent blocks while setting up SPIFFE, so provisioning looks stuck. Colima already loaded the module inside its VM, but a Linux host never did. One script now does that load, and make host-up runs it on either machine. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): keep an explicit OVN version when the plugin name is omitted Kubeadm init with no plugin name defaults to OVN, but a version sent with that request was discarded and 1.4.0 was installed instead. The requested version is used, and 1.4.0 is applied only when none was given. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): retry userspace TSO after a failed ovs-vswitchd restart ovs-vswitchd reads userspace-tso-enable only at startup. A failed restart left the setting enabled, so the next attempt treated it as already applied and never restarted the daemon. The previous value is restored on failure so the restart is tried again. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): install the CNI image package selected for a Forge sample cluster The Forge sample accepts CNI_PLUGIN=calico, but both node pools always installed the OVN image package. The pre-kubeadm commands now install the Calico images for Calico and the OVN images for OVN. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: rebuild CAPD OVN assets when any package is missing capd-image skipped preparing OVN assets when the charts package was present and newer than the script, even if the images or Helm package was gone. It now rebuilds when any of those packages is missing, and still rebuilds when the prepare script is newer than the charts package. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): fail the nico-vms sample create on HTTP errors The create request returned success on a 400 or 401 because curl exits 0 unless --fail is set, and --fail hides the body. The response stays visible, and the script now exits from the HTTP status. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): check the vTPM device in the configured Colima profile The macOS check ran colima ssh without a profile, so a non-default COLIMA_PROFILE could be reported missing or present against the wrong VM. The device checks now use the same profile colima-start.sh prepares. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: default each CAPD OVN package path on its own Setting CAPD_CNI_CHARTS_DEB_PATH skipped the images and Helm packages, so the node image was built without them. Each path is filled in when it is unset, and each one is checked before the image build. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): run container nodes on the kernel Open vSwitch datapath Userspace Open vSwitch encapsulates Geneve but has no port that can emit it, so traffic between container nodes is dropped. Container nodes now load the host kernel module and keep the dummy gateway bridge. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: drop the duplicate /lib/modules mount from CAPD nodes Kind already bind-mounts the host module tree read-only, so listing it again in extraMounts makes Docker reject the node container. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(cli): load the vTPM proxy without sudo when already root The arm64 bootstrap runner executes the job as root, and its sudoers file rejects sudo from root, so the e2e died after the fake nodes were ready. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: rebuild the CAPD Helm package when the OVN asset script changes The Helm freshness check compared prepare-ovn-assets.sh with the charts package, so a newer script could leave a stale nke-e2e-helm.deb in place. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): create the sample CAPD cluster through controlPlaneConfig The local controller rejects control-plane node pools, so the sample script's node pool was rejected before a cluster was stored. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: build the CAPD bundle mirror for the Docker daemon's architecture The legacy bundle path defaulted to amd64 OVN packages, so an arm64 daemon was served image debs it cannot install. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): reject an unknown CNI plugin instead of installing OVN The empty-plugin default already lives in the kubeadm init helper. The installer was also rewriting a typo to ovn and mutating the request. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: rebuild the CAPD OVN images package when the asset script changes The images freshness check compared prepare-ovn-assets.sh with the charts package, so a newer script could leave a stale images deb in place. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(api): waive omitting cniPlugin on cluster create An omitted plugin selects ovn-kubernetes. Clients built against the published spec were required to send the field, so the compatibility gate needs a named waiver. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): target the configured Colima profile for VM setup SSH, stop, and the failure hints used Colima's default VM, so a non-default profile never received the vTPM module or the Docker limits. Signed-off-by: Alex Greene <algreene@nvidia.com> * docs(agent): note that bare metal also uses the kernel datapath The container check keys off NKE_OVS_DATAPATH_TYPE. An unset variable keeps bare metal and VM nodes off the dummy-bridge path even though they run the kernel datapath. Signed-off-by: Alex Greene <algreene@nvidia.com> --------- Signed-off-by: Alex Greene <algreene@nvidia.com> |
||
|
|
427d6513e5 |
fix(e2e): configure CAPD userspace tunnel networking (#1314)
* fix(e2e): configure CAPD userspace tunnel networking Signed-off-by: Eric Staples <estaples@nvidia.com> * fix(e2e): keep the nkectl substrate off the OVS uplink bridge The nkectl bootstrap substrate builds FROM the CAPD node image and runs Calico. Since the uplink is always moved into the userspace br-phy bridge, kind and the fake nodes cannot reach each other on the substrate network. Signed-off-by: Eric Staples <estaples@nvidia.com> --------- Signed-off-by: Eric Staples <estaples@nvidia.com> |
||
|
|
c3fad3abff |
test(ci): use ovn-kubernetes in the default container lane (#1192)
* test(ci): use ovn-kubernetes in the default container lane Signed-off-by: Chao Chen <chaoch@nvidia.com> |
||
|
|
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> |
||
|
|
02b3333942 |
fix(e2e): pull host image builds through the Docker Hub mirror (#1208)
* fix(e2e): pull host image builds through the Docker Hub mirror The lanes already route pulls inside the Kind nodes and Helm through NKE_E2E_DOCKERHUB_MIRROR, but the host docker builds that make the controller, profiles, DSX mock, capd-reboot-controller and CAPD node images still resolved their bases from docker.io. The arm64 ARC runners share one egress address and their dind daemon has no mirror, so those builds hit 429 as soon as a few lanes ran at once: eight arm64 legs between 22:47Z and 22:59Z on 2026-10-02. Read each Dockerfile's docker.io ARG defaults and pass them as build-args on the mirror; give capd-reboot-controller and the node image the ARG they lacked; pull kindest/node through the mirror too. nico-vms gets the same variable. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(e2e): mirror the two remaining Docker Hub pulls and fix the mirror probe The first mirror runs of this change still showed two docker.io pulls. The nkectl bootstrap lane builds the controller image with nerdctl directly in the workflow, outside the lane scripts, and configureDockerHubMirror covers the bootstrap cluster's node rather than the host's containerd; it now passes the same build-args. The CAPNICo provider image is built from the staged module, whose Dockerfile names golang directly with no ARG; install-capnico.sh now feeds BuildKit a copy on stdin with official-image bases pointed at the mirror. build-image.sh's reachability probe treated the registry's 401 token challenge as no answer; it now accepts 200 and 401. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
37cd328428 |
feat(controller): pin node agent security profile per node (#1093)
- Persist each node's SPIRE attestation method, external mTLS, and TLS/JWT settings at creation. - Use the pinned profile for bootstrap, reconciliation, and agent connections. - Support mixed TPM and DSX IMDS nodes in the local Tilt setup. Signed-off-by: Vivin Wilson <vwilson@nvidia.com> |
||
|
|
340009f1e1 |
test(controller): add DSX IMDS Tilt integration (#997)
- add an optional DSX IMDS fixture using the real SPIRE plugins - build the agent plugin into local nodes and emulate NICo host identity - exercise TLS/JWT exchange and optional external mTLS with local certificates - install the mock exchange CA only for the enabled local test path - install packaged CNI manifests after kubeadm init in local node images Signed-off-by: Vivin Wilson <vwilson@nvidia.com> |
||
|
|
c543206796 |
refactor(cli)!: remove Docker from the bootstrap e2e harness (#639)
* refactor(cli)!: remove Docker from the bootstrap e2e harness Dropping the Docker bootstrap provider left the e2e harness still needing a Docker daemon: the fake-node fixture ran its containers through it, all three fixture images were built with `docker build`, and run.sh bridged those images into containerd with `docker save | nerdctl load` so nkectl could load them. The suite claimed to exercise a containerd-driven bootstrap while depending on Docker for most of its scaffolding. Everything now runs on the one containerd. The substrate takes its runtime from a single containerCLI constant rather than fourteen "docker" literals, so the next runtime change is one line. Each verb was checked against nerdctl's own command reference before porting; `inspect -f` is the one that would not have survived a rename, since nerdctl documents only `--format`, and it is the call whose output feeds the "is the node running" poll. The fixture image builds move to `nerdctl build`, which needs a buildkitd: nerdctl is a BuildKit client, not a builder. buildkitd ships in the same nerdctl-full archive the workflow already unpacks, so this is a systemd unit rather than another pinned download. It is wired to the standalone containerd and to the namespace nerdctl and kind read from -- a default buildkitd uses its own OCI worker, and images would build successfully into a store nothing else can see, surfacing much later as an ImagePullBackOff inside the bootstrap cluster rather than as a build error. capd-kindest-node/build-image.sh gains a CONTAINER_CLI variable defaulting to docker rather than being switched outright: controller/Makefile.dev and controller/hack/ci/backend-e2e.sh also drive it and still run on Docker. With the builds native to containerd, the `docker save | nerdctl load` bridge has nothing left to do and goes. That is the payoff -- it existed only because the builds were Docker's. Docker remains installed on the CI runner, so a reintroduced call would work there and pass unnoticed. `make -C cli check-no-docker` and a unit test in the substrate package are what keep this honest; both were checked against a deliberately reintroduced call rather than only against the passing case. The suite still needs root, and the network bridging still assigns the SPIRE VIP to the node-network bridge, because nerdctl cannot connect a running container to another network. The node network's bridge name now follows the br-<id[:12]> convention the kind network already relied on, rather than being read from Docker's network options. BREAKING CHANGE: `make -C cli test-e2e-bootstrap` no longer runs on Docker. It requires nerdctl with containerd, a buildkitd for `nerdctl build` to reach, and root. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * ci(nkectl): remove Docker from the e2e job so a reintroduction cannot pass Docker is installed on the linux-amd64-cpu16 pool and nothing in this job uses it any more. Left in place, a reintroduced dependency would work there and pass unnoticed -- and the grep guard added alongside the port cannot see every form that takes. A `docker build` slipped back into a Makefile target it catches. kind falling back to its Docker default if KIND_EXPERIMENTAL_PROVIDER were dropped, or nerdctl reaching Docker's containerd on /run/containerd/containerd.sock if CONTAINERD_ADDRESS were, it cannot: neither involves the word docker in a command position. So the job removes Docker before the first image is built, and asserts the removal took. The daemon, its socket and Docker's own containerd.service are stopped and masked -- the last one is the socket nerdctl defaults to, so masking it turns that fallback from a quiet success into a failure. Every docker binary on PATH is replaced in place by a shim that exits 1 with a pointer to this step, so /usr/bin/docker fails the same way a bare docker does. Three assertions follow: the CLI fails, the service is inactive, the socket is gone. A removal that did not take would otherwise read as a guarantee while providing nothing. Safe because the pool is container-based: nothing done to the environment outlives the job, and the standalone containerd-nerdctl.service the job installs is a separate unit on a separate socket. The grep guard stays as the cheap early half. It and the substrate unit test now also match an absolute-path invocation, which both previously let through; each was checked against a /usr/bin/docker probe, not only against the passing case. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * fix(e2e): permit forwarding between the kind and node bridges Since the fake nodes moved to nerdctl, nothing could cross between the two bridges. CWE's NodePreflight timed out dialing 172.26.0.x:15005 on every node, no node ever attested to SPIRE, and the site cluster sat in Provisioning until the fifteen-minute timeout -- with the cause several layers down in CWE's pod log. nerdctl's default network config gives the CNI firewall plugin ingressPolicy "same-bridge" (pkg/netutil/cni_plugin_unix.go). The plugin implements that as `iptables -I FORWARD -j CNI-ISOLATION-STAGE-1`, whose second stage DROPs any forward that leaves one CNI bridge for another (containernetworking/plugins, plugins/meta/firewall/ingresspolicy.go). Docker's bridge was not a CNI bridge, so the rule never applied to it; now both are, and it applies in both directions. The `iptables -t raw` rule this replaces was reasoned about in terms of Docker's inter-bridge drop. Whatever it did for a Docker bridge, a raw-table ACCEPT cannot pass a filter FORWARD DROP, and it was not load-bearing here. Two FORWARD ACCEPTs between exactly this pair of bridges, inserted at position 1 so they precede STAGE-1, are. Nothing else on the host becomes reachable through them, and teardown removes both. A probe now runs the moment the cluster is attached: kind to node on the agent port, node to kind on the kubelet port, via bash's /dev/tcp since neither image ships curl. A break here fails in seconds with the FORWARD chain printed, instead of surfacing as "did not report provisioned". Diagnostics also gain the host's FORWARD and CNI-ISOLATION chains, the hostport DNAT table, both network inspections, and the nke-agent and spire-agent journals from each node -- everything this diagnosis needed and had to infer. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * fix(e2e): route nodes-status through the runtime constant; close guard gaps `make -C cli nodes-status` still ran `docker ps`. It slipped past the port because the sweep covered substrate/*.go and not substrate/cmd/nodes/, and past both guards for the same reason: the unit test skipped directories, and the grep matched only an allowlist of subcommands. On a host set up per cli/AGENTS.md it failed; on one that still had Docker it printed an empty table, the fixtures now living in containerd -- the silently wrong answer is the worse of the two. The constant is exported as ContainerCLI so the command can use it. The unit test now walks the package tree. The grep now matches `docker` in command position followed by an argument, end of line, or a line continuation, so `docker buildx`, `docker compose`, `docker rmi` and a `docker \` continued onto the next line -- the prevailing style in this Makefile -- are all caught; each was probed. It is scoped to shell and the Makefile: Go is the unit test's domain, and a text grep over Go matched that test's own error message. check-no-docker is also a dependency of `lint` now. The merge gate runs `make lint` for this module, so a reintroduction blocks a merge instead of only reddening an advisory lane that nothing forces anyone to read. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * ci(nkectl): assert the Docker units are masked, and restore them afterwards Three assertions followed the removal -- CLI fails, service inactive, socket gone -- but none checked that the masks took, and the mask itself tolerated failure. docker.socket left unmasked could socket-activate the daemon back after the is-active check; containerd.service left unmasked is exactly what a dropped CONTAINERD_ADDRESS would ride on. The mask no longer tolerates failure, and a fourth assertion requires all three units to report masked. The claim that the pool is container-based rested on one comment in os-image-artifact.yml, while actionlint.yaml registers the label only as self-hosted, and image.yml and thirteen other workflows share the pool. The comment now says where the claim comes from and what it would cost to be wrong, and a Restore Docker step runs with always(): the binaries are moved aside rather than overwritten so they can be put back, the units are unmasked and started. If the premise holds it costs a second; if not, it is the difference between one red job and fourteen. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * fix(e2e): let the cross-bridge probe tell a closed port from a dropped packet The probe added with the forwarding fix aborted the run seventy seconds after attach, on a port that could not have been open. nke-agent does not bind 15005 until the node holds an SVID -- agent/cmd/agent/main.go blocks on workloadapi.NewX509Source before it reaches net.Listen -- and SPIRE is not deployed yet when the cluster is attached. The node's journal shows exactly that: "SVID is not found. Starting node attestation", against a server that does not exist yet. So the probe failed a precondition that is only met later, and the forwarding fix it was meant to verify was never exercised past that point. The host's FORWARD chain from the same run has the two ACCEPTs at positions 1 and 2, ahead of CNI-ISOLATION-STAGE-1, so the filter path itself was open. What the probe needs to establish is that packets cross the bridges, not that a service is up. A refused connection proves the former: the packet arrived and the node answered that nothing is listening. A timeout is the failure -- nothing answered, which is what the firewall plugin's cross-bridge DROP looks like. bash's /dev/tcp separates the two without help: refused fails at once, dropped hangs until `timeout` returns 124. The probe now passes on refused, fails on 124, prints the FORWARD chain on failure, and runs both directions before deciding rather than stopping at the first. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> * fix(e2e): read the control plane's address from the kind network The probe's node -> kind check resolved the control plane's address by ranging over every network in the container's own inspect output. That output lists the pod bridge alongside the kind network, so the template concatenated 10.4.1.2 with three copies of 10.244.0.1 into a single string bash could not resolve, and the check failed before it tested anything. `nerdctl network inspect kind` knows exactly one address for the container, under its name, with a CIDR suffix. Read it from there, strip the suffix, and fail plainly if the container is not on that network. The same run established the other direction: kind -> node reached the agent port and was refused, which is the node answering that nothing is listening yet -- packets are crossing the bridges. The forwarding fix is doing what it was meant to. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Lia Campbell <liac@nvidia.com> --------- Signed-off-by: Lia Campbell <liac@nvidia.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
472610d634 |
feat(nico-sim): unify nico-vms and mock-nico
Adds a Docker-backed NICo simulator backend alongside the existing VM backend, dispatched per site with a shared instances table. Existing databases migrate automatically at startup. Unifies the nico-mock and nico-vm Tilt providers into a single nico-sim provider. |
||
|
|
237807228f |
ci(nico-vms): cut the lane's clock: one upgrade hop, Calico, no pre-join reboot, and two CWE fixes (#516)
* test(e2e): let a lane cap the Kubernetes upgrade chain The upgrade specs walk 1.34.2 -> 1.35.3 -> 1.36.0 on one cluster. Each hop recycles every control-plane node, about 45 minutes on the nico-vms lane, so the two hops are the largest block of its 150-190 minute runs. NKE_E2E_UPGRADE_HOPS caps how many hops a run walks; unset, zero or invalid keeps the whole chain, so nothing changes by default. The nico-vms workflow sets 1. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * test(e2e): let a lane pick the nico-vms CNI NKE_E2E_NICO_VMS_CNI sets the CNI for nico-vms entries that do not pin one; unset keeps ovn-kubernetes. The nico-vms workflow sets calico: its image package is 523 MB against OVN's 1,579 MB, and the import that dominates each node's cloud-init drops from 3-4.5 min to about one. Entries that pin OVN (multi pod CIDRs, node pool lifecycle, cp rotation) are unchanged. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * test(fixtures): skip the pre-join reboot on the nico-vms control planes The fleet reboots before join so disable-ipv6-grub takes effect; the lane skips the 1-2 min per node. Kept on the worker so the path still runs. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(controller): coalesce DB reconcile events per key Every DB write fans out to the DB-backed controller sources, so a write storm on one row reconciles it at transaction speed. Measured on the nico-vms lane: the control-plane controller reconciled about 10 times a second for the whole of an upgrade (276,000 log lines in one run), and the node remediation controller re-issued the reboot workflow start 2,211 times in the 75 seconds a node took to reboot. Both run on the 12 cores the tenant VMs share. Deliver a key at most once per second: the first event goes out at once, events inside the window fold into one trailing delivery that runs after the last of them, so a reconcile always reads the newest state and no change is lost. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(controller): do not call an upgrade complete while nodes run the old version Right after a pool's version changes nothing is deprecated yet and every node is healthy, so the old check read that as complete and upgraded the add-ons against a node still on the previous kubeadm. Pool-managed only: the controller path never writes the pool version. Warn when the blocking pool has auto-provision disabled. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci(bootstrap-e2e): route node pulls through the CI mirror, and log the routing The lane never set NKE_E2E_DOCKERHUB_MIRROR, so the node image kept the dev-cache hostnames, which resolve to nothing in CI and sent every pull to docker.io: traefik's 55 MB took 5m48s against a 5m helm wait. hosts.toml now comes from a build arg: CI mirror, dev cache, upstream. containerd walks the list, so a missing host costs a dial. The files, the probe and the node's routing are logged. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci(bootstrap-e2e): run on the mirror branch, on NVIDIA runners With no push trigger for pull-request/N, a pull request reached this lane only through the gate, under pull_request, which self-hosted runners ignore. That forced GitHub-hosted ubuntu-22.04: 22-41 min and flaky on docker.io pull speed, against 12-13 min on cpu16. Same route as capd-e2e and nico-e2e, and like them it leaves the gate and reports as its own advisory check. A gate member is never path-filtered, so controller/** joins the paths. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
0d00d6ea11 |
fix(capd): stop defaulting the node image to the CloudFront bundle server (#389)
* fix(capd): stop defaulting the node image to the CloudFront bundle server The node image defaulted BUNDLE_SERVER_URL and INDEX_FILE_URL to d3mq564cn7sth7.cloudfront.net and baked both into AGENT_ARGS, so every tenant node carried that address for its whole life. The CI runners cannot reach it, which made the default the one setting that could never work there: the agent failed to fetch Calico, no CNI was installed, and clusters timed out. Both are empty now, and the agent flags are only emitted when a server is configured, the same way the SPIFFE flag already worked. An unset bundle server is a supported state: agent.go documents it as InstallBundle being unavailable, and a nico VM already runs that way. NODE_AGENT_BASE_URL and SPIRE_BUNDLES_BASE_URL lose their CDN defaults too. Each is now required by the path that uses it, which fails with the flag to set or the source to use instead, rather than silently reaching a host the caller cannot get to. Callers that need a bundle server set one. Both E2E entrypoints already do, pointing at the mirror they build from public sources. Two callers never did and inherited the CDN: cli/Makefile's ensure-capd-image and Makefile.dev's capd-image, so a plain `make capd-up` baked it in as well. Verified by building the image both ways: unset -> AGENT_ARGS="--disable-mlx5-rescan --secure-server-port 15005" set -> ... --bundle-server-url http://172.18.0.9/ --index-file-url http://172.18.0.9/nke_bundles/Ubuntu_24.04/index.json and by grepping the built image: no CDN string under /etc or /usr/local/bin. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci(e2e): run the local entrypoint lane on node image changes The entrypoint builds the CAPD node image through `make capd-up`, so a change under capd-kindest-node/ affects this lane, but its paths filter did not list that directory. The commit before this one changes exactly those files and would not have run the lane that exercises them. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(capd): give `make capd-up` a bundle source of its own Review caught that emptying the node image default broke the manual path. capd-image passed seven variables to build-image.sh and none was BUNDLE_SERVER_URL, so it had relied on the deleted ARG default. The agent installs Calico through FetchBundleFromIndex, and NoCniInstall is set only by the kubeadm bringup test, so a node built that way would have failed CNI with an empty URL. The E2E entrypoints export a mirror and were never affected. A new bundle-mirror target builds the bundle from public sources and serves it on the kind network beside the registry caches, and capd-image depends on it and falls back to its address. A caller that exports its own URLs still wins, which is what both E2E entrypoints do. The Dockerfile now gates each agent flag on its own variable. An index-only build was being dropped: build-image.sh keeps a caller-supplied INDEX_FILE_URL when the bundle server is empty and passes it as a build arg, and the agent lets --index-file-url win outright. Two comments that this branch made wrong: backend-e2e-lib.sh said the mirror saved a run from a CDN default that no longer exists, and cli/Makefile said its job used a public bundle host, which it no longer does. Verified by running the targets: the build failure now propagates rather than serving an empty directory, the mirror answers /index.json, and capd-image produces --bundle-server-url http://172.18.0.6/ --index-file-url http://172.18.0.6/index.json The first attempt derived nke_bundles/Ubuntu_24.04/index.json, which 404s against this layout, so the index is set explicitly. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(capd): pass the whole env to build-image.sh, and share the mirror helper Review caught that the `&&` before the environment prefix made the seven existing assignments a bare assignment list, so they became shell variables and never reached build-image.sh. Only the two after the `&&` did. That put CAPD_NODE_AGENT_LOCAL_BUILD back to auto and dropped COLIMA_DOCKER_HOST, which matters on a Colima host. The mirror address is now computed before the prefix, so the list is unbroken. My own check had missed it: I passed those variables on the make command line, and make exports command-line variables to a recipe on its own, which hid the broken prefix. This one runs `make capd-image` with nothing on the command line. bundle-mirror now calls e2e_start_bundle_mirror from backend-e2e-lib.sh instead of running its own docker. That copies into a named volume rather than bind mounting the working tree, because the daemon that resolves a bind path is not always this host, and it drops the always-restart policy that would have outlived the cluster. kind-down removes the mirror and its volume. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci(e2e): run the local entrypoint lane on the inputs it actually uses The lane did not run on the previous head. GitHub matches paths against the push, not the pull request's cumulative diff, and that push touched only controller/Makefile.dev, which the filter did not list. capd-image and bundle-mirror live in Makefile.dev, the mirror runs prepare-capd-bundles.sh, and kind-up brings the management cluster up from cwe-capi-kind.yaml. All three decide what this lane runs, and none was listed. PR 390 changes that kind config and did not run this lane either. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
6b8820124b |
fix: make the shell that CI runs work on a Mac too (#299)
Five places assumed GNU tools or bash 4. Each one is silent or misleading rather
than obviously broken, which is why they lasted: the repository has no macOS CI,
so nothing catches them.
Three `sed -i` sites. BSD sed reads the argument after -i as the backup suffix,
so `sed -i "s/..."` treats the script as the suffix and the filename as the
script. agent/Makefile:282 failed there, which broke `make deb-amd64` on a stock
Mac before it reached fakeroot; it now writes through a temporary file, which
both seds accept. backend-e2e.sh:81 and build-image.sh:182 pass several -e, and
that fails worse: sed takes the first -e as the suffix and the next as a
filename, so backend-e2e.sh's redaction pass exited non-zero having left the
diagnostics file UNREDACTED. Both now use -i.bak and remove the backup.
Verified against /usr/bin/sed: the old form reports "unescaped newline inside
substitute pattern", the new form substitutes correctly under BSD sed and GNU sed
alike.
etcd-member-remove.sh gets a bash 4 guard. It holds per-member health in an
associative array, and bash 3.2 does not reject `declare -A`: it warns on stderr,
falls back to an indexed array, resolves every non-numeric subscript to 0 and
exits 0. In a script that decides whether removing a member breaks quorum, every
member would report the last member's health. It is safe in production, because
the controller runs it on Linux nodes with bash 5, but anyone testing it on a Mac
gets silent corruption. shellcheck reports nothing for this at any severity, so a
guard is the only thing that catches it.
cluster-test.sh:260 used ${EXTRA_PACKAGES[-1]}, a negative index bash 4.2 added,
which is a hard error on 3.2. It now indexes from the length.
license.yml installed go-licenses @latest while agent/Makefile:297 and
controller/Makefile:295 both pin v2.0.1, so the workflow and the Makefiles could
reach different verdicts on the same tree, and the workflow's answer could change
with no commit. Now pinned to match.
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
|
||
|
|
b98600658a |
ci: share one E2E body between backends, and add the NICo lane (#251)
* ci: share one E2E body between backends capd-e2e.yml was 177 lines, of which only the label filter, the provider list and the artifact name were CAPD-specific. Adding a second backend meant copying the other 150, including about 60 lines of redaction-gated diagnostics. backend-e2e.yml now holds the body and capd-e2e.yml is a trigger plus configuration. It is workflow_call only, so a caller decides when a backend runs. Renamed, because none of this was CAPD-specific any more: hack/ci/capd-e2e.sh to backend-e2e.sh, hack/local-capd-e2e.sh to local-backend-e2e.sh, the make target to test-e2e-backend-ci, the CAPD_E2E_ environment prefix to NKE_E2E_, and the state directory to .local/backend-e2e. The Tilt provider list becomes a script input. It defaults to the exact set the script has always written and is validated as a JSON array rather than trusted, so CAPD behaviour is unchanged. No new lane here. This commit should be provably neutral: the capd-e2e run on it is the proof. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci(nico): add the NICo containers E2E lane The nico-containers spec was one of 60 Ginkgo specs no workflow selected. It now runs: 8 selected, 7 executed, 0 failed, in about 13 and a half minutes. CAPNICo lives in NVIDIA/cluster-api-provider-nico, an internal repository, read with NKE_INTERNAL_RO_TOKEN. That is the secret go-work-check.yml already uses for the internal module in controller/go.mod, and the mirror-branch trigger is what makes it available, since a fork's own pull_request event carries no secrets. Two things this had to get right, both found by running it. actions/checkout refuses a path outside the workspace, so the provider is checked out inside it and staged into the runner container, where everything after that point executes. The container path is not the Tiltfile's relative default: the source archive is expanded with --transform s,^controller/,, so /workspace/cloud-workflow-engine holds the controller directory, not the repo root. Tilt is told the path rather than left to infer it. The node image is built once, by the script, against a local bundle mirror and the agent source in this tree. The nico provider Tiltfile would otherwise rebuild it from the public bundle server, which the runner cannot reach, and the result would carry a released agent instead of the one under test. CAPD_KINDEST_NODE_IMAGE_PREBUILT lets CI say the image is already there; local development leaves it unset and still builds. Not in the merge gate. At 13m32s against a gate whose wall clock is about nine minutes, it would set the critical path. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
2cce33882c |
ci(controller): add CAPD E2E merge gate (#209)
Signed-off-by: Steven Zhang <stevenzhang@nvidia.com> |
||
|
|
20c0d90be6 |
feat: build from public upstream artifacts, and fix local bring-up on a bare box (#216)
* feat: default artifact downloads to public upstream sources The node image build and the node agent both fetched artifacts from an internal bundle server. That server answers NVIDIA networks and returns 403 to everyone else, so neither the image build nor a tenant node's CNI install works from outside. The artifacts themselves are not internal: the published SPIRE bundle carries the upstream spire-agent and tpm_attestor_agent binaries unmodified, byte for byte. Default to the upstream public releases and let downstream point back at the internal server: - build-image.sh assembles the SPIRE agent bundle from the spiffe/spire and spiffe/spire-tpm-plugin releases. Set SPIRE_AGENT_SOURCE=bundle to download the pre-assembled internal bundle instead. - install.sh and spire-agent.service move into the repository, since the bundle was the only place they existed. - The TPM plugin checksum is computed from the binary that was fetched, so a version bump cannot leave a stale value behind. Resolve bundles by their conventional URL first and fall back to the index. The index only maps a name, version and architecture to a path that already follows a fixed convention, so requiring it lets an unreachable index block an artifact that is reachable. A bundle server that serves artifacts but refuses index.json failed every CNI install with 'unable to fetch index'. Retry artifact downloads with backoff, in the build script and in the agent. Nodes fetch these seconds after their network comes up. Do not use curl --remove-on-error. It needs curl 7.83.0 and Ubuntu 22.04 ships 7.81.0, where the whole command fails with 'option --remove-on-error: is unknown'. The surrounding code already removes the partial file. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix: reuse the in-repo bundle assets, and clear three papercuts Reuse rather than duplicate. hack/ci/assets already carries spire-agent-install.sh and spire-agent.service, and hack/ci/prepare-capd-bundles.sh already assembles bundles from the upstream public releases with checksum verification. The previous commit added a second copy of the two assets; drop them and point the node image build at the existing ones. Also: - Makefile.dev no longer passes curl --remove-on-error when downloading clusterctl. That option needs curl 7.83.0 and Ubuntu 22.04 ships 7.81.0, where the whole command fails with 'option --remove-on-error: is unknown' and clusterctl cannot be installed at all. The failure branch already removes the partial file. Retry the download too. - The root Makefile gains a test target. It built every module and tested none, which invites the assumption that make test at the root does what make test in a module does. Each module keeps its own exclusions, so defer to its Makefile when it has one. - cmd_version strips whichever tag prefix git describe returns, not only the module's own. With no tags of their own, capd-reboot-controller and nico-mock fell through to git describe --always, picked up the nearest agent tag, and reported 'agent/v...' as their version. version-check could not catch it because the value looked plausible. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix: clear five more local-development papercuts PC-8: docs/getting-started.md offered one way to run CWE and it needed an NGC key. FORGE_ENVIRONMENT=test skips NGC auth and was documented nowhere. PC-4: the Tiltfile defaulted the profiles tree to the nke-site-deploy sibling, so a plain tilt up failed for anyone without that checkout even though controller/test/fixtures/profiles ships here and CI already uses it. Default to the in-repo fixture and name both options when it is missing. PC-3: integration-test/ had no build tag, so a plain go test ./... picked it up and failed on a connection refused to localhost:8080. make test avoided it with grep -v './integration-test', which matched by accident: . is a regex wildcard, not a path prefix. Tag the package and drop the grep. PC-7: with SPIFFE off the trust domain is empty, and CAPI node provisioning formats spiffe://<trustDomain>/... from it. The malformed ID fails after the infra machine is applied and before the CAPI Machine is, so the symptom is infra machines with no Machines, retrying forever. Refuse at startup when CAPI is enabled. SPIFFE off stays valid without CAPI. PC-10: a Temporal restart lasting seconds was enough to exit at startup, and CrashLoopBackOff then held CWE down for minutes. Retry for a minute first. PC-6: nothing is scheduled for an unregistered site and the workflow waits rather than failing, so a missing site is indistinguishable from slow provisioning. The e2e assumed the nil-UUID site but never created it. It now registers what it asks for, and the wait activity fails with a non-retryable error naming the site. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix: satisfy CI for the build-tag and retry changes Three CI failures from the previous commits. The integration-test compile job ran `go vet ./integration-test/...`, which now matches no packages because the package sits behind the `integration_test` build tag, and vet exits non-zero when nothing matches. Pass the tag. revive flagged the retry loop in the Temporal namespace registration: the if block ends in a return, so the else is redundant. Assign first, then return early. goconst flagged `ovn` and `calico` in the agent. Both name CNI plugins on InstallCNIPluginRequest and appeared as literals in three switch statements and two bundle lookups. Name them, next to the existing CNI stream constants. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
239397186c |
Test/Legacy cni capd e2e (#207)
* Revert "chore: remove legacy bundle-based CNI install path"
This reverts commit
|
||
|
|
a3c868615c |
fix(license): normalise SPDX headers to Apache-2.0, and assert it (#197)
* chore(license): normalise SPDX headers to Apache-2.0 [machine generated] MACHINE GENERATED. Every added line in this commit is `SPDX-License-Identifier: Apache-2.0` and nothing else; every removed line is the identifier it replaces, or the notice paragraph that followed it. Verified: 0 added lines are anything other than that SPDX line. 829 files. The repository ships Apache-2.0 -- LICENSE says so and GitHub reports it -- while 676 Go files and 153 others declared a different identifier, followed by a notice that contradicted it. The copyright line, the comment style and the indentation are left alone. Files carrying the short form, two SPDX lines with no notice paragraph, have the identifier swapped and nothing else. Markdown is excluded: there the identifier appears in prose describing the mismatch rather than in a header, so rewriting it would turn the sentence into a tautology. That file is handled in the next commit. Three shapes needed care, and each is worth knowing about if this is ever repeated. controller/api/prepend-license.go carries the block inside a Go raw string, so the paragraph's last line ends with a backtick; the closing delimiter is carried back onto the SPDX line rather than dropped, or the string would be left unterminated. Two shell scripts under controller/hack/ word the final sentence differently, so matching on the common ending alone misses them. And controller/.golangci.yml prefixes each line with "# //", which has to be stripped before the paragraph text can be recognised. The templates that produce these headers are rewritten here too, so this commit is self-consistent: the five addlicense boilerplates, the five goheader templates in .golangci.yml, and the block in prepend-license.go. Every header in the tree now names the same identifier. Review the next commit. This one is a substitution. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(license): one header template, and a check that reads it The previous commit fixed the headers. This one stops them drifting again, and is the part worth reviewing. Nothing here could catch a header that named the wrong licence. addlicense only ADDS a header to a file that has none; it never rewrites one already present. So `make file-license-check` runs addlicense, finds every file already stamped, produces no diff, and passes -- whatever the header says. agent/ is the proof: its template and its check have both been correct all along, and six of its files disagreed with them. Three mechanisms defined the header and could disagree with each other: an addlicense boilerplate per module, a goheader template in five .golangci.yml files, and a hardcoded block in controller/api/prepend-license.go that stamps generated API code. They are now one file, hack/license-header.tmpl, and every module reads it. make license-header-check replaces the per-module matrix and asserts two things rather than one: that a header exists, and that it names Apache-2.0. The second assertion is what this repository never had. Verified by planting a different identifier in a file and confirming the check fails and names it. Modules resolve the template through `git rev-parse --show-toplevel`, not a relative path. A relative ../hack path silently changes meaning when a module moves, which is how cli/ broke when it moved out of controller/. The file set is the union of what the per-module targets already ignored, so this covers exactly the files stamped today. 120 files carry no header at all -- generated output, testdata, fixtures, build tooling, three .github files -- and widening the set to reach them is a separate change. Mixing headers that are WRONG with headers that are MISSING would hide both. Dockerfiles stay out: addlicense keys off the file extension and gives Dockerfile.proto C-style // comments, which Docker cannot parse. AGENTS.md's licence-header rule now describes the current state: one identifier, added by `make license` rather than copied from a neighbouring file. The ban on relicensing as a side effect of unrelated work stays. The header-check job is renamed from "License headers (<module>)" to "License headers". The merge gate calls this workflow whole rather than naming its jobs, and the branch ruleset requires only `gate` and `DCO`, so no required check changes name. Verified: GOPROXY=off make build links all five binaries with no credentials; golangci-lint goheader reports 0 issues on cli and controller; `make license` is a no-op in all five modules; make license-header-check passes over 828 files and fails on a planted mismatched header. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> stderr is not captured when reading addlicense's output. addlicense prints the offending paths to stdout, while `go run` writes "go: downloading ..." on a cold module cache and "exit status 1" on failure -- both to stderr. Folding the two together reports a module download as a file with no header, which is how the first CI run of this check failed while passing on a machine whose cache was already warm. Reproduced locally against an empty GOMODCACHE. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
2722649937 |
fix(capd): stop the local agent build naming a file with a slash in it (#154)
build-image.sh derived the agent version with a bare `git describe --tags`. This repository tags per component, so that returns the nearest tag from any series, prefix and all: $ git describe --tags --always --dirty agent/v0.2.0-23-g99f70a40-dirty The value is passed back to agent/Makefile as VERSION and also names the tarball the script then copies, so the path became release/agent_agent/v0.2.0-23-g99f70a40-dirty_amd64.tgz which has a directory separator in the middle of a filename and cannot exist. The build failed at the `cp` several lines later, with a message about a missing bundle rather than about the version. Two tags sit on the same commit, `agent/v0.2.0` and `controller/v0.1.0`, so which one a bare describe returns is not even stable. Match the agent series and strip the prefix, which is what agent/Makefile already does for the same value. Both now derive v0.2.0-23-g99f70a40-dirty, so the tarball the Makefile writes is the one the script looks for. Also fail early when the version still holds a slash. The old failure pointed at the wrong line, and a caller can pass NODE_AGENT_VERSION by hand. shellcheck is clean. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
fd95309ade | chore: re-sync cwe from gitlab (#136) | ||
|
|
18e42b26e6 |
Rename node-agent to agent.
Drop the redundant "node-" prefix so the module path is github.com/NVIDIA/nke/agent rather than stuttering as nke/nke-agent. Controller still consumes the published gitlab node-agent module until a follow-up cutover. |
||
|
|
7ce92b69ce | feat: import cloud-workflow-engine (#7) |