feat(ci): publish a pre-built box image to GHCR on release tags - #272
Open
danielrmerskine wants to merge 1 commit into
Open
feat(ci): publish a pre-built box image to GHCR on release tags#272danielrmerskine wants to merge 1 commit into
danielrmerskine wants to merge 1 commit into
Conversation
Add a Release: Publish Box Image workflow that fires on every v* tag, builds
box/lager/docker/box.Dockerfile, and pushes ghcr.io/lagerdata/lager-box:vX.Y.Z
plus a bare :X.Y.Z alias. Also dispatchable against an existing tag, so images
can be backfilled for releases that predate it.
Nothing consumes the image yet, and no box behavior changes here. The client
half -- teaching `lager update` to docker pull a release instead of building
on the box -- is deliberately not in this commit. It cannot be tested until
real images exist on a registry to pull, and it has open questions that should
not ride along unexamined: the buildx preflight hard-exits before a path that
needs no buildx, and a bare `docker pull` of an amd64-only image onto an arm64
box tags something that cannot execute, which is worse than the local build it
replaces. Publishing first makes both testable against something real while
leaving the fleet untouched.
The GHCR package must be made public once, by hand, before any box could pull
anonymously. Until that happens a pull would fail even if a client asked for
one -- another reason this half is safe to land alone.
Resolve the tag through step env instead of interpolating github.event_name
and inputs.tag directly into the run block. `${{ }}` is substituted into the
script text before a shell ever parses it, so a crafted workflow_dispatch
input would execute rather than compare, and the vX.Y.Z `case` guard below it
runs too late to help. This job holds packages:write against the registry the
fleet would later pull from (zizmor: template-injection, high confidence,
high severity).
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
Release: Publish Box Imageworkflow. On everyv*tag it buildsbox/lager/docker/box.Dockerfileand pushesghcr.io/lagerdata/lager-box:vX.Y.Z(plus a bare
:X.Y.Zalias). Also dispatchable against an existing tag, so images canbe backfilled for releases that predate it.
Authored by @juul-charles-w. This is the publisher half of #263; the client half is
deliberately not here — see below.
Nothing consumes the image, and no box behavior changes.
lager updatestillbuilds locally on every path.
Why only half
#263 also taught
lager updatetodocker pullthe published image instead ofbuilding. That half is held back for four reasons:
until real images exist on the registry, and images cannot exist until this
workflow is on
main. Landing both together ships the consuming half completelyunexercised.
_docker_supports_buildkit()hard-exits before Step 8 when a box's Docker is >= 23without buildx. A
docker pullneeds no buildx — and a box that cannot build isexactly the box a pre-built image exists for.
docker pullis a box-down risk on arm64. This workflow buildslinux/amd64only. Without an explicit--platform, Docker on an arm64 host canpull the amd64 image anyway, tag it
lager, and leavestart_box.shfailing withexec format error— worse than the local build it replaces, which at leastproduces something that runs. The deploy tooling already branches for
aarch64|arm64|armv7l(cli/deployment/scripts/setup_and_deploy_box.sh).a registry blob run privileged with raw
/devand/sys/bus/usbaccess — pulled bymutable tag, with no digest pin or signature check. Worth an explicit decision
rather than arriving as a side effect.
Two smaller items for that follow-up:
store_build_hashis called unconditionally withthe local tree's hash, asserting "this image was built from this tree" when it came
from a registry; and the build-failure hint strings are
docker build-specific, sopull failures (auth,
manifest unknown, disk) get none.Changes from the original
env.${{ inputs.tag }}was interpolated directlyinto a
runblock, where${{ }}is substituted into the script text before anyshell parses it — so a crafted
workflow_dispatchinput would execute rather thancompare, and the
vX.Y.Zcaseguard below runs too late to help. This job holdspackages: writeagainst the registry the fleet would later pull from. (zizmortemplate-injection, high confidence / high severity — the only thing makingstatic-checksred on feat(update): pull pre-built box images from GHCR on release tags #263.)_try_pull_box_image, which does not exist inany version of this change.
Test plan
zizmor --no-online-audits --min-severity lowcleanactionlintcleanCOVERAGE.mdcounts match (no test changes in this PR)workflow_dispatchagainst an existing tag and confirm the imageappears on GHCR
docker pullworks from a host with no GHCR credentialsA red publish does not block a PyPI upload, since no box depends on the image.