strawberry/deploy/salt/test/Dockerfile.node
trvon 39ffa02ae6
Salt: dockerized multi-node fleet test (master/central + 3 sensors) + state fixes
deploy/salt/test/: builds a release tarball from HEAD in ubuntu:24.04 (CI path),
boots systemd containers (rootless, no --privileged), master==central + 3
sensors with the host's Salt onedir mounted read-only, applies the real states,
runs a workload with planted YARA detections, then two orchestrated cycles.
43 checks (install/config/idempotence, real daemons + telemetry, R2 cache
miss/hit, cp.push collect, 3-seed cycle, canary hold then fleet rollout, no
promoted model anywhere, fleet bits in round 2, --since cursor, dedup).

State fixes found by running them for real:
- init.sls no longer includes strawberry.distribute: a plain state.apply on
  sensors shipped models fleet-wide and bypassed the canary; only the
  orchestration distributes now.
- install.sls: CI tarballs carry a +g<sha> suffix that 'strawberry version'
  does not print, so install.sh re-ran on every apply; record the installed
  release and compare base version + marker.
- orch collect: mv -f (re-collected bundles must not be skipped).
- central cycle: builds the overlay first; a training refusal for too few
  teacher labels (normal on a young fleet) publishes the overlay only and
  keeps the sensors' shadow, any other error still fails.
- distribute.sls: serves only what the cycle published (cp.hash_file; the
  cp.list_master file-list cache can miss a just-published file).
Render check gains overlay-only and full publish cases (20 checks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 12:16:31 -07:00

20 lines
1.1 KiB
Text

# One image for the fleet test master/central and the sensor minions (systemd as PID 1).
# Salt itself is NOT installed: the host's onedir is bind-mounted read-only at /opt/saltstack.
# Runtime libs are what `ldd` asks of the noble-built strawberry binary.
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
systemd systemd-sysv dbus ca-certificates curl iproute2 procps util-linux \
python3 file less \
libyara10 libbpf1 libzstd1 libarchive13t64 libcurl4t64 libssl3t64 libstdc++6 \
&& apt-get clean && find /var/lib/apt/lists -type f -delete \
&& find /etc/systemd/system /lib/systemd/system \
\( -path '*.wants/*' -o -path '*/sockets.target.wants/*' \) \
\( -name '*getty*' -o -name '*udev*' -o -name 'systemd-update-utmp*' -o -name 'systemd-remount-fs*' \) -delete \
&& ln -sf /opt/saltstack/salt/salt-call /usr/local/bin/salt-call \
&& ln -sf /opt/saltstack/salt/salt /usr/local/bin/salt \
&& ln -sf /opt/saltstack/salt/salt-run /usr/local/bin/salt-run \
&& ln -sf /opt/saltstack/salt/salt-key /usr/local/bin/salt-key
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]