Repository navigation
fix(bootstrap): enable a shipped acpid, else install with one package manager, skip under 768 MiB (#1521) - #1547
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Live test: PASS (aws account, us-east-1, stock AL2023 arm64, CLI built from each head)Round 1, at But: Round 2, at
The bootstrap's acpid step no longer touches a package manager on AL2023 at any size. The body sha256 is Teardown: all six test instances, across both rounds, are terminated and verified. |
…nder 768 MiB (#1521) On AL2023 yum is dnf, so 'dnf install || yum install' reran the install dnf had just been OOM-killed in; on a t4g.nano that second run's OOM took spored and systemd-resolved. Run dnf if present, else yum, else nothing, never retrying under the other name; skip the install entirely when MemTotal is under 768 MiB. The step stays non-fatal (#1274). Changes the published bootstrap body: sha256 5782bdb0b4972dfb88050b0b2c412fcadc7ac8b0c72d5c98133a4e154cb141ce.
…nstalled' only when absent (#1521) The AL2023 AMI ships acpid, so the dnf install was a no-op whose repo-metadata load is what OOM-killed the t4g.nano, and the nano's skip path then printed a false 'acpid not installed'. Look for acpid first (command -v); install only when absent; decide the message by the same check afterwards. Bare bootstrap gzip budget +16 (3 bytes over margin). Published bootstrap body sha256 is now 3563692d194f446e3aca50030b0e6a24a9fb15a87594daf30b46271f0e93f739.
a784e70 to
df01584
Compare
Fixes #1521
Important
This changes the signed, published bootstrap body.
spawn bootstrap-bodysha256 (computed the wayrelease.yamldoes:go run . bootstrap-body | sha256sum; the same with or without-X cmd.Version=…):604611b9):baa047b3132cecce0c44ff9880ddf0edf0e6c8e390cec68bb4c2bb801b6b48613563692d194f446e3aca50030b0e6a24a9fb15a87594daf30b46271f0e93f739(heada784e70d)The release republishes and re-signs the body. The sweep orchestrator needs a code-only redeploy from that release, because its compiled-in body has to match the published one (
scripts/deploylambdas/deploy-sweep-orchestrator.shrefuse a mismatch). No test or release guard pins a literal body sha.Bug
On AL2023,
yumis dnf. When dnf was OOM-killed on a t4g.nano, the same transaction ran again asyum, and that second OOM took spored and systemd-resolved.The live test of the first revision (d13d7bd) found a second problem: the AL2023 AMI ships acpid. On every type, the nano included,
dnf install -y acpidwas a no-op that still loaded the full repo metadata, and that load is what OOM-killed the nano. The skip path then printed a false "acpid not installed".Fix (
pkg/launcher/bootstrap.go)command -v acpidand notsystemctl list-unit-files acpid.service: it is fewer bytes and needs no output parsing (list-unit-filesexits 0 or 1 depending on the systemd version and the pattern, so its output would have to be grepped). It is also reliable here: acpid is/usr/sbin/acpid, and/usr/sbinis already on the bootstrap's PATH, because the bootstrap callsuseradd/usermodunqualified. A binary on PATH without its unit file would show up as the "installed but not started" line, which is the truthful outcome.command -v acpiddecides the message afterwards. "Not installed" is printed only when acpid is absent after the step, including when an install "succeeded" but left no acpid behind.|| true.Memory floor: 768 MiB of
MemTotalaws.SporedMemoryFloorMiBis 1 GiB of instance memory, andMemTotalexcludes what the kernel reserves. Measured live on AL2023 arm64: nano 422188 kB, micro 931880 kB, small 1885000 kB. A 1 GiBMemTotalcheck would therefore skip the micro, which installs fine (#1515). 768 MiB (786432 kB) sits between the nano and the micro.TestAcpidMemoryFloorIsBelowTheLaunchWarningFloorkeeps the literal above 512 MiB and at least 1/8 belowSporedMemoryFloorMiB.Gzip budget: +16 bytes (9088 to 9104)
The whole change costs about 104 gzipped bytes (bare bootstrap 7963 to 8067), and the 1024-byte margin had 101 to spare, so after compacting the shell it was 3 bytes over. I raised the budget by the minimum round amount (16) and recorded the reason in
minify_test.go. The cost lands in the published body, not in a release launch's stub (stub: 1841 gzipped, unchanged).Tests (
pkg/launcher/bootstrap_acpid_test.go, full inline boot in the boot sandbox)The sandbox maps
/proc/meminfointo the sandbox, and the file is absent unless a test writes it. The package-manager stand-ins putacpidon PATH when they exit 0, as a real install does.MemTotal): no package manager runs, acpid is enabled, and none of the three acpid messages is printed.MemTotalunreadable: the install is attempted.MemTotal446000 and 786431 kB: no package manager runs, and the skip line plus "not installed" are printed. At 786432 and 948000 kB, the install runs once.Revert gate:
bootstrap.go(d13d7bd): the three new cases fail, each with its own assertion:a package manager ran with acpid already installedthe shipped acpid was not enabledprinted "acpid not installed…" though acpid is installed and enableda failed enable of an installed acpid was misreportedacpid is absent, so it must be reported not installedbootstrap.go: the cases above fail, and so dodnf OOM-killed(yum reran the install dnf was killed in (#1521)), the two under-floor cases and the floor-literal test.Checks (at
a784e70d)make check: green.go test ./...with AWS env stripped: green.make test-e2e-tier0(Substrate): green, 79 passing, 0 skipped.semgrep scan --config=auto --error .: 0 findings.TestBootstrap_Shellcheck: green.TestBootstrapToolsExistOnEveryBase: green.Live checks (owner)
dnf/yumline incloud-init-output.log, and no "acpid skipped" or "acpid not installed" line.systemctl is-active acpidshould be active, spored and systemd-resolved active, and there should be 0 oom-killer events.