Commit Graph

1575 Commits

Author SHA1 Message Date
Aurélien Bombo
c47bff6d6a
Merge pull request #11637 from kata-containers/sprt/remove-install-az-cli
gha: Remove unnecessary install-azure-cli step
2025-08-01 09:34:46 -05:00
Aurélien Bombo
96f1d95de5 gha: Remove unnecessary install-azure-cli step
az cli is already installed by the azure/login action.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-07-30 10:42:56 -05:00
Zvonko Kaiser
8768e08258 gpu: Add embeding service
For a simple RAG pipeline add a embeding service

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-07-30 13:45:59 +00:00
Zvonko Kaiser
254dbd9b45 gpu: Add Pod spec for NIM llama
Pod spec for the NIM inferencing service

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-07-30 13:45:59 +00:00
Zvonko Kaiser
568b13400a gpu: Add NIM bats test
We're running a simple NIM container to test if the GPUs
are working properly

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-07-30 13:45:59 +00:00
Zvonko Kaiser
6188b7f79f gpu: Add run_kubernetes_nv_tests.sh
Replicate what we have for run_tests and run .bats files

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-07-30 13:45:59 +00:00
Zvonko Kaiser
9a829107ba gpu: Add selector for k8s tests
We want to reuse the current run_tests with GPUs, introduce a var
that will define what to run.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-07-30 13:45:59 +00:00
Dan Mihai
30bfa2dfcc genpolicy: use CoCo settings by default
- "confidential_emptyDir" becomes "emptyDir" in the settings file.
- "confidential_configMap" becomes "configMap" in settings.
- "mount_source_cpath" becomes "cpath".
- The new "root_path" gets used instead of the old "cpath" to point to
  the container root path..
- "confidential_guest" is no longer used. By default it gets replaced
  by "enable_configmap_secret_storages"=false, because CoCo is using
  CopyFileRequest instead of the Storage data structures for ConfigMap
  and/or Secret volume mounts during CreateContainerRequest.
- The value of "guest_pull" becomes true by default.
- "image_layer_verification" is no longer used - just CoCo's guest pull
  is supported.
- The Request input files from unit tests are changing to reflect the
  new default settings values described above.
- tests/integration/kubernetes/tests_common.sh adjusts the settings for
  platforms that are not set-up for CoCo during CI (i.e., platforms
  other than SNP, TDX, and CoCo Dev).

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-07-28 18:30:13 +00:00
Steve Horsman
74fba9c736
Merge pull request #11619 from kata-containers/install-dependencies-gh-cli
ci: Try passing api token into githubh api call
2025-07-28 13:35:12 +01:00
Xuewei Niu
6aa3517393 tests: Prevent the shim from being killed in k8s-oom test
The actual memory usage on the host is equal to the hypervisor memory usage
plus the user memory usage. An OOM killer might kill the shim when the
memory limit on host is same with that of container and the container
consumes all available memory. In this case, the containerd will never
receive OOM event, but get "task exit" event. That makes the `k8s-oom.bats`
test fail.

The fix is to add a new container to increase the sandbox memory limit.
When the container "oom-test" is killed by OOM killer, there is still
available memory for the shim, so it will not be killed.

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2025-07-24 23:44:21 +08:00
stevenhorsman
475baf95ad ci: Try passing api token into githubh api call
Our CI keeps on getting
```
jq: error (at <stdin>:1): Cannot index string with string "tag_name"
```
during the install dependencies phase, which I suspect
might be due to github rate limits being reduced, so try
to pass through the `GH_TOKEN` env and use it in the auth header.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-07-24 08:49:32 +01:00
Fabiano Fidêncio
497a3620c2 tests: Remove references to qemu-sev
As it's been removed from our codebase.

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-07-18 12:49:54 +02:00
Wainer dos Santos Moschetta
f0f1974e14 tests/k8s: call teardown_common in k8s-parallel.bats
The teardown_common will print the description of the running pods, kill
them all and print the system's syslogs afterwards.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-07-12 10:13:51 +01:00
Wainer dos Santos Moschetta
8dfeed77cd tests/k8s: add handler for Job in set_node()
Set the node in the spec template of a Job manifest, allowing to use
set_node() on tests like k8s-parallel.bats

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-07-12 10:13:51 +01:00
Wainer dos Santos Moschetta
806d63d1d8 tests/k8s: call teardown_common in k8s-credentials-secrets.bats
The teardown_common will print the description of the running pods, kill
them all and print the system's syslogs afterwards.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-07-12 10:13:51 +01:00
Wainer dos Santos Moschetta
c8f40fe12c tests/k8s: call teardown_common in k8s-sandbox-vcpus-allocation.bats
The teardown_common will print the description of the running pods, kill
them all and print the system's syslogs afterwards.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-07-12 10:13:51 +01:00
Fabiano Fidêncio
5f17e61d11 tests: kata-deploy: Remove --wait from helm uninstall
As we're using a `kubectl wait --timeout ...` to check whether the
kata-deploy pod's been deleted or not, let's remove the `--wait` from
the `helm uninstall ...` call as k0s tests were failing because the
`kubectl wait --timeout...` was starting after the pod was deleted,
making the test fail.

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-07-09 14:01:30 +02:00
Fabiano Fidêncio
842e17b756 tests: k0s: Always use latest version, apart from CRI-O tests
We've been pinning a specific version of k0s for CRI-O tests, which may
make sense for CRI-O, but doesn't make sense at all when it comes to
testing that we can install kata-deploy on latest k0s (and currently our
test for that is broken).

Let's bump to the latest, and from this point we start debugging,
instead of debugging on an ancient version of the project.

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-07-09 13:27:18 +02:00
Steve Horsman
967f66f677
Merge pull request #11380 from arvindskumar99/sev-deprecation
Sev deprecation
2025-07-09 11:38:13 +01:00
Wainer dos Santos Moschetta
e4da3b84a3 workflows: adopting azure/setup-kubectl
There are workflows that rely on `az aks install-cli` to get kubectl
installed. There is a well-known problem on install-cli, related with
API usage rate limit, that has recently caused the command to fail
quite often.

This is replacing install-cli with the azure/setup-kubectl github
action which has no such as rate limit problem.

While here, removed the install_cli() function from gha-run-k8s-common.sh
so avoid developers using it by mistake in the future.

Fixes #11463
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-07-08 15:15:54 -03:00
Arvind Kumar
8eebcef8fb tests: Removing testing framework for SEV
Removing files pertaining to SEV from
the CI framework.

Co-authored-by: Adithya Krishnan Kannan <AdithyaKrishnan.Kannan@amd.com>
Signed-off-by: Arvind Kumar <arvinkum@amd.com>
2025-07-07 11:17:32 -05:00
Archana Choudhary
abbe1be69f tests: enable confidential_guest setting for coco
This commit updates the `tests_common.sh` script
to enable the `confidential_guest`
setting for the coco tests in the Kubernetes
integration tests.

Signed-off-by: Archana Choudhary <archana1@microsoft.com>
2025-07-01 10:35:20 +00:00
Steve Horsman
9ff30c6aeb
Merge pull request #11462 from kata-containers/add-scorecard-action
ci: Add scorecard action
2025-06-25 12:48:11 +01:00
Dan Mihai
2d43b3f9fc
Merge pull request #11424 from katexochen/p/regorus-oras-cache
ci/static-checks: use oras cache for regorus
2025-06-24 14:49:00 -07:00
Paul Meyer
43739cefdf ci/static-checks: use oras cache for regorus
Instead of building it every time, we can store the regorus
binary in OCI registry using oras and download it from there.
This reduces the install time from ~1m40s to ~15s.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-06-24 13:14:18 +02:00
Dan Mihai
62c9845623 tests: k8s-policy-rc: print pod descriptions
Don't use local launched_pods variable in test_rc_policy(), because
teardown() needs to use this variable to print a description of the
pods, for debugging purposes.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-06-23 16:23:26 +00:00
stevenhorsman
649e31340b doc: Add scorecard badge
Add our scorecard badge to our readme for transparency
and to help motivate us to update our score

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-06-23 16:22:59 +01:00
Archana Choudhary
e093919b42 tests: update container image for ci and unit test
This patch updates the container image for the CI test workloads:
- `k8s-layered-sc-deployment.yaml`
- `k8s-pod-sc-deployment.yaml`
- `k8s-pod-sc-nobodyupdate-deployment.yaml`
- `k8s-pod-sc-supplementalgroups-deployment.yaml`
- `k8s-policy-deployment.yaml`

Also updates unit tests:
- `test_create_container_security_context`
- `test_create_container_security_context_supplemental_groups`

This fixes tests failing due to an image pull error as the previous image is no longer available in
the container registry.

Signed-off-by: Archana Choudhary <archana1@microsoft.com>
Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2025-06-20 10:46:56 -07:00
Mitch Zhu
292c27130d ci: Add optional govulncheck security scanning to static checks
This adds govulncheck vulnerability scanning as a non-blocking check in
the static checks workflow. The check scans Go runtime binaries for known
vulnerabilities while filtering out verified false positives.

Signed-off-by: Mitch Zhu <mitchzhu@microsoft.com>
2025-06-17 20:43:00 -07:00
Seunguk Shin
4f9b7e4d4f ci: Enable cri-containerd-tests for arm64
This change enables cri-containerd-test for arm64.

Signed-off-by: Seunguk Shin <seunguk.shin@arm.com>
Reviewed-by: Nick Connolly <nick.connolly@arm.com>
2025-06-16 15:12:17 +01:00
Xynnn007
0b3a8c0355 initdata: delete coco_as token section in initdata
The new version of AA allows the config not having a coco_as token
config. If not provided, it will mark as None.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
2025-06-16 13:54:15 +08:00
Xynnn007
93826ff90c tests: update negative test log assertions
After moving image pulling from kata-agent to CDH, the failed image pull
error messages have been slightly changed. This commit is to apply for
the change.

Note that in original and current image-rs implementation, both no key
or wrong key will result in a same error information.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
2025-06-16 13:54:15 +08:00
Fabiano Fidêncio
6f0ea595b7
Merge pull request #11402 from microsoft/danmihai1/disable-nvdimm
runtime: build variable for disable_image_nvdimm=true
2025-06-13 16:35:57 +02:00
Paul Meyer
64906e6973 tests/static-checks: parse rego with opa and regorus
Ensure rego policies in tree can be parsed using opa and regorus.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-06-12 14:59:39 +02:00
Paul Meyer
107e7dfdf6 ci/static-checks: install regorus
Make regorus available for static checks as prerequisite for rego checks.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-06-12 14:59:39 +02:00
Paul Meyer
71796f7b12 ci/static-checks: install opa
Make open-policy-agent available for static checks as prerequisite for rego checks.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-06-12 10:46:43 +02:00
Dan Mihai
d37feac679 tests: test mariner with disable_image_nvdimm=true
Run the k8s tests on mariner with annotation disable_image_nvdimm=true,
to use virtio-blk instead of nvdimm for the guest rootfs block device.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-06-10 02:03:31 +00:00
Aurélien Bombo
9dd3807467 ci: Use OIDC to log into Azure
This completely eliminates the Azure secret from the repo, following the below
guidance:

https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-azure

The federated identity is scoped to the `ci` environment, meaning:

 * I had to specify this environment in some YAMLs. I don't believe there's any
   downside to this.
 * As previously, the CI works seamlessly both from PRs and in the manual
   workflow.

I also deleted the tools/packaging/kata-deploy/action folder as it doesn't seem
to be used anymore, and it contains a reference to the secret.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-06-06 15:26:10 -05:00
Xynnn007
8750eadff2 test: turn SNP on for initdata tests
After the last commit, the initdata test on SNP should be ok. Thus we
turn on this flag for CI.

Fixes #11300

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
2025-06-02 20:33:19 +08:00
RuoqingHe
a9ffdfc2ae
Merge pull request #11294 from wainersm/delint_confidential_kbs
tests/k8s: delint confidential_kbs.sh
2025-05-23 17:00:28 +02:00
Wainer dos Santos Moschetta
ddf333feaf tests/k8s: fix shellcheck SC1091 in confidential_kbs.sh
Fixed "note: Not following: ./../../../tools/packaging/guest-image/lib_se.sh:
openBinaryFile: does not exist (No such file or directory) [SC1091]"

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-22 15:38:27 -03:00
Wainer dos Santos Moschetta
c9fb0b9c85 tests/k8s: fix shellcheck SC2154 in confidential_kbs.sh
Fixed "warning: HKD_PATH is referenced but not assigned. [SC2154]"

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-22 15:02:20 -03:00
Wainer dos Santos Moschetta
68d91d759a tests/k8s: add set -e to confidential_ksh.sh
Although the script will inherit that setting from the caller scripts,
expliciting it in the file will vanish shellcheck "warning: Use 'pushd
... || exit' or 'pushd ... || return' in case pushd fails. [SC2164]"

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-22 14:55:24 -03:00
Wainer dos Santos Moschetta
b4adfcb3cb tests/k8s: apply shellcheck tips to confidential_kbs.sh
Addressed the following shellcheck advices:

SC2046 (warning): Quote this to prevent word splitting.
SC2248 (style): Prefer double quoting even when variables don't contain special characters
SC2250 (style): Prefer putting braces around variable references even when not strictly required.
SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-22 14:52:38 -03:00
Steve Horsman
9356ed59d5
Merge pull request #11130 from wainersm/tests-better-report
tests/k8s: better tests reporting for CI
2025-05-21 17:21:35 +01:00
Wainer dos Santos Moschetta
fdcf11d090 tests/k8s: increase wait time of KBS service ingress
kbs_k8s_svc_host() returns the ingress IP when the KBS service is
exposed via an ingress. In Azure AKS the ingress can time a while to be
fully ready and recently we have noticed on CI that kbs_k8s_svc_host()
has returned empty value. Maybe the problem is on current timeout being
too low, so let's increase it to 50 seconds to see if the situation
improves.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-20 15:20:08 -03:00
Wainer dos Santos Moschetta
8c4637d629 tests/k8s: print tests report
Added 'report-tests' command to gha-run.sh to print to stdout a report
of the tests executed.

For example:
```
SUMMARY (2025-02-17-14:43:53):
 Pass:  0
 Fail:  1

STATUSES:
 not_ok foo.bats

OUTPUTS:
::group::foo.bats
1..3
not ok 1 test 1
not ok 2 test 2
ok 3 test 3
1..2
not ok 1 test 1
not ok 2 test 2
::endgroup::
```

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-20 14:43:38 -03:00
Wainer dos Santos Moschetta
5e3b8a019a tests/k8s: split and save bats outputs in files
Currently run_kubernetes_tests.sh sends all the bats outputs to stdout
which can be very difficult to browse to find a problem, mainly on
CI. With this change, each bats execution have its output sent to
'reports/yyy-mm-dd-hh:mm:ss/<status>-<bats file>.log' where <status>
is either 'ok' (tests passed) or 'not_ok' (some tests failed).

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-20 14:43:38 -03:00
Steve Horsman
f8c5aa6df6
Merge pull request #11259 from fitzthum/bump-gc-0140
Update Trustee and Guest Components for CoCo v0.14.0
2025-05-20 18:05:17 +01:00
Dan Mihai
b9651eadab
Merge pull request #11214 from microsoft/cameronbaird/address-gid-mismatch-additionalgids
genpolicy: Enable AdditionalGids checks in rules.rego
2025-05-16 10:15:53 -07:00