ci: isolate systemd lifecycle smoke in Linux container
Linux / verify (pull_request) Successful in 1m59s
Linux / keyless-cuda (pull_request) Skipped
Linux / static-cuda-package (pull_request) Skipped
Linux / hosted-cuda-package (pull_request) Skipped
Linux / linux-cli-container (pull_request) Failing after 2m12s
Linux / linux-static-cli (pull_request) Failing after 3m30s
Linux / release-cli (pull_request) Skipped
Linux / verify (pull_request) Successful in 1m59s
Linux / keyless-cuda (pull_request) Skipped
Linux / static-cuda-package (pull_request) Skipped
Linux / hosted-cuda-package (pull_request) Skipped
Linux / linux-cli-container (pull_request) Failing after 2m12s
Linux / linux-static-cli (pull_request) Failing after 3m30s
Linux / release-cli (pull_request) Skipped
This commit is contained in:
@@ -269,12 +269,43 @@ jobs:
|
||||
run: python3 scripts/smoke-service-unit.py target/x86_64-unknown-linux-musl/release/strata-next
|
||||
- name: Native installer with actual isolated systemd user service
|
||||
run: |
|
||||
uid=$(id -u)
|
||||
sudo systemctl start "user@$uid.service"
|
||||
export XDG_RUNTIME_DIR="/run/user/$uid"
|
||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
|
||||
python3 scripts/smoke-service-unit.py target/x86_64-unknown-linux-musl/release/strata-next --lifecycle
|
||||
python3 scripts/smoke-native-switch.py target/x86_64-unknown-linux-musl/release/strata-next
|
||||
image="leleka-systemd-smoke:${GITHUB_RUN_ID}"
|
||||
container="leleka-systemd-smoke-${GITHUB_RUN_ID}"
|
||||
cleanup() {
|
||||
docker rm --force "$container" >/dev/null 2>&1 || true
|
||||
docker image rm "$image" >/dev/null 2>&1 || true
|
||||
}
|
||||
trap cleanup EXIT
|
||||
docker build --file deploy/Dockerfile.systemd-smoke --tag "$image" .
|
||||
docker run --detach --privileged --cgroupns=private --name "$container" \
|
||||
--tmpfs /run --tmpfs /run/lock \
|
||||
--stop-signal SIGRTMIN+3 "$image"
|
||||
for attempt in $(seq 1 30); do
|
||||
if docker exec "$container" systemctl show-environment >/dev/null 2>&1; then break; fi
|
||||
test "$attempt" -lt 30 || { docker logs "$container"; exit 1; }
|
||||
sleep 1
|
||||
done
|
||||
uid=1000
|
||||
docker exec "$container" systemctl start "user@$uid.service"
|
||||
for attempt in $(seq 1 30); do
|
||||
if docker exec "$container" test -S "/run/user/$uid/bus"; then break; fi
|
||||
test "$attempt" -lt 30 || { docker logs "$container"; exit 1; }
|
||||
sleep 1
|
||||
done
|
||||
docker cp target/x86_64-unknown-linux-musl/release/strata-next "$container:/tmp/strata-next"
|
||||
docker cp scripts/smoke-service-unit.py "$container:/tmp/smoke-service-unit.py"
|
||||
docker cp scripts/smoke-native-switch.py "$container:/tmp/smoke-native-switch.py"
|
||||
docker cp scripts/smoke-worker-cancel.py "$container:/tmp/smoke-worker-cancel.py"
|
||||
docker exec --user "$uid" \
|
||||
--env HOME=/home/leleka \
|
||||
--env XDG_RUNTIME_DIR="/run/user/$uid" \
|
||||
--env DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus" \
|
||||
"$container" python3 /tmp/smoke-service-unit.py /tmp/strata-next --lifecycle
|
||||
docker exec --user "$uid" \
|
||||
--env HOME=/home/leleka \
|
||||
--env XDG_RUNTIME_DIR="/run/user/$uid" \
|
||||
--env DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus" \
|
||||
"$container" python3 /tmp/smoke-native-switch.py /tmp/strata-next
|
||||
- name: Native deployment configuration without worker launch
|
||||
run: python3 scripts/smoke-config-check.py target/x86_64-unknown-linux-musl/release/strata-next
|
||||
- name: Native deployment readiness deadline without GPU
|
||||
|
||||
@@ -19,5 +19,5 @@ RUN cargo build --manifest-path control-plane/Cargo.toml --locked --release \
|
||||
|
||||
FROM scratch
|
||||
ARG RUST_TARGET=x86_64-unknown-linux-musl
|
||||
COPY --from=build /src/control-plane/target/${RUST_TARGET}/release/strata-next /strata-next
|
||||
COPY --from=build /src/target/${RUST_TARGET}/release/strata-next /strata-next
|
||||
ENTRYPOINT ["/strata-next"]
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
ENV container=docker
|
||||
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
|
||||
dbus-user-session python3 systemd systemd-sysv util-linux \
|
||||
&& useradd --create-home --uid 1000 --shell /bin/sh leleka \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
STOPSIGNAL SIGRTMIN+3
|
||||
CMD ["/sbin/init"]
|
||||
Reference in New Issue
Block a user