]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commit
podman auth: share one authfile via same-shell exports podman-auth-same-shell 2668/head
authorDavid Galloway <david.galloway@ibm.com>
Tue, 28 Jul 2026 21:24:40 +0000 (17:24 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Tue, 28 Jul 2026 21:24:40 +0000 (17:24 -0400)
commitd67f8bc12c8886590471a8d465576ee42cc5e8a6
treea8699501dd7ca933f2694156ca5cd82f3b221c64
parent54a9a6643000ae9e1517cbee79900c4faa813c2d
podman auth: share one authfile via same-shell exports

The two preceding reverts remove fixes built on wrong assumptions:

aae7f2fd blamed logind tearing down the XDG runtime dir between
  steps. An auditd watch on /run/user/<uid>/containers/ disproved
  that: nothing external ever touches auth.json there; every write is
  podman login's own atomic tmp+rename. Linger is enabled and the
  agent runs as a systemd service with no login sessions, so the
  directory is stable across the whole job.
- The ceph-dev-pipeline fix (#2656) added --authfile to the logins
  plus a Groovy env.REGISTRY_AUTH_FILE assignment. Tracker 77920
  recurred on 2026-07-22 with it deployed: login wrote docker.io
  credentials to $HOME/.config/containers/auth.json, and the
  FROM docker.io/ubuntu:22.04 pull inside podman build (spawned by
  build-with-container.py) still ran anonymous and hit
  toomanyrequests.

A debug run on a builder pinned the real mechanism. With the variable
present in podman build's environment, the base image pull uses it:

  $ REGISTRY_AUTH_FILE=$HOME/.config/containers/auth.json \
      podman build --pull --log-level=debug ... 2>&1 | grep -i cred
  "Found credentials for docker.io/library/ubuntu ... in file
   /home/jenkins-build/.config/containers/auth.json"

So the pull authenticates whenever REGISTRY_AUTH_FILE actually reaches
the process, which means on 2026-07-22 it did not. That dictates the
shape of this change:

- No --authfile on logins: pointing only the login at a file steers
  credentials somewhere later pulls never look, which is worse than
  the podman default.
- No Groovy env threading: it demonstrably failed to deliver the
  variable to the bwc subprocess, and it silently depends on stage
  ordering and when{} guards.
- Instead, every sh block that invokes podman or
  build-with-container.py exports REGISTRY_AUTH_FILE itself. A
  same-shell export reaches podman through ordinary process
  inheritance and cannot be lost. podman login honors the variable
  for writes, so login and every later read use the same persistent
  file by construction. The export line is repeated verbatim in each
  block on purpose: each block is self-sufficient and the pattern is
  greppable.

Fixes: https://tracker.ceph.com/issues/77920
Signed-off-by: David Galloway <david.galloway@ibm.com>
ceph-dev-pipeline/build/Jenkinsfile
scripts/bwc.sh