forked from mtusi2026/mtusi2026lab7
23 lines
887 B
Bash
Executable File
23 lines
887 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
docker compose --env-file .env restart openbao >/dev/null
|
|
# This is an explicit operator hook, not auto-unseal inside a server container.
|
|
python3 scripts/bao-operator.py wait
|
|
python3 scripts/bao-operator.py unseal
|
|
docker compose --env-file .env restart postgres redis s3 broker >/dev/null
|
|
docker compose --env-file .env restart api1 api2 cleanup dispatcher worker >/dev/null
|
|
docker compose --env-file .env restart otel-collector prometheus loki tempo grafana nginx >/dev/null
|
|
python3 - <<'PY'
|
|
import ssl,time,urllib.request
|
|
from pathlib import Path
|
|
c=ssl.create_default_context(cafile='secrets/public/ca.crt')
|
|
for i in range(120):
|
|
try:
|
|
with urllib.request.urlopen('https://localhost:8443/health/ready',context=c,timeout=2) as r:
|
|
if r.status==200:break
|
|
except OSError:pass
|
|
time.sleep(.5)
|
|
else:raise SystemExit('stack did not recover')
|
|
PY
|