Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ def collect_snapshot(values: dict[str, str], *, root: Path = Path("/"), run: Run
timers["updates"] = _unit_state(run, "apt-daily-upgrade.timer", timer=True, max_age_seconds=172800)
services["updates"] = _unit_state(run, "apt-daily-upgrade.service")
if values.get("CI_FLEET_HEALTH_BOOTSTRAP") == "1":
# ponytail: activation validates unit installation separately; scheduled runs verify live timers after enablement.
# ponytail: activation validates unit installation separately; scheduled runs verify maintenance state after commit.
timers = {name: "ok" for name in timers}
services = {name: "ok" for name in services}
instance = values.get("CI_FLEET_INSTANCE", "unknown")
stale = _stale_resources(run, instance) if docker_ok else {"containers": 0, "networks": 0, "volumes": 0}
stale["images"] = _count(run, ["docker", "images", "-q", "--filter", "dangling=true", "--filter", "label=io.randomdevelopment.ci-fleet.managed=true"]) if docker_ok else 0
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-worker-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ restore_checkpoint() {
failed=1
else
compose "$release_dir" "$rendered_env" up -d --no-deps controller || failed=1
if ((failed == 0)); then run_health_check "$release_dir" "$rendered_env" || failed=1; fi
if ((failed == 0)); then run_health_check "$release_dir" "$rendered_env" true || failed=1; fi
fi
fi
fi
Expand Down
3 changes: 2 additions & 1 deletion scripts/test_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test_collector_uses_sustained_metrics_and_all_service_units(self) -> None:
pressure = root / "proc/pressure/memory"
pressure.write_text("some avg10=0.00 avg60=0.05 avg300=0.20 total=1\n")
def run(args):
output = "yes\n" if args[0] == "timedatectl" else "success\n" if args[0] == "systemctl" else ""
output = "yes\n" if args[0] == "timedatectl" else "failed\n" if args[:2] == ["systemctl", "show"] and args[2].endswith(".service") else "success\n" if args[0] == "systemctl" else ""
return health.subprocess.CompletedProcess(args, 1 if args[:2] == ["docker", "info"] else 0, output, "")

original_load, original_cpus = health.os.getloadavg, health.os.cpu_count
Expand All @@ -183,6 +183,7 @@ def run(args):
run=run,
)
self.assertEqual(set(remote["services"]), {"cleanup", "drift", "reconcile"})
self.assertEqual(set(remote["services"].values()), {"ok"})
self.assertEqual(set(remote["timers"]), {"health", "cleanup", "drift", "reconcile"})
self.assertEqual(remote["reconciliation"]["status"], "bootstrap")
(root / "etc").mkdir()
Expand Down