-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate network-setup to nftables and improve it into a better state #4877
Conversation
Signed-off-by: kanpov <[email protected]>
Signed-off-by: kanpov <[email protected]>
Signed-off-by: kanpov <[email protected]>
Signed-off-by: kanpov <[email protected]>
I'm welcome to critique of the new sections in the doc, since I think this is the real minimal amount of information needed for a Firecracker user to get a proper networking setup with support for multiple guests and other improvements. Back when I started working with Firecracker, I found this specific area of the docs to be especially frustrating to use (and led to me spending far, far too much of my time developing fcnet to make networking bearable):
With this, I've tried to address these. |
Signed-off-by: kanpov <[email protected]>
Signed-off-by: kanpov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! I need to try the commands myself, but looks good so far.
I have a couple of asks: could we squash the commits together? I think it becomes easier to review. And we would like to keep the iptables
commands for some time until nft
becomes more spread.
I'll apply the squash and, as for iptables, I like your idea for collapsible blocks as opt-in for using it. Iptables, however, is most certainly no longer the default and, even when it's used, it's used only through the iptables-nft compat layer which is already itself deprecated on some distros (including RHEL). So I'll do a collapsible choice between iptables-nft and just nft. |
@pb8o Sorry for the delay! I've fixed the problems, and made an effort to support both I explicitly don't want to encourage using the legacy |
For the squashing, I'm pretty sure the PR can just be merged with the "squash and merge" option to clean everything up. |
In my Ubuntu machine the default is
|
Fedora 40 and 41 have it as default as well, but openSUSE Leap and Tumbleweed still use x_tables and enable it by default, and those are pretty significant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good to me!
Ok so I saw some style checks failing, here is how to make it happy:
You can check if the styles check pass by running |
Updated the deflate on oom test to increase stability of the test. Making the balloon smaller and the allocation larger. Signed-off-by: Jack Thomson <[email protected]>
…dates Bumps the firecracker group with 19 updates in the / directory: | Package | From | To | | --- | --- | --- | | [thiserror](https://github.com/dtolnay/thiserror) | `1.0.64` | `1.0.65` | | [vm-memory](https://github.com/rust-vmm/vm-memory) | `0.15.0` | `0.16.0` | | [zerocopy](https://github.com/google/zerocopy) | `0.8.6` | `0.8.7` | | [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.88` | `1.0.89` | | [syn](https://github.com/dtolnay/syn) | `2.0.82` | `2.0.85` | | [serde](https://github.com/serde-rs/serde) | `1.0.210` | `1.0.214` | | [regex](https://github.com/rust-lang/regex) | `1.11.0` | `1.11.1` | | [gdbstub](https://github.com/daniel5151/gdbstub) | `0.7.2` | `0.7.3` | | [kvm-ioctls](https://github.com/rust-vmm/kvm-ioctls) | `0.18.0` | `0.19.0` | | [linux-loader](https://github.com/rust-vmm/linux-loader) | `0.12.0` | `0.13.0` | | [vhost](https://github.com/rust-vmm/vhost) | `0.12.0` | `0.12.1` | | [anstream](https://github.com/rust-cli/anstyle) | `0.6.15` | `0.6.17` | | [anstyle](https://github.com/rust-cli/anstyle) | `1.0.8` | `1.0.9` | | [anstyle-parse](https://github.com/rust-cli/anstyle) | `0.2.5` | `0.2.6` | | [anstyle-query](https://github.com/rust-cli/anstyle) | `1.1.1` | `1.1.2` | | [colorchoice](https://github.com/rust-cli/anstyle) | `1.0.2` | `1.0.3` | | [libm](https://github.com/rust-lang/libm) | `0.2.8` | `0.2.11` | | [prettyplease](https://github.com/dtolnay/prettyplease) | `0.2.24` | `0.2.25` | | [rustix](https://github.com/bytecodealliance/rustix) | `0.38.37` | `0.38.38` | Updates `thiserror` from 1.0.64 to 1.0.65 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](dtolnay/thiserror@1.0.64...1.0.65) Updates `vm-memory` from 0.15.0 to 0.16.0 - [Release notes](https://github.com/rust-vmm/vm-memory/releases) - [Changelog](https://github.com/rust-vmm/vm-memory/blob/main/CHANGELOG.md) - [Commits](rust-vmm/vm-memory@v0.15.0...v0.16.0) Updates `zerocopy` from 0.8.6 to 0.8.7 - [Release notes](https://github.com/google/zerocopy/releases) - [Changelog](https://github.com/google/zerocopy/blob/main/CHANGELOG.md) - [Commits](google/zerocopy@v0.8.6...v0.8.7) Updates `proc-macro2` from 1.0.88 to 1.0.89 - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](dtolnay/proc-macro2@1.0.88...1.0.89) Updates `syn` from 2.0.82 to 2.0.85 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](dtolnay/syn@2.0.82...2.0.85) Updates `serde` from 1.0.210 to 1.0.214 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.210...v1.0.214) Updates `serde_derive` from 1.0.210 to 1.0.214 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.210...v1.0.214) Updates `regex` from 1.11.0 to 1.11.1 - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](rust-lang/regex@1.11.0...1.11.1) Updates `gdbstub` from 0.7.2 to 0.7.3 - [Release notes](https://github.com/daniel5151/gdbstub/releases) - [Changelog](https://github.com/daniel5151/gdbstub/blob/master/CHANGELOG.md) - [Commits](daniel5151/gdbstub@0.7.2...0.7.3) Updates `kvm-ioctls` from 0.18.0 to 0.19.0 - [Release notes](https://github.com/rust-vmm/kvm-ioctls/releases) - [Changelog](https://github.com/rust-vmm/kvm-ioctls/blob/main/CHANGELOG.md) - [Commits](rust-vmm/kvm@v0.18.0...v0.19.0) Updates `linux-loader` from 0.12.0 to 0.13.0 - [Release notes](https://github.com/rust-vmm/linux-loader/releases) - [Changelog](https://github.com/rust-vmm/linux-loader/blob/main/CHANGELOG.md) - [Commits](rust-vmm/linux-loader@v0.12.0...v0.13.0) Updates `vhost` from 0.12.0 to 0.12.1 - [Release notes](https://github.com/rust-vmm/vhost/releases) - [Commits](rust-vmm/vhost@vhost-v0.12.0...vhost-v0.12.1) Updates `anstream` from 0.6.15 to 0.6.17 - [Commits](rust-cli/anstyle@anstream-v0.6.15...anstream-v0.6.17) Updates `anstyle` from 1.0.8 to 1.0.9 - [Commits](rust-cli/anstyle@v1.0.8...v1.0.9) Updates `anstyle-parse` from 0.2.5 to 0.2.6 - [Commits](rust-cli/anstyle@anstyle-parse-v0.2.5...anstyle-parse-v0.2.6) Updates `anstyle-query` from 1.1.1 to 1.1.2 - [Commits](rust-cli/anstyle@anstyle-query-v1.1.1...anstyle-query-v1.1.2) Updates `anstyle-wincon` from 3.0.4 to 3.0.6 - [Commits](rust-cli/anstyle@anstyle-wincon-v3.0.4...anstyle-wincon-v3.0.6) Updates `colorchoice` from 1.0.2 to 1.0.3 - [Commits](rust-cli/anstyle@colorchoice-v1.0.2...colorchoice-v1.0.3) Updates `libm` from 0.2.8 to 0.2.11 - [Release notes](https://github.com/rust-lang/libm/releases) - [Changelog](https://github.com/rust-lang/libm/blob/master/CHANGELOG.md) - [Commits](rust-lang/libm@0.2.8...libm-v0.2.11) Updates `prettyplease` from 0.2.24 to 0.2.25 - [Release notes](https://github.com/dtolnay/prettyplease/releases) - [Commits](dtolnay/prettyplease@0.2.24...0.2.25) Updates `rustix` from 0.38.37 to 0.38.38 - [Release notes](https://github.com/bytecodealliance/rustix/releases) - [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGELOG.md) - [Commits](bytecodealliance/rustix@v0.38.37...v0.38.38) Updates `thiserror-impl` from 1.0.64 to 1.0.65 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](dtolnay/thiserror@1.0.64...1.0.65) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: vm-memory dependency-type: direct:production update-type: version-update:semver-minor dependency-group: firecracker - dependency-name: zerocopy dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: serde_derive dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: gdbstub dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: kvm-ioctls dependency-type: direct:production update-type: version-update:semver-minor dependency-group: firecracker - dependency-name: linux-loader dependency-type: direct:production update-type: version-update:semver-minor dependency-group: firecracker - dependency-name: vhost dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: anstream dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: anstyle dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: anstyle-parse dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: anstyle-query dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: anstyle-wincon dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: colorchoice dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: libm dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: prettyplease dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: rustix dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: thiserror-impl dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker ... Signed-off-by: dependabot[bot] <[email protected]>
vm-memory: GuestMemoryIterator is gone kvm-ioctls: DeviceFd::get_device_attr is now unsafe. Signed-off-by: Patrick Roy <[email protected]>
And remove 23.10 since it is EOL Signed-off-by: Pablo Barbáchano <[email protected]>
v1.6.0 has been EOL for a few months already. Signed-off-by: Pablo Barbáchano <[email protected]>
Add a const generic parameter to specify the length of the IovDeque. This way different devices can use different sizes for the queue. Signed-off-by: Egor Lazarchuk <[email protected]>
There is no need to use MmdsNetworkStack::new() instead of MmdsNetworkStack::new_with_defaults() in tests that pass the same default values. Signed-off-by: Takahiro Itazuri <[email protected]>
We bumped the snapshot version up twice recently, requiring users to regenerate their snapshot, but the user action isn't clearly stated. Signed-off-by: Takahiro Itazuri <[email protected]>
This avoids the need to store and download the image from S3. Signed-off-by: Pablo Barbáchano <[email protected]>
Enabling ftrace in our kernels changed the performance of several tests, so it was reverted. Make a new set of kernels that will not be used for performance tests. While doing this, simplify our guest kernel config customization that relied on patches and use file concatenation instead. Turns out `make olddefconfig` produces the same result and we avoid the complexity of dealing with patches. Signed-off-by: Pablo Barbáchano <[email protected]>
Compress squashfs with zstd since that now we have CONFIG_SQUASHFS_ZSTD=y in all our guest kernels. In my tests it is 78MB vs 85MB (an 8.2% reduction) Signed-off-by: Pablo Barbáchano <[email protected]>
socat v1.8.0 in Ubuntu 24.04 has a bug when using `UDP-LISTEN` without specifying the address family. It looks like: E xioopen_ipdgram_listen(): unknown address family 0 We can work-around it by specifying IPv4. See http://www.dest-unreach.org/socat/CHANGES v1.8.0.1 Signed-off-by: Pablo Barbáchano <[email protected]>
Update guest rootfs to Ubuntu 24.04 Signed-off-by: Pablo Barbáchano <[email protected]>
Generate SSH key after downloading artifacts, and add it to the rootfs. This avoids having an SSH key hardcoded in the rootfs. Downside is that we have to rebuild the rootfs, but that is fast. Signed-off-by: Pablo Barbáchano <[email protected]>
This returns a Popen object instead of waiting for the command to finish. It may be useful when we need to incrementally read the output of a long running process in the guest, without having to use screen. Signed-off-by: Pablo Barbáchano <[email protected]>
So that we don't have to install it in the future. Signed-off-by: Pablo Barbáchano <[email protected]>
For now it's a very simple one, but we can use it as a base to provide more complicated ones in the future. Signed-off-by: Pablo Barbáchano <[email protected]>
Use the new CI artifacts prepared for v1.11 Signed-off-by: Pablo Barbáchano <[email protected]>
It's more hassle to keep this as a separate tool than including it in the tests, and we avoid having to treat it specially. Also this way we can run it in parallel easily. Signed-off-by: Pablo Barbáchano <[email protected]>
This is so we use less IO overall sending snapshot to/from S3. - Punch holes in the memory snapshots - Decrease guest memory from 1GB to 512MB as it's not important to the test. This decreases around 10x: Before: 27GB * 22 runs ~ 594GB After: 2.7GB * 22 runs ~ 59.4GB Signed-off-by: Pablo Barbáchano <[email protected]>
Also fix for when the patch kernel version is <100. Signed-off-by: Pablo Barbáchano <[email protected]>
It is unlikely that we will ever support more than one rootfs. Signed-off-by: Pablo Barbáchano <[email protected]>
Stage it so next time we rebuild the devctr it's there, and we can use it to replace gzip, since it compresses better and faster. Signed-off-by: Pablo Barbáchano <[email protected]>
Add debugging information to debug kernels, but split it out by default. Signed-off-by: Pablo Barbáchano <[email protected]>
cargo-deny raised its MSRV to 1.81.0 in 0.16.2, while we are still at 1.79.0. Pinning cargo-deny to last working version that works with our version of Rust. Signed-off-by: Pablo Barbáchano <[email protected]>
Bumps the firecracker group with 13 updates: | Package | From | To | | --- | --- | --- | | [zerocopy](https://github.com/google/zerocopy) | `0.8.9` | `0.8.10` | | [clap](https://github.com/clap-rs/clap) | `4.5.20` | `4.5.21` | | [libc](https://github.com/rust-lang/libc) | `0.2.162` | `0.2.164` | | [serde](https://github.com/serde-rs/serde) | `1.0.214` | `1.0.215` | | [serde_json](https://github.com/serde-rs/json) | `1.0.132` | `1.0.133` | | [serde_derive](https://github.com/serde-rs/serde) | `1.0.214` | `1.0.215` | | [aws-lc-rs](https://github.com/aws/aws-lc-rs) | `1.10.0` | `1.11.0` | | [aws-lc-fips-sys](https://github.com/aws/aws-lc-rs) | `0.12.13` | `0.12.14` | | [aws-lc-sys](https://github.com/aws/aws-lc-rs) | `0.22.0` | `0.23.0` | | [cc](https://github.com/rust-lang/cc-rs) | `1.1.37` | `1.2.1` | | [clap_builder](https://github.com/clap-rs/clap) | `4.5.20` | `4.5.21` | | [clap_lex](https://github.com/clap-rs/clap) | `0.7.2` | `0.7.3` | | [cpufeatures](https://github.com/RustCrypto/utils) | `0.2.14` | `0.2.15` | Updates `zerocopy` from 0.8.9 to 0.8.10 - [Release notes](https://github.com/google/zerocopy/releases) - [Changelog](https://github.com/google/zerocopy/blob/main/CHANGELOG.md) - [Commits](google/zerocopy@v0.8.9...v0.8.10) Updates `clap` from 4.5.20 to 4.5.21 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](clap-rs/clap@clap_complete-v4.5.20...clap_complete-v4.5.21) Updates `libc` from 0.2.162 to 0.2.164 - [Release notes](https://github.com/rust-lang/libc/releases) - [Changelog](https://github.com/rust-lang/libc/blob/main/CHANGELOG.md) - [Commits](rust-lang/libc@0.2.162...0.2.164) Updates `serde` from 1.0.214 to 1.0.215 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.214...v1.0.215) Updates `serde_json` from 1.0.132 to 1.0.133 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](serde-rs/json@v1.0.132...v1.0.133) Updates `serde_derive` from 1.0.214 to 1.0.215 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.214...v1.0.215) Updates `aws-lc-rs` from 1.10.0 to 1.11.0 - [Release notes](https://github.com/aws/aws-lc-rs/releases) - [Commits](aws/aws-lc-rs@v1.10.0...v1.11.0) Updates `aws-lc-fips-sys` from 0.12.13 to 0.12.14 - [Release notes](https://github.com/aws/aws-lc-rs/releases) - [Commits](aws/aws-lc-rs@aws-lc-fips-sys/v0.12.13...aws-lc-fips-sys/v0.12.14) Updates `aws-lc-sys` from 0.22.0 to 0.23.0 - [Release notes](https://github.com/aws/aws-lc-rs/releases) - [Commits](aws/aws-lc-rs@aws-lc-sys/v0.22.0...aws-lc-sys/v0.23.0) Updates `cc` from 1.1.37 to 1.2.1 - [Release notes](https://github.com/rust-lang/cc-rs/releases) - [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md) - [Commits](rust-lang/cc-rs@cc-v1.1.37...cc-v1.2.1) Updates `clap_builder` from 4.5.20 to 4.5.21 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](clap-rs/clap@v4.5.20...v4.5.21) Updates `clap_lex` from 0.7.2 to 0.7.3 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](clap-rs/clap@clap_lex-v0.7.2...clap_lex-v0.7.3) Updates `cpufeatures` from 0.2.14 to 0.2.15 - [Commits](RustCrypto/utils@cpufeatures-v0.2.14...cpufeatures-v0.2.15) --- updated-dependencies: - dependency-name: zerocopy dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: libc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: serde_derive dependency-type: direct:production update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: aws-lc-rs dependency-type: direct:production update-type: version-update:semver-minor dependency-group: firecracker - dependency-name: aws-lc-fips-sys dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: aws-lc-sys dependency-type: indirect update-type: version-update:semver-minor dependency-group: firecracker - dependency-name: cc dependency-type: indirect update-type: version-update:semver-minor dependency-group: firecracker - dependency-name: clap_builder dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: clap_lex dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker - dependency-name: cpufeatures dependency-type: indirect update-type: version-update:semver-patch dependency-group: firecracker ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.10.5 to 3.10.11. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](aio-libs/aiohttp@v3.10.5...v3.10.11) --- updated-dependencies: - dependency-name: aiohttp dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
ensures binaries are installed in the directory specified by --path. previously binaries could be overwriten during installation. Signed-off-by: Matthew Buckingham-Bishop <[email protected]>
This helps the script work for instances it doesn't know about, which is helpful while onboarding new instances. Only Graviton metal instances are aarch64 at the moment. Fixes: c33bc6c Signed-off-by: Pablo Barbáchano <[email protected]>
Signed-off-by: kanpov <[email protected]>
Messed up the commit tree, will have to remake the PR( |
Changes
network-for-clones is not changed in this PR since it's a whole another can of worms I'd like to deal with later.
These changes are to network-setup:
Migrate to nftables
Improve the documentation itself to convert it from a rather basic getting started guide to something more usable in the real world:
Multiple guests section
Guest kernel configuration at kernel level section (
ip
kernel boot arg)Reason
Fulfills #4874
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
PR.
CHANGELOG.md
.TODO
s link to an issue.contribution quality standards.
rust-vmm
.