Commit Graph

12670 Commits

Author SHA1 Message Date
Fabiano Fidêncio
34d51b05f8
gha: cri-o: Bump runners to 22.04
This will *not* solve the CRI-O CI breakage but will give us an
environment where we could get it to run locally.

Fixes: #8935 -- part I

Thanks to Julien Ropé for trying to reproduce the issues I faced on
https://github.com/kata-containers/kata-containers/issues/8935 in an
Ubuntu 22.04 system.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-30 14:17:06 +01:00
Dan Mihai
6a8f46f3b8
Merge pull request #8918 from microsoft/danmihai1/metadata
genpolicy: optional PodTemplateSpec metadata field
2024-01-29 12:36:30 -08:00
Fabiano Fidêncio
087856f26c
Merge pull request #8934 from microsoft/danmihai1/nodeName
genpolicy: ignore the nodeName field
2024-01-29 16:57:59 +01:00
Greg Kurz
d687b601f1
Merge pull request #8933 from fidencio/topic/package-coco-guest-components
packaging: Build coco-guest-components
2024-01-29 16:34:06 +01:00
Zvonko Kaiser
a9348fa35b
Merge pull request #8375 from zvonkok/opa-binary-fix
arm64: agent_policy build always pulls amd64 opa binary
2024-01-29 15:10:10 +01:00
Fabiano Fidêncio
5ea6a29c37
Merge pull request #8947 from fidencio/topic/gha-pass-down-AZ_SUBSCRIPTION_ID
gha: azure: Set the correct subscription to the account
2024-01-29 15:07:06 +01:00
Fabiano Fidêncio
448c0aaecb
gha: azure: Set the correct subscription to the account
Due to the changes done in the CI, we need to set the correct
subscription to be used with the account from now on, otherwise we'd end
up using CoCo subscription.

Fixes: #8946

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-29 15:00:38 +01:00
Fabiano Fidêncio
98dc2d4c52
rootfs: agent: Initialise AGENT_SOURCE_BIN & AGENT_TARBALL
Otherwise those would be unbound if not passed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-26 19:58:41 +01:00
Fabiano Fidêncio
5e57e0235e
rootfs: agent: Fix build with AGENT_SOURCE_BIN
We need to actually check that the env var is not empty. :-)
This was introduced by 8307718842.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-26 19:58:20 +01:00
Fabiano Fidêncio
fbfc880eb6
rootfs: Add COCO_GUEST_COMPONENTS_TARBALL env var
This env ver will serve us to pass the Confidential Containers
guest-components tarball to the rootfs builder, which will then just
unpack the content into the rootfs.

Fixes: #8848 -- part I

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Linda Yu <linda.yu@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
Co-authored-by: Wang, Arron <arron.wang@intel.com>
Co-authored-by: zhouliang121 <liang.a.zhou@linux.alibaba.com>
Co-authored-by: Alex Carter <alex.carter@ibm.com>
Co-authored-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
Co-authored-by: Xynnn007 <xynnn@linux.alibaba.com>
2024-01-26 19:58:19 +01:00
Fabiano Fidêncio
644abde35c
packaging: coco-guest-components: Allow building the project
The Confidential Containers guest-components will, in the very short
future, be part of the Kata Containers rootfs that's used by the
Confidential Containers usecase.

This commit introduces the ability to, standalone, build the component
locally and as part of our CI, and this can be done by calling:
`make coco-guest-components-tarball`

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Linda Yu <linda.yu@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
Co-authored-by: Wang, Arron <arron.wang@intel.com>
Co-authored-by: zhouliang121 <liang.a.zhou@linux.alibaba.com>
Co-authored-by: Alex Carter <alex.carter@ibm.com>
Co-authored-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
Co-authored-by: Xynnn007 <xynnn@linux.alibaba.com>
2024-01-26 19:36:01 +01:00
Hyounggyu Choi
ee072e8a06
Merge pull request #8926 from fidencio/topic/cache-the-agent-for-non-x86_64
gha: Cache the agent for non-x86_64 arches
2024-01-26 18:04:33 +01:00
Dan Mihai
076869aa39 genpolicy: ignore the nodeName field
Validating the node name is currently outside the scope of the CoCo
policy.

This change unblocks testing using Kata CI's test-pod-file-volume.yaml
and pv-pod.yaml.

Fixes: #8888

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-26 16:30:55 +00:00
Dan Mihai
ef1ee81f81
Merge pull request #8909 from microsoft/danmihai1/main-shareProcessNamespace
genpolicy: add shareProcessNamespace support
2024-01-26 05:49:19 -08:00
Greg Kurz
f41fa7557a
Merge pull request #8914 from BbolroC/basic-e2e-ibm-se
tests: Add IBM SE to the basic confidential test
2024-01-26 12:32:32 +01:00
Fabiano Fidêncio
08a082ca47
gha: Cache the agent for non-x86_64 arches
Those are not yet being cached for no reason, and they better be as
it'll allow us to save a considerable amount of time building the
rootfs.

Fixes: #8917

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-26 12:02:26 +01:00
Fabiano Fidêncio
a7c68225aa
Merge pull request #8916 from fidencio/topic/packaging-reuse-already-built-agent
packaging:  Don't always build the kata-agent
2024-01-26 12:00:55 +01:00
Fabiano Fidêncio
95c569b0a6
packaging: Add safe.directory to the git config
Otherwise building as root will not work, as demonstrated by the arm64
CI.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-26 09:44:43 +01:00
Hyounggyu Choi
ab462a4b89 tests: Add IBM SE to the basic confidential test
The existing confidential basic test titled `Test unencrypted
confidential container launch success and verify that we are
running in a secure enclave` has been updated to incorporate
IBM Secure Execution (`qemu-se`).
Previously, a secure image was absent from kata-deploy, hindering
the inclusion of IBM SE in the test.
Thanks to the #6755 update, it is now possible to test the TEE.

This modification extends the existing test by introducing
`qemu-se`. The specific changes are outlined below:

- Add an additional test `cc-se-e2e-tests` to s390x nightly
- Expansion of `REMOTE_COMMAND_PER_HYPERVISOR` for `qemu-se`
- Temporary exclusion of two test cases currently incompatible with IBM SE
(`cpu-ns` is a common issue across all TEEs, while `inotify`
will be addressed in a subsequent pull request).

Fixes: #8913

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-26 06:04:39 +01:00
GabyCT
c13a63c8ba
Merge pull request #8905 from zvonkok/enable-tpm
qemu: enable TPM
2024-01-25 14:52:00 -06:00
GabyCT
aa958adf90
Merge pull request #8904 from GabyCT/topic/buildbq
tools: Use defined variable in build base qemu script
2024-01-25 13:51:44 -06:00
GabyCT
36fc2fd83f
Merge pull request #8876 from GabyCT/topic/dockerrestfp
metrics: Update packages needed for ResNet50 FP32 Dockerfile
2024-01-25 13:51:16 -06:00
Dan Mihai
8ad5459beb genpolicy: optional PodTemplateSpec metadata field
Add metadata containing the Policy annotation if the user didn't
provide any metadata in the input yaml file.

For a simple sanity test using a Kata CI YAML file:

genpolicy -u -y job.yaml

kubectl apply -f job.yaml

kubectl get pods | grep job
job-pi-test-64dxs 0/1     Completed   0          14s

Fixes: #8891

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-25 19:06:59 +00:00
Fabiano Fidêncio
dd49479829
packaging: Don't build the agent if not needed
Let's start relying on the already cached agent to be deployed inside
the rootfs.  By doing this we save a lot of time in our CI, and we have
a better way, for developers, to play with changes in the agent.

Fixes: #8915

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:33 +01:00
Fabiano Fidêncio
21fd7e6dfd
packaging: Fail in case oras can't find an artefact
It just means the component is not cached, and that it must be built in
the usual way.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
Fabiano Fidêncio
eb7a33ee71
rootfs: Always strip the agent binary
Let's always do this, regardless of where the agent is coming from.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
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
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