Skip to content

Streamline rootfs building#5727

Open
JamesC1305 wants to merge 2 commits intofirecracker-microvm:mainfrom
JamesC1305:fix-docker-popular-containers-rootfs
Open

Streamline rootfs building#5727
JamesC1305 wants to merge 2 commits intofirecracker-microvm:mainfrom
JamesC1305:fix-docker-popular-containers-rootfs

Conversation

@JamesC1305
Copy link
Contributor

@JamesC1305 JamesC1305 commented Feb 27, 2026

Changes

Move rebuild.sh rootfs building code into common functions file and refactor slightly, allowing the function to take an extra script as a parameter, with that script being run inside the container. This allows different behaviour to be specified for CI rootfs and docker popular rootfs.

Then change test-docker-popular to reuse this common rootfs builder code.

NB: docker-popular now uses squashfs rather than ext4 as before.

Reason

We currently have two very similar processes for building rootfs. One for building a CI rootfs, and another for running Firecracker in popular docker images (test-docker-popular). We should instead have a common implementation that works for both, for easier extensibility and maintainability.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • I have read and understand CONTRIBUTING.md.
  • I have run tools/devtool checkbuild --all to verify that the PR passes
    build checks on all supported architectures.
  • I have run tools/devtool checkstyle to verify that the PR passes the
    automated style checks.
  • I have described what is done in these changes, why they are needed, and
    how they are solving the problem in a clear and encompassing way.
  • I have updated any relevant documentation (both in code and in the docs)
    in the PR.
  • I have mentioned all user-facing changes in CHANGELOG.md.
  • If a specific issue led to this PR, this PR closes the issue.
  • When making API changes, I have followed the
    Runbook for Firecracker API changes.
  • I have tested all new and changed functionalities in unit tests and/or
    integration tests.
  • I have linked an issue to every new TODO.

  • This functionality cannot be added in rust-vmm.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.17%. Comparing base (083c4cf) to head (a140d81).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5727   +/-   ##
=======================================
  Coverage   83.17%   83.17%           
=======================================
  Files         277      277           
  Lines       29428    29428           
=======================================
  Hits        24478    24478           
  Misses       4950     4950           
Flag Coverage Δ
5.10-m5n.metal 83.48% <ø> (+<0.01%) ⬆️
5.10-m6a.metal 82.82% <ø> (+<0.01%) ⬆️
5.10-m6g.metal 80.18% <ø> (ø)
5.10-m6i.metal 83.47% <ø> (ø)
5.10-m7a.metal-48xl 82.80% <ø> (-0.01%) ⬇️
5.10-m7g.metal 80.18% <ø> (ø)
5.10-m7i.metal-24xl 83.45% <ø> (-0.01%) ⬇️
5.10-m7i.metal-48xl 83.45% <ø> (-0.01%) ⬇️
5.10-m8g.metal-24xl 80.18% <ø> (-0.01%) ⬇️
5.10-m8g.metal-48xl 80.18% <ø> (-0.01%) ⬇️
5.10-m8i.metal-48xl 83.44% <ø> (-0.01%) ⬇️
5.10-m8i.metal-96xl 83.44% <ø> (-0.01%) ⬇️
6.1-m5n.metal 83.50% <ø> (+<0.01%) ⬆️
6.1-m6a.metal 82.84% <ø> (-0.01%) ⬇️
6.1-m6g.metal 80.18% <ø> (-0.01%) ⬇️
6.1-m6i.metal 83.50% <ø> (+<0.01%) ⬆️
6.1-m7a.metal-48xl 82.83% <ø> (ø)
6.1-m7g.metal 80.18% <ø> (ø)
6.1-m7i.metal-24xl 83.51% <ø> (-0.01%) ⬇️
6.1-m7i.metal-48xl 83.52% <ø> (-0.01%) ⬇️
6.1-m8g.metal-24xl 80.18% <ø> (-0.01%) ⬇️
6.1-m8g.metal-48xl 80.18% <ø> (-0.01%) ⬇️
6.1-m8i.metal-48xl 83.51% <ø> (-0.01%) ⬇️
6.1-m8i.metal-96xl 83.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JamesC1305 JamesC1305 force-pushed the fix-docker-popular-containers-rootfs branch 9 times, most recently from 6150647 to 7147cd6 Compare March 2, 2026 13:09
Move code from CI rootfs rebuild script into common functions file. This
will allow it to be shared with the docker popular code as well.

Refactor it slightly too, so that it takes another bash script as a
parameter that we then run inside the docker image. This is what allows
the implementation to be shared with docker-popular – all of the
build-specific functionality is defined inside the supplied script.

Signed-off-by: James Curtis <jxcurtis@amazon.co.uk>
Simplify the docker-popular rootfs building using common functions.
Define a new file `setup-minimal.sh` that is responsible for the
image-specific setups.

Also, use squashfs for test-popular-containers tests, as there is no
specific reason for them to be ext4.

Signed-off-by: James Curtis <jxcurtis@amazon.co.uk>
@JamesC1305 JamesC1305 force-pushed the fix-docker-popular-containers-rootfs branch from 7147cd6 to a140d81 Compare March 2, 2026 13:09
@JamesC1305 JamesC1305 marked this pull request as ready for review March 2, 2026 13:28
@JamesC1305 JamesC1305 changed the title [DRAFT] Streamline rootfs building Streamline rootfs building Mar 2, 2026
@JamesC1305 JamesC1305 added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Awaiting review Indicates that a pull request is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant