Commit Graph

144 Commits

Author SHA1 Message Date
Stefano Garzarella
a5d88d4f8f README: use latest container tag in the examples
We recently changed the container tags from vNN to gSHA-1, but we didn't
update README.md. Also, we now push `latest`, which is always updated,
so use this tag in the examples and mention to look at CONTAINER_VERSION
in .buildkite/autogenerate_pipeline.py for a specific version.

Reported-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2025-08-07 12:33:55 +02:00
Wenyu Huang
659de9e3a1 Update container version to g260df6e with lsof installed
Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
2025-07-28 07:39:13 +00:00
Wenyu Huang
af54708293 chore: Update container version to gd59baa3
Update container version to gd59baa3 that rust version is 1.87

Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
2025-07-11 12:43:19 +02:00
Matias Ezequiel Vara Larsen
aa2f8a90e4 chore: Update container version to g825a7ab
Update container version to g825a7ab that includes kani.

Signed-off-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
2025-06-06 08:30:57 +00:00
Ruoqing He
c3ef897738 chore: Update container version to g492a130
We bumped our `RUST_TOOLCHAIN` from 1.83.0 to 1.85.0 in
rust-vmm/rust-vmm-container#129.

Update to g492a130 dev image to apply this change.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-24 09:39:47 +00:00
Patrick Roy
3ea2d3fb2e doc: update readme for coverage changes
Mention that `crate_features` is now optional, and also update a very
outdated reference to `cargo kcov`

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2025-03-19 09:41:19 +00:00
Patrick Roy
e94bff4ff5 coverage: make crate_features key optional
Currently, if a crate wishes to run the coverage test with some cargo
features enabled, it must explicitly list them out in the
`crate_features` key of the coverage json files.

Change this so that if this key is omitted from the json file, then
test_coverage.py passes `--all-features` to cargo.

No functional change, as currently `crate_features` is a mandatory key,
so to opt-in to this new behavior, crates must remove this key from
their coverage json file(s).

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2025-03-19 09:41:19 +00:00
Ruoqing He
8ae03e5c36 chore: Update container version to g82bd1a3
We are missing `rsync` for `seccompiler`. And after bumping to
ubuntu:24.04, some dependencies required by `vhost-devices` could be
installed from ubuntu sources, so @stefano-garzarella reworked the
preparation of `vhost-devices` dependencies in
rust-vmm/rust-vmm-container#128.

Update to g82bd1a3 dev image to apply the changes.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-07 09:10:48 +01:00
Ruoqing He
f65383cd31 chore: Update container version to gaf9029e
`libc-bin` is broken in previous images which causes problem in
rust-vmm/vhost-device#820.

We ended up upgrading to ubuntu 24:04 to address this.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-06 11:08:08 +00:00
Ruoqing He
2d733b05f0 chore: Update container version to g538dba3
We have switched to git sha1 tagging since v49. For details, see:
rust-vmm/rust-vmm-container#121.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-02-18 16:54:48 +01:00
Egor Lazarchuk
09aef997d8 chore: update container version to v48
Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
2024-12-10 10:34:37 +00:00
Egor Lazarchuk
c04433e8d8 feat: add unit tests with --release flag
Rust does optimizations which can cause havoc
in `--release` mode, so add another set of unit tests
with all optimizations enabled.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
2024-12-09 16:11:39 +01:00
Patrick Roy
1150c47872 fix: report line coverage instead of function coverage
It seems that the raw output of llvm-cov changed at some point, and we
ended upcomparing functoin coverage instead of line coverage. Fix this
by instead using the new json output, which will hopefully prevent such
goofs in the future.

Fixes #170
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2024-10-23 09:07:13 +00:00
Patrick Roy
212241789d fix: have benchmark test clean working directory
Before checking out different commits, clean the working directory to
avoid checkout failures to to temporary files created during benchmark
execution (as is done by linux-loader)

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2024-10-17 15:32:28 +01:00
Patrick Roy
209c04eb5e run unittests in privileged docker container
The code coverage tests already run in a privileged container, so this
does not affect our security posture. Additionally, it will unblock
vsock unit tests in the vhost-user-vsock crate, see also
https://github.com/rust-vmm/vhost-device/pull/706 and
https://github.com/rust-vmm/vhost-device/pull/728

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2024-10-10 06:24:25 +00:00
Ruoqing He
cdb4a2d5cd update container version to v47
Version v47 [1] incorporates:
- chore: Move RUST_TOOLCHAIN into build_container.sh
- chore: Refactor dialing to reduce useless hints
- riscv64: Set MIN_CORES to 4

[1] rust-vmm/rust-vmm-container#118

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2024-10-07 11:46:22 +01:00
Ruoqing He
92034f0e36 ci: Enable tests with no platform specified
After `.platform` mechanism was introduced in #159, it silently filters
out tests with no `platform` specified. Enable them to execute by adding
`platform is not None` predicate preceeds allowlist check.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2024-10-07 06:41:13 +00:00
Ruoqing He
007a40657d update container version to v46
This version [1] incorporates:
- Support of running unit-tests of `linux-loader`, `vm-memory` and etc.
  by mounting `tmpfs` onto `/tmp`
- Improvement on `sshd` inside QEMU VM connectivity test.

[1] rust-vmm/rust-vmm-container#117

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2024-10-01 06:23:10 +00:00
Stefano Garzarella
438f36e242 github/workflows: run black also on pull requests
It's happening quite often to have CI broken on the main branch
because we only run `black` on merges, to prevent these problems,
let's run `black` or PR as well.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2024-09-06 11:00:30 +01:00
Stefano Garzarella
4700eac531 autogenerate_pipeline.py: fix formatting issues
The last commit made `black` unhappy.
Let's fix the formatting issues suggested by `black`.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2024-09-06 11:00:30 +01:00
Ruoqing He
55ee075f85 update container version to v45
This version includes a fix [1] on network problem of riscv64 QEMU VM.

[1] rust-vmm/rust-vmm-container#116

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2024-09-06 11:51:06 +02:00
Ruoqing He
752ad1322a Introduce riscv64 CI
Introduce logic necessary for generating YAML needed by BuildKite, which
are designed to work with image introduced in
rust-vmm/rust-vmm-container#106.

The container version is updated to v44 to enable CI on RISC-V platform.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2024-09-02 09:38:45 +02:00
Dorinda Bassey
5e818dc729 update container version to v38
This version includes vhost-device-gpu dependencies
which is required for vhost-device-gpu crate
more info about the crate can be found here:
rust-vmm/vhost-device#668
link to the PR that adds these dependencies
where the tag is generated can be found here:
rust-vmm/rust-vmm-container#110

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2024-08-09 21:59:36 +01:00
Dorinda Bassey
cec97d9e6c update container version to v37
This version includes vhost-device-gpu dependencies
which is required for vhost-device-gpu crate
more info about the crate can be found here:
rust-vmm/vhost-device#668
link to the PR that adds these dependencies
where the tag is generated can be found here:
rust-vmm/rust-vmm-container#107

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2024-08-05 08:32:30 +00:00
Dorinda Bassey
9f641f269b update container version to v35
This version includes libepoxy dependencies
which is required for vhost-device-gpu crate
more info about the crate can be found here:
rust-vmm/vhost-device#668
link to the container PR that adds libepoxy
where the tag is generated can be found here:
rust-vmm/rust-vmm-container#103

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2024-07-24 08:41:13 +00:00
Egor Lazarchuk
05038671bb chore: update codeowners
Remove JonathanWoollett-Light.
Add ShadowCurse.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
2024-06-07 11:04:09 +03:00
Patrick Roy
7606478202 doc: Document process for using dependabot configs
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2024-02-14 15:17:51 +00:00
Patrick Roy
5f5deb060e Add default dependabot configurations
The intention with these is that crates including rust-vmm-ci as a
submodule will be able to copy either the monthly or weekly schedule to
their repository's .github/dependabot.yml. Sadly, it is not possible to
automatically keep these in-sync with upstream, as dependabot does not
support symlinking the dependabot.yml file into a submodule. However, we
expect updates to be rare enough for this to not be a practical problem.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2024-02-14 15:17:51 +00:00
Egor Lazarchuk
72ebeb393c update container version to v34
This version adds fixes needed for musl-tools
package to properly find linux headers.
More info in https://github.com/rust-vmm/rust-vmm-container/pull/99
and https://github.com/rust-vmm/rust-vmm-container/pull/100

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
2024-01-09 15:09:34 +00:00
Egor Lazarchuk
b31e811bb4 update container version to v32
This version adds minor changes needed
for musl-tools package to properly find
linux headers.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
2024-01-04 09:34:59 +00:00
Egor Lazarchuk
cd1e502a6e update container version to v31
This version adds musl-tools package
which is required for rust-vmm/vhost#218
to compile userfaultfd crate for musl target.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
2024-01-03 10:26:58 +00:00
Andreea Florescu
0100de0f57 update container version to v30
This version adds the necessary Rust targets to run tests for
no-std crates.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2023-11-15 15:16:48 +00:00
Stefano Garzarella
1f5d329419 Update container version to v29
The new version reduces the size of the container by removing
unneeded pipewire dependencies and adds dbus.
This is needed to test vhost-device-sound.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-14 08:31:53 +00:00
Manos Pitsidianakis
f91cfebb85 README: add link to rust-vmm-container repository
For convenience, since the two are related directly.

Also fix a small typo while at it.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-11-14 08:23:16 +00:00
Stefano Garzarella
cf9809721d test_coverage: calculate the difference in reverse
If we increase the coverage the message prints a negative value
as the difference from the previous value. This can be confusing
as it looks like the coverage has decreased.

For example if the value in coverage_config_x86_64.json is 73.42,
and the new coverage is 73.96 (increased), we have the following
error:

    ValueError: Current code coverage (73.96%) deviates by -0.54%
    from the previous code co...

Let's calculate the difference in reverse so that we have a
negative value if it decreases and positive otherwise.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-03 15:43:00 +00:00
Stefano Garzarella
be28ad8e2c test_coverage: fix formatting of --ignore-filename-regex
`black` suggests putting the string between single quotes so
there is no need to escape double quotes.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-10-24 09:06:08 +02:00
Stefano Garzarella
0b9e2e28ba Update container version to v28
This new version contains alsa and pipewire libraries to build
vhost-device-sound audio backends.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-10-23 09:11:46 +02:00
Stefano Garzarella
4c55aa732b Update exclude_path description and examples
Now that we use cargo-llvm-cov, `exclude_path` should be a regular
expression, since we are using `--ignore-filename-regex` option:

   --ignore-filename-regex <PATTERN>
       Skip source code files with file paths that match the given
       regular expression

To prevent users from separating multiple files with commas,
let's update the `exclude_path` description in the README and in
the examples.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-10-20 16:06:54 +00:00
Stefano Garzarella
9699b4dfe3 test_coverage: put exclude_path value between double quotes
We don't want the shell to interpret the contents of exclude_path,
but we want it all used as a single string for `--ignore-filename-regex`,
so let's put it between double quotes.

An example of failure is when we have | , as in this case:

  $ CARGO_TARGET_DIR=./cov_build cargo llvm-cov test --summary-only \
      --ignore-filename-regex crates/virtio-bindings|crates/virtio-queue/src/mock.rs \
      --workspace  --features=virtio-blk/backend-stdio
  bash: crates/virtio-queue/src/mock.rs: Permission denied
  ...
  error: failed to generate report: process didn't exit successfully: ...
  (exit status: 74)

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-10-20 16:06:54 +00:00
Stefano Garzarella
b6483ebe81 test_coverage.py: fix formatting
CI is failing since `black` suggests some reformatting.
Let's apply them.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-10-20 15:59:46 +00:00
Stefano Garzarella
352bc23bee Generate Cargo.lock before call cargo audit
Starting from v0.18.0, cargo-audit hangs indefinitely if Cargo.lock
does not exist. We discovered this while upgrading the container
from v26 to v28 [1], which among other things updated cargo-audit.

For the binary crates this should not be a problem, since they have
Cargo.lock committed, but for many libraries this may not be true.

If Cargo.lock is not there, we are generating one with the latest
available versions, which may not be very significant. For this and
other reasons it's now suggested that libraries also have a
Cargo.lock [2] committed (thanks Manos for pointing this out).

Note: `cargo generate-lockfile` updates Cargo.lock if it's already
there, but we don't want it, that's why we have the guard.

[1] https://github.com/rust-vmm/rust-vmm-ci/pull/138
[2] https://doc.rust-lang.org/nightly/cargo/faq.html#why-have-cargolock-in-version-control

Suggested-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Suggested-by: Patrick Roy <roypat@amazon.co.uk>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-10-20 17:16:00 +02:00
Tan En De
9751aaa0d0 README: Fix link to setup_new_repo.md
The community repo has moved documents from the `maintainers` folder:
9c611c5727

Signed-off-by: Tan En De <ende.tan@starfivetech.com>
2023-09-27 10:57:46 +03:00
Patrick Roy
665f31f4b4 Add Rust unittest so that test_coverage properly self-tests
Using kcov, a coverage of 33.3% was reported, even though that are no
rust-test code in the dummy crate that is included in this repository.
This commit adds an actual unit test, so that the test_coverage test
actually properly self-tests here.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2023-09-01 10:21:56 +00:00
Patrick Roy
2148c043a0 Update container version to 26
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2023-09-01 10:21:56 +00:00
Patrick Roy
412ecd55f0 Have coverage test use llvm-cov instead of cargo-kcov
cargo-kcov is broken on rust versions >=1.71.0. This is currently
blocking us from upgrading to the new toolchain version (1.72.0), which
is required to compile linux-loader (due to one dependency having a MSRV
policy of "N-2", meaning our current toolchain is no longer supported).

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2023-09-01 10:21:56 +00:00
Erik Schilling
7c1057e9bc test_commit_format: no longer check body length
There are quite a few, genuine useful cases where one wants to overflow
the recommended 75 (some use 72) character rule.

Breaking long lines or manually breaking long compiler or other
tool-generated outputs is just confusing and error-prone.

This does not mean that we should stop wrapping manually written text
at a sane length, but enforcing the rule with a script seems to yield
questionable results while creating quite a bit of friction.

Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
2023-07-14 11:42:08 +01:00
Stefano Garzarella
9dfe5b267c Use derivatives of BaseException for exceptions
When the coverage changes, we raise exceptions with simple strings,
this causes the following error:

    TypeError: exceptions must derive from BaseException

Let's use derivatives of BaseException to fix this issue.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-06-28 12:44:28 +01:00
Jonathan Woollett-Light
7e9af57588 test: Update code coverage test
Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
2023-06-16 11:46:25 +01:00
Jonathan Woollett-Light
56bfdc97bb test: Format with black
Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
2023-06-16 11:46:25 +01:00
Patrick Roy
285971e8c7 Update container version to 24
v24 contains the rust-src component which miri requires.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
2023-05-23 12:01:47 +02:00