docs: release process; feat(template): registry-auth-id + port-labels (DR-1399) - #297
Conversation
b60d7aa to
c6c7208
Compare
|
Promptless prepared a documentation update related to this change. Triggered by runpodctl PR #297 Updated the Review: Document runpodctl template registry-auth-id and port-labels flags |
Review follow-up + live e2e validationThe review put a hold on this PR, driven mainly by one fear about the port-labels path. I validated it against the live API and it turned out not to be real; the smaller items are addressed in commit bf1e549. Top concern — "a label write silently wipes fields" → refuted by live testThe worry: labels aren't in the REST schema, so they're applied via a GraphQL Live test on a real template:
Everything survived — start command, entrypoint, env, ports, disk, readme — plus the new labels. Crucially, To lock this in, added Re-assessment of the other majors
Minors addressed
Docs regenerated for the flag-help changes. |
|
Addressed the Round-2 blocker (NEW-1) — the only breaking-class item. Fix (6f3cf1f): carry the start command through the create overrides as the backend's canonical Tests: create-side override reconstruction, plus a stale-read guard that returns an empty Verified live: Not changed: M1 (schema-drift guard) and M4 (O(N) fetch-all in the retry loop) — correctness-neutral / perf, as noted in the review. Happy to follow up on those separately if wanted. |
templates created via the cli could not attach container registry auth, so private-registry image pulls failed and required a manual console step after each create. add --registry-auth-id to both create and update (parity with pod create), surfaced on template get via graphql. update uses a *string so passing an empty value clears the auth. refs DR-1399
--ports created port mappings but dropped the human-readable labels shown in the dashboard, because labels live in graphql's portsConfig field and not the public rest template schema. add a --port-labels flag (port=name pairs or json) to create and update. labels are applied with a follow-up graphql saveTemplate that reconstructs the template's full save-state (retrying briefly on stale reads after a create) and merges in the values just written over rest, so a fresh update is not reverted. create deletes the template if the label step fails, so the command stays atomic. labels are validated against --ports and shown on template get. refs DR-1399
template get reads the rest endpoint first, which has no port-label field, so labels set via --port-labels were saved but never echoed back. backfill portsConfig from graphql when a user-owned template exposes ports but rest returned no labels. refs DR-1399
…aveats - add TestUpdateTemplatePortLabelsPreservesStartCommand: applying a label must not wipe dockerArgs/startScript (where REST dockerStartCmd/dockerEntrypoint land), guarding the read-subset/write-whole saveTemplate path - document NormalizePort protocol validate-then-discard (port-number matching) - document port-labels comma limitation + json escape hatch (flags + parser) - trim registry-auth-id in pod create to match template create
The port-label write reads the template back over GraphQL and re-sends dockerArgs.
Immediately after create that read can be stale and return an empty dockerArgs, so
'template create --docker-start-cmd … --port-labels …' could send dockerArgs:"" and
silently wipe the just-set start command.
Carry the start command through the create overrides as the backend's canonical
{"cmd":[...],"entrypoint":[...]} dockerArgs encoding, so the label write
re-asserts it regardless of read staleness. This also completes the set of
create-time fields carried through overrides, closing the create side of the
present-but-stale read gap.
Tests: create-side override reconstruction (cmd/template) and a stale-read guard
(internal/api) that returns empty dockerArgs on read and asserts the write sends the
command, not "". Verified live: create --docker-start-cmd … --port-labels … now
round-trips dockerArgs {"cmd":["python -u app.py"]}.
6f3cf1f to
07e2227
Compare
|
Promptless prepared a documentation update related to this change. Triggered by runpodctl PR #297 Refreshed the Review: Document runpodctl template registry auth and port label flags |
What this PR does
Two independent changes, bundled per request:
templatecommand's missing flags —--registry-auth-idand--port-labels.1. docs: release process
Documents the goreleaser flow so it isn't tribal knowledge: push a
vX.Y.Ztag → thereleaseworkflow runs goreleaser → builds binaries + the GitHub release and auto-opens 2 PRs onrunpod/homebrew-runpodctl(formula + cask) that a human merges. Verified accurate againstrelease.yml,.goreleaser.yml, and the live tap repo.2. feat: template flags (DR-1399)
The ticket reported two real gaps, both confirmed against the code and fixed:
--registry-auth-idon create + updateTemplates couldn't attach a container registry auth, so private-image pulls failed and users had to fix it in the console after every create.
pod createalready had this flag; templates didn't. Added to both commands (REST fieldcontainerRegistryAuthId). Onupdateit's a*string, so passing an empty value clears the auth.--port-labelson create + update--ports "22/tcp,8888/http"created the port mappings but dropped the human-readable labels shown in the dashboard. Labels live in GraphQL'sportsConfig, not the public REST template schema — so:--port-labelsflag acceptsport=namepairs ("22=ssh,8888=jupyter lab") or JSON, validated against--ports.saveTemplatethat re-reads the template's full save-state (retrying briefly on stale reads right after a create) and merges in the values just written over REST, so a fresh write isn't reverted.template getnow shows labelsGetTemplatereads REST first (no label field), so labels were saved but never echoed back. It now backfillsportsConfigfrom GraphQL when a user-owned template has ports but REST returned no labels.Where the code lives
cmd/template/create.go,update.go,port_labels.go— flags, parsing, validation, orchestrationinternal/api/template_port_labels.go— GraphQLsaveTemplate+ save-state reconstructioninternal/api/templates.go—containerRegistryAuthId/portsConfigfields + thegetbackfillHow this was validated
Automated:
go build ./...,go vet ./...,go test ./...— all green. New unit tests cover registry-auth marshalling + clear, port-label parse/validate, save-state preservation, and thegetbackfill.Live e2e against the Runpod API (every result confirmed by querying the GraphQL server directly, not just CLI output; all temp templates deleted afterward):
--registry-auth-idcontainerRegistryAuthIdpersists server-side--port-labelsportsConfigpersists server-side (shows in dashboard)--port-labels(rename a label)template getafter createportsConfig--docker-start-cmd+--docker-entrypointand--port-labelsdockerArgs; confirmed no data loss)Reviewer notes / known trade-offs
updatepath and thegetbackfill each make an extra GraphQL round-trip. Accepted: labels aren't in REST, so a second read is unavoidable; the backfill only fires when a template actually has ports.runpod/skills/runpodctl) should get the two new flags documented — separate repo, follow-up, not in this PR.