Skip to content

Commit 3530a4c

Browse files
committed
ci/container: add lightweight image smoke tests
Why: a successful Docker build catches syntax and packaging problems, but it does not verify that the packaged startup/config contracts still work for the image roles. Impact: the container build workflow now runs short-lived config validation smoke tests for the user-facing image family when relevant container files change. Before/After: container CI only built the images; it now also exercises each role with representative environment values and `rsyslogd -N1`. Technical Overview: The workflow now records the CI image tag once during the build step and reuses it for a dedicated smoke-test step. The smoke runs stay lightweight: they validate the packaged startup path and config for `minimal`, `standard`, `collector`, `dockerlogs`, and `etl` without requiring external services. Images whose startup/config expects environment values receive small representative settings so the workflow tests realistic role-specific contracts rather than only the default happy path. With the help of AI-Agents: Codex
1 parent 5e79f93 commit 3530a4c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/container_build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,53 @@ jobs:
4545
# full image family whenever container packaging inputs change.
4646
# CI intentionally uses a non-release `ci-<sha>` tag. Stable release
4747
# workflows must inject their own explicit release version instead.
48+
id: build_containers
4849
if: >-
4950
${{ github.event_name == 'workflow_dispatch' ||
5051
steps.container_changes.outputs.any_changed == 'true' }}
5152
run: |
5253
short_sha="$(git rev-parse --short=12 HEAD)"
54+
echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT"
5355
make -C packaging/docker/rsyslog all VERSION="ci-${short_sha}"
5456
57+
- name: Smoke-test rsyslog container family
58+
# Keep smoke coverage lightweight: validate the packaged startup and
59+
# config contracts for each role without requiring external services.
60+
# These runs are short-lived and use representative environment values
61+
# for images whose entrypoint/config expects them.
62+
if: >-
63+
${{ github.event_name == 'workflow_dispatch' ||
64+
steps.container_changes.outputs.any_changed == 'true' }}
65+
run: |
66+
tag="ci-${{ steps.build_containers.outputs.short_sha }}"
67+
68+
docker run --rm \
69+
"rsyslog/rsyslog-minimal:${tag}" \
70+
rsyslogd -N1 -f /etc/rsyslog.conf
71+
72+
docker run --rm \
73+
"rsyslog/rsyslog:${tag}" \
74+
rsyslogd -N1 -f /etc/rsyslog.conf
75+
76+
docker run --rm \
77+
-e ENABLE_RELP=on \
78+
"rsyslog/rsyslog-collector:${tag}" \
79+
rsyslogd -N1 -f /etc/rsyslog.conf
80+
81+
docker run --rm \
82+
-e REMOTE_SERVER_NAME=collector \
83+
-e REMOTE_SERVER_PORT=514 \
84+
"rsyslog/rsyslog-dockerlogs:${tag}" \
85+
rsyslogd -N1 -f /etc/rsyslog.conf
86+
87+
docker run --rm \
88+
-e VESPA_NAMESPACE=default \
89+
-e VESPA_DOCTYPE=logs \
90+
-e VESPA_SERVER=vespa \
91+
-e VESPA_PORT=8080 \
92+
"rsyslog/rsyslog-etl:${tag}" \
93+
rsyslogd -N1 -f /etc/rsyslog.conf
94+
5595
- name: Skip container build, no relevant changes
5696
# This step is intentionally successful so the workflow can participate
5797
# in branch protection without forcing container rebuilds on unrelated

0 commit comments

Comments
 (0)