Commit Graph

12991 Commits

Author SHA1 Message Date
Dan Mihai
535cf04edb genpolicy: add shareProcessNamespace support
Validate the sandbox_pidns field value for CreateSandbox and
CreateContainer.

Fixes: #8868

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-25 16:48:57 +00:00
Dan Mihai
1e24581c07
Merge pull request #8908 from microsoft/danmihai1/genpolicy-permissions
tools: allow all users to execute genpolicy
2024-01-25 08:42:24 -08:00
Dan Mihai
295494c7dc
Merge pull request #8898 from microsoft/danmihai1/show-output-of-passing-tests
tests: k8s: bats --show-output-of-passing-tests
2024-01-25 06:22:50 -08: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
Zvonko Kaiser
76efe25aed
Merge pull request #8901 from zvonkok/remove-gha-action
gpu: remove GHA target first then remove the obsoleted Makefile targets
2024-01-25 13:40:03 +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
Dan Mihai
723c76d945 tools: allow all users to execute genpolicy
This tool can be useful for any users.

Fixes: #8907

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-25 00:40:53 +00:00
Zvonko Kaiser
19ecdbca3b qemu: enable TPM
Several use-cases need a vTPM lets enable it for QEMU, a follow up patch will introduce the runtime config.

Fixes: #8902

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-01-24 17:49:08 +00:00
Gabriela Cervantes
98b5a19b3a tools: Use defined variable in build base qemu script
This PR uses a variable that is already defined in the build base
qemu script to have uniformity across the script as this variable
is already used in the script.

Fixes #8903

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-24 17:05:17 +00:00
Zvonko Kaiser
4b8d79c1f6 gpu: remove GHA target first then remove the obsoleted Makefile targets
Lets remove the GHA target actions first so the the follow-up PR #8874 tests are succeeding.

Fixes: #8900

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-01-24 11:43:39 +00:00
Dan Mihai
66c012d052 tests: k8s: bats --show-output-of-passing-tests
Add --show-output-of-passing-tests to the k8s integration tests. The
output of a passing test can be helpful when investigating a failure
of the same test.

Fixes: #8885

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-24 03:04:28 +00: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
Zvonko Kaiser
ab597a4d5b opa: Improve the download logic
The versions.yaml has a default for the amd64 binary, but there is no
code to actually build the arm64 binary, which seems an overlook.

Let's simplify the OPA logic by removing the direct link to the binary,
and construct that link as part of the checks we do to decide whether we
need to build OPA or not.

Fixes: #8373

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-23 09:16:16 +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
Gabriela Cervantes
eb7e123de8 metrics: Update packages needed for ResNet50 FP32 Dockerfile
This PR updates the packages necessary to build the ResNet50 fp32
Dockerfile to run properly the benchmark.

Fixes #8875

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-22 16:15:36 +00: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