fix(azure): skip the redundant apt round trip when the image already has zram - #712
Merged
Merged
Conversation
…has zram An agent-box image built by azure-image.yml already installs linux-modules-extra for the kernel it ships (bake-image.sh), so every boot from that image was still paying for an apt update + install that could only ever confirm what was already true. Guard it the same way the nix install just below already skips its own installer: check what the box actually has (modinfo zram) rather than re-running apt to find out again (issue #697). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZfTzdVHrqQuChdMKBcj8V
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closure AND
linux-modules-extra(the zram kernel module) into the AzureCompute Gallery image (
deploy/azure/bake-image.sh), and the bootstrapalready skips its own nix installer when a box boots from that image
(
deploy/azure/agent-box.bicep, "nix already present (image-provided)").not, still ran
apt-get update+apt-get install linux-modules-extra-...unconditionally, paying a network round trip and a redundant install to
reconfirm a package the image already carries.
provides:
modinfo zram(does the kernel module exist on disk) rather thana dpkg database check, so it is true for an image-baked box and false for a
stock-marketplace boot regardless of what else changed.
Context
Prompted by the comment on #697 asking to bake the remaining runtime
closure / apt work into the image. That issue's larger asks (a Community
Gallery, replication regions, rebuild cadence, storage cost) are explicitly
listed there as decisions for a human, not this bot, and none of them are
touched here. This is the one piece of "apt work" in that ask that was a
plain bug with a known fix and no decision attached: the image already does
the work, the bootstrap just wasn't told to trust it.
Test plan
az bicep build --file deploy/azure/agent-box.bicepand committed theregenerated
agent-box.json.python3 scripts/check_azure_template.py(with PyYAML onPYTHONPATH)— all 14 checks OK, including the JSON-drift check against a fresh
build.
the static-IP change) is out of scope for this session — the change is
a pure skip-guard with no new az calls, verifiable from the script
logic and the existing bake-image.sh contents alone.
🤖 Generated with Claude Code