Files
mtusi2026lab7/scripts/restart.sh
T

16 lines
1.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
set -eu
# Перезапуск API, LB, pipeline, всех хранилищ (PostgreSQL, Redis, S3, RabbitMQ), OpenBao и стека
# наблюдаемости с сохранением volumes. После рестарта OpenBao запечатан: оператор выполняет
# unseal (здесь — scripts/bootstrap.py unseal с долями из secrets/operator), и только затем
# стартуют процессы, которым при запуске нужны секреты. Никаких down -v / повторного seed.
cd "$(dirname "$0")/.."
docker compose stop lb api reconciler relay worker
docker compose restart postgres redis s3 rabbitmq openbao otel-collector prometheus loki tempo grafana
${PYTHON:-python3} scripts/bootstrap.py unseal
until [ "$(docker inspect -f '{{.State.Health.Status}}' "$(docker compose ps -q postgres)")" = healthy ]; do sleep 1; done
until [ "$(docker inspect -f '{{.State.Health.Status}}' "$(docker compose ps -q redis)")" = healthy ]; do sleep 1; done
until [ "$(docker inspect -f '{{.State.Health.Status}}' "$(docker compose ps -q s3)")" = healthy ]; do sleep 1; done
until [ "$(docker inspect -f '{{.State.Health.Status}}' "$(docker compose ps -q rabbitmq)")" = healthy ]; do sleep 1; done
docker compose start api lb reconciler relay worker