Commit Graph

14271 Commits

Author SHA1 Message Date
Zhiwei Huang
7270a7ba48 tools: Fix container image build warning
All commands within the Dockerfile should use the same casing
(either upper or lower).[1]

[1]: https://docs.docker.com/reference/build-checks/consistent-instruction-casing/

Signed-off-by: Zhiwei Huang <ai.william@outlook.com>
2024-08-07 15:49:01 +08:00
Dan Mihai
2da77c6979
Merge pull request #10068 from burgerdev/genpolicy-test
genpolicy: add crate-scoped integration test
2024-08-06 16:10:46 -07:00
GabyCT
fb166956ab
Merge pull request #10132 from fidencio/topic/support-image-pull-with-nerdctl
runtime: image-pull: Make it work with nerdctl
2024-08-06 15:33:40 -06:00
Fabiano Fidêncio
63802ecdd9
Merge pull request #9880 from zvonkok/helm-chart
kata-deploy: Add Helm Chart
2024-08-06 22:55:31 +02:00
Fabiano Fidêncio
f33f2d09f7 runtime: image-pull: Make it work with nerdctl
Our code for handling images being pulled inside the guest relies on a
containerType ("sandbox" or "container") being set as part of the
container annotations, which is done by the CRI Engine being used, and
depending on the used CRI Engine we check for a specfic annotation
related to the image-name, which is then passed to the agent.

However, when running kata-containers without kubernetes, specifically
when using `nerdctl`, none of those annotations are set at all.

One thing that we can do to allow folks to use `nerdctl`, however, is to
take advantage of the `--label` flag, and document on our side that
users must pass `io.kubernetes.cri.image-name=$image_name` as part of
the label.

By doing this, and changing our "fallback" so we can always look for
such annotation, we ensure that nerdctl will work when using the nydus
snapshotter, with kata-containers, to perform image pulling inside the
pod sandbox / guest.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-06 17:07:45 +02:00
Zvonko Kaiser
8d9bec2e01
ci: add reset_runtime to cleanup
Adding reset_cleanup to cleanup action so that it is done automatically
without the need to run yet another DS just to reset the runtime.

This is now part of the lifecycle hook when issuing kata-deploy.sh
cleanup

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-08-06 11:57:04 +02:00
Zvonko Kaiser
1221ab73f9
ci: make cleanup_kata_deploy really simple
Remove the unneeded logic for cleanup the values are
encapsulated in the deployed helm release

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-08-06 11:57:04 +02:00
Zvonko Kaiser
51690bc157
ci: Use helm to deploy kata-deploy
Rather then modifying the kata-depoy scripts let's use Helm and
create a values.yaml that can be used to render the final templates

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-08-06 11:57:04 +02:00
Zvonko Kaiser
94b3348d3c
kata-deploy: Add Helm Chart
For easier handling of kata-deploy we can leverage a Helm chart to get
rid of all the base and overlays for the various components

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-08-06 11:57:04 +02:00
Markus Rudy
69535e5458 genpolicy: add crate-scoped integration test
Provides a test runner that generates a policy and validates it
with canned requests. The initial set of test cases is mostly for
illustration and will be expanded incrementally.

In order to enable both cross-compilation on Ubuntu test runners as well
as native compilation on the Alpine tools builder, it is easiest to
switch to the vendored openssl-src variant. This builds OpenSSL from
source, which depends on Perl at build time.

Adding the test to the Makefile makes it execute in CI, on a variety of
architectures. Building on ppc64le requires a newer version of the
libz-ng-sys crate.

Fixes: #10061

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2024-08-05 11:52:01 +02:00
Markus Rudy
4d1416529d genpolicy: fix clippy v1.78.0 warnings
cargo clippy has two new warnings that need addressing:
- assigning_clones
  These were fixed by clippy itself.
- suspicious_open_options
  I added truncate(false) because we're opening the file for reading.

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2024-08-05 11:48:30 +02:00
Fabiano Fidêncio
43dca8deb4
Merge pull request #10121 from microsoft/saulparedes/add_version_flag
genpolicy: add --version flag
2024-08-03 21:22:10 +02:00
Fabiano Fidêncio
3b2173c87a
Merge pull request #10124 from fidencio/topic/ci-enable-encrypted-image-tests-for-tees
ci: Enable encrypted image tests for TEEs
2024-08-03 11:39:51 +02:00
Fabiano Fidêncio
89f1581e54
ci: Enable encrypted image tests for TEEs
After experimenting a little bit with those tests, they seem to be
passing on all the available TEE machines.

With this in mind, let's just enable them for those machines.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-03 09:27:32 +02:00
Fabiano Fidêncio
3b896cf3ef
Merge pull request #10125 from fidencio/topic/un-break-ci
ci: Remove jobs that are not running
2024-08-03 09:27:04 +02:00
Fabiano Fidêncio
62a086937e
ci: Remove jobs that are not running
When re-enabling those we'll need a smart way to do so, as this limit of
20 workflows referenced is just ... weird.

However, for now, it's more important to add the jobs related to the new
platforms than keep the ones that are actively disabled.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-03 09:24:05 +02:00
GabyCT
76af5a444b
Merge pull request #10075 from microsoft/saulparedes/hooks
genpolicy: reject create custom hook settings
2024-08-02 15:36:34 -06:00
GabyCT
aadde2c25b
Merge pull request #10120 from kata-containers/fix_metrics_json_results_file
Fix metrics json results file
2024-08-02 11:29:02 -06:00
Fabiano Fidêncio
b93a0642e0
Merge pull request #10123 from fidencio/topic/re-enable-arm-ci
ci: re-enable arm CI
2024-08-02 17:48:35 +02:00
Dan Mihai
2628b34435
Merge pull request #10098 from microsoft/danmihai1/allow-failing
agent: fix the AllowRequestsFailingPolicy functionality
2024-08-02 08:42:47 -07:00
GabyCT
8da5f7a72f
Merge pull request #10102 from ChengyuZhu6/fix-debug
tests: Fix error with `kubectl debug`
2024-08-02 09:25:13 -06:00
Fabiano Fidêncio
551e0a6287
Merge pull request #10116 from GabyCT/topic/kbsdependencies
tests: kbs: Add missing dependencies to install kbs cli
2024-08-02 14:22:28 +02:00
Fabiano Fidêncio
ed57ef0297
ci; aarch64: Enable builders as part of the CI
As we have new runners added, let's enable the builders so we can
prevent build failures happening after something gets merged.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-02 14:13:53 +02:00
Fabiano Fidêncio
388b5b0e58
Revert "ci: Temporarily remove arm64 builds"
This reverts commit e9710332e7, as there
are now 2 arm64-builders (to be expanded to 4 really soon).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-02 13:53:50 +02:00
Fabiano Fidêncio
08be9c3601
Revert "ci: Temporarily remove arm64 builds -- part II"
This reverts commit c5dad991ce, as there
are now 2 arm64-builders (to be expanded to 4 really soon).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-02 13:52:53 +02:00
Fabiano Fidêncio
4183680bc3
Merge pull request #10107 from fidencio/topic/rotate-journal-logs-every-run
tests: k8s: Rotate & cleanup journal for every run
2024-08-02 07:27:10 +02:00
Fabiano Fidêncio
302e02aed8
Merge pull request #10114 from fidencio/topic/kata-manager-configure-qemu-and-ovmf-for-tdx
kata-manager: Ensure distro specific TDX config is set
2024-08-02 07:24:57 +02:00
Saul Paredes
194cc7ca81 genpolicy: add --version flag
- Add --version flag to the genpolicy tool that prints the current
version
- Add version.rs.in template to store the version information
- Update makefile to autogenerate version.rs from version.rs.in
- Add license to Cargo.toml

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-08-01 17:18:17 -07:00
David Esparza
dcd0c0b269
metrics: Remove duplicated headers from results file.
This PR removes duplicated entries (vcpus count, and available memory),
from onednn and openvino results files.

Fixes: #10119

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-08-01 18:11:06 -06:00
Dan Mihai
9e99329bef genpolicy: reject create sandbox hooks
Reject CreateSandboxRequest hooks, because these hooks may be used by an
attacker.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-08-01 16:58:35 -07:00
ChengyuZhu6
2eac8fa452 tests: Fix error with kubectl debug
The issue is similar to #10011.

The root cause is that tty and stderr are set to true at same time in
containerd: #10031.

Fixes: #10081

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-02 07:32:30 +08:00
David Esparza
1e640ec3a6
metrics: fix pargins json results file.
This PR encloses the search string for 'default_vcpus ='
and 'default_memory =' with double quotes in order to
parse the precise values, which are included in the kata
configuration file.

Fixes: #10118

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-08-01 17:05:03 -06:00
Dan Mihai
c2a55552b2 agent: fix the AllowRequestsFailingPolicy functionality
1. Use the new value of AllowRequestsFailingPolicy after setting up a
   new Policy. Before this change, the only way to enable
   AllowRequestsFailingPolicy was to change the default Policy file,
   built into the Guest rootfs image.

2. Ignore errors returned by regorus while evaluating Policy rules, if
   AllowRequestsFailingPolicy was enabled. For example, trying to
   evaluate the UpdateInterfaceRequest rules using a policy that didn't
   define any UpdateInterfaceRequest rules results in a "not found"
   error from regorus. Allow AllowRequestsFailingPolicy := true to
   bypass that error.

3. Add simple CI test for AllowRequestsFailingPolicy.

These changes are restoring functionality that was broken recently by
commmit df23eb09a6.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-08-01 22:37:18 +00:00
Fabiano Fidêncio
66b0305eed
Merge pull request #10117 from fidencio/topic/temporarily-remove-arm-nightly-jobs-part-2
ci: Temporarily remove arm64 builds -- part II
2024-08-01 23:06:46 +02:00
GabyCT
20a88b6470
Merge pull request #10099 from GabyCT/topic/fixmemo
metrics: Update memory tests to use grep -F
2024-08-01 13:48:36 -06:00
Fabiano Fidêncio
aef7da7bc9 tests: k8s: Rotate & cleanup journal for every run
This will help to avoid huge logs, and allow us to debug issues in a
better way.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-01 21:36:57 +02:00
Fabiano Fidêncio
c5dad991ce
ci: Temporarily remove arm64 builds -- part II
Let's remove what we commented out, as publish manifest complains:
```
Created manifest list quay.io/kata-containers/kata-deploy-ci:kata-containers-latest
./tools/packaging/release/release.sh: line 146: --amend: command not found
```

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-01 20:43:28 +02:00
Fabiano Fidêncio
5ec11afc21
Merge pull request #10111 from fidencio/topic/temporarily-remove-arm-nightly-jobs
ci: Temporarily remove arm64 builds
2024-08-01 19:50:07 +02:00
Gabriela Cervantes
7454908690 metrics: Update memory tests to use grep -F
This PR updates the memory tests like fast footprint to use grep -F
instead of fgrep as this command has been deprecated.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-08-01 17:20:57 +00:00
Gabriela Cervantes
d72cb8ccfc tests: kbs: Add missing dependencies to install kbs cli
This PR adds missing packages depenencies to install kbs cli in a fresh
new baremetal environment. This will avoid to have a failure when trying
to run install-kbs-client.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-08-01 17:09:50 +00:00
Fabiano Fidêncio
bfd014871a kata-manager: Ensure distro specific TDX config is set
We've done something quite similar for kata-deploy, but I've noticed we
forgot about the kata-manager counterpart.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-01 17:27:01 +02:00
Fabiano Fidêncio
e9710332e7 ci: Temporarily remove arm64 builds
It's been a reasonable time that we're not able to even build arm64
artefacts.

For now I am removing the builds as it doesn't make sense to keep
running failing builds, and those can be re-enabled once we have arm64
machines plugged in that can be used for building the stuff, and
maintainers for those machines.

The `arm-jetson-xavier-nx-01` is also being removed from the runners.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-01 13:30:47 +02:00
Fabiano Fidêncio
c784fb6508
Merge pull request #10110 from ChengyuZhu6/bump-trustee
version: bump trustee version
2024-08-01 07:34:38 +02:00
ChengyuZhu6
d35320472c version: bump trustee version
Bump trustee to the latest version to fix error
with pulling busybox from dockerhub.

Fixes: #10109

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-01 08:59:58 +08:00
Fupan Li
230aefc0da
Merge pull request #10070 from BbolroC/qemu-runtime-rs-k8s-s390x
GHA: Run k8s e2e tests for qemu-runtime-rs on s390x
2024-07-31 18:41:11 +08:00
Chengyu Zhu
8e9f140ee0
Merge pull request #10080 from ChengyuZhu6/fix-coco-ci
tests: add image check before running coco tests
2024-07-31 17:08:00 +08:00
Peng Tao
11e10647f9
Merge pull request #10104 from BbolroC/fix-zvsi-cleanup-s390x
gha: Restore cleanup-zvsi for s390x
2024-07-31 16:23:26 +08:00
Chengyu Zhu
fc0f635098
Merge pull request #10101 from AdithyaKrishnan/main
ci: Fix rate limit error by migrating busybox_image
2024-07-31 14:48:12 +08:00
ChengyuZhu6
2cfb32ac4d version: bump nydus snapshotter to v0.13.14
bump nydus snapshotter to v0.13.14 to stabilize CIs.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-07-31 14:47:33 +08:00
ChengyuZhu6
41b7577f08 tests: add image check before running coco tests
Currently, there are some issues with pulling images in CI, such as :
https://github.com/kata-containers/kata-containers/actions/runs/10109747602/job/27959198585

This issue is caused by switching between different snapshotters for the same image in some scenarios.
To resolve it, we can check existing images to ensure all content is available locally before running tests.

Fixes: #10029

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-07-31 14:47:33 +08:00