Commit Graph

15384 Commits

Author SHA1 Message Date
Wainer Moschetta
a94982d8b8
Merge pull request #10617 from stevenhorsman/skip-k8s-job-test-on-non-tee
tests: Skip k8s job test on qemu-coco-dev
2024-12-04 15:47:33 -03:00
Saul Paredes
84a411dac4 policy: improve pod namespace validation
- Remove default_namespace from settings
- Ensure container namespaces in a pod match each other in case no namespace is specified in the YAML

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-12-04 10:17:54 -08:00
Steve Horsman
c86f76d324
Merge pull request #10588 from stevenhorsman/metrics-clh-min-range-relaxation
metrics: Increase minval range for failing tests
2024-12-04 16:10:26 +00:00
stevenhorsman
a8ccd9a2ac tests: Skip k8s job test on qemu-coco-dev
The tests is unstable on this platform, so skip it for now to prevent
the regular known failures covering up other issues. See #10616

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-12-04 16:00:05 +00:00
Steve Horsman
9e609dd34f
Merge pull request #10615 from kata-containers/topic/update-remove-artifact-filter
workflows: Fix remove artifact name filter
2024-12-04 15:02:35 +00:00
Fabiano Fidêncio
531a29137e
Merge pull request #10607 from microsoft/danmihai1/less-logging
runtime: skip logging some of the dial errors
2024-12-04 15:01:45 +01:00
stevenhorsman
14a3adf4d6 workflows: Fix remove artifact name filter
- Fix copy-paste errors in artifact filters for arm64 and ppc64le
- Remove the trailing wildcard filter that falsely ends up removing agent-ctl
and replace with the tarball-suffix, which should exactly match the artifacts

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-12-04 13:34:42 +00:00
Alex Lyn
5f9cc86b5a
Merge pull request #10604 from 3u13r/euler/fix/genpolicy-rego-state-getter
genpolicy: align state path getter and setter
2024-12-04 13:57:34 +08:00
Alex Lyn
c7064027f4
Merge pull request #10574 from BbolroC/add-ccw-subchannel-qemu-runtime-rs
Add subchannel support to qemu-runtime-rs for s390x
2024-12-04 09:17:45 +08:00
Aurélien Bombo
57d893b5dc
Merge pull request #10563 from sprt/csi-deploy
coco: ci: Fully implement compilation of CSI driver and require it for CoCo tests [2/x]
2024-12-03 18:58:14 -06:00
Aurélien Bombo
4aa7d4e358 ci: Require CSI driver for CoCo tests
With the building/publishing step for the CSI driver validated, we can
set that as a requirement for the CoCo tests.

Depends on: #10561

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-12-03 14:43:36 -06:00
Aurélien Bombo
fe55b29ef0 csi-kata-directvolume: Remove go version check
The driver build recipe has a script to check the current Go version against
the go.mod version.  However, the script is broken ($expected is unbound) and I
don't believe we do this for other components. On top of this, Go should be
backward-compatible. Let's keep things simple for now and we can evaluate
restoring this script in the future if need be.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-12-03 14:43:36 -06:00
Aurélien Bombo
fb87bf221f ci: Implement build step for CSI driver
This fully implements the compilation step for csi-kata-directvolume.
This component can now be built by the CI running:

 $ cd tools/packaging/kata-deploy/local-build
 $ make csi-kata-directvolume-tarball

A couple notes:

 * When installing the binary, we rename it from directvolplugin to
   csi-kata-directvolume on the fly to make it more readable.
 * We add go to the tools builder Dockerfile to support building this
   tool.
 * I've noticed the file install_libseccomp.sh gets created by the build
   process so I've added it to a .gitignore.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-12-03 14:43:36 -06:00
Aurélien Bombo
0f6113a743
Merge pull request #10612 from kata-containers/sprt/fix-csi-publish2
ci: Fix Docker publishing for CSI driver, 2nd try
2024-12-03 14:43:28 -06:00
Aurélien Bombo
a23ceac913 ci: Fix Docker publishing for CSI driver, 2nd try
Follow-up to #10609 as it seems GHA doesn't allow hard links:

https://github.com/kata-containers/kata-containers/actions/runs/12144941404/job/33868901896?pr=10563#step:6:8

Note that I also updated the `needs` directive as we don't need the Kata
payload container, just the tarball artifact.

Part of: #10560

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-12-03 13:04:46 -06:00
Dan Mihai
2a67038836
Merge pull request #10608 from microsoft/saulparedes/policy_metadatata_uid
policy: ignore optional metadata uid field
2024-12-03 10:19:12 -08:00
Dan Mihai
25e6f4b2a5
Merge pull request #10592 from microsoft/saulparedes/add_constants_to_rules
policy: add constants to rules.rego
2024-12-03 10:17:10 -08:00
Aurélien Bombo
5e1fc5a63f
Merge pull request #10609 from kata-containers/sprt/fix-publish-csi
ci: Fix Docker publishing for CSI driver
2024-12-03 11:21:55 -06:00
Hyounggyu Choi
8b998e5f0c runtime-rs: Introduce get_devno_ccw() for deduplication
The devno assignment logic is repeated in 5 different places
during device addition.
To improve code maintainability and readability, this commit
introduces a standalone function, `get_devno_ccw()`,
to handle the deduplication.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-12-03 15:35:03 +01:00
Leonard Cohnen
9b614a4615 genpolicy: align state path getter and setter
Before this patch there was a mismatch between the JSON path under which
the state of the rule evaluation is set in comparison to under which
it is retrieved.

This resulted in the behavior that each time the policy was evaluated,
it thought it was the _first_ time the policy was evaluated.
This also means that the consistency check for the `sandbox_name`
was ineffective.

Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
2024-12-03 13:25:24 +01:00
Aurélien Bombo
85d3bcd713 ci: Fix Docker publishing for CSI driver
The compilation succeeds, however Docker can't find the binary because
we specify an absolute path. In Docker world, an absolute path is
absolute to the Docker build context (here:
src/tools/csi-kata-directvolume).

To fix this, we link the binary into the build context, where the
Dockerfile expects it.

Failure mode:
https://github.com/kata-containers/kata-containers/actions/runs/12068202642/job/33693101962?pr=10563#step:8:213

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-12-02 15:50:01 -06:00
Saul Paredes
711d12e5db policy: support optional metadata uid field
This prevents a deserialization error when uid is specified

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-12-02 11:24:58 -08:00
Dan Mihai
efd492d562 runtime: skip logging some of the dial errors
With full debug logging enabled there might be around 1,500 redials
so log just ~15 of these redials to avoid flooding the log.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-12-02 19:11:32 +00:00
Hyounggyu Choi
9c19d7674a
Merge pull request #10590 from zvonkok/fix-ci
ci: Fix variant for confidential targets
2024-12-02 18:39:52 +01:00
Saul Paredes
9105c1fa0c policy: add constants to rules.rego
Reuse constants where applicable

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-12-02 08:28:58 -08:00
Hyounggyu Choi
6f4f94a9f0
Merge pull request #10595 from BbolroC/add-zvsi-devmapper-to-gatekeeper-required-jobs
gatekeeper: add run-k8s-tests-on-zvsi(devmapper) to required jobs
2024-12-02 15:28:14 +01:00
Zvonko Kaiser
20442c0eae ci: Fix variant for confidential targets
The default initrd confidential target will have a
variant=confidential we need to accomodate this
and make sure we also accomodate aaa-xxx-confidential targets.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-12-02 14:21:03 +00:00
stevenhorsman
b87b4b6756 metrics: Increase ranges range for qemu failing tests
We've also seen the qemu metrics tests are failing due to the results
being slightly outside the max range for network-iperf3 parallel and minimum for network-iperf3 jitter tests on PRs that have no code changes,
so we've increase the bounds to not see false negatives.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-11-29 10:52:16 +00:00
stevenhorsman
4011071526 metrics: Increase minval range for failing tests
We've seen a couple of instances recently where the metrics
tests are failing due to the results being below the minimum
value by ~2%.
For tests like latency I'm not sure why values being too low would
be an issue, but I've updated the minpercent range of the failing tests
to try and get them passing.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-11-29 10:50:02 +00:00
Hyounggyu Choi
de3452f8e1 gatekeeper: add run-k8s-tests-on-zvsi(devmapper) to required jobs
As the following CI job has been marked as required:

- kata-containers-ci-on-push / run-k8s-tests-on-zvsi / run-k8s-tests (devmapper, qemu, kubeadm)

we need to add it to the gatekeeper's required job list.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-11-28 12:46:47 +01:00
Fabiano Fidêncio
bdf10e651a
Merge pull request #10597 from kata-containers/topic/unbreak-ci-3rd-time-s-a-charm
Unbreak the CI, 3rd attempt
2024-11-28 12:36:09 +01:00
Fabiano Fidêncio
92b8091f62
Revert "ci: unbreak: Reallow no-op builds"
This reverts commit 559018554b.

As we've noticed that this is causing issues with initrd builds in the
CI.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-28 12:02:40 +01:00
Fabiano Fidêncio
ca2098f828
build: Allow dummy builds (for when adding a new target)
This will help us to simply allow a new dummy build whenever a new
component is added.

As long as the format `$(call DUMMY,$@)` is followed, we should be good
to go without taking the risk of breaking the CI.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-28 11:13:24 +01:00
Fabiano Fidêncio
f9930971a2
Merge pull request #10594 from sprt/sprt/unbreak-ci-noop-build
ci: unbreak: Reallow no-op builds
2024-11-28 07:38:25 +01:00
Aurélien Bombo
559018554b ci: unbreak: Reallow no-op builds
#9838 previously modified the static build so as not to repeatedly
copy the same assets on each matrix iteration:

https://github.com/kata-containers/kata-containers/pull/9838#issuecomment-2169299202

However, that implementation breaks specifiying no-op/WIP build targets
such as done in e43c59a. Such no-op builds have been a historical of the
project requirement because of a GHA limitation. The breakage is due to
no-op builds not generating a tar file corresponding to the asset:

https://github.com/kata-containers/kata-containers/actions/runs/12059743390/job/33628926474?pr=10592

To address this breakage, we revert to the `cp -r` implementation and
add the `--no-clobber` flag to still preserve the current behavior. Note
that `-r` will also create the destination directory if it doesn't
exist.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-11-27 18:40:29 -06:00
Fabiano Fidêncio
9699c7ed06
Merge pull request #10589 from kata-containers/sprt/fix-csi-publish
gha: Unbreak CI and work around workflow limit
2024-11-27 23:52:55 +01:00
Aurélien Bombo
eac197d3b7
Merge pull request #10564 from microsoft/danmihai1/clh-endpoint-type
runtime: clh: addNet() logging clean-up
2024-11-27 14:44:14 -06:00
Aurélien Bombo
7f659f3d63 gha: Unbreak CI and work around workflow limit
#10561 inadvertently broke the CI by going over the limit of
20 reusable workflows:

https://github.com/kata-containers/kata-containers/actions/runs/12054648658/workflow

This commit fixes that by inlining the job.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-11-27 12:23:15 -06:00
Aurélien Bombo
16a91fccbe
Merge pull request #10561 from sprt/csi-driver-ci
coco: ci: Lay groundwork for compiling and publishing CSI driver image [1/x]
2024-11-27 10:26:45 -06:00
Fabiano Fidêncio
175fe8bc66
Merge pull request #10585 from fidencio/topic/kata-deploy-use-drop-in-containerd-config-whenever-it-is-possible
kata-deploy: Use drop-in files whenever it's possible
2024-11-27 16:36:18 +01:00
Steve Horsman
6bb00d9a1d
Merge pull request #10583 from squarti/agent-startup-cdh-client
agent: fix startup when guest_components_procs is set to none
2024-11-27 11:43:07 +00:00
Fabiano Fidêncio
500508a592 kata-deploy: Use drop-in files whenever it's possible
This will make our lives considerably easier when it comes to cleaning
up content added, while it's also a groundwork needed for having
multiple installations running in parallel.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-27 12:27:08 +01:00
Steve Horsman
3240f8a4b8
Merge pull request #10586 from stevenhorsman/delete-rootfs-binary-assets-after-rootfs-build
workflows: Remove rootfs binary artifacts
2024-11-27 10:03:20 +00:00
Fabiano Fidêncio
c472fe1924
Merge pull request #10584 from fidencio/topic/kata-deploy-prepare-for-containerd-config-version-3
kata-deploy: Support containerd configuration version 3
2024-11-26 18:44:56 +01:00
stevenhorsman
3e5d360185 workflows: Remove rootfs binary artifacts
We need the publish certain artefacts for the rootfs,
like the agent, guest-components, pause bundle etc
as they are consumed in the `build-asset-rootfs` step.
However after this point they aren't needed and probably
shouldn't be included in the overall kata tarball, so delete
them once they aren't needed any more to avoid them
being included.

Fixes: #10575
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-11-26 15:24:20 +00:00
Fabiano Fidêncio
6f70ab9169 kata-deploy: Adapt how the containerd version is checked for k0s
Let's actually mount the whole /etc/k0s as /etc/containerd, so we can
easily access the containerd configuration file which has the version in
it, allowing us to parse it instead of just making a guess based on
kubernetes distro being used.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-26 16:15:11 +01:00
Silenio Quarti
1230bc77f2 agent: fix startup when guest_components_procs is set to none
This PR ensures that OCICRYPT_CONFIG_PATH file is initialized only
when CDH socket exists. This prevents startup error if attestation
binaries are not installed in PodVM.

Fixes: https://github.com/kata-containers/kata-containers/issues/10568

Signed-off-by: Silenio Quarti <silenio_quarti@ca.ibm.com>
2024-11-26 09:57:04 -05:00
Fabiano Fidêncio
f5a9aaa100 kata-deploy: Support containerd config version 3
On Ubuntu 24.04, with the distro default containerd, we're already
getting:
```
$ containerd config default | grep "version = "
version = 3
```

With that in mind, let's make sure that we're ready to support this from
the next release.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-26 14:01:50 +01:00
Fupan Li
28166c8a32
Merge pull request #10577 from Apokleos/fix-vfiodev-name
runtime-rs: fix vfio device name combination issue
2024-11-26 09:35:45 +08:00
Dan Mihai
d93900c128
Merge pull request #10543 from microsoft/danmihai1/regorus-warning
genpolicy: avoid regorus warning
2024-11-25 16:47:33 -08:00