Repository navigation
fix(ci): make image builds noninteractive - #196
Conversation
Both image builds fail in packer: - arm64-rpi: dpkg halts on the interactive initramfs.conf conffile prompt (Y/I/N/O/D/Z) during 'apt-get upgrade' kernel configuration, then cascades: E: Sub-process /usr/bin/dpkg returned an error code (1) - amd64: debconf falls back through Dialog/Readline/Teletype frontends (no controlling tty) and the build later fails on 'E: Package netcat has no installation candidate' - the netcat metapackage was removed in Debian trixie Fixes: - export DEBIAN_FRONTEND=noninteractive and install an apt.conf.d dropin with Dpkg::Options --force-confdef/--force-confold so conffile prompts resolve to the default action and keep the existing config (build_joininbox.sh and the amd64 update.sh kernel upgrade) - install netcat-openbsd when the netcat metapackage is unavailable
PR CI builds pull head commits from forks which are not signed by the maintainer keys, so the mandatory PGP verification in build_joininbox.sh fails every PR image build: # BUILD FAILED --> PGP verification not OK / signature(0) verify(0) Behavior after this change: - pull_request workflow runs pass the PR number through the packer build chain (workflow -> build script -> packer var -> provisioner env -> JOININBOX_PR_NUMBER) - build_joininbox.sh skips the source signature verification when JOININBOX_PR_NUMBER is set, prints a prominent warning, and labels the image in /etc/joininbox-build-info as an UNVERIFIED test build - the uploaded artifact name carries a -pr<N> suffix via BUILD_VERSION - push-to-master and workflow_dispatch builds never set the variable, so production images keep mandatory verification
|
Added 77f3d24 implementing the PR-build policy. Root cause of this run's failure: New behavior:
Bootstrap caveat: for |
RonDeBanc
left a comment
There was a problem hiding this comment.
Review: APPROVE
Two clean fixes plus a well-guarded verification model for PR builds.
The noninteractive fix (the actual CI blocker)
DEBIAN_FRONTEND=noninteractive+/etc/apt/apt.conf.d/90joininbox-noninteractivewith--force-confdef/--force-confoldbefore theapt-get upgradeis the standard, correct remedy for theinitramfs.confconffile prompt hanging packer. Applied consistently in bothbuild_joininbox.shand the amd64update.shkernel step. ✅- The
netcat→netcat-openbsdfallback viaapt-cache showhandles the trixie metapackage removal while keeping the old name on older releases. ✅
The PR-build verification skip
The gating is sound and fails in the safe direction:
JOININBOX_PR_NUMBERis only ever set onpull_requestevents from${{ github.event.pull_request.number }}(GitHub-controlled, numeric — no injection surface). Master/push builds leave it empty, and[ -n "$JOININBOX_PR_NUMBER" ]means empty ⇒ verification mandatory. Production builds can't smuggle the skip in.- Labeling is done right:
-pr<N>suffixed intoBUILD_VERSION(so artifact names carry it) plus/etc/joininbox-build-infomarking the image as an unverified test build. - This complements #190 nicely: production paths stay signature-verified, and PR CI images now provide exactly the "test PRs in an isolated image" path that #190's consent warning recommends.
Notes (non-blocking)
- The apt dropin persists in deployed images. The PR body says it's "removed naturally with the image" — it isn't; it ships in the image, so every future
apt/dpkgoperation on a running node will silently keep old conffiles instead of prompting. For an appliance that's arguably desirable, but either remove the dropin at the end ofbuild_joininbox.shor correct the description so it's a deliberate choice. - Consider surfacing
/etc/joininbox-build-infoon first boot or in the menu, so a flashed PR image can't be mistaken for a production one after the artifact name is long forgotten. - Pre-existing, unrelated to this PR: both workflows still use the deprecated
::set-outputcommand — worth migrating to$GITHUB_OUTPUTin a follow-up.
Reviewed by Ron DeBanc (Hermes Agent)
- Remove /etc/apt/apt.conf.d/90joininbox-noninteractive at the end of build_joininbox.sh: the noninteractive dpkg conffile policy is a build-time measure and must not ship in deployed images, where interactive conffile handling is the default again - Show '!!! UNVERIFIED PR BUILD #<N> - TESTING ONLY !!!' on top of the main menu whenever /etc/joininbox-build-info is present, so a flashed PR image cannot be mistaken for a production build
|
All three points addressed in dd52c3e (PR body updated too):
|
RonDeBanc
left a comment
There was a problem hiding this comment.
Re-review after dd52c3e19 — APPROVE
The update directly addresses both substantive notes from my previous review:
- ✅ The build-time apt policy no longer ships in deployed images.
build_joininbox.shremoves/etc/apt/apt.conf.d/90joininbox-noninteractiveat the end, restoring the system's normal interactive conffile handling after the unattended build. On amd64,update.shruns beforejoininbox.sh; the latter recreates the same dropin for its own package phase and removes it at completion, so the final image is clean. - ✅ PR-image status is now visible during normal use.
menu.shdetects/etc/joininbox-build-infoand adds a prominentUNVERIFIED PR BUILD #N - TESTING ONLYbanner to the main menu, not merely the artifact name or a file an operator may never inspect. The menu height is adjusted accordingly.
The original assessment remains unchanged:
- The noninteractive apt/dpkg policy correctly resolves packer's conffile prompt while preserving existing configuration.
- The trixie
netcat-openbsdfallback is compatible with older releases. - The verification bypass remains limited to PR builds through GitHub's numeric PR field; an empty value keeps signature verification mandatory for production builds.
- PR artifacts are clearly labeled externally (
-pr<N>), internally (/etc/joininbox-build-info), and now interactively in the menu.
Residual notes (non-blocking)
- Cleanup happens only on successful completion. A trap could remove the apt dropin on an interrupted local build, but an interrupted image build is discarded anyway, so this is not merge-blocking.
- The deprecated workflow
::set-outputusage remains suitable for a separate cleanup PR. - ShellCheck, spelling, and Packer syntax checks pass. The amd64 and arm64 image builds are still pending at review time; approval here is for the code, with full packer execution still the final integration proof.
LGTM.
Reviewed by Ron DeBanc (Hermes Agent)
|
Looks good, will merge if the builds pass. |
Problem
Both image builds currently fail in packer on every PR:
arm64-rpi-image-build —
dpkghalts on the interactiveinitramfs.confconffile prompt (Y/I/N/O/D/Z) during kernel package configuration triggered byapt-get upgrade -f -y, then cascades:amd64-image-build — two issues:
E: Package 'netcat' has no installation candidate— thenetcatmetapackage was removed in Debian trixieAdditionally, the mandatory PGP source verification in
build_joininbox.shfails on every PR build because PR head commits come from forks and are not signed by the pinned maintainer keys:Fix
Noninteractive package management (build-time only):
build_joininbox.sh+ci/amd64/debian/scripts/update.sh: exportDEBIAN_FRONTEND=noninteractiveand install/etc/apt/apt.conf.d/90joininbox-noninteractivewithDpkg::Options { "--force-confdef"; "--force-confold"; }before the upgrades — conffile prompts resolve to the default action and keep the existing configbuild_joininbox.shso it does not ship in deployed images; running nodes keep the default interactive conffile handlingbuild_joininbox.sh: installnetcat-openbsdwhen thenetcatmetapackage is unavailable (trixie)PR builds skip code signature verification, labeled as test images:
pull_requestworkflow runs pass the PR number down the chain: workflowJOININBOX_PR_NUMBER→ build script arg → packerpr_numbervar → provisioner env →build_joininbox.sh/etc/joininbox-build-info(pr number, fork, branch, build date)!!! UNVERIFIED PR BUILD #<N> - TESTING ONLY !!!on top whenever that label is present, so a flashed PR image cannot be mistaken for a production build-pr<N>suffixpushto master andworkflow_dispatchnever set the variable → production images keep mandatory signature verificationNote: for
pull_requestevents the workflow YAML runs from the base branch, so this PR's own image-build checks still execute the old master workflow and stay red on verification. The new path activates after merge; PRs opened or rebased afterwards build green.Verified:
bash -n/sh -nclean on all modified scripts.