Commit Graph

7293 Commits

Author SHA1 Message Date
wllenyj
ab6b1cbfe9 agent: Append the container OCI spec with the image bundle one
We do not get a root filesystem path from the agent when creating a
new container for which the container image was not pulled by
containerd. That prevents the agent from creating the container.

To fix that, we populate the container root path with the internal
rootfs path by fetching the containerd added image name annotation and
mapping it back to a path through our image hash map.

Fixes #3009

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2021-11-18 22:41:05 +01:00
wllenyj
5691e66e1b shim: Fix CreateContainer for the confidential computing case
In the confidential computing scenario, there is no Image
information on the host, so skip handling Rootfs at
CreateContainer.

Fixes #3009

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2021-11-18 22:41:05 +01:00
wllenyj
e502fb23ea shim: Use ImageService to be compatible with containerd
- Replace containerd to `confidential-containers/containerd` in go.mod
- Use separate ImageService to support PullImage

Fixes #3009

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2021-11-18 22:41:05 +01:00
wllenyj
e1fcc2529c shim: Upgrade containerd to v1.6.0-beta.2
The version `v1.6.0-beta.2` released support for shim service,
which is needed for our implementation of ImageService.

Fixes #3009

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2021-11-18 22:41:05 +01:00
Fabiano Fidêncio
d22706c060
Merge pull request #3040 from wllenyj/rework-agent-ctl
CCv0|agent-ctl: fix compile error
2021-11-15 13:32:01 +01:00
wllenyj
429ab089f7 agent-ctl: fix complie error
Since the `utils::get_option` interface is modified,
PullImage needs to adapt to this modification in CCv0 branch.

Fixes #3044

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2021-11-15 14:28:40 +08:00
stevenhorsman
0a1d7893ff Merge remote-tracking branch 'upstream/main' into CCv0
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-12 09:46:51 +00:00
stevenhorsman
6c3e03958a Merge branch 'CCv0' of github.com:kata-containers/kata-containers into CCv0
Keep the CCvo branch up to date with changes from main
2021-11-12 09:36:39 +00:00
Fabiano Fidêncio
c0aea3f662
Merge pull request #3017 from fidencio/wip/bump-golang
versions: bump golang to 1.17.x
2021-11-11 16:57:50 +01:00
Fabiano Fidêncio
7c947357ad
Merge pull request #3015 from ManaSugi/fix-yq-path
release: Use ${GOPATH}/bin/yq for upload-libseccomp-tarball action
2021-11-11 10:48:42 +01:00
Fabiano Fidêncio
395638c4bc versions: bump golang to 1.17.x
According to https://endoflife.date/go golang 1.15 is not supported
anymore.  Let's remove it from out tests, add 1.17.x, and bump the
newest version known to work when building kata to 1.17.3.

Fixes: #3016

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-11 10:43:18 +01:00
Bin Liu
bf24eb6b33
Merge pull request #2979 from jodh-intel/agent-ctl-json-api-spec
agent-ctl: Allow API specification in JSON format
2021-11-11 16:45:30 +08:00
Manabu Sugimoto
3430723594 release: Use ${GOPATH}/bin/yq for upload-libseccomp-tarball action
We need to explicitly call `${GOPATH}/bin/yq` that is installed by
`ci/install_yq.sh`.

Fixes: #3014

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-11-11 13:42:12 +09:00
Bin Liu
04185bd068
Merge pull request #2997 from Jakob-Naucke/lint-protection
virtcontainers: Lint protection types
2021-11-11 08:34:48 +08:00
Fabiano Fidêncio
05cf7cdddb
Merge pull request #3007 from liubin/fix/3006-check-env-key-value
agent: check environment variables if empty or invalid
2021-11-10 19:19:47 +01:00
wllenyj
08c34f2ac2 runtime: Use a separate ImageService to support PullImage
Compatible with the agent's ImageService.

Fixes #2984

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2021-11-10 16:10:21 +01:00
wllenyj
dfb8c965e6 agent: Separate the ImageService from the AgentService
Use a separate ImageService to support PullImage.

Fixes #2984

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2021-11-10 16:10:21 +01:00
Jakob Naucke
23bd6fe5da
Merge pull request #2908 from Jakob-Naucke/install-aa
osbuilder: Build attestation-agent and friends
2021-11-10 16:09:54 +01:00
bin
57bb7ffae3 agent: check environment variables if empty or invalid
Invalid environment variable key/value will cause set_env panic.

Refer: https://doc.rust-lang.org/std/env/fn.set_var.html#panics

Fixes: #3006

Signed-off-by: bin <bin@hyper.sh>
2021-11-10 20:54:21 +08:00
Fabiano Fidêncio
653976c0fd
Merge pull request #3000 from bergwolf/crioptions
runtime: Revert "runtime: use containerd package instead of cri-containerd"
2021-11-10 13:41:24 +01:00
Tim Zhang
fbf3bb55c0
Merge pull request #2995 from Tim-Zhang/fix-container-created-time
rustjail: Fix created time of container
2021-11-10 19:44:04 +08:00
James O. D. Hunt
8ab90e1068 agent-ctl: Allow API specification in JSON format
Update the `agent-ctl` tool to allow API fields to be specified in JSON
format, either directly on the command-line, or via a file URI.

This feature is made possible by enabling `serde` support in the agent
`protocols` crate. Careful use of the `serde` macros allows the
`agent-ctl` tool to accept _partially_ specified API objects in JSON
format; fields that are not specified are set to the default value for
their respective types.

`build.rs` changes based on work by Fupan.

Fixes: #2978.

Contributions-by: Fupan Li <lifupan@gmail.com>
Contributions-by: Bin Liu <bin@hyper.sh>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-10 10:16:04 +00:00
James O. D. Hunt
18c47fe8f3
Merge pull request #2986 from jodh-intel/rm-dynamic-tracing-api
agent: Remove dynamic tracing APIs
2021-11-10 10:10:14 +00:00
Peng Tao
eacfcdec19 runtime: Revert "runtime: use containerd package instead of cri-containerd"
This reverts commit 76f16fd1a7 to bring
back cri-containerd crioptions parsing so that kata works with older
containerd versions like v1.3.9 and v1.4.6.

Fixes: #2999
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2021-11-10 16:06:42 +08:00
Tim Zhang
e7856ff10c rustjail: Fix created time of container
Got wrong created time of container after an exec
this commit will fix this problem.

Fixes: #2994

Signed-off-by: Tim Zhang <tim@hyper.sh>
2021-11-10 10:43:03 +08:00
Chelsea Mafrica
8b01666109
Merge pull request #2992 from Amulyam24/kernel_vfio
kernel: add VFIO kernel dependencies for ppc64le
2021-11-09 15:22:16 -08:00
Jakob Naucke
b7b89905d4
virtcontainers: Lint protection types
Protection types like tdxProtection or seProtection were marked nolint,
remove this. As a side effect, ARM needs dummy tests for these.

Fixes: #2801
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-11-09 18:36:32 +01:00
Jakob Naucke
13f6418c46
osbuilder: Build Skopeo, umoci, attestation-agent
When the environment variable $SKOPEO_UMOCI is set to "yes", Skopeo and
umoci are built inside the guest build container and installed to the
guest rootfs. The respective build- and runtime dependencies are added.
This respects the (existing) $LIBC variable (gnu/musl) and avoids issues
with glibc mismatches.
This is currently only supported for Ubuntu guests, as the system Golang
packages included in the versions of other distros that we use are too
old to build these packages, and re-enabling installing Golang from
golang.org is cumbersome, given especially that it is unclear how long
we will keep using Skopeo and umoci.

Additionally, when the environment variable $AA_KBC is set,
attestation-agent (with that KBC) is included.

This replaces some logic in ccv0.sh that is removed.

Fixes: #2907
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-11-09 18:04:21 +01:00
Amulyam24
7566b736ac kernel: add VFIO kernel dependencies for ppc64le
Recently added VFIO kernel configs require addtional
dependencies on pcc64le.

Fixes: #2991

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2021-11-09 14:38:03 +05:30
James O. D. Hunt
87f676062c agent: Remove dynamic tracing APIs
Remove the `StartTracing` and `StopTracing` agent APIs that toggle
dynamic tracing. This is not supported in Kata 2.x, as documented in the
[tracing proposals document](https://github.com/kata-containers/kata-containers/pull/2062).

Fixes: #2985.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-09 08:39:06 +00:00
James O. D. Hunt
b09dd7a883 docs: Fix typo
Correct a typo identified by the static checker's spell checker.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-09 08:38:42 +00:00
stevenhorsman
4762da105c Merge remote-tracking branch 'upstream/main' into CCv0 2021-11-08 14:58:30 +00:00
James O. D. Hunt
b192d388c1
Merge pull request #2970 from jodh-intel/logging-create-tests-and-checks
logging: Always run crate tests
2021-11-08 13:16:48 +00:00
stevenhorsman
9b34595ad0 version: Update CCv0 fork of containerd used
- Update CCv0 to use the new confidential containers fork of containerd
- Start using the current-CCv0 branch

Fixes #2947

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:50:32 +00:00
stevenhorsman
d57648eb13 doc: Add pull image support to shim
- Add a ctr shim pull image function to CCv0.sh
- Add information on how to use it in the how-to doc

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:50:32 +00:00
Dave Hay
02f6db595c shim: Add PullImage support
Add a new PullImage endpoint to the shim API.
Add new PullImage functions to the virtcontainers files, which allows
the PullImage endpoint on the agent to be called.
Update the containerd vendor files to support new PullImage API changes.

Fixes #2651

Signed-off-by: Dave Hay <david_hay@uk.ibm.com>
Co-authored-by: ashleyrobertson <ashleyro@uk.ibm.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:50:31 +00:00
Fabiano Fidêncio
18834810e6 kata-deploy: point to the -cc:v0 image
Just in case someone thinks about using kata-deploy directly from this
branch, let's point to the `-cc:v0`image.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2021-11-05 14:50:29 +00:00
Fabiano Fidêncio
7854cf007a kata-deploy: Add a basic script to build & upload a CCv0 image
This is a dirty hack, that we should expand later so we can pass one or
n number of repos where we'll upload our images, and use it as part of
the release scripts.

For now, however, let's just do this quick & dirty hack so we can
present the CCv0 demo using the operator, even knowing that the
kubernetes part of the work is not done yet and that the demo itself
will be done connecting to a node and doing all the shenanigans
manually.

Fixes: #2854

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2021-11-05 14:49:45 +00:00
stevenhorsman
f2bdd846fd doc: Update base rootfs to be ubuntu
- Update the CCv0 demo script to use ubuntu instead of fedora
- Update the extra packages to reflect the apt vs dnf namings
- Build and add the skopeo binary to the rootfs image
- Minor kubernetes init fix

Fixes #2849

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:45 +00:00
stevenhorsman
85d455791c osbuilder: update base rootfs to be ubuntu
- Revert fedora OS changes made in #2556 as we aren't using it anymore.
- They should be done in main under #2116

Fixes #2849

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:45 +00:00
stevenhorsman
03cf3aa168 agent: update base rootfs to be ubuntu
- Add skopeo --insecure-policy tag to reflect that ubuntu doesn't
create a default container policy

Fixes #2849

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:45 +00:00
stevenhorsman
c624e7fd97 agent: Add authenticated pull image support
Add source credentials field to pull_image endpoint
If field is not blank, send to skopeo in image pull command
Add source_creds to agentl-ctl pull command

Fixes: #2653
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:45 +00:00
stevenhorsman
522b9e33c3 doc: Add doc for authenticated pull image
Add support for a new source credentials environment variable in the
test script
Add documentation of it into the how-to guide

Fixes #2653

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:45 +00:00
stevenhorsman
40c406506b agent: Add CreateContainer support for pre-pulled bundle
- Add a check in setup_bundle to see if the bundle already exists
and if it does then skip the setup.

Fixes: #2617

Co-authored-by: Dave Hay <david_hay@uk.ibm.com>
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:42 +00:00
stevenhorsman
500356ace1 doc: Add Create Container test and doc
Refactor ccv0.sh so it's easier to add agent-ctl commands
Add agent create container agent-ctl method to ccv0.sh
Update doc to reflect changes

Fixes #2617

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:20 +00:00
stevenhorsman
87c632baf2 version: Add support for using containerd PR
Add a pr_id field to the cri-containerd config in versions.yaml
so the CI scripts can use this in the CCv0 builds

Fixes #2576

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:20 +00:00
stevenhorsman
76b70a7a82 doc: Add doc and scripts for CCv0 agent PullImage
This commit add documentation and a script to help people to build, run,
test and demo the CCv0 changes around PullImage on guest.
It is currently limited to the Agent pullimage, but can be expanded
as more code is shared.

Fixes #2574

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:20 +00:00
Georgina Kinge
af44b7a591 agent: Add PullImage endpoint
This commit adds the PullImge endpoint to the agent
and the agent-ctl command to test it.

Fixes: #2509

Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
2021-11-05 14:49:20 +00:00
Fabiano Fidêncio
c9e6efb1e1
Merge pull request #2976 from bergwolf/2.3.0-rc0-branch-bump
# Kata Containers 2.3.0-rc0
2021-11-05 14:19:21 +01:00
James O. D. Hunt
4be2c8b190
Merge pull request #2602 from cmaf/upgrade-opentelemetry
vendor: update OpenTelemetry
2021-11-05 11:00:25 +00:00