forked from mtusi2026/mtusi2026lab2
Source: immutable lab5 snapshot f88e9ba43cdfd7eb6a5a7ae5feb4247b4e820071; forward the allowed diff from 64d5c67. Carry SQLAlchemy, Alembic, reliability fixes, versioned jobs, infrastructure and student tests without changing protected coursework files.
Validation: make check, validate, lint; 515 student tests passed with one Linux-only skip; public smoke with telemetry enabled and repeat migration passed. Stop the owned stack and retain volumes. Preserve the existing OTel work in progress; grade implementation remains a separate phase.
10 lines
529 B
Bash
Executable File
10 lines
529 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
|
|
cd "$(dirname "$0")/.."
|
|
ids=$(docker compose ps -q "${API_SERVICE:-api}")
|
|
[ -n "$ids" ] || { echo "no running ${API_SERVICE:-api} replicas" >&2; exit 3; }
|
|
target=$(docker inspect -f '{{.Id}} {{.Config.Hostname}}' $ids | awk -v t="$TARGET_INSTANCE_ID" '$2 == t {print $1}')
|
|
[ -n "$target" ] || { echo "no running ${API_SERVICE:-api} replica answers as $TARGET_INSTANCE_ID" >&2; exit 3; }
|
|
docker stop -t "${STOP_TIMEOUT:-7}" "$target" >/dev/null
|