ЛР 4 — БПИ2303 — Костылев — на 5 #162

Closed
akostylev2303 wants to merge 79 commits from akostylev2303/lab4 AGit into master
Showing only changes of commit 21937f920f - Show all commits
+11 -1
View File
@@ -303,6 +303,16 @@ def single(check):
)
def healthy(service, seconds=90):
container = compose("ps", "-q", service).strip()
probe = ["docker", "inspect", "-f", "{{.State.Health.Status}}", container]
deadline = time.monotonic() + seconds
while must(probe).strip() != "healthy":
if time.monotonic() > deadline:
raise SystemExit(f"{service} is not healthy after {seconds} s")
time.sleep(1)
def interrupt(check):
name = f"lab4-reconcile-sigterm-{os.getpid()}"
compose("pause", "s3")
@@ -322,7 +332,7 @@ def interrupt(check):
code = runner.wait(timeout=60)
finally:
compose("unpause", "s3")
compose("up", "-d", "--wait", "--no-deps", "s3")
healthy("s3")
after = reconcile("--dry-run", *FLAGS)
status, init = state.split()
report = {