← Back to Pull requests

Build and push with unique human-readable tags #2877

Open
ted-xie opened this pull request with 152 lines diff across 6 files
View on GitHub
ted-xie ted-xie commented on Sep 22, 2026 18:36 UTC
Author

This change will make all future Docker image builds (both automated and manual) tagged with a human-readable tag, such as: 2026.09.22-<epoch timestamp>.

Note the change in push.sh: it looks like we're pushing twice the amount of content, but in reality we're only pushing twice the number of _tags_. The total size of the image registry will not balloon significantly with this change.

Diff: 152 lines (+131 / -21) across 6 files Reviewer: fweikert Review duration: 51142m
All Vouch review confidence checks passed
Residual risk 0.05 = Change Risk (0.47) × (1 − Review Confidence (0.90)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 152 lines diff across 6 files
0.47
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.92 · 5 substantive comment(s)
0.92
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
89%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.301
Real PR Conversation Timeline
10 items
github-actions[bot] github-actions[bot] commented on Sep 22, 2026 18:36 UTC
Bot

Terraform Plan for bazel-trusted 📖


Plan: 0 to add, 1 to change, 0 to destroy.
<details><summary>Show Plan</summary>


Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # buildkite_pipeline.create-linux-docker-images will be updated in-place
  ~ resource "buildkite_pipeline" "create-linux-docker-images" {
      + cluster_name                             = (known after apply)
        id                                       = "UGlwZWxpbmUtLS0wMTkzYjcwZC1hNTgyLTRlZGUtYjZkMi1jMGQxMzUxZWE2NDg="
        name                                     = "Create Linux Docker Images"
      ~ provider_settings                        = {
          ~ filter_condition                              = null -> (known after apply)
          ~ pull_request_branch_filter_configuration      = null -> (known after apply)
            # (22 unchanged attributes hidden)
        }
      ~ slug                                     = "create-linux-docker-images" -> (known after apply)
      ~ steps                                    = <<-EOT
            ---
            priority: 100
            steps:
              - command: |-
          -       docker builder prune -a -f
                  cd buildkite/docker
          -       [ "$BUILDKITE_BRANCH" = "master" ] || [ "$BUILDKITE_BRANCH" = "testing" ] && git checkout $BUILDKITE_BRANCH
          -       echo "--- Building docker images..."
          -       ./build.sh
          -       echo "--- Pushing docker images..."
          -       ./push.sh
          +       ./build_and_push_with_tag.sh
                label: ":pipeline: Create images"
                agents:
                  - "queue=default"
        EOT
        tags                                     = []
        # (11 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

</details>

ted-xie ted-xie commented on Sep 22, 2026 18:43 UTC
Author

Hm, I need to think about this a little more. As currently designed, the change will generate images tagged with e.g. 2026.09.22-1790102428. This is fine in the top-level script (build_and_push_with_tags.sh) since the image tag is pre-calculated and then explicitly passed to both build.sh and push.sh.

There could be a problem with local development though. If a dev is iterating on their machine, each set of images generated by build.sh will have a slightly different timestamp, and a subsequent call to push.sh will calculate its own timestamp, which will be different from any of the tags from build.sh.

I added the timestamp to the tag so that we could more-or-less guarantee unique tags per build.

ted-xie ted-xie commented on Sep 22, 2026 19:20 UTC
Author

I've updated build.sh to emit a small metadata file (.image_tag) with the latest successfully-built image tag that push.sh then reads. This should fix the local dev issues.

meteorcloudy meteorcloudy commented on Sep 23, 2026 14:28 UTC
Contributor

Please rebase

ted-xie ted-xie commented on Sep 23, 2026 19:08 UTC
Author

Rebased!

fweikert fweikert commented on code on Sep 23, 2026 21:34 UTC
Code Review
buildkite/docker/utils.sh:1
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# Copyright 2026 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Utilities for calculating Docker image tags for Bazel CI.
+
+function get_tag_suffix {
+    date +%s
+}
+
+function calculate_image_tag {
+    # Comes out like 2026.09.22

What if we push multiple images on a single day (possible when testing risky changes)? Maybe we should include hour and minute, too

fweikert fweikert commented on Sep 23, 2026 21:35 UTC
Reviewer

Nice :)

ted-xie ted-xie commented on code on Sep 24, 2026 13:57 UTC
Code Review
buildkite/docker/utils.sh:1
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# Copyright 2026 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Utilities for calculating Docker image tags for Bazel CI.
+
+function get_tag_suffix {
+    date +%s
+}
+
+function calculate_image_tag {
+    # Comes out like 2026.09.22

The date tag is suffixed with the epoch timestamp (from date +%s), so the month and date are implicitly baked in. I should update the comment here. The actual tag will come out like 2026.09.24-1790258222.

ted-xie ted-xie commented on Sep 24, 2026 20:02 UTC
Author

Yun and I discussed this a bit today. I'm going to simplify the local dev tagging and use the buildkite build number for the tag suffix in CI builds to make it easier to read.

Reviewers
Assignees
ted-xie ted-xie
Labels
risk: low confidence: 89.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 47.4% (MEDIUM) · Higher = larger blast radius
47.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 89.7% · Lower = rushed or shallow review
89.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 4.9% · Safe to merge
4.9%