Skip to content

Add short git hash to Docker image tags - #865

Merged
kmontemayor2-sc merged 3 commits into
mainfrom
kmonte/docker_image_tag_with_short_hash
Nov 6, 2026
Merged

kmontemayor2-sc merged 3 commits into
mainfrom
kmonte/docker_image_tag_with_short_hash

Conversation

@kmontemayor2-sc

Copy link
Copy Markdown
Collaborator

Summary

Docker image tags built from the Makefile were date-only (YYYYMMDD_HHMM). The artifact registry enforces tag immutability, so two builds of different commits in the same minute (or a retried build) collide and the push fails. Tags now include the short git hash, e.g. 20261105_0302_483c299c, so each commit gets a unique tag.

Approach

  • Add SHORT_GIT_HASH (from git rev-parse --short HEAD, empty outside a git repo, matching the existing GIT_HASH fallback) and a single DOCKER_IMAGE_TAG?=${DATE}_${SHORT_GIT_HASH} default.
  • Point the src-cpu, src-cuda, dataflow-runtime, dev-workbench image names and the make integration_test image tag at DOCKER_IMAGE_TAG instead of DATE.

User-facing changes

  • Images pushed via make push_*_docker_image / make integration_test default to <name>:<date>_<shorthash> instead of <name>:<date>.
  • DOCKER_IMAGE_TAG is a new ?= override that flows to every image; existing overrides (DOCKER_IMAGE_*_NAME_WITH_TAG used by create_release.yml, INTEGRATION_TEST_CPU_IMAGE_TAG used by the PR workflows) keep working unchanged.

Verification

  • Evaluated the Makefile variables locally: default tag resolves to 20261105_0302_483c299c; DOCKER_IMAGE_TAG=custom propagates to all image names; INTEGRATION_TEST_CPU_IMAGE_TAG=12345.1 still overrides only the integration image.
  • Makefile-only change; the Python unit-test suite was not run.

🤖 Generated with Claude Code

kmonte and others added 2 commits October 29, 2026 17:54
The artifact registry enforces tag immutability. A date-only tag collides
when a build is retried or two builds start in the same minute.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kmontemayor2-sc
kmontemayor2-sc marked this pull request as ready for review November 6, 2026 01:12
@kmontemayor2-sc
kmontemayor2-sc added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 9481d4b Nov 6, 2026
1 check passed
@kmontemayor2-sc
kmontemayor2-sc deleted the kmonte/docker_image_tag_with_short_hash branch November 6, 2026 03:11
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.

4 participants