Commit Graph

10377 Commits

Author SHA1 Message Date
Fabiano Fidêncio
58480aac34 packaging: Move calc_qemu_files_sha256sum() to lib.sh
We're going to use this function from different places, so we better
move it to lib.sh and avoid rewriting it.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-11-30 22:01:39 +01:00
Fabiano Fidêncio
5022a0d2c2 packaging: Don´t print sha256sum as part of sha256sum_from_files()
If you're directly using the output of this function, the info message
will show up as part of the string, and that's not what we want.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-11-30 22:00:44 +01:00
Fabiano Fidêncio
2c6b3d114c initramfs: get_from_kata_deps does't require a "kata_version" arg
It's been dropped for a long time now, as part of
a09e58fa80.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-11-30 22:00:02 +01:00
Fabiano Fidêncio
54e39dfcdf
Merge pull request #5733 from Jordan9500/workdir-ccv0-fix
CC | agent: Update the merge_oci_process function to change cwd
2022-11-30 18:19:58 +01:00
Fabiano Fidêncio
94d0c3c97d
Merge pull request #5767 from Megan-Wright/CCv0
CC: Merge main into CCv0 branch
2022-11-30 18:18:45 +01:00
Fabiano Fidêncio
e922c73f0c
Merge pull request #5680 from stevenhorsman/authenticated-registry
CC | agent: Add auth reg support to the agent
2022-11-30 11:17:17 +01:00
Fabiano Fidêncio
212325a9db
Merge pull request #5649 from ManaSugi/runk/refactor-start-using-agent-code
runk: Re-implement start operation using the agent codes
2022-11-29 20:45:16 +01:00
Fabiano Fidêncio
ac1b2d2a18
Merge pull request #5774 from UiPath/fix-go-panic
build: update golang version to 1.19.3
2022-11-29 13:17:53 +01:00
Fabiano Fidêncio
d8d9aae123
Merge pull request #5781 from jodh-intel/snap-fix-release
snap: Fix snapcraft setup (unbreak snap releases)
2022-11-29 13:11:34 +01:00
Manabu Sugimoto
78532154d9 docs: Add description for guest SELinux support
Add the description about how to enable SELinux for containers
running inside the guest.

Fixes: #4812

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-29 19:07:56 +09:00
Manabu Sugimoto
c617bbe70d runtime: Pass SELinux policy for containers to the agent
Pass SELinux policy for containers to the agent if `disable_guest_selinux`
is set to `false` in the runtime configuration. The `container_t` type
is applied to the container process inside the guest by default.
Users can also set a custom SELinux policy to the container process using
`guest_selinux_label` in the runtime configuration. This will be an
alternative configuration of Kubernetes' security context for SELinux
because users cannot specify the policy in Kata through Kubernetes's security
context. To apply SELinux policy to the container, the guest rootfs must
be CentOS that is created and built with `SELINUX=yes`.

Fixes: #4812

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-29 19:07:56 +09:00
Manabu Sugimoto
9354769286 agent: Add SELinux support for containers
The kata-agent supports SELinux for containers inside the guest
to comply with the OCI runtime specification.

Fixes: #4812

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-29 19:07:56 +09:00
Jordan Jackson
0264584935 agent: Update the merge_oci_process function to change cwd
Change the if statement to check if the CWD is set to /
Add unit tests for the correct merging of working directory
in the container and image process

Note: there is an outstanding question about one test case
Format code

Fixes: #5721

Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Signed-off-by: Jordan Jackson <jordan.jackson@ibm.com>
2022-11-29 09:20:22 +00:00
Bin Liu
588f81a23c
Merge pull request #5612 from openanolis/fix-iptables
fix(agent): fix iptables binary path in guest
2022-11-29 16:57:06 +08:00
Bin Liu
1da2d0603c
Merge pull request #5761 from gaohuatao-1/ght_overhead
runtime-rs: moving only vCPU threads into sandbox controller
2022-11-29 13:53:01 +08:00
Manabu Sugimoto
a75f99d20d osbuilder: Create guest image for SELinux
Create a guest image to support SELinux for containers inside the guest
if `SELINUX=yes` is specified. This works only if the guest rootfs is
CentOS and the init service is systemd, not the agent init. To enable
labeling the guest image on the host, selinuxfs must be mounted on the
host. The kata-agent will be labeled as `container_runtime_exec_t` type.

Fixes: #4812

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-29 13:32:26 +09:00
Manabu Sugimoto
a9c746f284 kernel: Add kernel configs for SELinux
Add kernel configs related to SELinux in order to add the
support for containers running inside the guest.

Fixes: #4812

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-29 13:32:26 +09:00
GabyCT
681d946644
Merge pull request #5748 from GabyCT/topic/removeextratabspacesdocker
tools: Remove extra tab spaces from kata deploy binaries script
2022-11-28 15:34:12 -06:00
Dov Murik
6a65803f75 runtime: pkg/sev: Support SEV-ES launch digest calculation
This includes contructing VMSA pages, parsing OVMF footer table to fetch
the AP reset EIP address, and allowing different vcpu types.

Fixes: #5471

Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
2022-11-28 18:08:50 +00:00
James O. D. Hunt
86cb058833 snap: Fix snapcraft setup (unbreak snap releases)
Setup the snapcraft environment manually as the action we had been using
for this does not appear to be actively maintained currently.

Related to this, switch to specifying the snapcraft store credentials
using the `SNAPCRAFT_STORE_CREDENTIALS` secret. This unbreaks
`snapcraft upload`, which Canonical appear to have broken by removing
the previous facility.

Fixes: #5772.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-11-28 15:51:47 +00:00
Alexandru Matei
f443b78537 build: update golang version to 1.19.3
This Go release fixes golang/go#56309

Fixes #5773
Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-11-28 17:03:29 +02:00
GabyCT
013752667b
Merge pull request #5776 from liubin/tmp/debug-static-check
ci: let static checks don't depend on build
2022-11-28 07:51:42 -06:00
Fabiano Fidêncio
db56d897ab
Merge pull request #5744 from Jordan9500/env-ccv0-fix
CC | agent: Update the merge_oci_process to properly manage the env variables
2022-11-28 14:13:30 +01:00
Fabiano Fidêncio
527e6c99e9
Merge pull request #5766 from liubin/fix/5763-use-composite-action-refactor-static-checks
actions: use matrix to refactor static checks
2022-11-28 14:12:27 +01:00
Bin Liu
6af037d379
Merge pull request #5154 from Yuan-Zhuo/main
agent: support systemd cgroup for kata agent.
2022-11-28 18:40:10 +08:00
Manabu Sugimoto
e12db92e4d runk: Re-implement start operation using the agent codes
This commit re-implements `start` operation by leveraging the agent codes.
Currently, `runk` has own `start` mechanism even if the agent already
has the feature to handle starting a container. This worsen the maintainability
and `runk` cannot keep up with the changes on the agent side easily.
Hence, `runk` replaces own implementations with agent's ones.

Fixes: #5648

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-28 19:11:21 +09:00
Fabiano Fidêncio
74531114c3
Merge pull request #5762 from liubin/fix/5759-skip-action-by-path
actions: skip some jobs using "paths-ignore" filter
2022-11-28 11:04:34 +01:00
Bin Liu
e723bad0af ci: let static checks don't depend on build
Build is a time consumable operation, skip build while let
ci run faster.

Fixes: #5777

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-11-28 15:26:04 +08:00
Bin Liu
a55eb78c32
Merge pull request #5752 from liubin/fix/5750-go-fix-1.19
runtime: go fix code for 1.19
2022-11-26 02:09:02 +08:00
Bin Liu
57c80ad65c
Merge pull request #5758 from chentt10/update-runtime-rs-build-and-install
doc: update runtime-rs "Build and Install"
2022-11-26 02:08:48 +08:00
Bin Liu
69aae02276 actions: use matrix to refactor static checks
Using matrix to reduce the duplication that of similar code.

Fixes: #5763

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-11-26 00:32:15 +08:00
Fabiano Fidêncio
32fa47e59e
Merge pull request #5771 from fidencio/topic/CC-export-kernel-version
CC | build: export kernel_version to be used with its build script
2022-11-25 15:51:55 +01:00
Fabiano Fidêncio
8baee93fca build: Fix kernel/build.sh identation
Simply replace space by tabs in one line that was off.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-11-25 13:50:24 +01:00
Fabiano Fidêncio
8a6533501f build: export kernel_version to be used with its build script
Now that we're caching the kernel, we're relying on the kernel version
being exported.  This is already done for the CC kernel, but not for the
TEE specific ones.

Fixes: #5770

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-11-25 13:50:17 +01:00
Fabiano Fidêncio
56f798eac2
Merge pull request #5618 from GabyCT/topic/cachekernel
CCv0: Use cached kernel
2022-11-25 13:08:53 +01:00
Fabiano Fidêncio
95f1872319
Merge pull request #5711 from BbolroC/cc-builders-s390x
CC: Fix errors on building cc-builders on s390x
2022-11-25 12:13:50 +01:00
Jianyong Wu
a5e4cad4b6 kata-ctl: add host check for aarch64
For now, we can check if host support running kata by check if "/dev/kvm"
exist on aarch64.

Fixes: #5768
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2022-11-25 18:55:32 +08:00
Jordan Jackson
5f2d81e490 agent: Update the merge_oci_process to properly manage the env variables
Loop through the images enviroment variables, checking if it exists
inside the target. If it does then do not append it.
Add unit tests for correctly merging the env variables of the pod yaml
and image itself in the container and image process
Format code

Fixes: #5730

Signed-off-by: Jordan Jackson <jordan.jackson@ibm.com>
2022-11-25 10:47:39 +00:00
Megan Wright
a71de1e5e9 runtime: Update vendor modules
Update containerd vendor modules after merge
Signed-off-by: Megan Wright <megan.wright@ibm.com>
2022-11-25 10:27:06 +00:00
Megan Wright
a8509821dd CCv0: Merge main into CCv0 branch
Merge remote-tracking branch 'upstream/main' into CCv0

Fixes: #5743
Signed-off-by: Megan Wright <megan.wright@ibm.com>
2022-11-25 09:55:44 +00:00
gaohuatao
2edbe389d8 runtime-rs: moving only vCPU threads into sandbox controller
when overhead controller exists, just contrain vCPU threads
in sandbox controller

Fixes:#5760

Signed-off-by: gaohuatao <gaohuatao@bytedance.com>
2022-11-25 17:53:21 +08:00
Peng Tao
e32c023d96
Merge pull request #5714 from UiPath/fix-mkdir
runtime: don't fail mkdir if the folder is already created by another process
2022-11-25 17:52:56 +08:00
Bin Liu
ae1001a9d1
Merge pull request #5742 from openanolis/chao/SGX_whitelist
kernel: add CONFIG_X86_SGX into whitelist
2022-11-25 17:36:26 +08:00
Bin Liu
340e24f175 actions: skip some job using "paths-ignore" filter
If only docs/images are changed, some jobs should not run.

Fixes: #5759

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-11-25 15:33:32 +08:00
Chen Taotao
2426ea9bdc doc: update runtime-rs "Build and Install"
When using source code to compile runtime-rs,make the
documentation point out the detailed environment build
and compilation methods to avoid errors caused by related
dependent packages.

Fixes:#5757

Signed-off-by: Chen Taotao <chentt10@chinatelecom.cn>
2022-11-25 13:13:00 +08:00
Chen Taotao
67fe703ff5 runtime-rs: remove the version number from the commit display message
The displayed commit message and version message are partially duplicated.
Remove the version number from the commit display message.

Fixes:#5735

Signed-off-by: Chen Taotao <chentt10@chinatelecom.cn>
2022-11-25 13:00:01 +08:00
Ji-Xinyou
1d93a93468 fix(agent): fix iptables binary path in guest
Some rootfs put iptables-save and iptables-restore
under /usr/sbin instead of /sbin. This pr checks both
and returns the one exist.

Fixes: #5608
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-11-25 11:57:34 +08:00
Bin Liu
1dfd845f51 runtime: go fix code for 1.19
We have starting to use golang 1.19, some features are
not supported later, so run `go fix` to fix them.

Fixes: #5750

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-11-25 11:29:18 +08:00
Zhongtao Hu
f02bb1a9cb
Merge pull request #5729 from openanolis/netnsref
runtime-rs: block on the current thread when setup the network to avoid be take over by other task
2022-11-25 08:09:10 +08:00
Fabiano Fidêncio
f72fe061eb tools: Pass kernel version to build script
This PR passes the kernel version to the build script.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-11-24 22:22:51 +00:00