* 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>
9.2 KiB
nvkectl compatibility policy
Anything you script against nvkectl is a contract whether or not anyone
declared it one. This document declares it: what nvkectl promises not to break,
what it reserves the right to change, and how something that has to change gets
removed.
nvkectl versions and releases with the rest of the repository on its
vX.Y.Z tags. The release process defines what each increment
means. This document says which parts of the CLI those increments apply to.
cmd/nvkectl/contract_test.go enforces the promises below at the command
boundary — it builds the binary and runs it as a process, so it sees the exit
code, the stream each byte lands on, and what a signal does. A change that
breaks one of these promises fails that test. Changing the test to match the new
behaviour, without the deprecation below, is the thing this policy exists to
prevent.
What is contract
These are covered by semantic versioning. A change that breaks one is a MAJOR change, and reaches a release only through the deprecation process at the end of this document.
| Surface | What is promised |
|---|---|
| Command and subcommand names | version, config, bootstrap, generate, get, create, patch, delete and their subcommands keep their names and their argument shape. Aliases already published (cluster/clusters, nodepool/nodepools) keep working. |
| Flag names and semantics | A documented flag keeps its name, its short form, and its meaning. New flags may be added. A flag's default may change only in a MINOR release and only when the new default cannot break a scripted invocation. |
| Exit codes | The table below. |
| Output channels | Results go to stdout. Diagnostics, progress, logs and deprecation warnings go to stderr. The two never mix: an error message never goes to stdout, so a piped -o json is never polluted by one. A failing command writes nothing to stdout, with one exception: get clusters and get nodepools given several names print the ones that matched, kubectl-style, and exit 1 if any name was not found. A query command that succeeds writes nothing to stderr, except the trace ID mismatch warning; a command that does work, such as bootstrap, reports its progress there. The trace ID is reported on stderr only, as described under Trace ID. |
| Machine-readable output | -o json and -o yaml keep the field names they emit. nvkectl version -o short stays the bare version string and nothing else. |
| Config file | The location ($XDG_CONFIG_HOME/nvkectl/config.yaml, else ~/.config/nvkectl/config.yaml) and the sites / current-site schema. Fields may be added; existing ones are not renamed or repurposed. The binary was called nkectl until cli/v0.1.x and kept the same file under nkectl/; when the current location has no file yet, that one is read and copied over once. |
| Environment variables | The NVKECTL_* variables, as documented in the README, keep their names and meanings. Each NVKECTL_* variable is also read under its NKECTL_* name for one release, with a deprecation warning, except NVKECTL_NICO_ALLOW_INSECURE_ENDPOINT, which turns a safety check off and answers only to its own name. |
| Site spec schema | generate sitespec output and bootstrap site -f input, as documented in sitespec.md. |
Trace ID
Every command except help and completion runs under one trace ID. nvkectl sends it to the management plane in the traceparent header, and every log line of the run carries it as trace_id. How it is reported depends on the kind of command:
| Kind | On success | On failure |
|---|---|---|
Query commands: commands that only report or write files (get, version, config, generate, render) |
Nothing printed; -v logs the ID |
The error ends with Trace ID: <32 hex digits> |
Help: -h, --help, a bare group such as nvkectl create, help, completion |
Nothing printed | Not applicable |
Everything else (create, delete, patch, bootstrap, validate, deprecate <kind>) |
The last line of stderr is Trace ID: <32 hex digits>; bootstrap site also prints it before it starts |
The error ends with the same line |
The line goes to stderr only, so -o json and -o yaml output is never changed. A command cancelled by SIGINT or SIGTERM ends with it too. An unknown command or flag at the root (nvkectl bogus, nvkectl --nosuchflag) prints the bare error. If the controller answers with an X-Trace-ID that differs from the one nvkectl sent, nvkectl writes one warning to stderr per run, even for a query command, naming both IDs; check that traceparent reaches the controller and that the controller continues the incoming trace.
What is not contract
Depend on these and a patch release may break you.
- Human-readable table output. Column set, column order, widths, and the
AGEbucketing are presentation. Use-o jsonfor anything scripted. - Error message text. The exit code and the stream are contract; the wording is not. Match on the exit code, not on a substring of stderr.
- Help and usage text, including the order commands are listed in.
- Log output.
--verboseand--json-logsexist for a human reading a failure. The fields, their names, and the lines emitted at each level may change at any time. - Anything under
internal/. Go's own rules make this unimportable; it is listed so nobody vendors it by copy. - Alpha commands, which say so in their help text.
nvkectl get providersis alpha today. - Timing and ordering of the steps a long-running command prints as it runs.
Exit codes
| Code | Meaning |
|---|---|
0 |
The command succeeded. |
1 |
The command failed. Invalid input, a usage error, an unreachable or erroring management plane, and a failed operation all report 1 — nvkectl does not distinguish them by code. The reason is on stderr. |
130 |
The command was interrupted by SIGINT and stopped before finishing. 128 + SIGINT, following shell convention. |
143 |
The command was interrupted by SIGTERM and stopped before finishing. 128 + SIGTERM. |
Nothing else is returned deliberately. A code outside this table means the
process was killed by a signal nvkectl does not handle, and the shell reported
128 + signum.
130 and 143 do not mean nothing happened. Interrupting bootstrap site part way
may leave the site cluster it already created; nvkectl does not roll it back.
Before site-cluster creation has started, nvkectl tears down the bootstrap Kind
cluster unless --keep-bootstrap-cluster is set. After it has started, nvkectl
retains the bootstrap cluster for recovery and prints how to recover it.
Signals
The first SIGINT or SIGTERM cancels the running command's context. A command
that is waiting on the network or on a child process unwinds, cleans up, and
exits 130 for SIGINT or 143 for SIGTERM.
A second signal kills the process outright. nvkectl restores the default disposition as soon as the first one arrives, so a command blocked somewhere that cannot watch a context — reading a spec from a terminal, for instance — still answers to a repeated Ctrl-C.
Non-interactive use
nvkectl never prompts. Every command runs unattended, in CI, with stdin closed:
- Nothing asks for confirmation.
nvkectl delete clusterdeletes. - Nothing reads from stdin unless you passed
-f -. - Nothing requires a TTY, and no behaviour changes based on whether one is attached.
Credentials come from the config file, the kubeconfig it names, and the documented environment variables — never from a prompt.
Deprecation and removal
A flag, command, output field or environment variable that has to go follows this sequence. It is tied to the increments in RELEASE.md.
- Announce, in a MINOR release. The deprecated thing keeps working and
keeps its behaviour. Its help text says it is deprecated, says what replaces
it, and names the release it was deprecated in. Using it writes a one-line
warning to stderr — never to stdout, so a piped
-o jsonis unaffected. The release notes say the same. - Carry it for at least one further MINOR release. A replacement, where one exists, ships in the same release as the announcement, so there is never a window in which neither works.
- Remove, in a MAJOR release only, with the removal in the release notes.
Adding a command, a flag, an output field, or an environment variable is a MINOR change and needs none of this. Fixing a command that contradicted its own documentation is a PATCH change: the documented behaviour is the contract, and the bug was the deviation.
A security fix may skip the carry period. The release notes say so explicitly when it does.
Reporting a break
If a release broke something on the contract list, that is a bug — open an issue on the repository with the command, the version you moved from and to, and what changed. If it broke something on the "not contract" list, an issue is still useful: it says the line is in the wrong place.