Commit Graph

14219 Commits

Author SHA1 Message Date
Hyounggyu Choi
e135d536c5 gha: Restore cleanup-zvsi for s390x
In #10096, a cleanup step for kata-deploy is removed by mistake.
This leads to a cleanup error in the following `Complete job` step.

This commit restores the removed step to resolve the current CI failure on s390x.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-31 06:42:16 +02:00
Hyounggyu Choi
c8a160d14a
Merge pull request #10096 from BbolroC/remove-pre-post-action-s390x
gha: Eradicate {pre,post}-action steps for s390x runners
2024-07-30 22:30:05 +02:00
Hyounggyu Choi
8d529b960a gha: Eradicate {pre,post}-action steps for s390x runners
As suggested in #9934, the following hooks have been introduced for s390x runners:

- ACTIONS_RUNNER_HOOK_JOB_STARTED
- ACTIONS_RUNNER_HOOK_JOB_COMPLETED

These hooks will perfectly replace the existing {pre,post}-action scripts.
This commit wipes out all GHA steps for s390x where the actions are triggered.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-07-30 17:10:19 +02:00
Wainer Moschetta
528745fc88
Merge pull request #10052 from nubificus/feat_fix_qemu_after_8070
runtime-rs: Fix QEMU backend for runtime-rs
2024-07-30 11:00:14 -03:00
Fupan Li
de22b3c4bf
Merge pull request #10024 from lifupan/main
runtime-rs: enable dragonball hypervisor support initrd
2024-07-30 16:00:42 +08:00
Fupan Li
e3f0d2a751 runtime-rs: enable dragonball hypervisor support initrd
enable the dragonball support initrd.

Fixes: #10023

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-07-30 14:50:24 +08:00
Fupan Li
4fbf9d67a5
Merge pull request #10043 from lifupan/fix_sandbox
runtime-rs : fix the issue of stop sandbox
2024-07-29 09:22:26 +08:00
Fabiano Fidêncio
949ffd146a
Merge pull request #10083 from microsoft/danmihai1/policy-tests
tests: k8s: minor policy tests clean-up
2024-07-28 11:04:24 +02:00
Dan Mihai
3e348e9768 tests: k8s: rename hard-coded policy test script
Rename k8s-exec-rejected.bats to k8s-policy-hard-coded.bats, getting
ready to test additional hard-coded policies using the same script.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-26 20:14:05 +00:00
Dan Mihai
7b691455c2 tests: k8s: hard-coded policy for any platform
Users of AUTO_GENERATE_POLICY=yes:

- Already tested *auto-generated* policy on any platform.
- Will be able to test *hard-coded* policy too on any platform, after
  this change.

CI continues to test hard-coded policies just on the platforms listed
here, but testing those policies locally (outside of CI) on other
platforms can be useful too.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-26 19:30:03 +00:00
Dan Mihai
83056457d6 tests: k8s-policy-pod: avoid word splitting
Avoid potential word splitting when using array of command args array.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-26 18:55:52 +00:00
Dan Mihai
5546ce4031
Merge pull request #10069 from microsoft/danmihai1/exec-args
genpolicy: validate each exec command line arg
2024-07-26 11:39:44 -07:00
Fabiano Fidêncio
b0b04bd2f3
Merge pull request #10078 from fidencio/topic/increase-rootfs-confidential-slash-run-to-50-percent
tee: osbuilder: Set /run to use 50% of the image with systemd
2024-07-26 18:37:41 +02:00
Anastassios Nanos
d11657a581 runtime-rs: Remove unused env vars from build
Since we can't find a homogeneous value for the resource/cgroup
management of multiple hypervisors, and we have decoupled the
env vars in the Makefile, we don't need the generic ones.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
2024-07-26 14:03:50 +00:00
Anastassios Nanos
3f58ea9258 runtime-rs: Decouple Makefile env VARS
To avoid overriding env vars when multiple hypervisors are
available, we add per-hypervisor vars for static resource
management and cgroups handling. We reflect that in the
relevant config files as well.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
2024-07-26 14:02:35 +00:00
Fabiano Fidêncio
5f146e10a1
osbuilder: Add logs for setting up systemd based stuff
This helps us to debug any kind of changes.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-07-26 14:22:45 +02:00
Alex Carter
4a8fb475be
tee: osbuilder: Set /run to use 50% of the image with systemd
Let's ensure at least 50% of the memory is used for /run, as systemd by
default forces it to be 10%, which is way too small even for very small
workloads.

This is only done for the rootfs-confidential image.

Fixes: kata-containers#6775
Signed-off-by: Alex Carter <Alex.Carter@ibm.com>
Signed-off-by: Wang, Arron <arron.wang@intel.com>
Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.co
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-07-26 14:22:38 +02:00
Chengyu Zhu
2a9ed19512
Merge pull request #9988 from huoqifeng/annotation
initdata: add initdata annotation in hypervisor config
2024-07-26 19:59:45 +08:00
Fupan Li
c51ba73199 container: fix the issue of send signal to process
It's better to check the container's status before
try to send signal to it. Since there's no need
to send signal to it when the container's stopped.

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-07-26 19:23:43 +08:00
Fupan Li
e156516bde sandbox: fix the issue of stop sandbox
Since stop sandbox would be called in multi path,
thus it's better to set and check the sandbox's state.

Fixes: #10042

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-07-26 19:23:34 +08:00
Qi Feng Huo
a113fc93c8 initdata: fix unit test code for initdata annotation
Added ut code for initdata annotation

Signed-off-by: Qi Feng Huo <huoqif@cn.ibm.com>
2024-07-26 18:24:05 +08:00
Qi Feng Huo
8d61029676 initdata: add unit test code for initdata annotation
Added ut code for initdata annotation

Signed-off-by: Qi Feng Huo <huoqif@cn.ibm.com>
2024-07-26 14:20:57 +08:00
Qi Feng Huo
b80057dfb5 initdata: Merge branch 'main' into annotation
- Merge branch 'main' into feature branch annotation
2024-07-26 14:01:04 +08:00
Archana Shinde
d7637f93f9
Merge pull request #9899 from amshinde/multiple-networks-fix
Fix issue while adding multiple networks with nerdctl
2024-07-25 11:56:27 -07:00
Dan Mihai
a37f10fc87 genpolicy: validate each exec command line arg
Generate policy that validates each exec command line argument, instead
of joining those args and validating the resulting string. Joining the
args ignored the fact that some of the args might include space
characters.

The older format from genpolicy-settings.json was similar to:

    "ExecProcessRequest": {
      "commands": [
                "sh -c cat /proc/self/status"
        ],
      "regex": []
    },

That format will not be supported anymore. genpolicy will detect if its
users are trying to use the older "commands" field and will exit with
a relevant error message in that case.

The new settings format is:

    "ExecProcessRequest": {
      "allowed_commands": [
        [
          "sh",
          "-c",
          "cat /proc/self/status"
        ]
      ],
      "regex": []
    },

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-25 16:57:17 +00:00
Dan Mihai
0f11384ede tests: k8s-policy-pod: exec_command clean-up
Use "${exec_command[@]}" for calling both:
- add_exec_to_policy_settings
- kubectl exec

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-25 16:55:03 +00:00
Dan Mihai
95b78ecaa9 tests: k8s-exec: reuse sh_command variable
Reuse sh_command variable instead of repeading "sh".

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-25 16:50:34 +00:00
Alex Lyn
abb0a2659a
Merge pull request #9944 from Apokleos/align-ocispec-rs
Align kata oci spec with oci-spec-rs
2024-07-25 19:36:52 +08:00
Alex Lyn
bb2b60dcfc oci: Delete the kata oci spec
It's time to delete the kata oci spec implemented just
for kata. As we have already done align OCI Spec with
oci-spec-rs.

Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 17:47:01 +08:00
Alex Lyn
b56313472b agent: Align agent OCI spec with oci-spec-rs
Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 17:47:01 +08:00
Alex Lyn
882385858d runtime-rs: Align oci spec in runtime-rs with oci-spec-rs
This commit aligns the OCI Spec implementation in runtime-rs
with the OCI Spec definitions and related operations provided
by oci-spec-rs. Key changes as below:
(1) Leveraged oci-spec-rs to align Kata Runtime OCI Spec with
the official OCI Spec.
(2) Introduced runtime-spec to separate OCI Spec definitions
from Kata-specific State data structures.
(3) Preserved the original code logic and implementation as
much as possible.
(4) Made minor code adjustments to adhere to Rust programming
conventions;

Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 17:47:01 +08:00
Alex Lyn
bf813f85f2 runk: Align oci spec with oci-spec-rs
Utilized oci-spec-rs to align OCI Spec structures
and data representations in runk with the OCI Spec.

Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 17:47:01 +08:00
Alex Lyn
b3eab5ffea genpolicy: Align agent-ctl OCI Spec with oci-spec-rs
Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 17:47:01 +08:00
Alex Lyn
c500fd5761 agent-ctl: Align agent-ctl OCI Spec with oci-spec-rs
This commit aligns the OCI Spec used within agent-ctl
with the oci-spec-rs definition and operations. This
enhancement ensures that agent-ctl adheres to the latest
OCI standards and provides a more consistent and reliable
experience for managing container images and configurations.

Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 17:47:01 +08:00
Alex Lyn
faffee8909 libs: update Cargo config and lock file
update Cargo.toml and Cargo.lock for adding runtime-spec

Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 17:47:01 +08:00
Alex Lyn
8b5499204d protocols: Reimplement OCI Spec to TTRPC Data Translation
This commit transitions the data implementation for OCI Spec
from kata-oci-spec to oci-spec-rs. While both libraries adhere
to the OCI Spec standard, significant implementation details
differ. To ensure data exchange through TTRPC services, this
commit reimplements necessary data conversion logic.
This conversion bridges the gap between oci-spec-rs data and
TTRPC data formats, guaranteeing consistent and reliable data
transfer across the system.

Fixes #9766

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 17:46:07 +08:00
Anastassios Nanos
cda00ed176 runtime-rs: Add FC specific KERNELPARAMS
To avoid overriding KERNELPARAMS for other hypervisors, add
FC-specific KERNELPARAMS.

Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
2024-07-25 08:53:57 +00:00
Alex Lyn
4e003a2125
Merge pull request #10058 from Apokleos/enhance-vsock-connect
runtime-rs: enhance debug info for agent connect.
2024-07-25 11:29:04 +08:00
Alex Lyn
36385a114d runtime-rs: enhance debug info for agent connect.
we need more friendly logs for debugging agent conntion
cases when kata pods fail.

Fixes #10057

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 08:51:57 +08:00
Dan Mihai
c3adeda3cc
Merge pull request #10051 from microsoft/danmihai1/exec-variable-reuse
tests: k8s: reuse policy exec variable
2024-07-24 14:58:40 -07:00
Aurélien Bombo
f08b594733
Merge pull request #9576 from microsoft/saulparedes/support_env_from
genpolicy: Add support for envFrom
2024-07-24 13:39:54 -07:00
GabyCT
79edf2ca7d
Merge pull request #10054 from GabyCT/topic/docnydus
docs: Update url links in kata nydus document
2024-07-24 14:08:44 -06:00
Archana Shinde
64d6293bb0 tests:Add nerdctl test for testing with multiple netwokrs
Add integration test that creates two bridge networks with nerdctl and
verifies that Kata container is brought up while passing the networks
created.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-07-24 10:45:56 -07:00
Archana Shinde
49fbae4fb1 agent: Wait for interface in update_interface
For nerdctl and docker runtimes, network is hot-plugged instead of
cold-plugged. While this change was made in the runtime,
we did not have the agent waiting for the device to be ready.
On some systems, the device hotplug could take some time causing
the update_interface rpc call to fail as the interface is not available.

Add a watcher for the network interface based on the pci-path of the
network interface. Note, waiting on the device based on name is really
not reliable especially in case multiple networks are hotplugged.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-07-24 10:45:56 -07:00
Dan Mihai
fecb70b85e tests: k8s: reuse policy exec variable
Share a single test script variable for both:
- Allowing a command to be executed using Policy settings.
- Executing that command using "kubectl exec".

Fixes: #10014

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-07-24 17:42:04 +00:00
Fabiano Fidêncio
162a6b44f6
Merge pull request #10063 from ChengyuZhu6/fix-ci-timeout
gha: Increase timeout to run CoCo tests
2024-07-24 15:14:35 +02:00
Pavel Mores
dd1e09bd9d runtime-rs: add experimental support for memory hotunplugging to qemu-rs
Hotunplugging memory is not guaranteed or even likely to work.
Nevertheless I'd really like to have this code in for tests and
observation.  It shouldn't hurt, from experience so far.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-07-24 13:22:41 +02:00
Pavel Mores
3095b65ac3 runtime-rs: support hotplugging memory in QemuInner
The bulk of this implementation are simple though tedious sanity checks,
alignment computations and logging.

Note that before any hotplugging, we query qemu directly for the current
size of hotplugged memory.  This ensures that any request to resize memory
will be properly compared to the actual already available amount and only
necessary amount will be added.

Note also that we borrow checked_next_multiple_of() from CH implementation.
While this might look uncleanly it's just a rather temporary solution since
an equivalent function will apparently be part of std soon, likely the
upcoming 1.75.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-07-24 13:22:41 +02:00
Pavel Mores
4a1c828bf8 runtime-rs: support hotplugging memory in Qmp
The algorithm is rather simple - we query qemu for existing memory devices
to figure out the index of the one we're about to add.  Then we add a
backend object and a corresponding frontend device.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-07-24 13:22:41 +02:00
Pavel Mores
0e0b146b87 runtime-rs: support storage & retrieval of guest memblock size in qemu-rs
This will be used for ensuring that hotplugged memory block sizes are
properly aligned.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-07-24 13:22:41 +02:00