Собрать стенд лабораторной 5: очередь, worker и идемпотентность pipeline.

This commit is contained in:
Wladislava1
2026-11-12 13:05:02 +03:00
parent 276dbdad8a
commit a1b972f7d9
39 changed files with 5492 additions and 34 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?}"
found=""
for id in $(docker ps -q \
--filter label=com.docker.compose.project=mtusi-lab5 \
--filter label=com.docker.compose.service=api); do
host=$(docker inspect -f '{{.Config.Hostname}}' "$id")
short=$(printf %s "$id" | cut -c1-12)
if [ "$host" = "$TARGET_INSTANCE_ID" ] || [ "$short" = "$TARGET_INSTANCE_ID" ]; then
found=$id
break
fi
done
if [ -z "$found" ]; then
echo "api replica not found" >&2
exit 1
fi
# SIGTERM, затем процесс остаётся остановленным (restart: unless-stopped).
docker stop --time 5 "$found" >/dev/null