Commit Graph

12633 Commits

Author SHA1 Message Date
Fabiano Fidêncio
f23451de01
rootfs: Add xz as a dep
As we'll be untarring the agent tarball (and any other component that
may be part of the rootfs) into the rootfs, we have to have xz
installed.

For debian and ubuntu the package is called xz-utils; for centos,
alpine and cbl-mariner the package is called xz.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
Fabiano Fidêncio
8307718842
rootfs: Add AGENT_TARBALL env var
This env var will serve us to pass the agent tarball to the rootfs
builder, which will then just unpack the content into the rootfs instead
of building the agent again.

AGENT_TARBALL and AGENT_SOURCE_BIN should never be used together.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
Fabiano Fidêncio
5b0d0687e5
packaging: agent: Allow building in all arches
We're moving away from alpine and using ubuntu in order to be able to
build the agent for all the architectures we need.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
Fabiano Fidêncio
1039641ab8
packaging: agent: Add the arch to the builder container
This has been missed during reviews and is already a problem as we're
trying to build the agent outside of the rootfs for other architectures
than x86_64.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 14:11:14 +01:00
Fabiano Fidêncio
58874f9c3e
packaging: tools: Add the arch to the builder container
This has been missed during reviews and will become a problem when the
tools start to be built in different architectures.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 14:10:22 +01:00
Chelsea Mafrica
24b33ae35b
Merge pull request #8884 from GabyCT/topic/ulib
versions: Update libseccomp to version v2.5.5
2024-01-24 23:55:32 -08:00
Hyounggyu Choi
f4290688bb
Merge pull request #7146 from BbolroC/ibm-se-howto-doc
docs: provide a guide for how to use IBM Secure Execution
2024-01-23 22:48:05 +01:00
Hyounggyu Choi
25ecca91c6 docs: provide a guide for how to use IBM Secure Execution
This PR is to add a document for how to run kata containers under IBM
Secure Execution environment.

Fixes: #7025

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-23 18:58:27 +01:00
Greg Kurz
0f67a26751
Merge pull request #8812 from kalil-pelissier/feature/issue-7720/drop-dead-code
runtime: remove SharedVersions field dead code
2024-01-23 17:46:41 +01:00
Gabriela Cervantes
1b0d12ab78 versions: Update libseccomp to version v2.5.5
This PR updates the libseccompt version to v2.5.5 which includes
the following changes:
- Update the syscall table for Linux
- Fix minor issues with binary tree testing and with empty binary trees

Fixes #8883

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-23 16:31:25 +00:00
Greg Kurz
4516f38165
Merge pull request #8872 from zvonkok/nvidia-gpu-confidential
gpu: Add NVIDIA GPU Confidential kernel target
2024-01-23 09:22:27 +01:00
Dan Mihai
3d2ec5c919
Merge pull request #8857 from microsoft/danmihai1/k8s-gha
gha: get ready to install genpolicy
2024-01-22 08:29:24 -08:00
Zvonko Kaiser
4fc34323ae gpu: Add NVIDIA GPU Confidential kernel target
This is a follow up to the work of minimizing targets, unifying TDX,SNP builds for NVIDIA GPUs

Fixes: #8828

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-01-22 14:58:57 +00:00
Kvlil
a4b208a712 runtime: remove SharedVersions field dead code
SharedVersion fiel add a versiontable property that isn't supported by upstream QEMU.
This is dead code since virtcontainers isn't setting SharedVersions to true.

Fixes: #7720

Signed-off-by: Kvlil <kalil.pelissier@gmail.com>
2024-01-22 12:18:42 +00:00
Dan Mihai
ea9c659d36 gha: get ready to install genpolicy
The changes to install and test genpolicy must come later, after CI
picks up these gha changes.

Fixes: #8856

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-19 23:37:49 +00:00
GabyCT
bb1ada1a8b
Merge pull request #8855 from GabyCT/topic/updatefc
versions: Update firecracker version
2024-01-19 16:25:50 -06:00
Fabiano Fidêncio
1e30fde8fa
Merge pull request #8862 from microsoft/danmihai1/genpolicy-dns
genpolicy: ignore pod DNS settings
2024-01-19 23:08:26 +01:00
Dan Mihai
ca03d47634 genpolicy: ignore pod DNS settings
Ignore pod DNS settings because policing the network traffic is
currently outside the scope of the Agent Policy.

Example from Kata CI: pod-custom-dns.yaml

Fixes: #8832

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-19 16:42:35 +00:00
Alex.Lyn
826c751bf3
Merge pull request #8185 from pmores/add-qemu-cmdline-generation-framework
Add qemu cmdline generation framework
2024-01-19 21:42:49 +08:00
Greg Kurz
b7d6b18768
Merge pull request #8485 from BbolroC/add-unit-test-s390x
GHA: Enable static check for s390x, aarch64 and ppc64le
2024-01-19 11:49:16 +01:00
Pavel Mores
25c8d5db5d runtime-rs: use qemu cmdline generation framework to launch VM
Deploy the framework added by the previous commit to generate qemu
command line and launch the VM.

We now properly store the child process object which allows us to
implement remaining Hypervisor functions necessary for a simple but
successful VM lifecycle, get_vmm_master_tid() and stop_vm().

Fixes #8184

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-01-19 11:42:23 +01:00
Gabriela Cervantes
0696807384 versions: Update firecracker version
This PR updates the firecracker version to v1.6.0 which includes
the following features
- Added support for per net device metrics. In addition to aggregate metrics net, each individual net device will emit metrics under the label "net_{iface_id}". E.g. the associated metrics for the endpoint "/network-interfaces/eth0" will be available under "net_eth0" in the metrics json object.
- Added support for per block device metrics. In addition to aggregate metrics block, each individual block device will emit metrics under the label "block_{drive_id}". E.g. the associated metrics for the endpoint "/drives/{drive_id}" will be available under "block_drive_id" in the metrics json object.
- Added a new vm-state subcommand to info-vmstate command in the snapshot-editor tool to print MicrovmState of vmstate snapshot file in a readable format. Also made the vcpu-states subcommand available on x86_64.
- Added source-level instrumentation based tracing. See tracing for more details.
- Added developer preview only (NOT for production use) support for vhost-user block devices. Firecracker implements a vhost-user frontend. Users are free to choose from existing open source backend solutions or their own implementation. Known limitation: snapshotting is not currently supported for microVMs containing vhost-user block devices. See the related doc page for details. The device emits metrics under the label "vhost_user_{device}_{drive_id}".

Fixes #8854

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-18 15:50:30 +00:00
Amulyam24
f6fea5f2ca agent: fix failing unit tests on ppc64le
- test_volume_capacity_stats: verify the file block size against the fetched size via statfs()
 - test_reseed_rng: Correct the request codes for RNDADDTOENTCNT and RNDRESEEDCRNG when platform is ppc64le
 - test list_routes: Add the route only if destination is not empty
 - test_new_fs_manager: skip the test if cgroups v2 is used by default
 - skip test cases rpc::tests::test_do_write_stream, sandbox::tests::test_find_process, sandbox::t
ests::test_find_container_process and sandbox::tests::add_and_get_container on ppc64le as they are fl
aky

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-01-18 16:32:16 +01:00
Hyounggyu Choi
610f878894 dragonball: Fix compile error for aarch64
This is to fix a compile error raised for aarch64.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-18 16:32:15 +01:00
Amulyam24
376941cf69 kata-ctl: skip building kata-ctl on ppc64le
kata-ctl currently fails to build on ppc64le. Skip it for running static checks and the issues will be fixed and tracked in a seperate issue.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-01-18 16:31:13 +01:00
Amulyam24
4ecd82a5df runk: skip the test_init_container_create_launcher if not root on ppc64le
This is to skip the test_init_container_create_launcher if not root on ppc64le.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-01-18 16:31:13 +01:00
Amulyam24
a4b5447924 tools: fix makefile spacing
This minor PR removes the extra space in the makefiles.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-01-18 16:31:13 +01:00
Amulyam24
394777291d runtime: fix failing unit tests on ppc64le
A few CPU related test cases were failing as the version was being verified against Power8 while the CI machine is Power9.

Fixes: #5531

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-01-18 16:31:13 +01:00
Amulyam24
486b8a0538 dragonball: skip running static-checks for ppc64le
Since dragonball is not currently supported on ppc64le, skip running the targets for static-checks.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-01-18 16:31:13 +01:00
Amulyam24
14934c7b0d github: run static checks on ppc64le
This PR adds ppc64le runner to the static-checks workflow.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-01-18 16:31:13 +01:00
Hyounggyu Choi
8061a49ca5 kata-ctl: Clean up a test leftover file explicitely
It was observed that a tmporary file `/tmp/kata_hybrid_vsock02.hvsock`
for test_setup_hvsock_failed() is not removed from time to time.
This leads to a test failure for the same test next time due to the
file permission on a self-hosted runner.
This commit is to explicitely delete the file before the check starts.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-18 16:31:13 +01:00
Hyounggyu Choi
290ecf4c46 Static-check: Exclude s390x from dragonball and runtime-rs
At the moment, a project `dragonball` and `runtime-rs` does not support
for s390x. During the enablement, some errors due to the misconfiguration
of Makefile for `make check` and `make vendor` were identified.

This is to skip the build for the affected target of the projects.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-18 16:31:13 +01:00
Hyounggyu Choi
c0f57c9e0a Lint: Fix cargo clippy errors for s390x
Some linting errors were identified during the enablement of `make check`.
These have not been found by the Jenkins CI job because `make test` was
only triggered.

The errors for the `agent` occurs under the s390x specific tests while
the other ones for the `kata-ctl` are the architecture-specific code.

This commit is to fix those errors.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-18 16:31:13 +01:00
Hyounggyu Choi
a1f288e5d3 CI: Use sudo if yq_path is not writable by USER
If `yq_path` is set to `/usr/local/bin/yq`, there could be a situation
where the `yq` cannot be installed without `sudo`.
This commit handles the situation by putting `sudo` in front of `curl`
and `chmod`, respectively.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-18 16:31:13 +01:00
Hyounggyu Choi
354cbede9c GHA: Enable static check for s390x
As part of the CI migration from Jenkins to GitHub Action, a CI job named
`kata-containers-2.0-ubuntu-s390x-unit-PR` is covered by the static check.
This commit is to enable the check for s390x by incorporating a runner
`s390x` with the corresponding workflow.

Fixes: #8482

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-18 16:31:13 +01:00
Jianyong Wu
ba74a624a8 runtime-rs: use pathBuf only for x86
PathBuf here is only used for x86.

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2024-01-18 16:31:13 +01:00
Jianyong Wu
a10779bf0b GHA: enable static check on arm64
This is to add a runner for arm64 to the workflow.

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2024-01-18 16:31:11 +01:00
Dan Mihai
eeba459a6b
Merge pull request #8845 from microsoft/danmihai1/genpolicy-defaults
tools: install genpolicy settings files
2024-01-17 15:08:49 -08:00
Chelsea Mafrica
32ad465663
Merge pull request #8710 from jodh-intel/runtime-rs-ch-get-thread-ids
runtime-rs: ch: Implement minimal implementation for missing thread/pid APIs
2024-01-17 14:51:44 -08:00
Fabiano Fidêncio
147d5fd752
Merge pull request #8836 from microsoft/danmihai1/test-with-cbl-mariner
genpolicy: use root path from cbl-mariner Guest VM
2024-01-17 17:51:44 +01:00
Pavel Mores
f550d9a325 runtime-rs: add basic implementation of qemu command line generation
This current framework is enough to launch a VM with a simple container
in it (e.g. busybox).

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-01-17 12:55:00 +01:00
Pavel Mores
e8e13044da runtime-rs: add simple impls to some of Qemu's Hypervisor functions
The idea of most of these is just to prevent running into todo!()s where
we can at the moment, while implementing the fundamental functionality of
VM launch.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-01-17 12:55:00 +01:00
Dan Mihai
febabef08c tools: install genpolicy settings files
Install the default genpolicy OPA rules and settings JSON files, in
addition to the genpolicy binary.

Fixes: #8844

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-16 23:59:59 +00:00
David Esparza
e11c520ffa
Merge pull request #8808 from kata-containers/memory_usage_test_skip_virtiofs_when_req
tests: Ignore virtiofs contribution to memory usage when it is disabled.
2024-01-16 16:50:06 -06:00
Dan Mihai
69557e5ad6
Merge pull request #8814 from microsoft/danmihai1/genpolicy-kata-deploy
tools: genpolicy static checks
2024-01-16 07:33:42 -08:00
Dan Mihai
13f2398fe8
Merge pull request #8837 from microsoft/danmihai1/allow_storages
genpolicy: temporarily disable allow_storages()
2024-01-16 07:10:49 -08:00
Alex.Lyn
17719f1ac5
Merge pull request #8708 from Apokleos/directvol-bugfix-blk-pci
runtime-rs: bugfix for DirectVolume/rawblock when driver is blk
2024-01-16 14:25:16 +08:00
alex.lyn
99717371c1 runtime-rs: bugfix for DirectVolume/rawblock when driver is blk
DirectVolume/Rawblock doesn't work well when device's block driver
is virtio-blk-pci and the storage handler is DRIVER_BLK_PCI_TYPE.

Fixes: #8707

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2024-01-16 10:35:08 +08:00
Dan Mihai
205dafd323 genpolicy: temporarily disable allow_storages()
Temporarily disable the allow_storages() rules, because they are based
on the tarfs snapshotter + container image integrity information that
are not available yet in the main branch - see #8833.

Fixes: #8834

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-15 23:55:27 +00:00
Dan Mihai
f4106a6107 genpolicy: use root path from cbl-mariner Guest VM
Adjust genpolicy-settings.json to match the container root path from
the main branch + cbl-mariner Guest VMs.

This configuration might have to be adjusted again when other types of
Guest VMs will be tested during CI using genpolicy, in the future.

Also, improve logging from allow_root_path(), to easier debug these
issues in the future.

Fixes: #8835

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-15 23:33:28 +00:00