Commit Graph

7342 Commits

Author SHA1 Message Date
Jakob Naucke
69d157f78b CCv0: Use Ubuntu as base for initrd
As discussed in #2908, Ubuntu is used as a base for CCv0 for building
umoci in the guest. Currently, CCv0 only works with initrd, so this only
applies to initrd.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-01 08:58:04 +01:00
Tobin Feldman-Fitzthum
7c41af4082 Agent: Attestation Agent Integration
Pull an encrypted image using the Attestation Agent as
a keyprovider.

Fixes: #3022

Signed-off-by: Tobin Feldman-Fitzthum <tobin@linux.ibm.com>
Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-11-24 23:32:11 +01:00
Steve Horsman
27c0dc260c
Merge pull request #3084 from stevenhorsman/CCv0
CCv0: Merge main into CCv0
2021-11-22 17:44:09 +00:00
stevenhorsman
7152448f21 ci: Add Merge message to commit check
Add the "Merge pull request (kata-containers)?#<x> from" message to the
subsystem check to allow commit check on merges between branches to work

Fixes: #3085
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-22 16:21:24 +00:00
stevenhorsman
d17aaba475 agent: Add PoC container signature validation
- Add new agent configuration policy path parameter
- Update agent pull image to use the policy path if specified and
otherwise fall back to the accept all policy
- Remove the double copy of the image during pulling
- Ensure that temporary directories are always removed

Fixes: #2682
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-22 11:51:05 +01:00
stevenhorsman
6f1bdd7079 doc: Add PoC container signature validation
- Document how to test the signature validation with
a number of different scenarios and test images
- Update ccv0.sh to add policy_path to kernel_params

Fixes: #2682

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-22 11:51:05 +01:00
stevenhorsman
7670792f97 osbuilder: Add PoC container signature validation
- Add hardcoded gpg, signature and polict files
- Modify rootfs.sh to put these in the correct place in the kata image
if skopeo and umoci are being used

Fixes: #2682

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-22 11:51:05 +01:00
root
e3c8c9023f vendor: Re-vendor after merging main
Ran `make -C src/runtime handle_vendor` after merge

Fixes: #3085

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-19 15:41:05 +00:00
stevenhorsman
ea34b30839 Merge remote-tracking branch 'upstream/main' into CCv0
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2021-11-19 14:37:33 +00:00
Tim Zhang
653b461dc2
Merge pull request #3064 from lifupan/main
agent: fix the issue of missing create a new session for container
2021-11-19 11:28:54 +08:00
Greg Kurz
c01189d4a6
Merge pull request #3075 from c3d/bugs/3074-containerd-update
runtime: Update containerd to 1.5.8
2021-11-18 22:42:05 +01:00
Samuel Ortiz
3f68265d60 versions: Switch to the Alibaba containerd branch
It contains the initial ImageService implementation.

Fixes #3009

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2021-11-18 22:41:05 +01:00
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
Christophe de Dinechin
0380b9bda7 runtime: Update containerd to 1.5.8
Release 1.5.8 of containerd contains fixes for two low-severity advisories:

[GHSA-5j5w-g665-5m35](https://github.com/opencontainers/distribution-spec/security/advisories/GHSA-mc8v-mgrf-8f4m)
[GHSA-77vh-xpmg-72qh](https://github.com/opencontainers/image-spec/security/advisories/GHSA-77vh-xpmg-72qh)

Fixes: #3074

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2021-11-18 18:38:27 +01:00
Greg Kurz
bdde8beb52
Merge pull request #3003 from Amulyam24/snap_ppc
qemu: fix snap build on ppc64le
2021-11-18 17:46:23 +01:00
Greg Kurz
f80ca66300
Merge pull request #2921 from Amulyam24/template_test
virtcontainers: fix failing template test on ppc64le
2021-11-18 17:32:18 +01:00
Amulyam24
112ea25859 qemu: fix snap build by disabling libudev
While building snap, static qemu is considered. Disable libudev
as it doesn't have static libraries on most of the distros of all
archs.

Fixes: #3002

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2021-11-18 18:50:19 +05:30
Amulyam24
d5a18173b9 virtcontainers: fix failing template test on ppc64le
If a file/directory doesn't exist, os.Stat() returns an
error. Assert the returned value with os.IsNotExist() to
prevent it from failing.

Fixes: #2920

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2021-11-18 15:37:40 +05:30
James O. D. Hunt
7269352fd4
Merge pull request #3057 from jodh-intel/docs-update-agent-readme
agent: Update README
2021-11-18 08:02:10 +00:00
Fupan Li
bbaf57adb0 agent: fix the issue of missing create a new session for container
When the container didn't had a tty console, it would be in a same
process group with the kata-agent, which wasn't expected. Thus,
create a new session for the container process.

Fixes: #3063

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2021-11-18 14:12:51 +08:00
Eric Ernst
076dbe6cea
Merge pull request #2973 from egernst/remove-cruft
Remove cruft, do some simple non-functional cleanup in the runtime
2021-11-17 15:26:12 -08:00
Eric Ernst
7e6f2b8d64 vc-utils: don't export unused function
Many of these functions are just used on one place throughout the rest
of the code base. If we create hypervisor package, newtork package, etc, we may want to
parse this out.

Fixes: #3049

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-11-17 14:12:57 -08:00
Eric Ernst
860f30882a virtcontainers: move oci, uuid packages top level
This will be useful at runtime level; no need for oci or uuid to be subpkg of
virtcontainers.

While at it, ensure we run gofmt on the changed files.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-11-17 14:12:57 -08:00
Eric Ernst
8acb3a32b6 virtcontainers: remove unused package nsenter
Package is not utilized. Remove.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-11-17 14:12:57 -08:00
Eric Ernst
4788cb8263 vc-network: remove unused functions
Unused functions -- let's clean up!

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-11-17 14:12:57 -08:00
Eric Ernst
b6ebddd7ef oci: remove unused function GetContainerType
This is unused - we utilize ContainerType directly.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-11-17 14:12:57 -08:00
James O. D. Hunt
599bc0c2a9 agent: Update README
Update the agent README by removing the historical details about the
conversion from golang to rust which (occurred at the start of Kata 2.x
development) and replacing it with information that developers and
testers should find more useful.

Fixes: #3056.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-17 17:57:45 +00:00
Fabiano Fidêncio
e34893a0c4
Merge pull request #3051 from egernst/macvlan-rename
macvlan: drop bridged part of name
2021-11-17 10:21:07 +01:00
Eric Ernst
1e7cb4bc3a macvlan: drop bridged part of name
The fact that we need to "bridge" the endpoint is a bit irrelevant. To
be consistent with the rest of the endpoints, let's just call this
"macvlan"

Fixes: #3050

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-11-16 16:44:29 -08:00
Carlos Venegas
15b5d22e81
Merge pull request #2778 from jcvenegas/clh-race-condition-check
clh: Fix race condition that prevent start pods
2021-11-16 14:15:06 -06:00
Carlos Venegas
55412044df monitor: Fix monitor race condition doing hypervisor.check()
The thread monitor will check if the agent and the VMM are alive every
second in a blocking thread. The Cloud hypervisor API server is
single-threaded, if the monitor does a `check()`, while a slow request
is still in progress, the monitor check() method will timeout. The
monitor thread will stop all the shim-v2 execution.

This commit modifies the monitor thread to make it check the status of
the hypervisor after 5 seconds. Additionally, the `check()` method from
cloud-hypervisor will use the method `clh.isClhRunning(timeout)` with a
10 seconds timeout. The monitor function does no timeout, so even if
`hypervisor.check()` takes more 10 seconds, the isClhRunning method
handles errors doing a VmmPing and retry in case of errors until the
timeout is reached.

Reduce the time to the next check to 5 should not affect any functionality,
but it will reduce the overhead polling the hypervisor.

Fixes: #2777

Signed-off-by: Carlos Venegas <jose.carlos.venegas.munoz@intel.com>
2021-11-16 18:28:29 +00:00
James O. D. Hunt
480343671b
Merge pull request #3046 from fidencio/wip/update-crio-documentation
Update CRI-O documentation
2021-11-16 08:33:29 +00:00
Fabiano Fidêncio
eb11d053d5 cri-o: Update deployment documentation
CRI-O deployment documentation was quite outdated, giving info from the
`1.x` era.  Let's update this to reflect what we currently have.

Fixes: #2498

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-15 18:30:40 +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
Fabiano Fidêncio
92e3a14023 cri-o: Update links for the CRI-O github page
The links are either pointing to the not-used-anymore `master` branch,
or to the kubernetes-incubator page.

Let's always point to the CRI-O github page, using the `main`branch.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-15 11:39:09 +01:00
Fabiano Fidêncio
0a19340a93 cri-o: Remove outdated documentation
Although the documentation removed is correct, it's not relevant to the
current supported versions of CRI-O.

Related: #2498

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-15 11:39:08 +01:00
snir911
b046c1ef6b
Merge pull request #2959 from snir911/wip/cgroups-systemd-fix
cgroups: Fix systemd cgroup support
2021-11-15 10:44:45 +02: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
Eric Ernst
e89c06e68b
Merge pull request #3032 from liubin/fix/3031-merge-two-types-packages
runtime: merge virtcontainers/pkg/types into virtcontainers/types
2021-11-12 14:23:21 -08:00
Chelsea Mafrica
b585264555
Merge pull request #3034 from fidencio/wip/remove-non-used-actions
workflows: Remove non-used main.yaml
2021-11-12 11:25:47 -08:00
Chelsea Mafrica
d38135c93b
Merge pull request #2570 from YchauWang/wyc-agent-test
agent/src: improve unit test coverage for src/namespace.rs
2021-11-12 11:24:13 -08:00
Fabiano Fidêncio
a3b3c85ec3 workflows: Remove non-used main.yaml
The main.yaml workflow was created and used only on 1.x.  We inherited
it, but we didn't remove it after deprecating the 1.x repos.

While here, let's also update the reference to the `main.yaml` file,
and point to `release.yaml` (the file that's actually used for 2.x).

Fixes: #3033

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-12 18:17:11 +01:00
Chelsea Mafrica
6b48d3754a
Merge pull request #3013 from fgiudici/kata_metrics_doc
doc: update kata metrics documentation
2021-11-12 09:11:36 -08:00
Chelsea Mafrica
c8f2ef9488
Merge pull request #3030 from liubin/fix/3029-delete-codes
runtime: delete not used codes
2021-11-12 08:53:20 -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
bin
09f7962ff1 runtime: merge virtcontainers/pkg/types into virtcontainers/types
There are two types packages under virtcontainers, and the
virtcontainers/pkg/types has a few codes, merging them into
one can make it easy for outstanding and using types package.

Fixes: #3031

Signed-off-by: bin <bin@hyper.sh>
2021-11-12 15:06:39 +08:00