Skip to content

Commit 8a15447

Browse files
authored
Fix base image builds and add PR compatibility validation for 1.29 patch prep (#307)
## What was changed - Fixed `base-admin-tools` cqlsh installation on Alpine by constraining build-time setuptools (`setuptools<81`) so cassandra-driver source builds continue to work after setuptools v82 removed `pkg_resources`. - Corrected `base-server` builder image tag from `golang:1.25-alpine3.23.3` to valid upstream tag `golang:1.25-alpine3.23`. - Added a dedicated PR workflow (`Docker PR Compatibility`) that: - builds base images from PR changes, and - builds downstream `server`, `admin-tools`, and `auto-setup` images against those PR-built base images to validate compatibility. ## Why? We are preparing for a 1.29 patch release and need base image changes to both build reliably and be validated against downstream runtime images during PRs. ## Checklist 1. Closes N/A 2. How was this tested: - Reproduced and fixed the `cqlsh` installation failure in `docker/base-images/base-admin-tools.Dockerfile`. - Verified `base-server` now references a valid Go Alpine tag. - Added PR CI compatibility build path to ensure downstream images build against PR base image changes. 3. Any docs updates needed? No
1 parent 8746f64 commit 8a15447

File tree

6 files changed

+80
-7
lines changed

6 files changed

+80
-7
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Docker PR Compatibility
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build-compat-images:
13+
runs-on: ubuntu-latest-16-cores
14+
timeout-minutes: 30
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
submodules: "true"
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
with:
24+
driver: docker
25+
26+
- uses: actions/setup-go@v5
27+
with:
28+
cache-dependency-path: "**/*.sum"
29+
go-version-file: "temporal/go.mod"
30+
31+
- name: Prepare build args
32+
run: |
33+
github_sha_short=${GITHUB_SHA:0:7}
34+
echo "IMAGE_SHA_TAG=sha-${github_sha_short}" >> $GITHUB_ENV
35+
36+
branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
37+
echo "IMAGE_BRANCH_TAG=branch-${branch_name}" >> $GITHUB_ENV
38+
39+
TEMPORAL_SHA=$(git submodule status -- temporal | awk '{print $1}')
40+
echo "TEMPORAL_SHA=${TEMPORAL_SHA}" >> $GITHUB_ENV
41+
TCTL_SHA=$(git submodule status -- tctl | awk '{print $1}')
42+
echo "TCTL_SHA=${TCTL_SHA}" >> $GITHUB_ENV
43+
44+
- name: Build Linux amd64 binaries
45+
run: make amd64-bins
46+
47+
- name: Build base images from PR changes
48+
run: |
49+
docker build \
50+
-f docker/base-images/base-server.Dockerfile \
51+
-t temporaliotest/base-server:${IMAGE_SHA_TAG} \
52+
docker/base-images
53+
54+
docker build \
55+
-f docker/base-images/base-admin-tools.Dockerfile \
56+
-t temporaliotest/base-admin-tools:${IMAGE_SHA_TAG} \
57+
docker/base-images
58+
59+
- name: Build downstream images against PR base images
60+
run: |
61+
docker buildx bake \
62+
-f docker-bake.hcl \
63+
--set "*.platform=linux/amd64" \
64+
--set "server.args.BASE_SERVER_IMAGE=temporaliotest/base-server:${IMAGE_SHA_TAG}" \
65+
--set "admin-tools.args.BASE_ADMIN_TOOLS_IMAGE=temporaliotest/base-admin-tools:${IMAGE_SHA_TAG}" \
66+
--load \
67+
server admin-tools auto-setup

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,3 @@ update-alpine:
141141
update-base-images:
142142
@printf $(COLOR) "Updating builds to use latest Temporal base images.."
143143
./scripts/update-base-images.sh
144-

docker/base-images/base-admin-tools.Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=alpine:3.23
1+
ARG BASE_IMAGE=alpine:3.23.3
22

33
FROM ${BASE_IMAGE} AS builder
44

@@ -8,9 +8,16 @@ RUN apk add --update --no-cache \
88
musl-dev \
99
libev-dev \
1010
gcc \
11+
g++ \
1112
pipx
1213

13-
RUN pipx install --global cqlsh
14+
# cassandra-driver source builds still import pkg_resources via ez_setup.
15+
# Setuptools v82 removed pkg_resources: https://setuptools.pypa.io/en/latest/history.html#v82-0-0
16+
# On Alpine, cassandra-driver is built from source (no musllinux wheels), so pip's isolated
17+
# build env must be constrained to setuptools<81 or the build fails.
18+
RUN printf 'setuptools<81\n' > /tmp/pip-build-constraints.txt && \
19+
PIP_CONSTRAINT=/tmp/pip-build-constraints.txt pipx install --global cqlsh && \
20+
rm -f /tmp/pip-build-constraints.txt
1421

1522
FROM ${BASE_IMAGE} AS base-admin-tools
1623

docker/base-images/base-builder.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.25-alpine3.23 AS base-builder
1+
FROM golang:1.25.7-alpine3.23 AS base-builder
22

33
RUN apk upgrade --no-cache
44
RUN apk add --no-cache \

docker/base-images/base-ci-builder.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.25-alpine3.23 AS base-ci-builder
1+
FROM golang:1.25.7-alpine3.23 AS base-ci-builder
22

33
RUN apk upgrade --no-cache
44
RUN apk add --no-cache \

docker/base-images/base-server.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ARG BASE_IMAGE=alpine:3.23
1+
ARG BASE_IMAGE=alpine:3.23.3
22

3-
FROM golang:1.25-alpine3.23 AS builder
3+
FROM golang:1.25.7-alpine3.23 AS builder
44

55
ARG DOCKERIZE_VERSION=v0.9.2
66
RUN go install github.com/jwilder/dockerize@${DOCKERIZE_VERSION}

0 commit comments

Comments
 (0)