five-desks-control / source /scripts /start_failure_envs.sh
rca-umb's picture
Five Desks v5 collapse test (positive control)
ab59633 verified
Raw History Blame Contribute Delete
2.23 kB
#!/bin/bash
# Start six other entrants' arena environments for the failure-mode study, hardened and offline:
# internal Docker network (no internet), read-only root, 1 GB /tmp, all capabilities dropped except what their
# sandboxes need to switch users, no privilege escalation, 3 GB memory, 2 CPUs, 512 processes.
# A relay container (our relay.py on python:3.12-slim) is the only thing that can reach them, on 127.0.0.1:8041-8046.
# Stop everything with: docker rm -f $(docker ps -aq --filter label=far-test=1)
set -u
HARD=(--network far-int --read-only --tmpfs /tmp:rw,exec,size=1g --cap-drop ALL --cap-add CHOWN --cap-add SETUID
--cap-add SETGID --cap-add FOWNER --cap-add KILL --cap-add DAC_OVERRIDE --security-opt no-new-privileges
--memory 3g --cpus 2 --pids-limit 512 --platform linux/amd64 --label far-test=1)
docker network inspect far-int >/dev/null 2>&1 || docker network create --internal far-int >/dev/null
start() { docker rm -f "$1" >/dev/null 2>&1; docker run -d --name "$1" "${HARD[@]}" "$2" >/dev/null && echo "started $1"; }
start fm-domainlab kshitij190/arena-domain-lab@sha256:ad5f333b6eb8c21c9b9fae01689c6a62ff41bba04b3220c74d9dbec0ca36fadf
start fm-ledger ghcr.io/nicholas-ruest/openenv-decision-ledger@sha256:6a656cac9bb519eecc5c34cccb3d296dbc3b2e29e615a5d6af422d0ee08e6a7b
start fm-workbench ghcr.io/noeflandre/workbench-gym:v2
start fm-reconcile ghcr.io/qingyuanwunothing/openenv-reconcile-lab@sha256:dd13c35036488a8ac6444a892095c1acdb225f03a783cc794f812b7e91811816
start fm-analyst aji28/analyst-workbench@sha256:638d3cce2abb7e8ad87fe17a72305465a28dd44607d5cb552ca272faec9fa49b
start fm-audit ghcr.io/noeflandre/audit-trail:v1
for i in $(seq 40); do
n=0; for p in 8041 8042 8043 8044 8045 8046; do curl -fsS -m 2 "http://127.0.0.1:$p/health" >/dev/null 2>&1 && n=$((n+1)); done
[ "$n" -ge 6 ] && break; sleep 3
done
for p in 8041 8042 8043 8044 8045 8046; do printf '%s ' "$p"; curl -sS -m 3 "http://127.0.0.1:$p/health" 2>&1 | head -c 100; echo; done
docker ps -a --filter label=far-test=1 --format '{{.Names}} {{.Status}}'
docker exec fm-analyst python -c "import urllib.request; urllib.request.urlopen('https://huggingface.co', timeout=5); print('INTERNET REACHABLE')" 2>&1 | tail -1