Skip to content

New CI artifacts #3896

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

Merged
merged 30 commits into from
Aug 11, 2023
Merged

New CI artifacts #3896

merged 30 commits into from
Aug 11, 2023

Conversation

pb8o
Copy link
Contributor

@pb8o pb8o commented Jun 28, 2023

Changes

Refresh CI artifacts and adapt tests to work with the new kernels/rootfs

Reason

Our current rootfs is Ubuntu 18.04, which is EOL.

I don't understand how GitHub is doing the diffstat, but in my workspace it is:

 151 files changed, 2524 insertions(+), 4486 deletions(-)

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

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@pb8o pb8o self-assigned this Jun 28, 2023
@pb8o pb8o added the Status: Awaiting author Indicates that an issue or pull request requires author action label Jun 28, 2023
@pb8o pb8o force-pushed the new-ci-artifacts branch from b773920 to 747dde4 Compare June 28, 2023 14:18
@pb8o pb8o force-pushed the new-ci-artifacts branch 3 times, most recently from d73c668 to c299a6c Compare July 7, 2023 07:13
@pb8o pb8o force-pushed the new-ci-artifacts branch 23 times, most recently from 105cb5a to 6d07d64 Compare July 10, 2023 20:35
pb8o added 20 commits August 11, 2023 08:59
Add some abstractions and functions around the snapshotting process.
This is something that otherwise gets repeated over and over in
integration tests, and makes debugging tests hard.

Cleaning up existing tests is left over to the next changes in the
series.

Signed-off-by: Pablo Barbáchano <[email protected]>
Add a new script to regenerate the CI artifacts. This includes:

- Latest stable Linux kernels
- Latest rootfs (Ubuntu 22.04)

Signed-off-by: Pablo Barbáchano <[email protected]>
When running with an Ubuntu 22.04 rootfs, vsock_helper can hang and
never exit.

Fixed it by also closing STDERR when daemonizing.

Signed-off-by: Pablo Barbáchano <[email protected]>
These options are needed for testing virtio-rng support.

Signed-off-by: Pablo Barbáchano <[email protected]>
Also save a copy of the kernel config.

Signed-off-by: Pablo Barbáchano <[email protected]>
microvm capabilities was an interesting idea that is not used in
practice.

The tests now assume all data is local. To ensure that we fetch all
files that could be needed from S3 before running the tests.

Also, update to use new artifacts.

- Changes to paths since we are moving some custom binaries and scripts.
- Changes due to the new rootfs being read-only (squashfs) Changes due
  to migrating from Ubuntu 18.04 to Ubuntu 22.04, like cpuid output
  differences.

Signed-off-by: Pablo Barbáchano <[email protected]>
All the functionality has been moved to the Microvm class and fixtures.

Signed-off-by: Pablo Barbáchano <[email protected]>
Firecracker releases up to 1.3.3 do not pass CPU information in a way
that can cause a crash in the Ubuntu 22.04 rootfs.

This was fixed in 8dab78b, but not released in the 1.2 branch.

Skip the test as 1.2 will be out of support soon.

Signed-off-by: Pablo Barbáchano <[email protected]>
This does not mean the guest is vulnerable, just that we don't give
enough information to the guest to tell if it is vulnerable ot not. The
docs[1] say that

    'Vulnerable: Clear CPU buffers attempted, no microcode':

    The processor is vulnerable, but microcode is not updated. The
    mitigation is enabled on a best effort basis.

We may not want to pass-through the microcode to the guest, as that
could be leveraged by an attacker.

[1]: https://www.kernel.org/doc/html/next/admin-guide/hw-vuln/processor_mmio_stale_data.html

Signed-off-by: Pablo Barbáchano <[email protected]>
This is a temporary measure until we can migrate the tests that don't
pass with the new artifacts.

Signed-off-by: Pablo Barbáchano <[email protected]>
Looks like the text_offset was changes in recent stable kernel versions,
and that is reflected in the PC register prior to booting the VM.

Signed-off-by: Pablo Barbáchano <[email protected]>
Due to the new guest kernel versions, the MSRs seen by the guest are
different.

The only difference is MSR_IA32_SPEC_CTRL[1], which passes IBRS
information in bit 0 now.

[1]: https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/cpuid-enumeration-and-architectural-msrs.html

Signed-off-by: Pablo Barbáchano <[email protected]>
That way to take new baselines we can just take them from a failed run
rather than having to manually launch instances to run a single command.

Signed-off-by: Pablo Barbáchano <[email protected]>
These destructors get called when the instance gets out of lexical
scope, which makes some issues tricky to debug.

We will cleanup at test teardown instead, and anyway everything gets
deleted after the container exits.

Signed-off-by: Pablo Barbáchano <[email protected]>
Add the source of the binary since it was missing, and include it in our
rootfs images. This avoids the need for a separate initrd image.

Signed-off-by: Pablo Barbáchano <[email protected]>
Get the data with the same command for host and guest, and avoid a file
in the rootfs.

Signed-off-by: Pablo Barbáchano <[email protected]>
Use busybox instead of a full Alpine image. This results in a much
smaller image.

In addition, we leverage `busybox devmem` command to write the magic
boot value into MMIO, removing the need for `init.c`.

Signed-off-by: Pablo Barbáchano <[email protected]>
The script will set up a TMPDIR and will copy the test artifacts to
/srv so they can be hardlinked to save space and IO.

Signed-off-by: Pablo Barbáchano <[email protected]>
Currently /srv is a Docker volume backed by an overlay filesystem on top
of whatever the rootfs block device. The overlay filesystem is slow, so
rather than having tests opt-in to using a ramfs, do this by default for
all tests.

This also simplifies the ramfs logic.

Signed-off-by: Pablo Barbáchano <[email protected]>
We cannot just use the guest_kernel_4_14 fixture as st_core already
depends on guest_kernel. Use indirect parametrization for the guest
fixture as a workaround.

Signed-off-by: Pablo Barbáchano <[email protected]>
@zulinx86
Copy link
Contributor

pushed my change to pb8o/new-ci-artifacts with rebasing on top of HEAD of main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled python Pull requests that update Python code Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants