Complete Lab 5 grade 4 async attachment pipeline

This commit is contained in:
2026-11-16 16:46:44 +03:00
parent 276dbdad8a
commit f9246b8844
52 changed files with 4023 additions and 50 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID is required}"
for container_id in $(docker compose ps -q api); do
hostname=$(docker inspect --format '{{.Config.Hostname}}' "$container_id")
if [[ "$hostname" == "$TARGET_INSTANCE_ID" ]]; then
mkdir -p evidence
printf '%s %s\n' "$(date -u +%FT%TZ)" "$TARGET_INSTANCE_ID" >> evidence/stopped-replicas.txt
docker stop --time 6 "$container_id" >/dev/null
exit 0
fi
done
printf 'No running API container matches TARGET_INSTANCE_ID.\n' >&2
exit 1