Commit Graph

14349 Commits

Author SHA1 Message Date
Fabiano Fidêncio
987ef1007e
ci: Enable basic k8s arm tests
Let's get the tests running. :-)

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-08-17 14:35:48 +02:00
Fabiano Fidêncio
1a186b619a
ci: Add basic k8s arm tests
Those tests are covering:
* go runtime:
  * cloud-hypervisor
  * qemu
* rust runtime:
  * cloud-hypervsuor
  * dragonball

The tests are running on a ARM64 baremetal machine, which has vanilla
kubernetes deployed.

I don't want to use the same machine for devmapper tests / cri-o tests,
as that would require deploying and re-deploying k8s there, which is not
exactly optimal for a baremetal machine.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-08-17 14:31:41 +02:00
Fabiano Fidêncio
7113490cb1
Merge pull request #10179 from fidencio/topic/switch-nginx-image
ci: k8s: Replace nginx alpine images
2024-08-17 13:07:31 +02:00
Fabiano Fidêncio
0831081399
ci: k8s: Replace nginx alpine images
The previous ones are gone, so let's switch to our own multi-arch image
for the tests.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-17 12:19:33 +02:00
Fabiano Fidêncio
a78d82f4f1
Merge pull request #10159 from squarti/main
agent: Handle EINVAL error when umounting container rootfs
2024-08-16 22:07:50 +02:00
Dan Mihai
79c1d0a806
Merge pull request #10136 from microsoft/danmihai1/docker-image-volume2
genpolicy: add bind mounts for image volumes
2024-08-16 13:07:01 -07:00
Fabiano Fidêncio
28aa4314ba
Merge pull request #10175 from ChengyuZhu6/error_message
runtime: Add specific error message for gRPC request timeouts
2024-08-16 22:06:49 +02:00
Fabiano Fidêncio
720edbe3fc
Merge pull request #10174 from ChengyuZhu6/install_script
tools: install luks-encrypt-storage script by guest-components
2024-08-16 22:04:56 +02:00
Fabiano Fidêncio
7b5da45059
Merge pull request #10178 from fidencio/topic/revert-trustee-bump
Revert "version: bump trustee version"
2024-08-16 21:48:30 +02:00
Fabiano Fidêncio
45f43e2a6a
Revert "version: bump trustee version"
This reverts commit d35320472c.

Although the commit in question does solve an issue related to the usage
of busybox from docker.io, as it's reasonably easy to hit the rate
limit, the commit also brings in functionalities that are causing issues
in, at least, the TDX CI, such as:
```sh
[2024-08-16T16:03:52Z INFO  actix_web::middleware::logger] 10.244.0.1 "POST /kbs/v0/attest HTTP/1.1" 401 259 "-" "attestation-agent-kbs-client/0.1.0" 0.065266
[2024-08-16T16:03:53Z INFO  kbs::http::attest] Auth API called.
[2024-08-16T16:03:53Z INFO  actix_web::middleware::logger] 10.244.0.1 "POST /kbs/v0/auth HTTP/1.1" 200 74 "-" "attestation-agent-kbs-client/0.1.0" 0.000169
[2024-08-16T16:03:54Z INFO  kbs::http::attest] Attest API called.
[2024-08-16T16:03:54Z INFO  verifier::tdx] Quote DCAP check succeeded.
[2024-08-16T16:03:54Z INFO  verifier::tdx] MRCONFIGID check succeeded.
[2024-08-16T16:03:54Z INFO  verifier::tdx] CCEL integrity check succeeded.
[2024-08-16T16:03:54Z ERROR kbs::http::error] Attestation failed: Verifier evaluate failed: TDX Verifier: failed to parse AA Eventlog from evidence

    Caused by:
        at least one line should be included in AAEL
```

Let's revert this for now, and then once we get this one fixed on
trustee side we'll update again.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-16 18:10:38 +02:00
Dan Mihai
c22ac4f72c genpolicy: add bind mounts for image volumes
Add bind mounts for volumes defined by docker container images, unless
those mounts have been defined in the input K8s YAML file too.

For example, quay.io/opstree/redis defines two mounts:
/data
/node-conf
Before these changes, if these mounts were not defined in the YAML file
too, the auto-generated policy did not allow this container image to
start.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-08-16 15:11:05 +00:00
Fabiano Fidêncio
b203f715e5
Merge pull request #10170 from beraldoleal/deploy-reset-fix
kata-deploy: fix kata-deploy reset
2024-08-16 16:51:14 +02:00
Fabiano Fidêncio
8d63723910
Merge pull request #10161 from microsoft/saulparedes/ignore_role_resource
genpolicy: ignore Role resource
2024-08-16 16:50:16 +02:00
Fabiano Fidêncio
6c58ae5b95
Merge pull request #10171 from fidencio/topic/ci-treat-nydus-snapshotter-as-a-dep
ci: nydus: Treat the snapshotter as a dependency
2024-08-16 16:39:48 +02:00
ChengyuZhu6
1eda6b7237 tests: update error message with guest pulling image timeout
update error message with guest pulling image timeout.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-16 20:26:33 +08:00
ChengyuZhu6
ca05aca548 runtime: Add specific error message for gRPC request timeouts
Improved error handling to provide clearer feedback on request failures.

For example:
Improve createcontainer request timeout error message from
"Error: failed to create containerd task: failed to create shim task:context deadline exceed"
to "Error: failed to create containerd task: failed to create shim task: CreateContainerRequest timed out: context deadline exceed".

Fixes: #10173 -- part II

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-16 20:24:48 +08:00
Beraldo Leal
b3a4cd1a06
Merge pull request #10172 from deagon/fix-typo
osbuilder: fix typo in ubuntu rootfs depends
2024-08-16 08:01:59 -04:00
Beraldo Leal
b843b236e4 kata-deploy: improve kata-deploy script
For the rare cases where containerd_conf_file does not exist, cp could fail
and let the pod in Error state. Let's make it a little bit more robust.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-08-16 07:52:38 -04:00
ChengyuZhu6
aa31a9d3c4 tools: install luks-encrypt-storage script by guest-components
Install luks-encrypt-storage script by guest-components. So that we can maintain a single source and prevent synchronization issues.

Fixes: #10173 -- part I

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-16 16:28:20 +08:00
Chengyu Zhu
ba3c484d12
Merge pull request #9999 from ChengyuZhu6/trusted-storage
Trusted image storage
2024-08-16 15:39:50 +08:00
Fabiano Fidêncio
0f3eb2451e
Merge pull request #10169 from fidencio/topic/revert-reset_runtime-to-cleanup
Revert "ci: add reset_runtime to cleanup"
2024-08-16 07:29:58 +02:00
Aurélien Bombo
e1775e4719
Merge pull request #10164 from BbolroC/make-exec_host-stable
tests: Ensure exec_host() consistently captures command output
2024-08-15 21:43:32 -07:00
Guoqiang Ding
1d21ff9864 osbuilder: fix typo in ubuntu rootfs depends
Remove the duplicate package "xz-utils".

Signed-off-by: Guoqiang Ding <dgq8211@gmail.com>
2024-08-16 11:33:55 +08:00
Silenio Quarti
0dd16e6b25 agent: Handle EINVAL error when umounting container rootfs
Container/Sandbox clean up should not fail if root FS is not mounted.
This PR handles EINVAL errors when umount2 is called.

Fixes: #10166

Signed-off-by: Silenio Quarti <silenio_quarti@ca.ibm.com>
2024-08-15 19:41:46 -04:00
Fabiano Fidêncio
3733266a60
ci: nydus: Treat the snapshotter as a dependency
Instead of deploying and removing the snapshotter on every single run,
let's make sure the snapshotter is always deploy on the TDX case.

We're doing this as an experiment, in order to see if we'll be able to
reduce the failures we've been facing with the nydus snapshotter.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-15 22:44:30 +02:00
Hyounggyu Choi
ba3e5f6b4a Revert "tests: Disable k8s file volume test"
This reverts commit e580e29246.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-08-15 21:10:39 +02:00
Hyounggyu Choi
758e650a28 tests: Ensure exec_host() consistently captures command output
The `exec_host()` function often fails to capture the output of a given command
because the node debugger pod is prematurely terminated. To address this issue,
the function has been refactored to ensure consistent output capture by adjusting
the `kubectl debug` process as follows:

- Keep the node debugger pod running
- Wait until the pod is fully ready
- Execute the command using `kubectl exec`
- Capture the output and terminate the pod

This commit refactors `exec_host()` to implement the above steps, improving its reliability.

Fixes: #10081

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-08-15 21:10:39 +02:00
Beraldo Leal
74662a0721
Merge pull request #10137 from hex2dec/fix-image-warning
tools: Fix container image build warning
2024-08-15 14:45:41 -04:00
Dan Mihai
905c76bd47
Merge pull request #10153 from microsoft/saulparedes/support_cron_job
genpolicy: Add support for cron jobs
2024-08-15 11:11:00 -07:00
Aurélien Bombo
0223eedda5
Merge pull request #10050 from burgerdev/request-hardening
genpolicy: hardening some agent requests
2024-08-15 08:31:21 -07:00
Fabiano Fidêncio
1f6a8baaf1 Revert "ci: add reset_runtime to cleanup"
This reverts commit 8d9bec2e01, as it
causes issues in the operator and kata-deploy itself, leading to the
node to be NotReady.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-15 16:09:34 +02:00
ChengyuZhu6
5f4209e008 agent:README: add secure_image_storage_integrity to agent's README
add secure_image_storage_integrity to agent's README.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 20:32:44 +08:00
ChengyuZhu6
6ecb2b8870 tests: skip test trusted storage in qemu-coco-dev
I can't set up loop device with `exec_host`, which the command is
necessary for qemu-coco-dev. See issue #10133.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 20:32:44 +08:00
ChengyuZhu6
51b9d20d55 tests: update error message in pulling image encrypted tests
Update error message in pulling image encrypted to "failed to get decrypt key no suitable key found for decrypting layer key".

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 20:32:44 +08:00
ChengyuZhu6
b4d10e7655 version: update the version of coco-guest-components
update the version of coco-guest-components.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 20:32:43 +08:00
Fupan Li
365df81d5e
Merge pull request #10148 from lifupan/main_sandboxapi
runtime-rs: Add the wait_vm support for hypervisors
2024-08-15 17:08:38 +08:00
ChengyuZhu6
a9b436f788 agent:cdh: Introduces secure_mount API in cdh
Introduces `secure_mount` API in the cdh. It includes:

- Adding the `SecureMountServiceClient`.
- Implementing the `secure_mount` function to handle secure mounting requests.
- Updating the confidential_data_hub.proto file to define SecureMountRequest and SecureMountResponse messages
  and adding the SecureMountService service.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:23 +08:00
ChengyuZhu6
1528d543b2 agent:cdh: Rename sealed_secret API namespace to confidential_data_hub
renames the sealed_secret.proto file to confidential_data_hub.proto and
updates the corresponding API namespace from sealed_secret to confidential_data_hub.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:23 +08:00
ChengyuZhu6
37bd2406e0 docs: add content about how to pull large image
Add content about how to pull large image in the guest with trust
storage.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:22 +08:00
ChengyuZhu6
c5a973e68c tests:k8s: add tests for guest pull with configured timeout
add tests for guest pull with configured timeout:
1) failed case: Test we cannot pull a large image that pull time exceeds a short creatcontainer timeout(10s) inside the guest
2) successful case: Test we can pull a large image inside the guest with increasing createcontainer timeout(120s)

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:22 +08:00
ChengyuZhu6
6c506cde86 tests:k8s: add tests for pull images in the guest using trusted storage
add tests for pull images in the guest using trusted storage:
1) failed case: Test we cannot pull an image that exceeds the memory limit inside the guest
2) successful case: Test we can pull an image inside the guest using
   trusted ephemeral storage.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:22 +08:00
GabyCT
ecfbc9515a
Merge pull request #10158 from GabyCT/topic/k8sstabil
tests: Add kubernetes stability test
2024-08-14 14:44:49 -06:00
Saul Paredes
5ad47b8372 genpolicy: ignore Role resource
Ignore Role resources because they don't need a Policy.

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-08-14 12:57:06 -07:00
Gabriela Cervantes
d48ad94825 tests: Add kubernetes stability test
This PR adds a k8s stability test that will be part of the CoCo Kata
stability tests that will run weekly.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-08-14 15:30:49 +00:00
Fupan Li
cadcf5f92d runtime-rs: Add the wait_vm support for hypervisors
Add the wait_vm method for hypervisors. This is a
prerequisite for sandbox api support.

Fixes: #7043

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-08-14 12:01:34 +08:00
Fupan Li
506977b102
Merge pull request #10156 from GabyCT/topic/disablevolume
tests: Disable k8s file volume test
2024-08-14 12:00:47 +08:00
GabyCT
b0b6a1baea
Merge pull request #10154 from GabyCT/topic/stressk8s
tests: Add kubernetes stress-ng tests
2024-08-13 15:09:59 -06:00
Gabriela Cervantes
e580e29246 tests: Disable k8s file volume test
This PR disables the k8s file volume test as we are having random failures
in multiple GHA CIs mainly because the exec_host function sometimes
does it not work properly.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-08-13 20:50:18 +00:00
Saul Paredes
af598a232b tests: add test for cron job support
Add simple test for cron job support

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-08-13 10:47:42 -07:00
Saul Paredes
88451d26d0 genpolicy: add support for cron jobs
Add support for cron jobs

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-08-13 10:47:42 -07:00