Commit Graph

14094 Commits

Author SHA1 Message Date
Steve Horsman
064b45a2fa
Merge pull request #10016 from wainersm/ibm-se-auth-reg
workflows: setup environment to run auth registry tests on s390x
2024-07-16 22:24:39 +01:00
GabyCT
2206e2dd5c
Merge pull request #10013 from GabyCT/topic/updatecontdoc
docs: Update cri installion guide url in containerd documentation
2024-07-16 14:32:59 -06:00
Wainer dos Santos Moschetta
66c600f8d8 gha: delint the s390x workflow
Made run-k8s-tests-on-zvsi.yaml free of warnings by removing:

SC2086:info:1:1: Double quote to prevent globbing and word splitting ...
SC2086:info:2:1: Double quote to prevent globbing and word splitting ...

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-07-16 15:20:46 -03:00
Wainer dos Santos Moschetta
a98985fab8 gha: export user/password for auth registry tests on s390x
Counterpart of commit d8961cbd4a for run-k8s-tests-on-zvsi workflow

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-07-16 15:18:40 -03:00
Gabriela Cervantes
e4045ff29a docs: Update runtime v2 containerd url information
This PR updates the runtime v2 containerd url information at containerd
documentation.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-15 20:36:17 +00:00
Dan Mihai
bcaf7fc3b4
Merge pull request #10008 from microsoft/danmihai1/runAsUser
genpolicy: add support for runAsUser fields
2024-07-15 12:08:50 -07:00
Gabriela Cervantes
9f738f0d05 docs: Update cri installion guide url in containerd documentation
This PR updates the cri installation guide url link in the containerd
documentation guide as the previous url link does not exists.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-15 16:58:18 +00:00
Dan Mihai
648265d80e
Merge pull request #9998 from microsoft/danmihai1/GENPOLICY_PULL_METHOD
tests: k8s: GENPOLICY_PULL_METHOD clean-up
2024-07-15 09:32:29 -07:00
Steve Horsman
02b9fd6e95
Merge pull request #9382 from Xynnn007/feat-encrypt-image
Merge to main: supporting pull encrypted images
2024-07-15 15:58:42 +01:00
stevenhorsman
b060fb5b31 tests/k8s: Skip measured rootfs test
The only kernel built for measured rootfs was the kernel-tdx-experimental,
so this test only ran in the qemu-tdx job runs the test.
In commit 6cbdba7 we switched all TEE configurations to use the same kernel-confidential,
so rootfs measured is disabled for qemu-tdx too now.
The VM still fails to boot (because of a different reason...) but the bug
in the assert_logs_contain, fixed in this PR was masking the checks on the logs.
We still have a few open issues related to measured rootfs and generating
the root hash, so let's skip this test that doesn't work until they are looked at

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-07-15 12:00:50 +01:00
stevenhorsman
2cf94ae717 tests: Add guest-pull encrypted image tests
Add three new tests cases for guest-pull of an encrypted image
for the following scenarios:

_**Scenario: Pull encrypted image on guest with correct key works**_
**Given** I have a version of kata deployed with a guest image that has
an agent with `guest_pull` feature enabled and nydus-snapshotter installed
and configured for guest-pulling
  **And** A public encrypted container image *i* with a decryption key *k*
that is configured as a resource the KBS, so that image-rs on the guest can
connect to it
**When** I try and create a pod from *i*
**Then** The pod is successfully created and runs

_**Scenario: Cannot pull encrypted image with no decryption key**_
**Given** I have a version of kata deployed with a guest image that has
an agent with `guest_pull` feature enabled and nydus-snapshotter installed
and configured for guest-pulling
  **And** A public encrypted container image *i* with a decryption key *k*,
that is **not** configured in a KBS that image-rs on the guest can connect to
**When** I try and create a pod from *i*
**Then** The pod is not created with an error message that reflects why

_**Scenario: Cannot pull encrypted image with wrong decryption key**_
**Given** I have a version of kata deployed with a guest image that has
an agent with `guest_pull` feature enabled and nydus-snapshotter installed
and configured for guest-pulling
  **And** A public encrypted container image *i* with a decryption key *k*
and a different key *k'* that is set as a resource in a KBS, that image-rs
on the guest can connect to
**When** I try and create a pod from *i*
**Then** The pod is not created with an error message that reflects why

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-07-15 12:00:50 +01:00
Xynnn007
a56b15112a agent: add ocicrypt config
ocicrypt config is for kata-agent to connect to CDH to request for image
decryption key. This value is specified by an env. We use this
workaround the same as CCv0 branch.

In future, we will consider better ways instead of writting files and
setting envs inside inner logic of kata-agent.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
2024-07-15 12:00:50 +01:00
Xynnn007
1072658219 agent: Enable kata-cc-rustls-tls in image-rs
- Enable the kata-cc-rustls-tls feature in image-rs, so that it
can get resources from the KBS in order to retrieve the registry
credentials.
- Also bump to the latest image-rs to pick up protobuf fixes
- Add libprotobuf-dev dependency to the agent packaging
as it is needed by the new image-rs feature
- Add extra env in the agent make test as the
new version of the anyhow crate has changed the backtrace capture thus unit
tests of kata-agent that compares a raised error with an expected one
would fail. To fix this, we need only panics to have backtraces, thus
set RUST_BACKTRACE=0 for tests due to document
https://docs.rs/anyhow/latest/anyhow/

Fixes #9538

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-07-15 12:00:50 +01:00
stevenhorsman
3b72e9ffab tests/k8s: Fix assert_logs_contain
The pipe needs adding to the grep, otherwise the grep
gets consumed as an argument to `print_node_journal` and
run in the debug pod.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-07-15 12:00:50 +01:00
Hyounggyu Choi
83b3a681f4
Merge pull request #10010 from BbolroC/osbuilder-bump-fedora-to-40
osbuilder: Bump Fedora to 40
2024-07-15 13:00:28 +02:00
Greg Kurz
203d9e7803
Merge pull request #10000 from littlejawa/kata_deploy_add_storage_config_for_crio
kata-deploy: add storage configuration for cri-o
2024-07-15 12:29:21 +02:00
Hyounggyu Choi
08d2f6bfe4 osbuilder: Bump Fedora to 40
As Fedora 38 has reached EOL, we are encountering 404 errors for s390x, such as:

```
Status code: 404 for https://dl.fedoraproject.org/pub/fedora-secondary/updates/38/Everything/s390x/repodata/repomd.xml
```

Let's bump the OS to the latest version.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-15 09:58:54 +02:00
Fupan Li
a7179be31d
Merge pull request #9534 from Tim-Zhang/fix-stdin-stuck
Fix ctr exec stuck problem
2024-07-15 13:19:19 +08:00
Dan Mihai
dded329d26 tests: k8s: SecurityContext.runAsUser policy test
Add test for auto-generating policy for a pod spec that includes the
SecurityContext.runAsUser field.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-13 01:37:58 +00:00
Dan Mihai
7040fb8c50 tests: k8s-security-context auto-generated policy
Auto-generate the policy in k8s-security-context.bats - previously
blocked by lacking support for PodSecurityContext.runAsUser.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-13 01:23:54 +00:00
Dan Mihai
f087044ecb genpolicy: add support for runAsUser
Add ability to auto-generate policy for SecurityContext.runAsUser and
PodSecurityContext.runAsUser.

Fixes: #8879

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-13 01:10:43 +00:00
Dan Mihai
5282701b5b genpolicy: add link to allow_user() active issue
Improve comment to workaround in rules.rego, to explain better the
reason for that workaround.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-13 01:05:58 +00:00
GabyCT
3c0171df3d
Merge pull request #10005 from GabyCT/topic/katadragonball
common: Add share fs information for dragonball
2024-07-12 16:10:29 -06:00
Wainer Moschetta
646d7ea4fb
Merge pull request #9951 from BbolroC/enable-attestation-for-ibm-se
tests: Enable attestation e2e tests for IBM SE
2024-07-11 16:02:59 -03:00
Hyounggyu Choi
ca80301b4b
Merge pull request #10003 from BbolroC/skip-pod-shared-volume-for-ibm-se
k8s: Skip shared-volume relevant tests for IBM SE
2024-07-11 19:29:13 +02:00
Gabriela Cervantes
4477b4c9dc common: Add share fs information for dragonball
This PR adds the share fs information for dragonball using kata-ctl
to avoid the failures in runk tests saying that shared_fs is an
unbound variable.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-11 17:09:35 +00:00
Dan Mihai
09c5ca8032 tests: k8s: clarify the need to use containerd.sock
Modify the permissions of containerd.sock just when genpolicy needs
access to this socket, when testing GENPOLICY_PULL_METHOD=containerd.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-11 16:49:58 +00:00
Dan Mihai
c1247cc254 tests: k8s: explain the default containerd settings
Explain why the containerd settings on the local machine get set to
containerd's defaults when testing GENPOLICY_PULL_METHOD=containerd.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-11 16:49:39 +00:00
Dan Mihai
3b62eb4695 tests: k8s: add comment for GENPOLICY_PULL_METHOD
Explain why there are two different methods for pulling container
images in genpolicy.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-11 16:40:01 +00:00
Dan Mihai
eaedd21277 tests: k8s: use oci-distribution as default value
oci-distribution is the value used by run-k8s-tests-on-aks.yaml, so
use the same value as default for GENPOLICY_PULL_METHOD in gha-run.sh.

The value of GENPOLICY_PULL_METHOD is currently compared just with
"containerd", but avoid possible future problems due to using a
different default value in gha-run.sh.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-11 16:40:01 +00:00
GabyCT
2056eda5f0
Merge pull request #9922 from GabyCT/topic/updateblogname
metrics: Update container name in blogbench test
2024-07-11 10:05:35 -06:00
Hyounggyu Choi
32c3e55cde k8s: Skip shared-volume relevant tests for IBM SE
Currently, it is not viable to share a writable volume (e.g., emptyDir)
between containers in a single pod for IBM SE.
The following tests are relevant:
  - pod-shared-volume.bats
  - k8s-empty-dirs.bats
(See: https://github.com/kata-containers/kata-containers/issues/10002)

This commit skips the tests until the issue is resolved.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-11 14:09:19 +02:00
Julien Ropé
b83d4e1528 kata-deploy: add storage configuration for cri-o
Make sure that the "skip_mount_home" flag is set in cri-o config.

Fixes: #9878

Signed-off-by: Julien Ropé <jrope@redhat.com>
2024-07-11 10:11:30 +02:00
GabyCT
dac07239f5
Merge pull request #9974 from squarti/sharedfs
runtime: Initialize SharedFS for remote hypervisor
2024-07-10 17:03:00 -06:00
GabyCT
3827b5f9f2
Merge pull request #9982 from ChengyuZhu6/fix-ci
tests: Delete test scripts forcely
2024-07-10 17:00:41 -06:00
Wainer Moschetta
deb4627558
Merge pull request #9975 from niteeshkd/nd_snp_attestation
gha: enable SNP attestation
2024-07-10 18:59:05 -03:00
GabyCT
c40b3b4ce7
Merge pull request #9992 from sprt/fix-nydus
ci: fix run-nydus tests
2024-07-10 13:56:16 -06:00
David Esparza
be9385342e
Merge pull request #9990 from GabyCT/topic/tdxtimeout
gha: Increase timeout to run CoCo TDX tests
2024-07-10 13:21:23 -06:00
Silenio Quarti
8260ce8d15 runtime: Initialize SharedFS for remote hypervisor
Sets SharedFS config to NoSharedFS for remote hypervisor in order to start the file watcher which syncs files from the host to the guest VMs. 

Signed-off-by: Silenio Quarti <silenio_quarti@ca.ibm.com>
2024-07-10 14:31:25 -03:00
Aurélien Bombo
25e0e2fb35 ci: fix run-nydus tests
GH-9973 introduced:

 * New function get_kata_memory_and_vcpus() in
   tests/metrics/lib/common.bash.
 * A call to get_kata_memory_and_vcpus() from extract_kata_env(), which
   is defined in tests/common.bash.

Because the nydus test only sources tests/common.bash, it can't find
get_kata_memory_and_vcpus() and errors out.

We fix this by moving the get_kata_memory_and_vcpus() call from
tests/common.bash to tests/metrics/lib/json.bash so that it doesn't
impact the nydus test.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-07-10 17:19:08 +00:00
Gabriela Cervantes
b6b8524ab7 gha: Increase timeout to run CoCo TDX tests
This PR increases the timeout to run the CoCo TDX tests in order
to avoid the random failures on TDX saying that
The action 'Run tests' has timed out after 30 minutes and making
the GHA job fail.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-10 16:06:07 +00:00
Niteesh Dubey
e8a3f8571e docs: update for SNP attestation
This updates how-to document for SNP attestation.

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-07-10 15:06:55 +00:00
Niteesh Dubey
ff04154fdb gha: enable SNP attestation
This removes the code to skip the SNP attestation.

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-07-10 15:06:55 +00:00
Hyounggyu Choi
d94b285189 tests: Enable k8s-confidential-attestation.bats for s390x
For running a KBS with `se-verifier` in service,
specific credentials need to be configured.
(See https://github.com/confidential-containers/trustee/tree/main/attestation-service/verifier/src/se for details.)

This commit introduces two procedures to support IBM SE attestation:

- Prepare required files and directory structure
- Set necessary environment variables for KBS deployment
- Repackage a secure image once the KBS service address is determined

These changes enable `k8s-confidential-attestation.bats` for s390x.

Fixes: #9933

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Hyounggyu Choi
5d0f74cd70 local-build: Extract build_secure_image() as a separate library
Currently, all functions in `build_se_image.sh` are dedicated to
publishing a payload image. However, `build_secure_image()` is now
also used for repackaging a secure image when a kernel parameter
is reconfigured. This reconfiguration is necessary because the KBS
service address is determined after the initial secure image build.

This commit extracts `build_secure_image()` from `build_se_image.sh`
and creates a separate library, which can be loaded by bats-core.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Hyounggyu Choi
bf2f0ea2ca tests: Change a location for creating key.bin
The current KBS deployment creates a file `key.bin` assuming that
`kustomization.yaml` is located in `overlays/`.

However, this does not hold true when the kustomize config is enabled
for multiple architectures. In such cases, the configuration file
should be located in `overlays/$(uname -m)`.
This commit changes the location for file creation.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Hyounggyu Choi
4025ef7193 versions: Bump trustee to multi-arch deployment for KBS
As part of the enablement for s390x, KBS should support multi-arch deployment.
This commit updates the version of coco-trustee to a commit where the support
is implemented.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Hyounggyu Choi
856a1f72c6 packaging: Set ATTESTER to se-attester for guest components on s390x
This commit allows the guest-components builder to only build se-attester on s390x.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-10 16:18:37 +02:00
Xuewei Niu
7f71eac6de
Merge pull request #9868 from l8huang/dan
runtime: implement DAN in Go kata-runtime
2024-07-10 19:09:46 +08:00
Alex Lyn
dafff26f01
Merge pull request #9814 from Apokleos/bugfix-pcipath
runtime-rs: bugfix for root bus slot allocation
2024-07-10 16:19:06 +08:00