Commit Graph

10258 Commits

Author SHA1 Message Date
Fabiano Fidêncio
9ac9f99c3a
Merge pull request #5846 from fidencio/topic/fix-install_cc_tee_kernel
kernel: Export KATA_BUILD_CC in install_cc_tee_kernel()
2022-12-06 16:37:50 +01:00
Fabiano Fidêncio
265347993d
Merge pull request #5826 from GeorginaKin/CCv0
CCv0: Merge main into CCv0 branch
2022-12-06 16:29:02 +01:00
Steve Horsman
ac3683e26e
Merge pull request #5783 from BbolroC/multi-arch-payload-ci
CC: Add cc-payload-ci workflow for s390x
2022-12-06 12:15:19 +00:00
Fabiano Fidêncio
32e91d9d8a kernel: Export KATA_BUILD_CC in install_cc_tee_kernel()
As already done for install_cc_kernel(), let's ensure we export
KATA_BUILD_CC=yes as part of the install_cc_tee_kernel.

This is used to generate the hash of the devices in the initramfs.

Fixes: #5845

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-06 11:47:46 +01:00
Fabiano Fidêncio
e271eba4e0 kernel: Only print build info when not using cached artefacts
Let's move the info about building initramfs to *after* trying to
install the cached components.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-06 11:47:41 +01:00
GabyCT
7830e94e8c
Merge pull request #5827 from GabyCT/topic/cachevirtofsdccc
CCv0: use virtiofsd cache
2022-12-05 09:31:31 -06:00
Hyounggyu Choi
69b037d53e CC: Add cc-payload-ci workflow for s390x
This is to adjust the existing cc-payload-ci workflow for s390x.

Fixes: #5660

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2022-12-05 14:23:23 +01:00
Fabiano Fidêncio
846c765c89
Merge pull request #5834 from mattarnoatibm/agent-target-dependencies
agent: Fix s390x agent build
2022-12-05 14:15:28 +01:00
Gabriela Cervantes
beceb3c844 CCv0: use virtiofsd cache
This PR allow us to use the virtiofsd cache tarball instead of
building it from source.

Fixes #5356

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-12-05 12:41:53 +01:00
Fabiano Fidêncio
bbdd3b35d3
Merge pull request #5828 from fidencio/topic/cached-components-add-support-for-caching-firmwares
CC | Add support for caching firmwares
2022-12-05 12:34:18 +01:00
Matthew Arnold
43c9b8fb5d agent: Fix s390x agent build
Exclude the image-rs cosign feature when the build target
is the s390x architecture.

Change Cargo to use workspace resolver 2 so that conditional
include for the image-rs crate is resolved correctly for different
targets.

Update cargo lock.

Fixes: #5582

Signed-off-by: Matthew Arnold <mattarno@uk.ibm.com>
2022-12-05 10:50:05 +00:00
Fabiano Fidêncio
3b6dd03b04 kata-deploy-binaruies: Use wget instead of curl for cached components
It seems that the Kata Containers jenkins may be very slow to reach from
behind the firewall, causing TDX machine to fail downloading some of the
cached artefacts.

With this in mind, let's switch to using wget for this specific case.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-05 10:24:22 +01:00
Fabiano Fidêncio
56d5d5932d kata-deploy-binaries: Avoid pushd / popd if not needed
Let's avoid getting into a dir and risking not being able to leave that
dir in case something fails.

Instead, let's just stay in the current dir and move the final tarball
to the exoected directory in case all the checks go as expected.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-05 10:24:22 +01:00
Fabiano Fidêncio
724108a817 kata-deploy-binaries: Fix getting TDVF version
It's under the externals sections, not under assets.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-05 10:24:22 +01:00
Fabiano Fidêncio
5f2eb63574 kata-deploy-binaryes: Adapt td-shim version for its cached version
With the cached version we're concatenating the td-shim version with the
toolchain version used to build the project.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-05 10:24:22 +01:00
Fabiano Fidêncio
316a4cfc8e cache_components: Add more document to the kernel / qemu options
Let's add a documentation about the environment variables that can be
used with the `-k` and `-q` options.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-05 10:24:19 +01:00
Fabiano Fidêncio
8d03bc7e4b cache_components: Remove unused qemu_script_dir
The `qemu_script_dir` is a leftover from before the rework on how we
cache the components.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-03 02:22:49 +01:00
Fabiano Fidêncio
fdd6826d40 cache_components: Add support for caching firmwares
As we're already doing for some components, let's also add support for
caching firmwares. TD-Shim and TDVF are the ones supported for now.

Fixes: #5360, #5361

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-03 02:22:39 +01:00
stevenhorsman
578ee62da2 CCv0: Merge main into CCv0 branch
Merge remote-tracking branch 'upstream/main' into CCv0

Fixes: #5824
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2022-12-02 16:15:39 +00:00
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
Bin Liu
8246de821f
Merge pull request #5809 from liubin/fix/cargo-deny-workflow-error
workflow: fix cargo-deny-runner.yaml syntax error
2022-12-02 12:19:44 +08:00
Bin Liu
514b7778a2
Merge pull request #5807 from liubin/fix/5806-add-shim-lanuage
runtime: Add identification in version for runtime-rs
2022-12-02 11:36:55 +08:00
Bin Liu
c1f5a93b66
Merge pull request #5814 from liubin/fix/5813-test-dragonball-error
workflow: call cargo in user's $PATH
2022-12-02 11:36:19 +08: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
Bin Liu
89574f03f8 workflow: call cargo in user's $PATH
Call cargo in root's HOME may lead to permission error, should
call cargo installed in user's HOME/PATH.

Fixes: #5813

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-12-01 15:37:16 +08:00
Bin Liu
d4321ab489 runtime: Add identification in version for runtime-rs
Now we are supporting two runtime/shim, the go version,
and the rust version, for debug purposes, we can
add an identification in the version info
to tell us which runtime/shim is used.

Fixes: #5806

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-12-01 15:14:08 +08:00
Bin Liu
7fabfb2cf0
Merge pull request #5756 from chentt10/remove-version-number-from-commit-message
runtime-rs: remove the version number from the commit display message
2022-12-01 13:11:47 +08:00
Bin Liu
f7fc436bed workflow: fix cargo-deny-runner.yaml syntax error
There is a syntax error in .github/workflows/cargo-deny-runner.yaml

Fixes: #5808

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-12-01 12:32:00 +08: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
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
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