Skip to content

Stamp image tags from STABLE_ status keys - #312

Closed
matx-sjacob wants to merge 1 commit into
buildbarn:mainfrom
matx-sjacob:sjacob/stable-stamp-keys
Closed

Stamp image tags from STABLE_ status keys#312
matx-sjacob wants to merge 1 commit into
buildbarn:mainfrom
matx-sjacob:sjacob/stable-stamp-keys

Conversation

@matx-sjacob

@matx-sjacob matx-sjacob commented Aug 5, 2026

Copy link
Copy Markdown

Related buildbarn/bb-storage#358

BUILD_SCM_REVISION and BUILD_SCM_TIMESTAMP have no STABLE_ prefix, so Bazel files them in volatile-status.txt and reports an unchanging digest for that file whatever it contains. The expand_template in bb-storage that turns them into the image tag is therefore never invalidated, and _stamped.tags.txt is generated once and reused indefinitely — on a build machine whose cache persists, every later build pushes its image to the tag produced by the first build on that machine.

This is where we hit it, on a self-hosted runner. In a single job the checkout was at 0250440 and volatile-status.txt correctly said BUILD_SCM_REVISION 0250440, while _stamped.tags.txt still held 20260407T093634Z-220cdb7 with an April mtime — four months and two version bumps stale.

The bb-storage bump is part of the fix, not incidental. That template is what expands these keys, and the pin here (10acc76a) predates 33530b6, which switched it to the prefixed names. Renaming the keys alone would leave the pinned template still reading the volatile ones, so nothing would change.

@matx-sjacob
matx-sjacob marked this pull request as draft August 5, 2026 18:13
@matx-sjacob
matx-sjacob force-pushed the sjacob/stable-stamp-keys branch 5 times, most recently from db8da3d to d9b098f Compare August 6, 2026 09:17
@matx-sjacob
matx-sjacob marked this pull request as ready for review August 6, 2026 09:48
@matx-sjacob
matx-sjacob force-pushed the sjacob/stable-stamp-keys branch from d9b098f to 61d53fd Compare August 6, 2026 14:07
BUILD_SCM_REVISION and BUILD_SCM_TIMESTAMP have no STABLE_ prefix, so Bazel
files them in volatile-status.txt and reports an unchanging digest for that
file whatever it contains. The expand_template in bb-storage that turns them
into the image tag is therefore never invalidated, and _stamped.tags.txt is
generated once and reused indefinitely.

Ephemeral CI never sees this, since each job starts with an empty cache. On a
build machine whose cache persists, every later build pushes its image to the
tag produced by the first build on that machine, silently overwriting what was
published there before.

Bump bb-storage to 33530b6 so the template consuming these keys expects the
prefixed names. Renaming the keys without the bump would have no effect, since
the pinned template still reads the volatile ones. Move go.mod to the matching
commit as well, so a plain "go build" resolves the same version the Bazel
build does.
@matx-sjacob
matx-sjacob force-pushed the sjacob/stable-stamp-keys branch from 61d53fd to a00df6d Compare August 6, 2026 21:47
@matx-sjacob

Copy link
Copy Markdown
Author

@EdSchouten please could I get a review for this one? It should be identical to buildbarn/bb-remote-execution#244

@isakstenstrom

Copy link
Copy Markdown
Collaborator

Looks good! I took your changes and updated the module lock file with the latest commits on main in #336.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants