Commit Graph

13492 Commits

Author SHA1 Message Date
Dan Mihai
5d31eb4847 agent: use regorus 0.1.4
Use regorus 0.1.4 from crates.io, instead of its source code
repository.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 23:21:17 +00:00
Dan Mihai
ed6412b63c tests: k8s: reduce the policy tests output noise
Hide some of the kubectl output, to reduce the size and redundancy of
this output.

Fixes: #9388

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:59:33 +00:00
Dan Mihai
df23eb09a6 agent: use regorus instead of opa
Implement Agent Policy using the regorus crate instead of the OPA
daemon.

The OPA daemon will be removed from the Guest rootfs in a future PR.

Fixes: #9388

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:58:30 +00:00
Dan Mihai
58e608d61a tests: remove k8s-policy-set-keys.bats
Remove k8s-policy-set-keys.bats in preparation for using the regorus
crate instead of the OPA daemon for evaluating the Agent Policy. This
test depended on sending HTTP requests to OPA.

Fixes: #9388

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:49:38 +00:00
Dan Mihai
b509c1beee agent: lock anyhow version to 1.0.58
Lock anyhow version to 1.0.58 because:

- Versions between 1.0.59 - 1.0.76 have not been tested yet using
  Kata CI. However, those versions pass "make test" for the
  Kata Agent.

- Versions 1.0.77 or newer fail during "make test" - see
  https://github.com/kata-containers/kata-containers/issues/9538.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:49:15 +00:00
Archana Shinde
cc6b671101 runtime-rs: Update storage source for pci block devices
In case of block devices using virtio-block, we need to pass the
pci-path as the storage source field to the agent.
Current the virt-path is being passed which works just for mmio block
devices.
In the future when support is added for scsi, block-ccw and pmem
devices, the storage source would need to be handled accordingly.

Fixes: #9034

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-04-22 11:36:58 -07:00
Hyounggyu Choi
f10744df99 CC: Enable guest-pull tests on non-TEE for s390x
This commit is to add a new CI job to run-k8s-tests-on-zvsi.yaml.
Why the job is not configured in run-kata-coco-tests.yaml by having it
integrated with `run-k8s-tests-coco-nontee` is:

- It uses k3s instead of AKS
- It runs on a self-hosted runner

These differences make the integrated job not easy to read and maintain
when it comes to incorporating other platforms in the near future.

Fixes: #9467

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-22 17:15:20 +02:00
Greg Kurz
6ca0f09710
Merge pull request #9518 from microsoft/danmihai1/agent-cargo-lock
agent: update cargo.lock
2024-04-22 13:36:06 +02:00
Tim Zhang
aeba483ec8 agent: avoid fd leakage of passfd-io
In do_create_container and do_exec_process, we should create the proc_io first,
in case there's some error occur below, thus we can make sure
the io stream closed when error occur.

Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-04-22 17:39:33 +08:00
Tim Zhang
8441187d5e runtime-rs: fix FIFO handling
Fixes: #9334

In linux, when a FIFO is opened and there are no writers, the reader
will continuously receive the HUP event. This can be problematic.
To avoid this problem, we open stdin in write mode and keep the stdin-writer

We need to open the stdout/stderr as the read mode and keep the open endpoint
until the process is delete. otherwise,
the process would exit before the containerd side open and read
the stdout fifo, thus runD would write all of the stdout contents into
the stdout fifo and then closed the write endpoint. Then, containerd
open the stdout fifo and try to read, since the write side had closed,
thus containerd would block on the read forever.
Here we keep the stdout/stderr read endpoint File in the common_process,
which would be destroied when containerd send the delete rpc call,
at this time the containerd had waited the stdout read return, thus it
can make sure the contents in the stdout/stderr fifo wouldn't be lost.

Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-04-22 17:39:33 +08:00
Tim Zhang
d68eb7f0ad agent: Fix close_stdin for passfd-io
In scenario passfd-io, we should wait for stdin to close itself
instead of manually intervening in it.

Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-04-22 17:39:32 +08:00
Steve Horsman
ff9985fc50
Merge pull request #9490 from wainersm/port_attestation_nontee_job
gha: move attestation tests to run-k8s-tests-coco-nontee
2024-04-22 10:23:11 +01:00
Archana Choudhary
4a010cf71b genpolicy: add default implementations for K8sResource trait
This commit adds default implementations for following methods of
K8sResource trait:
- generate_policy
- serialize

Fixes: #8960
Signed-off-by: Archana Choudhary <archana1@microsoft.com>
2024-04-21 12:59:02 +00:00
Archana Choudhary
6edc3b6b0a genpolicy: add default implementation for use_sandbox_pidns
This patch adds a default implementation for the use_sandbox_pidns
and updates the structs that implement the K8sResource trait to use
the default.

Fixes: #8960
Signed-off-by: Archana Choudhary <archana1@microsoft.com>
2024-04-21 12:59:02 +00:00
Archana Choudhary
d5d3f9cda7 genpolicy: add default implementation for use_host_network
- Provide default implementation for use_host_network
- Remove default implementation from structs implementing the trait K8sResource

Fixes: #8960
Signed-off-by: Archana Choudhary <archana1@microsoft.com>
2024-04-21 12:59:02 +00:00
Archana Choudhary
9a3eac5306 genpolicy: add default impl for get_containers
- Provide default impl for get_containers
- Remove default impl from structs implementing the trait K8sResource

Fixes: #8960
Signed-off-by: Archana Choudhary <archana1@microsoft.com>
2024-04-21 12:59:02 +00:00
Archana Choudhary
2db3470602 genpolicy: add default impl for get_container_mounts_and_storages
- Provide default impl for get_container_mounts_and_storages
- Remove default impl from structs implementing the trait K8sResource

Fixes: #8960
Signed-off-by: Archana Choudhary <archana1@microsoft.com>
2024-04-21 12:59:02 +00:00
Archana Choudhary
09b0b4c11d genpolicy: add default implementation for get_sandbox_name
- Provide default implementation for get_sandbox_name in K8sResource trait
- Remove default implementation from structs implementing the trait K8sResource

Fixes: #8960
Signed-off-by: Archana Choudhary <archana1@microsoft.com>
2024-04-21 12:55:32 +00:00
Archana Choudhary
43e9de8125 genpolicy: add default implementation for get_annotations
- Provide default implementation for get_annontations.
- Remove default implementation from structs implementing the trait K8sResource

Fixes: #8960
Signed-off-by: Archana Choudhary <archana1@microsoft.com>
2024-04-21 12:55:32 +00:00
Saul Paredes
2149cb6502 genpolicy: changing caching so the tool can run
concurrently with itself

Based on 3a1461b0a5186a92afedaaea33ff2bd120d1cea0

Previously the tool would use the layers_cache folder for all instances
and hence delete the cache when it was done, interfereing with other
instances. This change makes it so that each instance of the tool will
have its own temp folder to use.

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-04-19 15:46:30 -07:00
Wainer dos Santos Moschetta
1e35291fd5 gha: move attestation tests to run-k8s-tests-coco-nontee
The new run-k8s-tests-coco-nontee job should be the home of attestation
tests.

Changed run-k8s-tests-coco-nontee to get KBS installed and by the time the
KBS variable is exported in the environment then the attestation tests
will kick in (likewise they will skip in run-k8s-tests-on-aks).

Fixes #9455
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-19 14:51:30 -03:00
Steve Horsman
7e12d588c0
Merge pull request #9485 from sparky005/update_golang.org/x/net
update golang.org/x/net
2024-04-19 11:26:13 +01:00
Amulya Meka
12964256a4
Merge pull request #9521 from Amulyam24/gha
gha: tag k8s tests on ppc64le to ppc64le-runner-01
2024-04-19 15:08:08 +05:30
Julien Ropé
70e798ed35 runtime: Call CreateRuntime hooks at container creation time
CreateRuntime hooks are called at the CreateSandbox time,
but not after CreateContainer.

Fixes: #9523

Signed-off-by: Julien Ropé <jrope@redhat.com>
2024-04-19 10:25:02 +02:00
Alex Lyn
3456483df9
Merge pull request #9513 from stevenhorsman/bump-stale-version
gha: stale: Bump stalebot version
2024-04-19 15:15:10 +08:00
Alex Lyn
c147f0f4ed
Merge pull request #9516 from sprt/rlz-340
release: bump version for 3.4.0 release
2024-04-19 15:12:26 +08:00
Amulyam24
8255ed248a gha: tag k8s tests on ppc64le to ppc64le-runner-01
This PR aims at running the k8s tests to one runner on ppc64le.

Fixes: #9520

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-04-19 12:04:25 +05:30
Hyounggyu Choi
304dc1e4da doc: Update how-to-run-kata-containers-with-SE-VMs.md
This is to update a document `how-to-run-kata-containers-with-SE-VMs`
on using confidential artifacts to build a secure image.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-19 08:31:12 +02:00
Hyounggyu Choi
8fbed9f6a4 local-build: Use confidential kernel and initrd for boot-image-se
This is to make `boot-image-se-tarball` use confidential kernel and
initrd instead of vanilla version of artifacts.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-19 07:09:04 +02:00
Dan Mihai
4242801b1c agent: update cargo.lock
Update Kata Agent's Cargo.lock after the recent changes to Cargo.toml.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-18 17:12:48 +00:00
Aurélien Bombo
95971e4a42 release: bump version for 3.4.0 release
Release v3.4.0.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-04-18 17:08:06 +00:00
Steve Horsman
6dd038fd58
Merge pull request #9501 from zvonkok/check-fixes
kata: Remove check for "Fixes" in PR
2024-04-18 17:48:50 +01:00
Hyounggyu Choi
2b9c439fcf
Merge pull request #9508 from BbolroC/gha-s390x-k8s-label
gha: Make integration tests for s390x run on s390x-large runners
2024-04-18 18:05:01 +02:00
Adil Sadik
1c5ca0c915 runtime: update golang.org/x/net
updates golang.org/x/net to newer version that closes some reported
vulnerabilities and security issues

Fixes #9486

Signed-off-by: Adil Sadik <sparky.005@gmail.com>
2024-04-18 10:55:02 -04:00
Tim Zhang
221c5b51fe dragonball: fix EPOLLHUP/EPOLLERR events handling in vsock
1. EPOLLHUP events also need to be read and will be got len 0.
2. We should kill the connection when EPOLLERR events are received.

Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-04-18 20:47:02 +08:00
Hyounggyu Choi
49a0d57f66 gha: Make integration tests for s390x run on s390x-large runners
This is to make a workflow `run-k8s-tests` and `run-cri-containerd`
(s390x and zvsi) run only on the runners labeled by `s390x-large`.

Fixes: #9507

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-18 14:35:24 +02:00
stevenhorsman
cf5c3dc155 gha: stale: Bump stalebot version
- Bump the stalebot action version to v9 as that fixes the
```
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/stale@v8.
```
warning.

Fixes: #9512
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-04-18 11:41:09 +01:00
Steve Horsman
bf16b18180
Merge pull request #9503 from stevenhorsman/stale-pr-remove-date
gha: stale: Remove the start-date
2024-04-18 09:36:27 +01:00
Hyounggyu Choi
566a6de594
Merge pull request #9505 from BbolroC/remove-crio-nightly-test-s390x
gha: Remove k8s-cri-containerd-rhel9-e2e-tests for s390x
2024-04-18 09:31:07 +02:00
Hyounggyu Choi
cc22dc33f2
Merge pull request #9489 from BbolroC/install-opa-in-docker
rootfs: Make OPA build working in docker for s390x and pp…
2024-04-18 00:26:11 +02:00
Dan Mihai
5ceed689eb
Merge pull request #9492 from microsoft/danmihai1/pod-tests
tests: k8s: inject agent policy failures (part 3)
2024-04-17 14:01:11 -07:00
Hyounggyu Choi
e046f5e652 gha: Remove k8s-cri-containerd-rhel9-e2e-tests for s390x
This commit is simply to remove a CI workflow `k8s-cri-containerd-rhel9-e2e-tests`.

Fixes: #9504

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-17 15:36:42 +02:00
Zvonko Kaiser
eda3bfe2ef config: Add NVIDIA GPU SNP, TDX configuration files
Fixes: #9475

For TDX and SNP add NVIDIA specific configuration files

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-04-17 12:49:13 +00:00
Wainer Moschetta
2d8e7933c5
Merge pull request #9461 from GabyCT/topic/uninstallkbs
tests/k8s: Add uninstall kbs client command function
2024-04-17 09:36:37 -03:00
Zvonko Kaiser
d7b24c04e5
Merge pull request #9473 from zvonkok/gpu-image-initrd-versions
version: add initrd, image NVIDIA sections
2024-04-17 13:22:05 +02:00
stevenhorsman
7235988605 gha: stale: Remove the start-date
As documented in https://github.com/actions/stale?tab=readme-ov-file#start-date
> The start date is used to ignore the issues and pull requests created before the start date.
> Particularly useful when you wish to add this stale workflow on an existing repository
> and only wish to stale the new issues and pull requests.

As we don't want need to treat PRs older than May 2023 as a special case, then remove this option.

Fixes: #9502
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-04-17 11:19:56 +01:00
Zvonko Kaiser
395e93acd5 kata: Remove Issue - PR dependency
We've discussed this over and over. Let's try to get to an agreement here.
I will use this issue to remove the mandatory Issue - PR dependency.

Fixes: #9500

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-04-17 09:53:08 +00:00
Archana Shinde
af3b19ed18
Merge pull request #9084 from amshinde/document-intel-gpu-vfio
docs: Document Intel Discrete GPUs usage with Kata
2024-04-16 16:17:03 -07:00
Archana Shinde
973a15332a spell-check: Add missing words to spell-check
Add missing words to spell-check dictionaries

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-04-16 11:50:02 -07:00
Archana Shinde
6f97dc1f60 static-checks: Rename file in doc to make static checks happy
Configuration file for qemu with runtime-rs was recently renamed.
Doc contains name for old file. This was somehow not caught in the CI
earlier.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-04-16 11:50:02 -07:00