Commit Graph

10205 Commits

Author SHA1 Message Date
Fabiano Fidêncio
d910a79a3f
Merge pull request #5823 from fidencio/topic/cached-components-fix-clh-tarball-name
CC | packaging: Fix the cloud hypervisor cached logic
2022-12-02 15:43:58 +01:00
Fabiano Fidêncio
2b72f8337c kata-deploy-binaries: Fix OVMF/TDVF component_version
We should use {} instead of () when passing the component version to the
install_cached_component() function.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-02 14:07:45 +01:00
Fabiano Fidêncio
f93e0c1541 packaging: Fix typos in cache_components.sh
asserts -> assets
stastic -> static

Those were not caught during the first merge of the series as we didn't
have CI jobs testing for the TEE artefacts.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-02 12:45:20 +01:00
Fabiano Fidêncio
08bea6c900 packaging: Fix checksum logic
Unless the checksum fails, we should *not* call cleanup_and_return.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-02 12:03:19 +01:00
Fabiano Fidêncio
7e8e54ce7d packaging: Drop the TDX cloud hypervisor target
We're currently building Cloud Hypervusor with thE TDX feature
regardless of using with TDX or not.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-02 10:24:05 +01:00
Fabiano Fidêncio
b9dc23033a packaging: Fix cloud-hypervisor version cache
The name of the asset was wrong, "cloud-hypervisor" instead of
"hypervisor.cloud_hypervsior", generating an empty "latest" file.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-02 10:23:16 +01:00
Fabiano Fidêncio
dab8e5673e packaging: Fix the cloud hypervisor tarball name
The final cloud hypervisor tarball name is either
kata-static-cc-cloud-hypervisor.tar.xz or
kata-static-cc-tdx-cloud-hypervisor.tar.xz, meaning it uses
"cloud-hypervisor" instead of "clh" in the name.

Fixes: #5816

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-02 09:23:08 +01:00
Fabiano Fidêncio
72d2f19c98
Merge pull request #5784 from fidencio/topic/cached-components
Re-work the way we cache components for the CCv0 branch
2022-12-01 23:19:59 +01:00
Fabiano Fidêncio
0eb2b1f58c kata-deploy-binaries: Check for cached version
Let's check for the cached version of the components as part of the
kata-deploy-binaries.sh as here we already have the needed info for
checking whether a component is cached or not, and to use it without
depending on changes made on each one of the builder scripts.

Fixes: #5816

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-01 13:37:57 +01:00
Fabiano Fidêncio
3c79af1ee1 cache_components: Cache the final tarball
Instead of caching files generated during the component build, let's
cache the final tarball generated for each component.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-01 01:12:34 +01:00
Fabiano Fidêncio
8a4e771144 packaging: Add functions to generate component's image name
Let's do this as the component name will be re-used later on, when we
start checking whether a cached component needs to be rebuilt or not.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-01 01:12:34 +01:00
Fabiano Fidêncio
02f6af9e1e packaging: Move repo_root_dir to lib.sh
This is used in several parts of the code, and can have a single
declaration as part of the `lib.sh` file, which is already imported by
all the places where it's used.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-11-30 23:03:13 +01:00
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
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
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
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
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
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
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
Fabiano Fidêncio
4f9ce2cde0
Merge pull request #5746 from fidencio/topic/CC-revendor-containerd-to-v1.6.8
CC | runtime: Revendor containerd to v1.6.8
2022-11-24 19:22:53 +01:00
Fabiano Fidêncio
47a0a796bf
Merge pull request #5671 from GabyCT/topic/fixqemucached
tools: Improve cached artifacts for qemu
2022-11-24 17:34:41 +01:00
Fabiano Fidêncio
92fa3329db runtime: Revendor containerd to v1.6.8
As we bumped containerd dependency to v1.6.8, let's also do the
re-vendor of its code on the runtime side.

Fixes: #5745

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-11-24 17:02:51 +01:00
stevenhorsman
bd7266ba66 agent: Add auth reg support
If the attestation-agent is used then enable image_client_auth
to enable the attempt to get registry credentials for the pull

Fixes: #5652

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2022-11-24 15:47:13 +00:00
Gabriela Cervantes
3e325f8da7 tools: Improve cached artifacts for qemu
This PR improves the cached artifacts for qemu components.

Fixes #5670

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-11-24 15:40:34 +01:00
Hyounggyu Choi
f24c47ea47 CC: Fix errors on building cc-builders on s390x
This is to fix errors on building cc-builders images on s390x.

Fixes: #5677

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2022-11-24 15:28:39 +01:00
Fabiano Fidêncio
4ba26bf86a
Merge pull request #5698 from GeorginaKin/CCv0
CCv0: Merge main into CCv0 branch
2022-11-24 14:55:05 +01:00
Chao Wu
cb199e0ecf kernel: add CONFIG_X86_SGX into whitelist
CONFIG_X86_SGX is introduced after kernel 5.11, and that config is a
default x86_64 config for Kata build-kernel.sh script.
But if we use -v to specify any kernel version below 5.11 will cause an
inevitable error because CONFIG_X86_SGX is not supported in older
kernels and that may cause problem for the situation if we need kernel
version below 5.11.

So I propose to put CONFIG_X86_SGX into whitelist.conf to avoid break
building guest kernel below 5.11.

fixes: #5741

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-11-24 20:43:58 +08:00
stevenhorsman
c23c93edb2 runtime: Go formatter
Add new line between copyright and package

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2022-11-24 09:56:31 +00:00
stevenhorsman
bd153436dc runtime: Update deprecate package
- Switch io/ioutil to os

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2022-11-24 09:32:38 +00:00
Chao Wu
9bde32daa1
Merge pull request #5707 from openanolis/ref
Refactor(runtime-rs): add conditional compile for virt-sandbox persist
2022-11-24 15:24:06 +08:00
Zhongtao Hu
b987bbc576 runtime-rs: block on the current thread when setup the network
As the increase of the I/O intensive tasks, two issues could be caused:

 1. When the future is blocked, the current thread (which is in the network namespace)
    might be take over by other tasks. After the future is finished, the thread take over
    the current task might not be in the pod network namespace
 2. When finish setting up the network, the current thread will be set back to the host namsapce.
    But the task which be taken over would still stay in the pod network namespace

 To avoid that, we need to block the future on the current thread.

Fixes:#5728
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-11-24 13:48:05 +08:00
Bin Liu
06a604b753
Merge pull request #5720 from YchauWang/wyc-docs-test-22
runtime: add log record to the qemu config method `appendDevices` for…
2022-11-24 13:15:06 +08:00
Peng Tao
b4d0a39f6d
Merge pull request #5723 from fidencio/topic/runtime-bump-containerd-to-v1.6.8
runtime: Use containerd v1.6.8
2022-11-24 11:28:58 +08:00
GabyCT
6d1b5d47fb
Merge pull request #5664 from GabyCT/topic/fixfirecrackerscript
tools: Fix indentation of build static firecracker script
2022-11-23 15:00:07 -06:00
stevenhorsman
c11f7733c8 version: Update version of containerd
Update version of containerd after
Fabiano's containerd bump PR:
https://github.com/confidential-containers/containerd/pull/6

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2022-11-23 14:26:30 +00:00
Fabiano Fidêncio
82aa876903
Merge pull request #5727 from liubin/feat/add-nydus-to-release
package: add nydus to release artifacts
2022-11-23 14:39:26 +01:00
Bin Liu
abb9ebeece package: add nydus to release artifacts
Install nydus related binaries under /opt/kata/libexec/

Fixes: #5726

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-11-23 15:17:58 +08:00
Fabiano Fidêncio
5cbf879659
Merge pull request #5693 from jongwu/test_ip_table
agent: check if command exist before do ip_tables test
2022-11-23 08:15:08 +01:00