Make the podman builder run, and let a step build without pushing #120
No reviewers
Labels
No labels
blocked
bug
duplicate
effort
high
effort
low
effort
medium
effort
minimal
enhancement
help wanted
invalid
pr
feedback
pr
reviewing
question
status
backlog
status
document
status
done
status
implement
status
pending
status
planning
status
reviewing
waiting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tepichord/milner!120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/podman-builder-runs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happened
milner/podman-builderwas merged in #119 without ever having been executed.Built in a pod from the image the registry serves (
nixpkgs-e5bdc4a4), theentrypoint dies three times before a Dockerfile builds:
The re-exec's map is spelled with two separators.
unshare --map-users=0,0:"$ids"is the hybrid0,0:65536, and the util-linux theimage carries (2.42.2) accepts
0,0,65536(and0:0,65536) and refusesthe hybrid outright:
The re-exec is the whole way into the namespace, so nothing after it ran —
build-and-pushnever reachedpodman./var/tmpdoes not exist in a pod, and buildah stats its temporarydirectory rather than making it:
Nothing trusted a registry. A pod carries no certificates and the image
is not a distribution, so every handshake died with
x509: certificate signed by unknown authority— the base-image pull and the push alike./tmpdoes not exist either, and the push's--digestfile/tmp/push-digestis written after the manifest is: the push looked likeit had worked and then died with
open /tmp/push-digest: no such file or directory.With those patched by hand the whole flow works end to end, and it was
re-measured against the fixed image afterwards, in a pod built from it: a
proxy Dockerfile carrying annia's own
nix profile install --priority 4builds, a call naming no registry stops after COMMIT, and a call naming the
registry pushes and reports the served manifest equal to the pushed one.
The fix
--map-users=0,0,"$ids",--map-groups=0,0,"$ids";mkdir -p /run/user/0/libpod/tmp /var/tmp, both for the measured reason;pkgs.cacertridescontentsandSSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crtis in the image's
Env, because Go — podman and buildah — does not read adistribution's path by default;
gitMinimal: it is the step image, and naming a tag fromthe checkout (
git rev-list --count HEAD) is a step's own line.The interface, and why it moved
A call now takes two required arguments and one optional registry, so a
step that must not push is one command with no registry and no secret:
The login happens only when a token was handed over.
milner/**andpreview/**are anonymous pushes (docs/woodpecker-ci.md §9n), so a callerpushing to one of those is no longer stopped by a variable it has no reason to
set, and a destination that does need the
annia-cicredential is refused bythe registry itself.
podmanBuilderChecknow holds each measure, the hybrid separator as anegative, and names
pkgs.pkgsStatic.busyboxfor the reasonreaperCheckdocuments — without it
/bin/sh's chain leaves the extracted root for a storethe sandbox does not carry, and the check failed on a correct image under
nix build's default sandbox.What merging this does
flake.nixis an input to two tag guards, so this change movesmilner/reaperto
0.2.4andmilner/annia-enqueuerto0.1.3(the same bump the previousflake change made), with the docs and manifests that name each tag.
flake.lockdoes not move, so the builder's tag does not move. Themain-push
build-podman-builderstep re-pushesnixpkgs-e5bdc4a4with thefixed bytes, which means:
so a step pinning a mutable tag sets
pull: true(annia-infra#318 does);look at next — it is recorded in §9n, not fixed here.
Checks
nix build .#podmanBuilderCheckpasses under the default sandbox (and themessage it prints is unchanged);
python -m pytest tests/— 331 passed;ci/{reaper,enqueuer,router,oz}-tag-guard.sh mainall agree;applied by hand:
DIGESTS-MATCH.The builder image shipped without ever having been run: `/bin/build-and-push` died on three things before a Dockerfile ever built, all measured in a pod built from the pushed image. * `unshare --map-users=0,0:"$ids"` is a mixed separator, and the util-linux the image carries refuses the hybrid outright (`unshare: invalid mapping '0,0:65536'`) while taking `0,0,65536` (and `0:0,65536`). The re-exec is the whole way into the namespace, so nothing ran at all; * buildah *stats* its temporary directory rather than making it, and a pod carries no `/var/tmp` (`creating a temporary directory: stat /var/tmp: no such file or directory`), so the first thing a build does died; * nothing in the image trusted a registry: a pod carries no certificates and Go — podman and buildah — does not read a distribution's path by default, so every handshake failed with `x509: certificate signed by unknown authority`. `pkgs.cacert` rides `contents` now and `SSL_CERT_FILE` names the bundle in the image's `Env`. The registry is optional as well: two required arguments and one, so a call that names no registry builds and stops. That is the shape a pull-request step runs — the Dockerfile is proved to build without writing a tag no preview deploys, and without a secret it has no reason to hold. `milner/**` and `preview/**` are anonymous pushes, so the login happens only when a token was handed over; a destination that does need the `annia-ci` credential is refused by the registry itself, which is the only party that can say so. `podmanBuilderCheck` holds each of these, the hybrid separator as a negative, and names `pkgs.pkgsStatic.busybox` for the reason reaperCheck documents: without it `/bin/sh`'s chain leaves the extracted root for a store the sandbox does not carry, and the check fails on a correct image. `flake.nix` is an input to two tag guards, so `reaper` and `annia-enqueuer` move to `0.2.4` and `0.1.3` — the same bump the previous flake change made, and each with the docs that name the tag.d6b75033a27590e106277590e1062727cc28b34527cc28b345f38aeaef33f38aeaef3368c5283a44