Repository navigation
fix(build-snapshot): check_lease_support logs once on success, with its duration - #824
Conversation
…ts duration The lease check printed only on failure, so a build log could not show that it ran, or how close it came to guest_client's -timeout-s 60 on a large rootfs. It now logs one line on success naming the checks run (lease-v1, plus lease-processes-v1 on Firecracker) and the seconds taken. The tests load the script's log() into the harnesses that run the function, and check the line both in the function's text and in a passing run's output. Closes rossoctl#721 Assisted-By: Claude Code Signed-off-by: Rong Chang <[email protected]>
There was a problem hiding this comment.
Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Summary
Clean, well-scoped fix for #721: check_lease_support now logs one success line through the script's log(), naming the checks run (lease-v1, plus lease-processes-v1 on Firecracker) and the whole seconds taken against guest_client -timeout-s 60. Failure paths and the guest request are unchanged. The three harnesses that run the function on its own now load log() too, so the success path no longer falls through to a log on the PATH. Two optional test nits are below. Nothing blocks merge.
Author: webchang (MEMBER — maintainer)
Areas reviewed: Shell, Tests
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing (deploy-scripts, deploy-scripts-bash32, shellcheck, lint, check, and the rest)
| $tracked_line | ||
| $grp_line | ||
| ")" "0" | ||
| check "lease support: a pass logs the checks and their duration (#721)" \ |
There was a problem hiding this comment.
nit: only the Firecracker label is asserted. The chv-ok run (ls_harness "$LT/chv-ok" … cloud-hypervisor) already writes $LT/chv-ok/out, so one more check could pin the Cloud Hypervisor line, e.g. grep -cE '^build-snapshot.sh: lease-v1 check ok in [0-9]+ s ' = 1, and make sure it does not say lease-processes-v1. That covers the checks= default branch.
| mkdir -p "$LT/fail/stage"; printf '#!/bin/sh\necho "guest_client: dial: refused" >&2\nexit 1\n' >"$LT/fail/stage/guest_client" | ||
| chmod 0755 "$LT/fail/stage/guest_client" | ||
| { echo "STAGE='$LT/fail/stage'"; fn_body sbx_tracked_passwd; fn_body check_lease_support; echo 'check_lease_support /uds'; } >"$LT/fail/run.sh" | ||
| { echo "STAGE='$LT/fail/stage'"; grep '^log() ' "$SCRIPT"; fn_body sbx_tracked_passwd; fn_body check_lease_support; echo 'check_lease_support /uds'; } >"$LT/fail/run.sh" |
There was a problem hiding this comment.
nit: the PR says a failure prints no new output. A one-line check here would lock that in: grep -c 'check ok' "$LT/fail/out" = 0.
Takes upstream main at 1a7f41e (19 merges since 032c8f6): the sandbox idle lifetime across docs, control plane, clients and deploy (rossoctl#820, rossoctl#837, rossoctl#842, rossoctl#843), grant redemption (rossoctl#822), the lease-check log line (rossoctl#824), egress fixes (rossoctl#829, rossoctl#834), the mock wait (rossoctl#828), the deadline timer (rossoctl#835), the create rollback (rossoctl#832), multi refusals and the rossoctl#363 leftovers (rossoctl#833, rossoctl#838), the identity near-miss check (rossoctl#827), mocactl login errors (rossoctl#836), the ghostunnel probes (rossoctl#830), refusal-burst deferral (rossoctl#831), a sandbox-worker change (rossoctl#841) and the v0.11 doc truth (rossoctl#821). Conflicts (one): - deploy/sbx/README.md, the "Optional inputs" table. Upstream (rossoctl#843) rewrote the SBX_LIFETIME_DAYS row (the default idle lifetime, at most SBX_MAX_LIFETIME_DAYS) and added the SBX_MAX_LIFETIME_DAYS and SBX_LOWER_WORKSPACE_IDLE rows, which widened the table; the fork had added an SBX_GATE_RECORD_SCHEMA row at its end. Resolved by taking upstream's table whole and appending the fork's SBX_GATE_RECORD_SCHEMA row after SBX_PROFILE, then re-padding the table with prettier. The fork's env-file example line for SBX_GATE_RECORD_SCHEMA merged cleanly. Merged without markers, checked: setup.sh keeps the fork's SBX_GATE_RECORD_SCHEMA validation and its sbx-settings write (so it stays in the settings hash) beside upstream's SH_SANDBOX_MAX_LIFETIME_SECONDS; both ocp-sbx and ocp-combined patch-control-plane.yaml keep the optional SH_GATE_RECORD_SCHEMA from sbx-settings beside the new optional SH_SANDBOX_MAX_LIFETIME_SECONDS; setup.test.sh keeps the fork's cases beside upstream's. The fork's RUNBOOK, README and template-onboarding docs say nothing about sandbox lifetime, refusal bursts, login errors or the create rollback, so none needed a correction; GUIDE.md is unchanged and GUIDE.pdf is not regenerated. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Rong Chang <[email protected]>
Closes #721
What changed and why
check_lease_supportindeploy/microvm/build-snapshot.shprinted only when the check failed, so a build log could not show that it ran, or how close it came to itsguest_client -timeout-s 60on a large rootfs.log, naming the checks run and the seconds taken:build-snapshot.sh: lease-v1 and lease-processes-v1 check ok in N s (guest_client -timeout-s 60)on Firecracker;build-snapshot.sh: lease-v1 check ok in N s (…)on Cloud Hypervisor, which asks only lease-v1.SECONDS, whole seconds, measured around the one guest request and its parsing. Nothing else changes: the same request, the same failures and messages, and no new output on a failure.Tests
deploy/microvm/tests/build-snapshot.test.sh:check_lease_supporton its own now load the script's one-linelog()as well. Without it, the success path calls whateverlogis on the PATH (on macOS,/usr/bin/log, which exits 64)./bin/bash3.2.shellcheck -S warning(shellcheck-py 0.10.0.1, the pre-commit pin) is clean on both files, and pre-commit passes.Every commit is signed off (DCO).
Assisted-By: Claude Code