Skip to content

[NVX] Limit image caches to 10 GiB - #1815

Draft
Huzaifa Danish (huzaifa-d) wants to merge 3 commits into
microsoft:mainfrom
huzaifa-d:user/modanish/image-expiry
Draft

Huzaifa Danish (huzaifa-d) wants to merge 3 commits into
microsoft:mainfrom
huzaifa-d:user/modanish/image-expiry

Conversation

@huzaifa-d

@huzaifa-d Huzaifa Danish (huzaifa-d) commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Configure the signed NVX agent's existing admission limit to 10 GiB
(10,737,418,240 bytes) in each create-and-run and lifecycle state root. Document
capacity eviction, in-use protection, offline behavior, and the fact that this
is not an immediate trim or a total disk-usage limit. The limit does not refresh
images by age.

The maintainer accepted this operational setting without a separate spec; it
does not add a request or SDK API field.

🔗 References

Refs #1712; accepted scope.

🔍 Validation

At head d7b4952a08bd5a9c9e33c36ec300b380c5dc0002:

  • From src: cargo fmt --all -- --check — passed.
  • From src: cargo clippy --locked -p mxc-sdk --no-default-features --features microvm --test nvx_e2e -- -D warnings — passed.
  • From the repository root: node --test scripts\tests\microvm-validation.test.js — passed, 79 tests.
  • From src, with ACI_EDGE_SANDBOXES_AGENT_ARTIFACTS_DIR set to the repository's src\target\debug\aci-edge-sandboxes directory: cargo test --locked -p mxc-sdk --no-default-features --features microvm --test nvx_e2e windows_x64::signed_bundle_image_cache_capacity -- --exact --ignored --nocapture --test-threads=1 — passed on Windows x64 with WHP and the signed bundle. Both roots cross the actual 10 GiB boundary and exercise largest-first eviction, re-pull, lifecycle protection, and an existing over-limit cache. The test also checks oversized local-image registration directly with the signed agent.
  • A deterministic calculation using the observed fixture sizes and registration order showed that an oldest-registration-first policy would remove both candidates and fail the smaller-image retention assertion in each root. This was a model, not a modified native runtime.

Earlier validation at head f77aa913a2f49523171a011d435e7ef704d6e2cf:

  • From src: cargo test --locked -p mxc-sdk --no-default-features --features microvm --test nvx_e2e windows_x64::image_cache_fixture_space_check_fails_closed -- --exact --nocapture — passed, including available-space boundary and directory-query failure checks.
  • From the repository root: & '.\scripts\ci\stage-nvx-validation-tests.ps1' -BinaryDirectory '.\src\target\release' -Features microvm — passed, including signed-bundle integrity and test discovery.
  • From the repository root, with ACI_EDGE_SANDBOXES_AGENT_ARTIFACTS_DIR set to src\target\release\aci-edge-sandboxes: & '.\src\target\release\nvx-e2e-tests.exe' --exact 'windows_x64::signed_bundle_image_cache_capacity' --ignored --nocapture --test-threads=1 — passed on Windows x64 with WHP and the signed bundle.
  • On a volume with 15,512,657,920 bytes available, the worker ran the capacity test executable and observed the expected failure before fixture allocation, reporting the 32,212,254,720-byte requirement and the fixture directory.

Earlier validation at head 99744539d6788599255548a836e206af86bef07b:

  • From src: cargo test -p mxc-sdk --lib --features microvm agent_setup_selects_host_cpu_profile_and_platform_snapshots_fit_its_defaults — passed.
  • From src: cargo build --release -p wxc --features microvm — passed.
  • With the original unlimited agent_setup, cargo test -p mxc-sdk --features microvm --test nvx_e2e signed_bundle_image_cache_capacity -- --ignored --nocapture --test-threads=1 — failed as expected because the old image was not evicted.

Not covered: an oversized registry-reference request through an MXC public
entry point. The maintainer accepted this gap for the draft. The complete
scheduled lane was not run locally; its host must provide at least 30 GiB free
on the test-executable volume, which has not been verified for the nightly pool.

✅ Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • For features or changes requiring a spec: linked the issue with maintainer-applied feature-accepted
  • For implementation: linked the required approved and merged design/API spec, or explained why no spec is required
  • Feature issue remains open unless this PR completes all agreed implementation, validation, and documentation
  • Updated documentation (if applicable)
  • Updated Copilot instructions (if build, architecture, or conventions changed)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes (see pull request builds)

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 00:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The mandatory Windows/WHP capacity scenario requires 30 GiB of free space, but nightly-pool capacity and completion of the full scheduled lane remain unverified despite a successful isolated run.

No open issues 🎉

What changed in this PR

Configures the signed NVX agent’s existing image-cache admission limit to 10 GiB per create-and-run and lifecycle state root. This addresses capacity management related to #1712, not age-based refresh, and adds no request or SDK API fields.

Changes:

  • Applies the limit through shared agent setup while preserving other image settings.
  • Adds functional capacity coverage and requires its discovery and completion in scheduled validation.
  • Documents eviction, protected images, offline behavior, and exclusions from the limit.
File Description
src/​mxc-sdk/​tests/​nvx_e2e.rs Adds capacity, eviction, re-pull, concurrency, and lifecycle-protection scenarios.
src/​mxc-sdk/​src/​backends/​nvx/​crate_runtime.rs Sets the 10 GiB limit and verifies setup serialization.
scripts/​tests/​microvm-validation.test.js Tests capacity-scenario discovery and completion enforcement.
scripts/​ci/​stage-nvx-validation-tests.ps1 Requires discovery of the new capacity test.
scripts/​ci/​run_backend_validation_tests.ps1 Requires the capacity scenario’s completion marker.
docs/​development/​build-and-test/​ci-validation-infrastructure.md Documents coverage and the 30 GiB free-space prerequisite.
docs/​backends/​nvx/​nvx.md Explains admission limits, eviction protections, and cache behavior.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 02:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The mandatory Windows x64/WHP nightly scenario lacks a complete scheduled-lane run and confirmation that the nightly pool provides 30 GiB free on the staged executable volume.

No open issues 🎉

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 03:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Maintainer confirmation is needed because the mandatory 30 GiB free-space prerequisite and complete scheduled Windows x64 lane remain unverified on the actual nightly pool.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants