Щербацевич-БПИ2302-на 3

This commit is contained in:
2026-11-27 21:28:16 +03:00
parent 20afc2c790
commit bd3a530df3
119 changed files with 10026 additions and 18 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
"""Bootstrap local secrets and start the lab7 stand."""
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def compose(*args):
subprocess.check_call(["docker", "compose", "--env-file", str(ROOT / ".env"), *args], cwd=ROOT)
def main() -> None:
subprocess.check_call([sys.executable, str(ROOT / "scripts" / "bootstrap.py")], cwd=ROOT)
compose("up", "-d", "--build", "--scale", "api=2")
ids = subprocess.check_output(
["docker", "compose", "--env-file", str(ROOT / ".env"), "ps", "-q", "api"],
cwd=ROOT,
text=True,
).split()
if len(ids) < 2:
raise SystemExit("expected two API replicas, got %s" % len(ids))
print("stand is up; wait for https://localhost:8443/health/ready")
print("CA_FILE=%s" % (ROOT / "secrets" / "certs" / "ca.crt"))
if __name__ == "__main__":
main()