Commit Graph

10294 Commits

Author SHA1 Message Date
Steve Horsman
e217628eb5
Merge pull request #5581 from dubek/sev-es-launch-digest
CCv0: runtime: pkg/sev: Support SEV-ES launch digest calculation
2022-12-16 11:38:45 +00:00
Steve Horsman
c6f1a1e42a
Merge pull request #5897 from BbolroC/runtime-payload-multiarch
CC: Enable multi-arch build for runtime-payload image
2022-12-15 10:01:25 +00:00
Fabiano Fidêncio
813f8b7e93
Merge pull request #5896 from fidencio/topic/CC-use-pre-built-containerd
versions: Use prebuilt containerd artefacts
2022-12-14 17:19:26 +01:00
Hyounggyu Choi
843b5afb3d CC: Enable multi-arch build for runtime-payload image
This is to enable quay.io/confidential-containers/runtime-payload for
s390x on top of amd64.

Fixes: #5894

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2022-12-14 11:38:27 +01:00
Fabiano Fidêncio
94ea07e42b versions: Use prebuilt containerd artefacts
In order to avoid building the containerd binaries on every single run
of our CI, let's simply rely on the fact that now we're releasing the
"same" artefacts containerd normally releases from our own fork.

See:
https://github.com/confidential-containers/containerd/releases/tag/v1.6.8.1

Fixes: #5895

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-14 10:11:48 +01:00
Fabiano Fidêncio
c2d1ea770a
Merge pull request #5835 from fidencio/topic/CC-cache-rootfs
CC | Cache and use rootfs whenever it's possible
2022-12-13 20:50:48 +01:00
Fabiano Fidêncio
aef3e5184b kata-deploy-binaries: Use cached shim-v2 when possible
As done for different components, let's also use a cached version of the
shim-v2 whenever it's possible.

Fixes: #5838

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 20:07:32 +01:00
Fabiano Fidêncio
5d6ca191ce
Merge pull request #5886 from fidencio/topic/CC-fix-pushing-the-shim-v2-build-image-to-quay
actions: Fix pushing the shim-v2 build image to quay.io
2022-12-12 19:32:33 +01:00
Gabriela Cervantes
de69f9c832 cache_components: Add the ability to cache the shim-v2
In order to cache the shim-v2 we're considering the the cached component
can be used if:
* There were no changes in the runtime directory
* There were no changes in the golang version used
* There were no changes in the rust version used
  * We don't build the rust agent, but better be prepared for the future
* There were no changes in the following files that are provided by the
  rootfs builds:
  * root_hash_vanilla.txt
  * root_hash_tdx.txt

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 19:12:26 +01:00
Fabiano Fidêncio
d9dd1ac9ec kata-deploy-binaries: Use cached rootfs when possible
As done for different components, let's also use a cached version of
the rootfs whenever it's possible.

Fixes: #5433

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 18:03:01 +01:00
Fabiano Fidêncio
60f0fc996e actions: Fix pushing the shim-v2 build image to quay.io
e1f075dc60 reworked the action so the
shim-v2 was split out of the matrix build.  With that done I ended up
not realising I'd need to log into the quay.io as one step of the
build-asset-cc-shim-v2 job.

Fixes: #5885

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 17:58:46 +01:00
Fabiano Fidêncio
4d835f6089 cache_components: Add the ability to cache the rootfs
This is the most complex part to cache, as the cached component can be
only used if:
* There were no changes in the agent
* There were no changes in the libs (used by the agent)
* There were no changes in the rootfs build scripts
* There is no change in the version of the following components:
  * attestation-agent (part of the rootfs)
  * gperf (used to build libseccomp)
  * libseccomp (used to build the agent)
  * pause image (part of the rootfs)
  * skopeo (part of the rootfs)
  * umoci (part of the rootfs)
  * rust (used to build the kata-containers and attestation agents)

We're relying on the last commit merged on places related to the rootfs
generation  and using that as the rootfs version and that should be good
enough for what we need.

Apart from everything already mentioned, we've also added the ability to
cache the `root_hash_vanilla.txt` and `root_hash_tdx.txt` files, as
those are needed for when building the shim-v2, in order to have
measured boot working there.

It's important to note that we've added the ability to cache *both*
files, and I've taken that path as the shim-v2 cache work (which will
come soon) relies on both files.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 16:07:45 +01:00
Fabiano Fidêncio
d3e0190786
Merge pull request #5876 from fidencio/topic/CC-rework-build-dependencies-so-measured-rootfs-can-be-used
Rework how we build the payload so measured boot can be used with the Operator
2022-12-12 16:03:45 +01:00
Fabiano Fidêncio
aa351bc989 kata-deploy-binaries: Print extra_opts when building shim-v2
This will help us, in the future, to debug any possible issue related to
the measured rootfs arguments passed to the shim during the build time.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 13:54:56 +01:00
Fabiano Fidêncio
e1f075dc60 actions: Consider root_hash_*.txt for the CC actions
The ability to do a measured boot has been overlooked when releasing the
payload consumed by the Confidential Containers project, and this
happened as we depend, at the shim-v2 build time, of a `root_hash_*.txt`
generated in the `tools/osbuilder/` directory, which is then used to add
a specific parameter to the `kernel_params` in the Kata Containers
configuration files.

With everything said above, the best way we can ensure this is done is
by saving those files during the rootfs build, download them during the
shim-v2 build (which *must* happen only after the rootfs builds happen),
and correctly use them there.

Fixes: #5847

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 13:54:56 +01:00
Fabiano Fidêncio
788f1e6d61 config: Adjust TDXKERNELPARAMS for different VMMs
As Cloud Hypervisor and QEMU are using different rootfs images (the
former with `offline_fs_kbc` as aa_kbc, and the latter with `eaa_kbc`),
we need to differentiate the kernel parameters passed to each one of
those, as the `root_hash.txt` file used for measured boot will differ
according to the rootfs used.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 13:54:56 +01:00
Fabiano Fidêncio
24c7066425 config: Drop $(ROOTMEASURECONFIG) from SEV kernel param
This is not used at all, as SEV relies on an initrd instead of relying
on an image.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 13:54:56 +01:00
Fabiano Fidêncio
0a1de98179 build_image: config: Allow passing a specific root_hash_suffix
By doing this we can ensure that when building different rootfs-images
we won't end up overring the `root_hash.txt` file.

Plus, this will help us later in this series to pass the correct
argument to be used with the respective image.

Nothing's been done for SEV as it uses a initrd instead of an image.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-12 13:54:52 +01:00
Fabiano Fidêncio
2d48300bf8 build_image: Don't add root_hash.txt to the final tarball
Adding the `root_hash.txt` to the final tarball doesn't bring any
benefit to the project, as the file dependency is for building the
shim-v2 and passing the correct measurement for the kernel command line.

It's important to mention that when building shim-v2, it doesn't look
for the file in `/opt/confidential-containers/share/kata-containers`,
bur rather in the `${repo_root_dir}/tools/osbuilder/`, as shown here:
ac3683e26e/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh (L228-L232)

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-09 21:01:54 +01:00
Fabiano Fidêncio
de4f1231c0
Merge pull request #5852 from BbolroC/payload-390x-fix
CC: Fix issues on cc-payload-ci workflow for s390x
2022-12-09 20:26:08 +01:00
Fabiano Fidêncio
bd753b5834
Merge pull request #5863 from fidencio/topic/CC-rework-tdx-config-files
CC | Rework TDX runtime configuration files
2022-12-09 16:52:21 +01:00
Fabiano Fidêncio
a75e83ab41 config: Drop clh-tdx-eaa-kbc configuration file
It turns out that there's more work needed to be done on the Cloud
Hypervisor side so we can fully support EAA_KBC with it.

For now, let's remove the configuration as the tests are not currently
passing when using it, and stick to the `offline_fs_kbc` and its
specific image for the Cloud Hypervisor + TDX case.

Fixes: #5862

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-08 13:29:15 +01:00
Fabiano Fidêncio
788c327cac config: Set qemu-tdx as the one with eaa_kbc support
The `qemu-tdx` configuration is tied to using `offline_fs_kbc` as the
aa_kbc, which is something we're moving away from.

With this in mind, let's rename the `qemu-tdx-eaa-kbc` to `qemu-tdx` and
decrease the amount of the way too many configurations that we ship.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-12-08 13:09:21 +01:00
Fabiano Fidêncio
7257470fdc
Merge pull request #5855 from Megan-Wright/CCv0
CC: Merge main into CCv0 branch
2022-12-08 12:10:57 +01:00
Megan Wright
7c1b3f0b61 CCv0: Merge main into CCv0 branch
Merge remote-tracking branch 'upstream/main' into CCv0

Fixes: #5854
Signed-off-by: Megan Wright <megan.wright@ibm.com>
2022-12-07 11:15:50 +00:00
Chelsea Mafrica
1ff4185111
Merge pull request #5842 from cyyzero/update_install_guide
docs: Update the rust version in the installation documentation
2022-12-06 23:40:35 -08:00
Hyounggyu Choi
6e6842c815 CC: Fix issues on cc-payload-ci workflow for s390x
This is to differentiate an artifact name between amd64 and s390x and add a
virtiofsd target for s390x.

Fixes: #5851

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2022-12-06 21:59:53 +01:00
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
Chao Wu
326d589ff5
Merge pull request #5822 from liubin/fix/5820-var-name-and-typo
runtime-rs: fix some variable names and typos
2022-12-06 14:24:11 +08:00
Zhongtao Hu
c12bb5008d
Merge pull request #5769 from jongwu/check_host_arm
kata-ctl: add host check for aarch64
2022-12-06 14:05:52 +08:00
Chen Yiyang
46b38458af
docs: Update the rust version in the installation documentation
Rust version in the installation documentation does not match the
requirements. Just fix it.

Fixes: #5841

Signed-off-by: Chen Yiyang <cyyzero@qq.com>
2022-12-06 12:50:32 +08:00
Chao Wu
538bddf4ee
Merge pull request #5811 from tzY15368/fix-katactl-conflict-dependency
kata-ctl: fix dependency version conflict
2022-12-06 10:44:48 +08: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