fix(infra): align cold-start limits and retain failure diagnostics
This commit is contained in:
@@ -74,7 +74,7 @@ SDK traces/logs: очередь 512 записей, batch64, конечные т
|
|||||||
|
|
||||||
Предварительные неуспешные опыты сохранены с complete=false. Они выявили имя actual RSS metric, недостаточный запас памяти, слишком раннее фиксированное ожидание resolved и строковый тип Compose mem_limit. Последнее исправлено нормализацией чисел. Ни один неполный опыт не выдан за успешный30минутный.
|
Предварительные неуспешные опыты сохранены с complete=false. Они выявили имя actual RSS metric, недостаточный запас памяти, слишком раннее фиксированное ожидание resolved и строковый тип Compose mem_limit. Последнее исправлено нормализацией чисел. Ни один неполный опыт не выдан за успешный30минутный.
|
||||||
|
|
||||||
Полный fresh clone с повторением telemetry persistence/cluster/pipeline/cleanup ещё выполняется отдельно; до его успешного receipt воспроизводимость из чистого клона не заявляется.
|
Первый fresh clone (`clean-clone-final-failed.json`, source2c7b89b) прошёл static checks/26unit, но остановился на unhealthy одной API-реплики до HTTP suite. Его результат сохранён как INCOMPLETE. Выявлено несовпадение default API RAM384MiB с фактически исследованными768MiB; default приведён к исследованному профилю, задан конечный startup health budget и добавлены progress/санитизированная диагностика до удаления временного стенда. Причина первого неуспешного health без сохранённых container logs окончательно не установлена. Повторный полный fresh clone с telemetry persistence/cluster/pipeline/cleanup выполняется отдельно; до его успешного receipt воспроизводимость из чистого клона не заявляется.
|
||||||
|
|
||||||
## Ответы на контрольные вопросы
|
## Ответы на контрольные вопросы
|
||||||
|
|
||||||
|
|||||||
+8
-2
@@ -89,8 +89,14 @@ services:
|
|||||||
s3-bootstrap:
|
s3-bootstrap:
|
||||||
condition: service_completed_successfully
|
condition: service_completed_successfully
|
||||||
cpus: ${API_CPUS:-0.5}
|
cpus: ${API_CPUS:-0.5}
|
||||||
mem_limit: ${API_MEMORY:-384m}
|
mem_limit: ${API_MEMORY:-768m}
|
||||||
memswap_limit: ${API_MEMORY:-384m}
|
memswap_limit: ${API_MEMORY:-768m}
|
||||||
|
healthcheck:
|
||||||
|
test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).read()"]
|
||||||
|
interval: 3s
|
||||||
|
timeout: 3s
|
||||||
|
start_period: 30s
|
||||||
|
retries: 12
|
||||||
pids_limit: 128
|
pids_limit: 128
|
||||||
read_only: true
|
read_only: true
|
||||||
tmpfs:
|
tmpfs:
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"date": "2026-11-20T15:15:34.500702+00:00",
|
||||||
|
"source_commit": "2c7b89bb8e68ac79971b3314a8f7f97eb30f0cf5",
|
||||||
|
"fresh_secrets_environment_and_volumes": true,
|
||||||
|
"command": "python scripts/verify_clean.py",
|
||||||
|
"fixed_host_port_for_restart": 57033,
|
||||||
|
"static_checks": ".venv/bin/python scripts/check_contract.py\nPASS: offline skeleton structure, local refs and Python syntax; application NOT tested.\n.venv/bin/python scripts/validate_openapi.py\nPASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.\n<home>/.local/bin/uv run --locked ruff format --check src student-tests student-unit research scripts/bootstrap.py scripts/stand.py scripts/cluster.py scripts/observe.py scripts/research_slo.py scripts/verify_clean.py scripts/verify_cleanup.py scripts/verify_cluster.py scripts/verify_observability_persistence.py scripts/verify_pipeline.py scripts/verify_telemetry.py\n46 files already formatted\n<home>/.local/bin/uv run --locked ruff check src student-tests student-unit research scripts/bootstrap.py scripts/stand.py scripts/cluster.py scripts/observe.py scripts/research_slo.py scripts/verify_clean.py scripts/verify_cleanup.py scripts/verify_cluster.py scripts/verify_observability_persistence.py scripts/verify_pipeline.py scripts/verify_telemetry.py\nAll checks passed!",
|
||||||
|
"unit_tests": "PYTHONPATH=. <home>/.local/bin/uv run --locked pytest student-unit -q\n.......................... [100%]\n26 passed in 10.87s",
|
||||||
|
"failed_action": "docker compose up -d --build --wait",
|
||||||
|
"result": "INCOMPLETE"
|
||||||
|
}
|
||||||
+48
-10
@@ -37,23 +37,32 @@ def save_incomplete():
|
|||||||
atexit.register(save_incomplete)
|
atexit.register(save_incomplete)
|
||||||
|
|
||||||
|
|
||||||
|
def redact(text, cwd):
|
||||||
|
directory = cwd / "secrets"
|
||||||
|
if directory.exists():
|
||||||
|
for path in directory.iterdir():
|
||||||
|
if path.is_file():
|
||||||
|
value = path.read_text().strip()
|
||||||
|
if len(value) >= 12:
|
||||||
|
text = text.replace(value, "<secret>")
|
||||||
|
return (
|
||||||
|
text.replace(str(cwd), "<clean-clone>")
|
||||||
|
.replace(str(ROOT), "<repository>")
|
||||||
|
.replace(str(Path.home()), "<home>")
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def run(args, *, cwd, env, expected=0):
|
def run(args, *, cwd, env, expected=0):
|
||||||
|
print("CHECK: " + redact(" ".join(args[:3]), cwd), flush=True)
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
args, cwd=cwd, env=env, capture_output=True, text=True
|
args, cwd=cwd, env=env, capture_output=True, text=True
|
||||||
)
|
)
|
||||||
|
|
||||||
def redact(text):
|
|
||||||
return (
|
|
||||||
text.replace(str(cwd), "<clean-clone>")
|
|
||||||
.replace(str(ROOT), "<repository>")
|
|
||||||
.replace(str(Path.home()), "<home>")
|
|
||||||
)
|
|
||||||
|
|
||||||
if result.returncode != expected:
|
if result.returncode != expected:
|
||||||
if "receipt" in PROGRESS:
|
if "receipt" in PROGRESS:
|
||||||
PROGRESS["receipt"]["failed_action"] = redact(" ".join(args))
|
PROGRESS["receipt"]["failed_action"] = redact(" ".join(args), cwd)
|
||||||
raise RuntimeError(redact(result.stdout + result.stderr))
|
raise RuntimeError(redact(result.stdout + result.stderr, cwd))
|
||||||
return redact(result.stdout.strip())
|
return redact(result.stdout.strip(), cwd)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@@ -267,6 +276,35 @@ def main():
|
|||||||
["git", "fsck", "--full"], cwd=clone, env=env
|
["git", "fsck", "--full"], cwd=clone, env=env
|
||||||
)
|
)
|
||||||
receipt["checks_completed"] = True
|
receipt["checks_completed"] = True
|
||||||
|
except BaseException:
|
||||||
|
receipt["failure_diagnostics"] = {}
|
||||||
|
for label, arguments in [
|
||||||
|
("services", ["ps", "-a", "--format", "json"]),
|
||||||
|
(
|
||||||
|
"logs",
|
||||||
|
[
|
||||||
|
"logs",
|
||||||
|
"--no-color",
|
||||||
|
"--tail",
|
||||||
|
"60",
|
||||||
|
"api",
|
||||||
|
"s3",
|
||||||
|
"migrate",
|
||||||
|
"cache",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]:
|
||||||
|
diagnostic = subprocess.run(
|
||||||
|
["docker", "compose", *arguments],
|
||||||
|
cwd=clone,
|
||||||
|
env=env,
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
)
|
||||||
|
receipt["failure_diagnostics"][label] = redact(
|
||||||
|
diagnostic.stdout + diagnostic.stderr, clone
|
||||||
|
)
|
||||||
|
raise
|
||||||
finally:
|
finally:
|
||||||
assert project.startswith("mtusi-lab6-clean-")
|
assert project.startswith("mtusi-lab6-clean-")
|
||||||
run(
|
run(
|
||||||
|
|||||||
Reference in New Issue
Block a user