Commit Graph
15 Commits
Author SHA1 Message Date
Miancheng Lin cb27604ad8 chore: disable SSH password login by default in the example releases and fixtures (#2010)
- Example release templates (cli/examples) set ssh allow-pw to false.
- The nvke-nico-vms-24.04-{amd64,arm64}-fde ClusterRelease and NodePoolRelease
  fixtures set ssh_pwauth to false, matching the nvke-* releases in
  nke-site-deploy. nico-vms still enables it for its nico-diag user when
  NICO_VMS_DIAG_SSH_ENABLED is on, so guest diagnostics keep working.
- The dev scripts default to nvke-260625-24.04-x86-fde instead of the
  deprecated nke-260611-24.04-amd64-fde.
- The nico-sim "Create instance" button passes RELEASE, the variable
  capnico-create-instance.sh reads. It passed NODEPOOL_RELEASE, so the
  release typed in the button was ignored.
- capnico-create-instance.sh points at cwe-profiles/releases-nvke when the
  release is not installed.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-11-03 12:31:13 -08:00
Miancheng Lin 3317737e1e refactor(api): rename the OS profile surface to releases (#1612)
* refactor(api): rename the OS profile surface to releases

/osProfiles becomes /releases and nico.osProfile becomes nico.release, so
the REST API uses the release vocabulary the rest of the management plane
already does. Internal db and workflow structs keep their field names.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

* refactor(controller): rename the OS profile to the release

Nico payloads gain a release key. os_profile is still written alongside
it and still read as a fallback, so a CWE predating the rename keeps
reading and writing the value through a rolling upgrade or a rollback.
No stored data changes. A later release backfills release from
os_profile, then drops the mirror and the fallback.

The os_profile Prometheus label is deliberately unchanged.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

* docs: follow the OS profile rename

The request YAML in the workload-cluster guides named a field the API no
longer accepts, and two troubleshooting entries quoted error text that no
longer appears. The dashboard panel descriptions in operate/observe.md
keep the old wording: the panels and the os_profile metric label they
read are unchanged.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

* fix(scripts): read cluster NICo fields from .nico and allow an absent configProfile

The cluster-level orgID, siteID and vpcID live under .nico in the API
response, as the node pool fields already corrected do, so the script
exited before generating anything. configProfile is optional in the same
schema, and requiring it skipped a valid node pool.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

---------

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-10-15 11:56:35 -07:00
Chao 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>
2026-10-12 14:14:32 -07:00
Davanum SrinivasandClaude Fable 5.1 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>
2026-10-10 18:28:35 -04:00
Eric Staples 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>
2026-10-09 15:37:21 -07:00
Aaron Patten 418ed5c55c chore(e2e): say controller, not CWE, in the e2e harness, CI and Tilt (#1394)
Signed-off-by: Aaron Patten <apatten@nvidia.com>
2026-10-09 09:44:03 -06:00
Miancheng Lin 0f709ef431 feat(controller): resolve OS profiles from the releases and provide them locally (#1165)
* feat(controller): resolve OS profiles from the releases

CWE reads OS images and first-boot templates from ClusterRelease,
NodePoolRelease and MachineImage resources instead of the files under
PROFILES_DIR. The osProfile names clusters and node pools already store are
release names, so persisted selections keep resolving.

Provisioning and the Kubernetes upgrade both resolve a release by the node's
role through the new internal/machinerelease package: a control-plane node from
a ClusterRelease, a worker from a NodePoolRelease, with no fallback between
them. The upgrade preserves the current image's architecture, variant and
Ubuntu version and never selects a deprecated target. GET /osProfiles keeps its
contract and lists the non-deprecated ClusterRelease names.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

* feat(controller): apply the releases in every way CWE runs locally

CWE resolves every OS image from the release resources, so each way of running
it outside a fleet now installs the CRDs and applies the releases: Tilt, `make
run-local`, the gofail e2e framework, the nke-sbom deploy, and the nico-vms and
backend CI lanes. Each reads them from a releases directory, defaulting to the
committed fixtures under test/fixtures/releases. The two Tilt resources are
named machine-engine-crds and machine-engine-releases, after the resources they
install rather than after their consumer.

capnico-create-instance.sh takes the iPXE template from the NodePoolRelease's
MachineImage, under NODEPOOL_RELEASE rather than OS_PROFILE. The OS profile
matrix test lists NodePoolReleases, replacing the fleet-profiles mirror with
test/fixtures/fleet-releases. controller/AGENTS.md, controller/README.md and
the nke-sbom README say where OS images come from now.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

---------

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-10-08 13:06:31 -07:00
Aaron Patten 03cba1060d feat(dev): run Tilt and the e2e deploy paths with the nke-controller greenfield profile (#1271)
* feat(dev): run Tilt and the e2e deploy paths with the nke-controller greenfield profile

Tilt and the capd-e2e, capnico-e2e and nke-sbom deploy paths install the
controller the way a greenfield site does: release, namespace, Deployment,
Service and ServiceAccount nke-controller; SPIFFE ID
/nke-service/nke-controller; Temporal namespace nke-controller and queue
nke-controller-tasks; database nke-controller; and the field-manager,
managed-by and Teleport label/prefix values in nke-controller form.
backend-e2e.sh no longer branches on Tilt versus deploy path.

The e2e harness package internal/cwe is now internal/controller and
defaults to nke-controller. The CWE_* settings the dev loop, CI scripts
and e2e suite read are renamed NKE_CONTROLLER_*; the old names are still
read for one release, including when the new name is set but empty.
hack/nke-token.sh and hack/nke-auth-demo.sh find the controller in
nke-controller, then cloud-workflow-engine, as nkectl does.
The Tilt values file, Dockerfile, kind config and CAPD RBAC manifest are
renamed to say controller. The host-debug .env.local.example and README
example point at the nke-controller database, Temporal namespace and
queue, and the NKTP kind-validation doc queries the controller's metrics,
logs and traces under nke-controller.

Tilt stops with a recreate-the-cluster message on a cluster that still
runs the old release cwe in cloud-workflow-engine. The kind cluster name
cwe-capi and the nico-vms bridge cwebr0 are unchanged; renaming them would
force every developer to recreate their cluster or leave a stale bridge.

Chart defaults are unchanged, so existing sites keep their names.
The nke-sbom path now installs on a fresh cluster only, and its README
says so: nothing migrates an install from an earlier revision.

Signed-off-by: Aaron Patten <apatten@nvidia.com>

* fix(dev): name the controller's local SPIFFE ID and auth doc examples nke-controller

scripts/dev-env-spire.sh registers the host-run controller under the
ServiceAccount the cluster runs it as: nke-controller when that
ServiceAccount exists in namespace nke-controller, else
cloud-workflow-engine. The kubectl examples in
docs/authenticating-to-the-api.md use Tilt's names and say what to use on a
site that still runs the old name.

The comments at the cwe-capi and cwebr0 defaults describe the deferred
rename without an internal tracker reference, which docs-check rejects.

Signed-off-by: Aaron Patten <apatten@nvidia.com>

---------

Signed-off-by: Aaron Patten <apatten@nvidia.com>
2026-10-08 16:58:11 +00:00
Guillermo Gaston 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.
2026-09-08 19:33:50 -04:00
Terry Howe 43614bec44 chore: remove internal ticket references from comments (#324)
Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-08-26 17:35:56 -04:00
Akshay KumarandClaude Opus 5 485f0a5d4f refactor(controller)!: rename forge-vms to nico-vms (#279)
* refactor(controller)!: rename forge-vms to nico-vms

The name "forge" is NVIDIA-internal; NICo is the open-sourced name for the
same thing, so the component is renamed ahead of the OSS release (NKX-15090).

Renamed: the directory and Go module (controller/forge-vms ->
controller/nico-vms), both binaries (forge-vms/forge-vmsctl ->
nico-vms/nico-vmsctl), the FORGE_VMS_* environment namespace, host state under
/var/lib and /var/run, the /etc/sudoers.d setcap rule, the libvirt domain
prefix (forge-vm- -> nico-vm-), the diagnostic SSH account (forge-diag ->
nico-diag), the Tilt provider key, the Ginkgo label, the make targets and the
docs. The go.work entry, root Makefile WORK_MODULES, govulncheck GATE_WAIVED
and the lint/test workflow paths move in this same commit: `make work-check`
and the govulncheck gate both compare against those literals, so splitting
them would turn the required merge gate red.

Deliberately NOT renamed, because they name the upstream API this service
emulates rather than the service itself -- the same boundary nico-mock already
draws:

  - the /v2/org/{org}/forge/ and /carbide/ routes
  - apiName=forge in nico-credentials, which is also what CWE sends to
    production NGC
  - FORGE_URL and FORGE_ENVIRONMENT, read by CWE's real Forge client
  - Forge-Tenant-NKE, a real Forge tenant at az41
  - the carbide-pxe.forge metadata hostname baked into the FDE image

BREAKING CHANGE: no compatibility shims. Existing dev hosts must destroy their
forge-vm-* domains, re-run teardown-linux.sh then setup-linux.sh, re-export
NICO_VMS_*, and update the provider key in tilt_config.json. See the
"Migrating from forge-vms" section in controller/nico-vms/README.md.

The OS and config profile names (nke-nico-vms-*, nico-vms-cp, nico-vms-worker)
are owned by the nke-site-deploy fleet catalog; a matching MR there is required
before e2e resolves them against a real checkout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Akshay Kumar <akshaykumar@nvidia.com>

* fix(nico-vms): require --nvram when undefining legacy forge-vm domains

The migration steps added in the previous commit told readers to run
`virsh undefine --remove-all-storage`, which aborts with
"Cannot undefine domain with NVRAM/varstore" on exactly the domains it is
meant to remove: every iPXE instance boots UEFI, so libvirt allocates an
NVRAM varstore, and undefine refuses to proceed unless --nvram is passed.

Match what the code already does in internal/vm/libvirt/virsh.go -- try
--nvram --tpm first and fall back to --nvram alone on older libvirt that
does not know --tpm.

Without this the stale domain survives, and because CreateAndStart marks
domains autostart while the new reaper only matches nico-vm-, it keeps
restarting and holding its DHCP reservation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Akshay Kumar <akshaykumar@nvidia.com>

* fix(workspace): sort the nico-vms entry into its go.work position

`go work sync` writes the use() block lexically. ./controller/forge-vms sorted
before ./controller/hack/*, but ./controller/nico-vms sorts after it, and the
rename edited the line in place rather than moving it.

The set of modules is unchanged, so every static check passed locally --
`make work-check` skips the freshness re-derivation here because
cluster-api-provider-nico is not fetchable outside CI, which is exactly the
step that caught this.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Akshay Kumar <akshaykumar@nvidia.com>

---------

Signed-off-by: Akshay Kumar <akshaykumar@nvidia.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 20:16:18 -04:00
Ryan Bever 7dc33da82e fix(tilt): use monorepo sibling paths and absolutize external providers (#193)
Drop built-in forge-console wiring from the public controller Tiltfile.
Default CAPNICo and nke-site-deploy checkouts to sit beside the monorepo
root, and resolve relative external provider dirs to absolute paths so
build scripts that cd into provider_dir keep working.

Signed-off-by: Ryan Bever <rbever@nvidia.com>
2026-08-19 22:19:29 +00:00
Davanum Srinivas 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>
2026-08-18 20:42:45 -04:00
nhammernik fd95309ade chore: re-sync cwe from gitlab (#136) 2026-08-15 19:32:05 -04:00
nhammernik 7ce92b69ce feat: import cloud-workflow-engine (#7) 2026-08-05 16:25:10 -06:00