Skip to content

Commit b81c0ce

Browse files
committed
fix smoke tests
1 parent 49b2f4a commit b81c0ce

File tree

5 files changed

+192
-189
lines changed

5 files changed

+192
-189
lines changed

.devcontainer/Dockerfile

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,52 @@
11
# syntax=docker/dockerfile:1.4
2-
ARG VARIANT="1-1.22-bookworm"
2+
ARG VARIANT="1-1.23-bookworm"
33
FROM mcr.microsoft.com/devcontainers/go:${VARIANT}
44

5+
# Use bash globally for pipefail
6+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
7+
58
ARG DEBIAN_FRONTEND=noninteractive
69

7-
# Keep the base image packages patched and install common utilities needed for
8-
# development and release tooling.
9-
RUN apt-get update \
10-
&& apt-get upgrade -y \
11-
&& apt-get install -y --no-install-recommends \
12-
ca-certificates \
13-
curl \
14-
jq \
15-
&& apt-get autoremove -y \
16-
&& apt-get clean \
17-
&& rm -rf /var/lib/apt/lists/*
10+
RUN set -eux; \
11+
apt-get update; \
12+
apt-get -y upgrade; \
13+
apt-get install -y --no-install-recommends \
14+
ca-certificates curl fuse-overlayfs iptables jq podman slirp4netns uidmap; \
15+
rm -rf /var/lib/apt/lists/*
16+
17+
# Podman shim
18+
RUN <<'BASH'
19+
set -euo pipefail
20+
echo "vscode ALL=(ALL) NOPASSWD: /usr/bin/install, /usr/bin/podman" >/etc/sudoers.d/010-vscode-podman
21+
chmod 0440 /etc/sudoers.d/010-vscode-podman
22+
install -d -m 0755 /usr/local/bin
23+
BASH
1824

19-
# Install etcd from the latest stable upstream release so local tests can rely
20-
# on an etcd binary that matches production expectations.
25+
# Install etcd (arch-aware, ohne Hash)
2126
ARG ETCD_VERSION="3.6.4"
22-
ARG ETCD_SHA256="4d5f3101daa534e45ccaf3eec8d21c19b7222db377bcfd5e5a9144155238c105"
23-
RUN curl -fsSL https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz -o /tmp/etcd.tgz \
24-
&& echo "${ETCD_SHA256} /tmp/etcd.tgz" | sha256sum -c - \
25-
&& tar -xzf /tmp/etcd.tgz -C /tmp \
26-
&& install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-amd64/etcd /usr/local/bin/etcd \
27-
&& install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-amd64/etcdctl /usr/local/bin/etcdctl \
28-
&& install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-amd64/etcdutl /usr/local/bin/etcdutl \
29-
&& rm -rf /tmp/etcd.tgz /tmp/etcd-v${ETCD_VERSION}-linux-amd64
27+
RUN set -eux; \
28+
arch="$(dpkg --print-architecture)"; \
29+
curl -fsSL -o /tmp/etcd.tgz "https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-${arch}.tar.gz"; \
30+
tar -xzf /tmp/etcd.tgz -C /tmp; \
31+
install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-${arch}/etcd /usr/local/bin/etcd; \
32+
install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-${arch}/etcdctl /usr/local/bin/etcdctl; \
33+
install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-${arch}/etcdutl /usr/local/bin/etcdutl; \
34+
rm -rf /tmp/etcd.tgz /tmp/etcd-v${ETCD_VERSION}-linux-${arch}
3035

31-
# Install nfpm so packaging workflows inside the container can build .deb/.rpm
32-
# artefacts without extra manual setup. Assets are fetched from the official
33-
# release and verified using the published SHA256 checksum.
36+
# Install nfpm (arch-aware, ohne Hash)
3437
ARG NFPM_VERSION="2.43.1"
35-
ARG NFPM_SHA256="2bc2c0b4a13ddbf8ffb0e1df36c43208db6d65a38832c9fe0de097f985653267"
36-
RUN curl -fsSL https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz -o /tmp/nfpm.tgz \
37-
&& echo "${NFPM_SHA256} /tmp/nfpm.tgz" | sha256sum -c - \
38-
&& tar -xzf /tmp/nfpm.tgz -C /tmp \
39-
&& install -m 0755 /tmp/nfpm /usr/local/bin/nfpm \
40-
&& rm -f /tmp/nfpm /tmp/nfpm.tgz /tmp/LICENSE.md /tmp/README.md \
41-
&& rm -rf /tmp/completions /tmp/manpages
38+
RUN set -eux; \
39+
arch="$(dpkg --print-architecture)"; \
40+
case "$arch" in \
41+
amd64) nfpm_arch="x86_64" ;; \
42+
arm64) nfpm_arch="arm64" ;; \
43+
*) echo "Unsupported arch: $arch" >&2; exit 1 ;; \
44+
esac; \
45+
curl -fsSL -o /tmp/nfpm.tgz "https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_${nfpm_arch}.tar.gz"; \
46+
tar -xzf /tmp/nfpm.tgz -C /tmp; \
47+
install -m 0755 /tmp/nfpm /usr/local/bin/nfpm; \
48+
rm -f /tmp/nfpm /tmp/nfpm.tgz /tmp/LICENSE.md /tmp/README.md; \
49+
rm -rf /tmp/completions /tmp/manpages
4250

43-
# Validate the installation early so container builds fail fast if upstream
44-
# assets change or become unavailable.
45-
RUN etcd --version && etcdctl version && nfpm --version
51+
# Smoke test
52+
RUN set -eux; etcd --version; etcdctl version; nfpm --version

.devcontainer/devcontainer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"args": {
77
"VARIANT": "1-1.23-bookworm",
88
"ETCD_VERSION": "3.6.4",
9-
"ETCD_SHA256": "4d5f3101daa534e45ccaf3eec8d21c19b7222db377bcfd5e5a9144155238c105",
10-
"NFPM_VERSION": "2.43.1",
11-
"NFPM_SHA256": "2bc2c0b4a13ddbf8ffb0e1df36c43208db6d65a38832c9fe0de097f985653267"
9+
"NFPM_VERSION": "2.43.1"
1210
}
1311
},
1412
"remoteUser": "vscode",
@@ -17,6 +15,13 @@
1715
"containerEnv": {
1816
"ETCDCTL_API": "3"
1917
},
18+
"runArgs": [
19+
"--privileged",
20+
"--cgroupns=host"
21+
],
22+
"mounts": [
23+
"source=/sys/fs/cgroup,target=/sys/fs/cgroup,type=bind"
24+
],
2025
"customizations": {
2126
"vscode": {
2227
"settings": {

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ etcd --data-dir /tmp/etcd-data \
126126
--advertise-client-urls http://127.0.0.1:2379
127127
```
128128

129+
The dev container now ships Podman alongside a passwordless `docker` shim that proxies to `sudo podman`,
130+
enabling the packaging smoke tests to build and launch privileged containers without extra setup.
131+
129132
## Operations
130133

131134
The [Operations Guide](docs/OPERATIONS.md) expands on deployment, maintenance windows, health script practices, and

docs/STATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
- The orchestration loop now retries transient runtime failures with a
2424
jittered exponential backoff and listens for SIGINT/SIGTERM so operators can
2525
stop the daemon cleanly when managed by service supervisors.
26-
- A reproducible dev container (Go 1.22 with etcd 3.6.4 and nfpm 2.43.1) is
27-
available for local development, packaging experiments, and integration
28-
testing.
26+
- A reproducible dev container (Go 1.22 with etcd 3.6.4 and nfpm 2.43.1) now also ships Podman with a
27+
passwordless docker shim so local smoke tests can build and run privileged containers without extra host
28+
setup, keeping packaging experiments and integration testing self-contained.
2929
- CLI run mode now wires the reporter into a JSON logger on stderr and an
3030
optional Prometheus metrics listener, exporting the address to the health
3131
script environment for runtime validation.

0 commit comments

Comments
 (0)