Commit Graph

9066 Commits

Author SHA1 Message Date
Fabiano Fidêncio
097fe823e5 packaging: Show the new options of kata-deploy-binaries.sh
We've added a bunch of new options related to Confidential Containers
builds as part of the kata-deploy-binaries.sh.  Let's make sure those
are displayed to the users of the script when it's called with --help.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 21:10:25 +02:00
Fabiano Fidêncio
07bdf75913 packaging: Add a cc option for kata-deploy-binaries.sh
Similar to what we have with the `all` option, let's also add a `cc`
one, allowing others to easily call the script and build all the `cc`
related components.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 21:10:25 +02:00
Fabiano Fidêncio
1ba29c3e0c packaging: Add a cc-tarball target to build cc related tarballs
Quite similar to the `kata-tarball` target, let's add a `cc-tarball`
target so we can build all the CC related tarballs in a single command,
with all the tarballs being merged together in the end.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 21:10:25 +02:00
Fabiano Fidêncio
226abc4a47 packaging: Add a cc-parallel target to build cc related tarballs
Quite similar to the `all-parallel` target, let's add a `cc-parallel`
target so we can build all the CC related tarballs in parallel.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 21:10:25 +02:00
Fabiano Fidêncio
dc5f0c7d0c packaging: Add a cc target to build all the CC related tarballs
Quite similar to the `all` target, let's add a `cc` target so we can
build all the CC related tarballs.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 21:10:25 +02:00
Fabiano Fidêncio
186cec6889 packaging: Allow building virtiofsd for CC
We're adding a new target for building virtiofsd for CC, but it's
important to note that the only difference between this one and the
"vanilla" build is the installation path.

Moreover, virtiofsd will **NOT** be used by the CC effort, but as the
very first release target doesn't include TEE support, let's not force
those who want to give it a try to setup devicemapper.

Fixes: #4569

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 21:10:14 +02:00
Fabiano Fidêncio
b307531c29 packaging: Allow building QEMU for CC
We're adding a new target for building QEMU for CC, but it's important
to note that the only difference between this one and the "vanilla"
build is the installation path.

The reason we're taking this approach is because the first release
target for CC doesn't include TEE support.

We had to also include a new builder for QEMU, a specific one for CC, as
for now that's the easiest way to override the prefix in a way that
we'll be easily able to expand the script to support TEE capable builds
in the very near future.

Fixes: #4568

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 21:10:08 +02:00
Fabiano Fidêncio
c4cc16efcd packaging: Allow building the Kernel for CC
We're adding a new target for building the Kernel for CC, but it's
important to note that the only difference between this one and the
"vanilla" build is the installation path.

The reason we're taking this approach is because the first release
target for CC doesn't include TEE support.

Fixes: #4567

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 21:09:55 +02:00
Fabiano Fidêncio
caabd54b6e packaging: Allow building Cloud Hypervisor for CC
We're adding a new target for building Cloud Hypervisor for CC, but it's
important to note that the only difference between this one and the
"vanilla" build is the installation path.

The reasons we're taking this approach are:
* Cloud Hypervisor, for the `main` and `stable` branches, is already
  built with TDX support.
* The first target for the CC release doesn't include TEE support.

Fixes: #4566

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 21:09:35 +02:00
Fabiano Fidêncio
8f6eca517a
Merge pull request #4565 from fidencio/topic/cc-build-the-shim-with-the-needed-configurations
CC | Build the shim-v2 with the needed configurations for Confidential Containers usage
2022-06-30 20:42:43 +02:00
Fabiano Fidêncio
df486533fa packaging: Allow building a CC shim-v2 capable runtime
Let's add a new build target for our local-build scripts, cc-shim-v2,
and use it to build Kata Containers properly configured for the CC
use-case.

Fixes: #4564
Depends-on: github.com/kata-containers/tests#4895

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 13:21:21 +02:00
Fabiano Fidêncio
7ceeeba9a2 static-build: Allow removing shipped shim-v2 configs
Let's add a new "REMOVE_VMM_CONFIGS" environment variable that can be
passsed to the script responsible for building Kata Containers.

Right now this is not useful for the `main` or `stable` branch, but for
the CC release we only have been working and testing with QEMU and Cloud
Hypervisor.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 13:06:43 +02:00
Fabiano Fidêncio
d4d178359b runtime: Expose DEFSERVICEOFFLOAD build option
For the CC build we need to enable such a flag, and the cleaner way to
do so is exposing it in the Makefile and, later on, making sure its
correct value to the build script.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 12:21:10 +02:00
Fabiano Fidêncio
e23322b95c packaging: Allow passing EXTRA_OPTS to the shim-v2 build
While this has never been needed for the `main` and `stable` releases,
for the coming CC release we need to pass a few extra options when
building the shim.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-30 12:16:44 +02:00
GabyCT
3a655c4198
Merge pull request #4558 from fidencio/topic/cc-build-rootfs-image-with-the-needed-tools
CC | Build the rootfs image with skopeo, umoci, and using an offline_fs_kbc
2022-06-29 17:05:55 -05:00
GabyCT
995c14d429
Merge pull request #4552 from fidencio/topic/cc-always-use-ubuntu-as-rootfs
CC | versions: Always use ubuntu as rootfs for CC
2022-06-29 17:04:11 -05:00
Fabiano Fidêncio
a438d6114b packaging: Allow building a CC capable image
Let's add a new build target for our local-build scripts,
cc-rootfs-image-tarball, and use it to build an image that has skopeo
and umoci embedded in, and that using the offline_fs_kbc as the
attenstation agent KBC.

Fixes: #4557

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-29 21:09:33 +02:00
Fabiano Fidêncio
335ddd5876 packaging: Do not unset env vars needed for CC
SKOPEO, UMOCI, and AA_KBC have been unset so far as we have not been
generating rootfs images that would be used for CC as part of our
workflow.

Now, as we're targetting the first release of the operator with the CCv0
branch, let's stop unsetting those and start taking advantage of our
tools to help us building a CC capable image.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-29 19:05:11 +02:00
Georgina Kinge
6c2b9f67d7
Merge pull request #4556 from GeorginaKin/CCv0
CCv0: Merge main into CCv0 branch
2022-06-29 15:59:56 +01:00
Georgina Kinge
eb9836ff8e runtime: add image import back in
Putting image import back in after removal during merge conflict

Fixes: #4555
Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
2022-06-29 14:13:18 +01:00
Georgina Kinge
bda68b16f1 CCv0: Merge main into CCv0 branch
Merge remote-tracking branch 'upstream/main' into CCv0

Fixes: #4555
Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
2022-06-29 13:22:22 +01:00
Fabiano Fidêncio
03170c2651 versions: Always use ubuntu as rootfs for CC
As we're still depending on components that are only being tested on
Ubuntu, let's make sure the VM image distributed is exactly the same
we've been testing.

Fixes: #4551

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-29 11:25:23 +02:00
Fabiano Fidêncio
38b61bb743
Merge pull request #4537 from GeorginaKin/CCv0
CCv0: Refactor ccv0.sh to remove duplicate code
2022-06-29 08:17:35 +02:00
Fabiano Fidêncio
ad055235a5
Merge pull request #4547 from GabyCT/topic/removeunuseddocker
packaging: Remove unused kata docker configure script
2022-06-28 20:09:15 +02:00
GabyCT
b2c0387993
Merge pull request #4130 from surajssd/add-cgroup-driver-info
kata-with-k8s: Add cgroupDriver for containerd
2022-06-28 10:30:18 -05:00
Gabriela Cervantes
1a78c3df2e packaging: Remove unused kata docker configure script
This PR removes an unused kata configure docker script which was used
in packaging for kata 1.x but not longer being used in kata 2.x

Fixes #4546

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-06-28 15:10:39 +00:00
Georgina Kinge
74a748f36e CCv0: Refactor ccv0.sh to remove duplicate code
Refactored ccv0.sh to remove rootfs code now in lib.sh

Fixes: #4512

Co-authored-by: Megan Wright Megan.Wright@ibm.com
Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
2022-06-28 14:09:23 +01:00
Tim Zhang
916ffb75d7
Merge pull request #4432 from liubin/fix/4420-binary-log
shim: support shim v2 logging plugin
2022-06-28 16:29:07 +08:00
Bin Liu
4e30e11b31 shim: support shim v2 logging plugin
Now kata shim only supports stdout/stderr of fifo from
containerd/CRI-O, but shim v2 supports logging plugins,
and nerdctl default will use the binary schema for logs.

This commit will add the others type of log plugins:

- file
- binary

In case of binary, kata shim will receive a stdout/stderr like:

binary:///nerdctl?_NERDCTL_INTERNAL_LOGGING=/var/lib/nerdctl/1935db59

That means the nerdctl process will handle the logs(stdout/stderr)

Fixes: #4420

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-06-28 13:54:22 +08:00
Steve Horsman
c6a5814a91
Merge pull request #4490 from Megan-Wright/CCv0-containerd-1.6.6-rebase
CCv0: Update CC containerd version
2022-06-27 15:59:09 +01:00
stevenhorsman
761786324e CCv0: Increase timeout
Increase crictl timout to stop pod creation failing on v1.24.1

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2022-06-27 10:19:05 +01:00
Megan Wright
d6924182f3 vendor: Update CC containerd version
Re-vendor to pickup confidential-containers containerd 1.6.6 rebase
Fixes: #4489

Signed-off-by: Megan Wright <megan.wright@ibm.com>
2022-06-27 10:19:05 +01:00
Megan Wright
94a6edcfa3 versions: Update containerd version
Update kata-containers version to reflect 1.6.6 rebase of
containerd
Fixes: #4489

Signed-off-by: Megan Wright <megan.wright@ibm.com>
2022-06-27 10:14:32 +01:00
Fabiano Fidêncio
e52d6b1d0b
Merge pull request #4529 from GeorginaKin/CCv0
CCv0: Refactor ccv0.sh to use bats test
2022-06-27 09:39:27 +02:00
Bin Liu
27b1bb5ed9
Merge pull request #4467 from egernst/device-pkg
device package cleanup/refactor
2022-06-27 14:40:53 +08:00
Fabiano Fidêncio
54f47cceaa
Merge pull request #4518 from fidencio/topic/pin-a-specific-version-of-image-rs
CCv0 | agent: Pin a specific version of image-rs
2022-06-27 07:51:44 +02:00
Eric Ernst
e32bf53318 device: deduplicate state structures
Before, we maintained almost identical structures between our persist
API and what we keep for our devices, with the persist API being a
slight subset of device structures.

Let's deduplicate this, now that persist is importing device package.
Json unmarshal of prior persist structure will work fine, since it was
an exact subset of fields.

Fixes: #4468

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-06-26 21:31:29 -07:00
Eric Ernst
f97d9b45c8 runtime: device/persist: drop persist dependency from device pkgs
Rather than have device package depend on persist, let's define the
(almost duplicate) structures within device itself, and have the Kata
Container's persist pkg import these.

This'll help avoid unecessary dependencies within our core packages.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-06-26 21:31:29 -07:00
Eric Ernst
f9e96c6506 runtime: device: move to top level package
Let's move device package to runtime/pkg instead of being buried under
virtcontainers.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-06-26 21:31:29 -07:00
Bin Liu
3880e0c077 agent: refactor reading file timing for debugging
In the original code, reads mountstats file and return
the content in the error, but at this time the file maybe
changed, we should return the file content that parsed
line by line to check why there is not a fstype option.

Fixes: #4246

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-06-26 21:27:43 -07:00
Steve Horsman
ebacd986bb
Merge pull request #4532 from stevenhorsman/CCv0-PS1-unbound
CCv0: Fix PS1 unbound error
2022-06-25 18:08:24 +01:00
Archana Shinde
2488a0f6c0
Merge pull request #4439 from amshinde/update-kernel-to-5.15.46
versions: Update kernel to latest LTS version 5.15.48
2022-06-24 11:03:32 -07:00
stevenhorsman
305532db02 CCv0: Fix PS1 unbound error
export PS1, so it is bound

Fixes: #4531
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2022-06-24 17:27:43 +01:00
Georgina Kinge
20ef9e9f5c CCv0: Refactor ccv0.sh to use bats test
Refactored ccv0.sh to utilise new automated tests for pulling encrypted images and creating a pod.

Fixes: #4512
Depends-on: github.com/kata-containers/tests#4866

Co-authored-by: Megan Wright <Megan.Wright@ibm.com>
Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
2022-06-24 15:43:15 +01:00
Fabiano Fidêncio
083ca5f217
Merge pull request #4505 from yoheiueda/agent-debug-build
agent: Allow BUILD_TYPE=debug
2022-06-24 14:04:23 +02:00
Fabiano Fidêncio
03fca8b459
Merge pull request #4526 from fidencio/topic/fix-clippy-warnings-and-update-agent-vendored-code
Fix clippy warnings and update agent's vendored code
2022-06-24 14:02:28 +02:00
Fabiano Fidêncio
40b1c79c97 agent: Pin a specific version of image-rs
Let's pin a specific version of image-rs, one that pins a specific
version of ocicrypt-rs on their side, and ensure we don't fall into
issues by consuming the content from main on those repos, and also
helping to ensure reproducible builds from our side.

Fixes: #4517

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-24 14:01:53 +02:00
Fabiano Fidêncio
62864b5041 agent: Update Cargo.lock
Let's update the Cargo.lock file to bring in all the new dependencies
and to decrease the diff after pinning a specific version of image-rs.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-24 14:01:09 +02:00
Fabiano Fidêncio
404515f568 image_rpc: Fix "single-char-pattern" clippy warning
```
error: single-character string constant used as pattern
   --> src/image_rpc.rs:199:36
    |
199 |                 cid = v[0].replace(":", "_");
    |                                    ^^^ help: try using a `char` instead: `':'`
    |
    = note: `-D clippy::single-char-pattern` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
```

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-24 14:00:17 +02:00
Fabiano Fidêncio
d21c3c340d random: Fix "nonminimal-bool" clippy warning
The error shown below was caught during a dependency bump in the CCv0
branch, but we better fix it here first.
```
error: this boolean expression can be simplified
  --> src/random.rs:85:21
   |
85 |             assert!(!ret.is_ok());
   |                     ^^^^^^^^^^^^ help: try: `ret.is_err()`
   |
   = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool

error: this boolean expression can be simplified
  --> src/random.rs:93:17
   |
93 |         assert!(!ret.is_ok());
   |                 ^^^^^^^^^^^^ help: try: `ret.is_err()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
```

Fixes: #4523

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-24 13:50:13 +02:00