Skip to content

Commit 913709e

Browse files
committed
packaging/docker: gate releases on PPA readiness
Why: release-tagged container images should only be published after the matching rsyslog packages are available in the correct Adiscon PPA. Impact: manual release flows now use fixed stable and daily-stable channels, derive the stable container tag automatically from `RSYSLOG_VERSION`, and update `latest` only when explicitly requested. Before/After: release-tagged image publishing was a manual sequence without a package-availability gate or an explicit `latest` decision; it is now an explicit release workflow with a lightweight PPA readiness check and fixed channel rules. Technical Overview: The Docker image Makefile now adds explicit manual release targets: `release_build`, `release_push`, and `release_publish`. The stable channel uses `ppa:adiscon/v8-stable` and derives the image tag from `RSYSLOG_VERSION` using `8.yymm.0` -> `20yy-mm`. The daily-stable channel uses `ppa:adiscon/daily-stable` and the fixed image tag `daily-stable`. Before any release build or push proceeds, a disposable Ubuntu container checks that the selected channel exposes the requested rsyslog release series. The real image build remains the source of truth for package completeness. `release_publish` updates `latest` only when `PUSH_LATEST=yes` is set. The operator README now documents the channel rules, the stable tag mapping, and the manual release workflow consistently with the Makefile. AGENTS.md adds the same container guidance for future AI-driven changes. With the help of AI-Agents: Codex
1 parent 7cd2718 commit 913709e

File tree

3 files changed

+204
-3
lines changed

3 files changed

+204
-3
lines changed

AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ Follow these three steps for a typical development task:
3737
- The container Makefile default version must stay clearly non-release.
3838
Use explicit `VERSION=...` values for release-like local rehearsals and for
3939
any publish automation.
40+
- Release-tagged container images are downstream of package publishing.
41+
AI agents must not add or use release container flows that bypass the
42+
Adiscon PPA readiness check.
43+
- Manual release flows use two fixed channels:
44+
`stable` maps `8.yymm.0` to `20yy-mm` via `ppa:adiscon/v8-stable`,
45+
and `daily-stable` uses `ppa:adiscon/daily-stable` with the fixed tag
46+
`daily-stable`.
4047
- AI agents must not introduce release-looking fallback tags such as
4148
`2026-03` as the default local container build version.
4249

packaging/docker/rsyslog/Makefile

Lines changed: 105 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,29 @@ DEFAULT_VERSION = dev-local
2020
# make all VERSION=2026-03
2121
VERSION ?= $(DEFAULT_VERSION)
2222

23+
# Stable release targets derive the container tag from RSYSLOG_VERSION using
24+
# 8.yymm.0 -> 20yy-mm. Example: 8.2602.0 -> 2026-02.
25+
RELEASE_CHANNEL ?= stable
26+
RELEASE_VERSION = $(strip $(shell \
27+
if [ "$(RELEASE_CHANNEL)" = "daily-stable" ]; then \
28+
printf 'daily-stable\n'; \
29+
elif printf '%s\n' "$(RSYSLOG_VERSION)" | grep -Eq '^8\.[0-9]{4}\.0$$'; then \
30+
printf '%s\n' "$(RSYSLOG_VERSION)" | sed -E 's/^8\.([0-9]{2})([0-9]{2})\.0$$/20\1-\2/'; \
31+
fi))
32+
2333
# Default OCI metadata values for local builds.
2434
BUILD_DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
2535
VCS_REF ?= $(shell git rev-parse --short=12 HEAD 2>/dev/null || echo unknown)
2636
OCI_BUILD_ARGS = --build-arg BUILD_DATE="$(BUILD_DATE)" \
2737
--build-arg VCS_REF="$(VCS_REF)"
2838

39+
# Manual release publishing is downstream of PPA readiness. Operators must
40+
# provide the expected rsyslog release version explicitly before stable
41+
# release-tagged images are built or pushed. The readiness check keeps to
42+
# the minimum: confirm that the selected release channel exposes the
43+
# requested series.
44+
RELEASE_UBUNTU_VERSION ?= 24.04
45+
2946
# Variable to control cache busting. Set to 'yes' to force a rebuild from scratch for all targets.
3047
# Example: make all REBUILD=yes
3148
REBUILD ?= no
@@ -63,7 +80,8 @@ ETL_IMAGE_TAG = $(strip $(ETL_IMAGE_NAME):$(VERSION))
6380
minimal standard collector dockerlogs etl \
6481
build_minimal_image build_standard_image build_collector_image build_dockerlogs_image build_etl_image \
6582
push_minimal push_standard push_collector push_dockerlogs push_etl \
66-
rebuild_all check_publish_version
83+
rebuild_all check_publish_version check_release_inputs \
84+
check_ppa_release_ready release_build release_push release_publish
6785

6886
# Default target: Builds all functional images.
6987
# Assumed layering: minimal -> standard -> (collector, dockerlogs, etl)
@@ -169,6 +187,77 @@ check_publish_version:
169187
echo "Using publishable VERSION=$(VERSION)" ;; \
170188
esac
171189

190+
check_release_inputs:
191+
@if [ "$(RELEASE_CHANNEL)" = "stable" ] && [ -z "$(RSYSLOG_VERSION)" ]; then \
192+
echo "ERROR: stable release targets require RSYSLOG_VERSION." >&2; \
193+
echo "Example: make release_build RSYSLOG_VERSION=8.2602.0" >&2; \
194+
exit 1; \
195+
fi
196+
@if [ -z "$(RELEASE_VERSION)" ]; then \
197+
echo "ERROR: invalid release input for RELEASE_CHANNEL=$(RELEASE_CHANNEL)." >&2; \
198+
echo "Stable example: make release_build RSYSLOG_VERSION=8.2602.0" >&2; \
199+
echo "Daily example: make release_build RELEASE_CHANNEL=daily-stable" >&2; \
200+
exit 1; \
201+
fi
202+
@if [ "$(VERSION)" != "$(DEFAULT_VERSION)" ] && [ "$(VERSION)" != "$(RELEASE_VERSION)" ]; then \
203+
echo "ERROR: VERSION=$(VERSION) does not match derived release tag $(RELEASE_VERSION)." >&2; \
204+
echo "Omit VERSION for release targets or set VERSION=$(RELEASE_VERSION)." >&2; \
205+
exit 1; \
206+
fi
207+
@echo "Using release channel $(RELEASE_CHANNEL)"
208+
@if [ -n "$(RSYSLOG_VERSION)" ]; then echo "Using rsyslog release version $(RSYSLOG_VERSION)"; fi
209+
@echo "Derived container tag $(RELEASE_VERSION)"
210+
211+
check_ppa_release_ready: check_release_inputs
212+
@echo "--- Checking Adiscon PPA readiness for VERSION=$(RELEASE_VERSION) ---"
213+
@docker run --rm ubuntu:$(RELEASE_UBUNTU_VERSION) bash -lc " \
214+
set -e; \
215+
export DEBIAN_FRONTEND=noninteractive; \
216+
apt-get update >/dev/null; \
217+
apt-get install -y --no-install-recommends ca-certificates software-properties-common >/dev/null; \
218+
if [ \"$(RELEASE_CHANNEL)\" = \"daily-stable\" ]; then \
219+
release_ppa=\"ppa:adiscon/daily-stable\"; \
220+
else \
221+
release_ppa=\"ppa:adiscon/v8-stable\"; \
222+
fi; \
223+
add-apt-repository -y \"\$$release_ppa\" >/dev/null; \
224+
apt-get update >/dev/null; \
225+
if [ \"$(RELEASE_CHANNEL)\" = \"daily-stable\" ]; then \
226+
resolved_version=\"\$$(apt-cache madison rsyslog | awk 'NR==1 { print \$$3; exit }')\"; \
227+
else \
228+
resolved_version=\"\$$(apt-cache madison rsyslog | awk '\$$3 ~ /^$(RSYSLOG_VERSION)-/ { print \$$3; exit }')\"; \
229+
fi; \
230+
if [ -z \"\$$resolved_version\" ]; then \
231+
if [ \"$(RELEASE_CHANNEL)\" = \"daily-stable\" ]; then \
232+
echo \"ERROR: no rsyslog package is available in \$$release_ppa.\" >&2; \
233+
else \
234+
echo \"ERROR: no rsyslog package matching $(RSYSLOG_VERSION)-* is available in \$$release_ppa.\" >&2; \
235+
fi; \
236+
exit 1; \
237+
fi; \
238+
echo \"Resolved PPA package version \$$resolved_version from \$$release_ppa.\""
239+
@if [ "$(RELEASE_CHANNEL)" = "daily-stable" ]; then \
240+
echo "PPA is ready for daily-stable"; \
241+
else \
242+
echo "PPA is ready for rsyslog $(RSYSLOG_VERSION)"; \
243+
fi
244+
245+
release_build: check_ppa_release_ready
246+
@echo "--- Manual release build for VERSION=$(RELEASE_VERSION) ---"
247+
$(MAKE) all VERSION=$(RELEASE_VERSION)
248+
249+
release_push: check_ppa_release_ready
250+
@echo "--- Manual release push for VERSION=$(RELEASE_VERSION) ---"
251+
$(MAKE) all_push VERSION=$(RELEASE_VERSION)
252+
253+
release_publish: release_push
254+
@if [ "$(PUSH_LATEST)" = "yes" ]; then \
255+
echo "--- Updating latest tags for VERSION=$(RELEASE_VERSION) ---"; \
256+
$(MAKE) push_latest VERSION=$(RELEASE_VERSION); \
257+
else \
258+
echo "Skipping latest tag update. Set PUSH_LATEST=yes to publish latest."; \
259+
fi
260+
172261
# --- Push Targets ---
173262
push_minimal: check_publish_version build_minimal_image
174263
@echo "--- Pushing minimal image: $(MINIMAL_IMAGE_TAG) ---"
@@ -242,6 +331,10 @@ help:
242331
@echo " all_push - Builds and pushes all versioned images."
243332
@echo " tag_latest - Tags all built images with ':latest' in their respective repositories."
244333
@echo " push_latest - Pushes all ':latest' tagged images."
334+
@echo " release_build - Validates PPA readiness, then builds a release-tagged image set."
335+
@echo " release_push - Validates PPA readiness, then pushes release-tagged images."
336+
@echo " release_publish - Runs release_push and optionally updates ':latest'."
337+
@echo " Use PUSH_LATEST=yes to move latest."
245338
@echo ""
246339
@echo "Utility Targets:"
247340
@echo " clean - Removes all local built and ':latest' images."
@@ -252,12 +345,21 @@ help:
252345
@echo " Current default: $(VERSION)"
253346
@echo " The default is intentionally non-release for local builds."
254347
@echo " Publish/tag targets reject development-like values."
348+
@echo " RSYSLOG_VERSION - Expected rsyslog release version, for example 8.2602.0."
349+
@echo " Required for RELEASE_CHANNEL=stable."
350+
@echo " RELEASE_CHANNEL - Release source. Defaults to stable."
351+
@echo " stable -> ppa:adiscon/v8-stable and 8.yymm.0 -> 20yy-mm"
352+
@echo " daily-stable -> ppa:adiscon/daily-stable and tag daily-stable"
353+
@echo " PUSH_LATEST - Set to 'yes' to let release_publish update ':latest'."
354+
@echo " RELEASE_UBUNTU_VERSION - Ubuntu base used for the PPA readiness check."
255355
@echo " REBUILD - Set to 'yes' to force a full rebuild, bypassing Docker build cache."
256356
@echo " Example: make all REBUILD=yes"
257357
@echo ""
258358
@echo "Example Workflow:"
259359
@echo " 1. Local smoke build: make all"
260360
@echo " 2. Local release rehearsal: make VERSION=2026-03 all"
261361
@echo " 3. Force a full rebuild of all images: make rebuild_all"
262-
@echo " 4. Push all release-tagged images: make VERSION=2026-03 all_push"
263-
@echo " 5. Tag and push latest for a release build: make VERSION=2026-03 push_latest"
362+
@echo " 4. Check PPA readiness: make check_ppa_release_ready RSYSLOG_VERSION=8.2602.0"
363+
@echo " 5. Manual release push: make release_push RSYSLOG_VERSION=8.2602.0"
364+
@echo " 6. Release push plus latest: make release_publish RSYSLOG_VERSION=8.2602.0 PUSH_LATEST=yes"
365+
@echo " 7. Daily channel build: make release_build RELEASE_CHANNEL=daily-stable"

packaging/docker/rsyslog/README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ The build system treats `VERSION` as the source of truth for image tags.
3131
Release automation must pass the intended stable version explicitly
3232
instead of relying on the Makefile default.
3333

34+
Stable container tags are expected to follow the rsyslog release train:
35+
36+
- rsyslog release version `8.2602.0`
37+
- container image tag `2026-02`
38+
39+
The stable-channel mapping rule is: `8.yymm.0` becomes `20yy-mm`.
40+
3441
## Publishing rules
3542

3643
Publish and `latest` tagging targets reject development-style versions:
@@ -50,6 +57,91 @@ make VERSION=2026-03 all_push
5057
make VERSION=2026-03 push_latest
5158
```
5259

60+
## PPA readiness comes first
61+
62+
Release-tagged container images must only be built and pushed after the
63+
matching rsyslog packages are already available in the correct Adiscon
64+
PPA.
65+
66+
This is a hard prerequisite because the image build installs rsyslog
67+
packages from the PPA at build time. A release-like container tag is
68+
incorrect if the requested rsyslog release series is not yet present
69+
there.
70+
71+
By default, the manual release flow uses the stable channel:
72+
73+
- `RELEASE_CHANNEL=stable`
74+
- PPA: `ppa:adiscon/v8-stable`
75+
- tag mapping: `8.yymm.0` -> `20yy-mm`
76+
77+
Warning: this workflow assumes the selected PPA still publishes the
78+
requested rsyslog release series. In practice, PPAs commonly expose only
79+
the currently published package versions for a given Ubuntu series. Once
80+
the PPA advances, older stable container sets may no longer be
81+
rebuildable from it.
82+
83+
For the daily channel:
84+
85+
- `RELEASE_CHANNEL=daily-stable`
86+
- PPA: `ppa:adiscon/daily-stable`
87+
- image tag: `daily-stable`
88+
89+
Manual release targets therefore require:
90+
91+
- `RSYSLOG_VERSION` for the stable channel
92+
- `RELEASE_CHANNEL=daily-stable` for the daily channel
93+
94+
The release readiness check resolves the newest matching `rsyslog`
95+
package for the selected channel. The real image build remains the source
96+
of truth for package completeness and will fail if required packages are
97+
still missing.
98+
99+
The readiness check runs in a disposable Ubuntu container and does not
100+
modify the host system's apt sources.
101+
102+
## Manual release flow
103+
104+
1. Determine the container tag from the rsyslog release tag.
105+
Example: `8.2602.0` and `v.26-02.0` both map to `2026-02`.
106+
2. Verify PPA readiness:
107+
108+
```bash
109+
make check_ppa_release_ready RSYSLOG_VERSION=8.2602.0
110+
```
111+
112+
This looks up the newest `8.2602.0-*` package published in the Adiscon
113+
PPA. If the PPA is not ready for that release series, the check fails
114+
early. If subpackages are still missing, the actual image build fails.
115+
116+
3. Build the release-tagged image family:
117+
118+
```bash
119+
make release_build RSYSLOG_VERSION=8.2602.0
120+
```
121+
122+
4. Push the release-tagged images:
123+
124+
```bash
125+
make release_push RSYSLOG_VERSION=8.2602.0
126+
```
127+
128+
5. Update `latest` only when that is intended:
129+
130+
```bash
131+
make release_publish RSYSLOG_VERSION=8.2602.0 PUSH_LATEST=yes
132+
```
133+
134+
If `PUSH_LATEST` is not set to `yes`, `release_publish` pushes only the
135+
versioned images and leaves `latest` unchanged.
136+
137+
For the daily channel:
138+
139+
```bash
140+
make check_ppa_release_ready RELEASE_CHANNEL=daily-stable
141+
make release_build RELEASE_CHANNEL=daily-stable
142+
make release_push RELEASE_CHANNEL=daily-stable
143+
```
144+
53145
## CI guidance
54146

55147
CI validation jobs should use non-release tags such as `ci-<sha>`.

0 commit comments

Comments
 (0)