ЛР5: устойчивый versioned pipeline изображений, outbox и доказательства отказов

This commit is contained in:
2026-11-06 18:27:29 +03:00
parent 276dbdad8a
commit 7f51c6ac3b
78 changed files with 7278 additions and 65 deletions
+21
View File
@@ -0,0 +1,21 @@
import os
import sys
import time
import urllib.error
import urllib.request
wanted = int(sys.argv[1])
url = "http://127.0.0.1:" + os.environ.get("PUBLIC_PORT", "8085") + "/health/ready"
deadline = time.monotonic() + 40
seen = set()
while time.monotonic() < deadline:
try:
with urllib.request.urlopen(url, timeout=2) as response:
seen.add(response.headers["X-Instance-Id"])
if len(seen) >= wanted:
break
except (urllib.error.URLError, TimeoutError):
seen.clear()
time.sleep(0.1)
else:
raise SystemExit("LB did not expose enough healthy replicas")