ЛР 7 — БВТ2303 — Брезгунова — на 5
Skeleton contracts / contracts (pull_request) Blocked by required conditions
Lab7 solution / integration (pull_request) Blocked by required conditions

This commit is contained in:
2026-12-04 17:07:57 +03:00
parent 20afc2c790
commit ee9d70af85
129 changed files with 81564 additions and 90 deletions
+18
View File
@@ -0,0 +1,18 @@
"""Persistence hook: restart all actual services and explicit operator unseal."""
from pathlib import Path
import subprocess
import time
ROOT=Path(__file__).resolve().parents[1]
DC=['docker','compose','--env-file','.env']
def call(*args):subprocess.run(DC+list(args),cwd=ROOT,check=True,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
sidecars=['api1-tls','api2-tls','broker-tls','otel-collector-tls','prometheus-tls','loki-tls','tempo-tls','grafana-tls']
# Stop shared-network sidecars before replacing the parent's namespace.
call('stop',*sidecars)
call('restart','postgres','s3','broker','openbao','otel-collector','prometheus','loki','tempo','grafana','api1','api2','publisher','worker','janitor','lb')
for _ in range(20):
try:
call('run','--rm','--no-deps','operator','python','scripts/bootstrap.py','unseal')
break
except subprocess.CalledProcessError:time.sleep(1)
else:raise RuntimeError('operator unseal failed')
call('up','-d','--no-deps','--force-recreate',*sidecars)