Commit Graph

6166 Commits

Author SHA1 Message Date
Maksym Pavlenko
df14d386a5 Agent: OCI hooks return malformed json
This PR fixes wrong serialization of OCI state object.
OCI hooks end up with a JSON string with double quotes in `state` field.

This happens because of confusion `Debug` and `Display` traits. Debug trait
returns a string representation with double quotes.

Ideally we should not use Debug as a part of serialization process, so a bit
more safer fix would be to move container states to `oci` crate and simply
disallow wrong values in that field.

`ContainerState` in go spec: https://github.com/opencontainers/runtime-spec/blob/master/specs-go/state.go#L4

Fixes: #1404

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-02-11 19:02:41 -08:00
Eric Ernst
3721351324 runtime: cpuset: when creating container, don't pass cpuset details
Today we only clear out the cpuset details when doing an update call on
existing container/pods. This works in the case of Kubernetes, but not
in the case where we are explicitly setting the cpuset details at boot
time. For example, if you are running a single container via docker ala:

docker run --cpuset-cpus 0-3 -it alpine sh

What would happen is the cpuset info would be passed in with the
container spec for create container request to the agent. At that point
in time, there'd only be the defualt number of CPUs available in the
guest (1), so you'd be left with cpusets set to 0. Next, we'd hotplug
the vCPUs, providing 0-4 CPUs in the guest, but the cpuset would never
be updated, leaving the application tied to CPU 0.

Ouch.

Until the day we support cpusets in the guest, let's make sure that we
start off clearing the cpuset fields.

Fixes: #1405

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2021-02-11 17:38:15 -08:00
Manabu Sugimoto
660b047306 oci: Update seccomp configuration
Seccomp configuration should be updated to prepare for the future seccomp support based on the latest OCI specification.

Add:
- flags which is used with seccomp(2) in struct LinuxSeccomp
- errnoRet which is errno return code in struct LinuxSyscall
- some new seccomp actions and an architecture

Fixes: #1391

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-02-11 22:37:02 +09:00
Fabiano Fidêncio
96196e102e
Merge pull request #1396 from dgibson/pointtopoint
agent: Remove bogus check from list_interfaces() unit test
2021-02-11 09:06:01 +01:00
David Gibson
c9c7c12440 agent: Remove bogus check from list_interfaces() unit test
The unit test for list_interfaces() checks that the hardware address
returned for each interface has non-zero length.  However, that need not be
the case.  Point-to-point devices, such as ppp, or tun devices in certain
configurations may not have a hardware address, which is represented as
a zero length address here.

This happens on my machine with a tun0 device created by OpenVPN.

fixes #1377

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-02-11 15:09:10 +11:00
Eric Ernst
cb6d2f3c40 osbuilder: alphabetize fields
Let's go ahead and list the usage info / fields in alphabetical order!

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2021-02-10 12:39:10 -08:00
Fabiano Fidêncio
e2c8c7e603
Merge pull request #1031 from knittl/feature/kata-option-aliases
cli: Add aliases for `kata-` options
2021-02-10 16:22:13 +01:00
Fabiano Fidêncio
2009ef4872
Merge pull request #1364 from fidencio/wip/only-run-kata-deploy-test-on-pull-requests
github: Only run kata-deploy-test on pull-requests
2021-02-10 13:59:30 +01:00
Daniel Knittl-Frank
056d742c17 docs: Update documentation with new prefixless config options
Remove the old config options from the documentation and replace them
with the new form (without the redundant `kata-` prefix).

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2021-02-10 07:55:18 +01:00
Daniel Knittl-Frank
fdcde7968a cli: use new prefixless config options in tools scripts
Update all tools/packaging scripts to prefer the new options over the
old ones (e.g. `--config` instead of `--kata-config`).

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2021-02-10 07:55:18 +01:00
Daniel Knittl-Frank
02ee8b0b8a cli: Add aliases for kata- options
Remove `kata-` prefix from options `kata-config` and
`kata-show-default-config-paths`.

Fixes #1011

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2021-02-10 07:55:18 +01:00
Daniel Knittl-Frank
c6bc43b697 docs: Fix broken link to fluentbit.io docs
Fix link to external website in fluentd how-to.

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2021-02-10 07:55:18 +01:00
Julio Montes
61b448c7fb
Merge pull request #1385 from ManaSugi/change_virtiofsd_dir
docs: Fix the installation directory of virtiofsd
2021-02-09 10:49:33 -06:00
Manabu Sugimoto
20b27a16c9 docs: Fix the installation directory of virtiofsd
Change the installation directory of virtiofsd to kata-qemu.

Fixes: #1379

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-02-09 22:47:27 +09:00
Fabiano Fidêncio
f4fe97411e
Merge pull request #1267 from Jakob-Naucke/s390x-fix-docker-rootfs-build
osbuilder: Fix USE_DOCKER on s390x
2021-02-09 14:13:35 +01:00
Fabiano Fidêncio
8c1e0d3002 kernel: Enable OVERLAY_FS_{METACOPY,XINO_AUTO}
* CONFIG_OVERLAY_FS_METACOPY is needed to have reasonable performance
  for chmod and similar calls;
* CONFIG_OVERLAY_FS_XINO_AUTO is recommended for POSIX compliance.

Fixes: #1075

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-02-09 13:01:01 +01:00
Jakob-Naucke
11fe6a3552
osbuilder: Fix USE_DOCKER on s390x
- Install the required protobuf-compiler on Ubuntu
- Install correct libc Rust target (glibc on s390x)
- Do not skip Rust installation on s390x

Fixes: #1266

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-02-09 12:37:24 +01:00
bin
10f1c30f3d kata-runtime: use filepath.Join() to compose file path
Use filepath.Join() will be safer than format string directly.

Signed-off-by: bin <bin@hyper.sh>
2021-02-09 19:37:20 +08:00
Bin Liu
f4ae9c8476 docs: Update Developer-Guide.md
Add description for difference of namespace in containerd and Kuberenetes.

Co-authored-by: Eric Ernst <eric.g.ernst@gmail.com>
Signed-off-by: bin <bin@hyper.sh>
2021-02-09 19:37:14 +08:00
bin
9963428a4d docs: update document for using debug console
Delete using `kata-monitor` to use `kata-runtime exec`

Fixes: #1329

Signed-off-by: bin <bin@hyper.sh>
2021-02-09 19:37:06 +08:00
bin
44cde6e464 runtime: connect guest debug console bypass kata-monitor
Parse agent socket address by conversation to improve usability of
using guest debug console.

Fixes: #1329

Signed-off-by: bin <bin@hyper.sh>
2021-02-09 19:36:48 +08:00
Fabiano Fidêncio
d4c506f270
Merge pull request #1184 from zanetworker/add-e2e-arch-image
Add katacontainers end-to-end arch image
2021-02-09 12:26:23 +01:00
Fabiano Fidêncio
6dbc648c54
Merge pull request #1263 from Jakob-Naucke/s390x-glibc-agent
Build for glibc on s390x
2021-02-09 12:26:02 +01:00
Fabiano Fidêncio
9e2ac11086
Merge pull request #1265 from Jakob-Naucke/s390x-fix-vmlinux
packaging: Fix vmlinux kernel install on s390x
2021-02-09 11:24:04 +01:00
Fabiano Fidêncio
d6682e3168
Merge pull request #1261 from Jakob-Naucke/update-yq
ci: Upgrade to yq 3.4.1
2021-02-09 10:21:14 +01:00
Fabiano Fidêncio
548c459066
Merge pull request #1375 from fidencio/wip/fix-build-kernel
kernel: Don't fail if "experimental" dir doesn't exist
2021-02-09 10:05:54 +01:00
Bin Liu
4e6a39cd25
Merge pull request #1366 from fidencio/wip/kata-deploy-remove-mention-to-docker
kata-deploy: Remove kata-deploy-docker.sh
2021-02-09 16:11:44 +08:00
Fupan Li
5d1432210c
Merge pull request #1352 from liubin/fix/migrate-opentracing-to-opentelemetry
runtime: migrate from opentracing to opentelemetry
2021-02-09 10:18:10 +08:00
bin
3406502706 runtime: add jaeger configuration items
add configuration items in Kata Containers
configuration file to let users specify jaeger
collector address, and user/password.

Signed-off-by: bin <bin@hyper.sh>
2021-02-09 08:02:05 +08:00
Fabiano Fidêncio
fbab262f2d kernel: Don't fail if "experimental" dir doesn't exist
This directory has been automatically removed as there's no files inside
it, as part of d3c9862059

Let's improve the logic in the scripts to avoid failing in case the
"experimental" dir is not present.

Fixes: #1328

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-02-08 21:52:53 +01:00
Fupan Li
f3e9d4e7e3
Merge pull request #1373 from ManaSugi/use-rlimit-crate
rustjail: use rlimit crate
2021-02-08 23:15:37 +08:00
Manabu Sugimoto
e1dce3a369 rustjail: use rlimit crate
The current implementation of rustjail uses the specific setrlimit.
This patch uses rlimit crate for maintainability.

Fixes: #1372

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-02-08 18:43:56 +09:00
Jakob Naucke
8045104eaf ci: Upgrade to yq 3.4.1
Since the resolution of https://github.com/mikefarah/yq/issues/502,
the `yq` binary is no longer broken on s390x. This is an upgrade to
the latest v3 version of yq (v4 has new syntax).

Fixes: #1260

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-02-08 09:29:57 +01:00
Jakob-Naucke
3d3e4dc147
packaging: Fix vmlinux kernel install on s390x
Installing the built uncompressed vmlinux kernel will not work on s390x,
QEMU will complain:
Linux kernel boot failure: An attempt to boot a vmlinux ELF image
failed.
This image does not contain all parts necessary for starting up. Use
bzImage or arch/s390/boot/compressed/vmlinux instead.
Hence, use that kernel image on s390x.

Fixes: #1264

Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2021-02-08 09:25:26 +01:00
Fupan Li
d54c702539
Merge pull request #1368 from ManaSugi/get_caps_dyn
rustjail: get all capabilities dynamically
2021-02-08 16:00:51 +08:00
Manabu Sugimoto
a252d861e3 rustjail: get all capabilities dynamically
The runtime determines the kernel capability set at runtime.

Fixes: #1370

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-02-07 16:39:14 +09:00
Fabiano Fidêncio
d4391d784d
Merge pull request #1334 from clnperez/ppc64le-protoc
agent: README update to install protoc for ppc64le
2021-02-06 01:08:42 +01:00
Fabiano Fidêncio
7b5e56b274
Merge pull request #1360 from fidencio/wip/qemu-virtiofs-security-fixes
qemu: Add security fixes for CVE-2020-35517
2021-02-05 21:37:46 +01:00
Chelsea Mafrica
a12772c601
Merge pull request #1358 from Tim-Zhang/remove-allow
Fix lints and remove allow attributes which silence these warnings
2021-02-05 12:17:29 -08:00
Fabiano Fidêncio
62cbaf4de4 kata-deploy: Remove kata-deploy-docker.sh
Kata Containers 2.x is not supported outside of the kubernetes world.
With this in mind, let's remove leftovers from the 1.x deployments &
documentation.

Fixes: #1356

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-02-05 15:18:43 +01:00
Fabiano Fidêncio
50fea9fa6f github: Only run kata-deploy-test on pull-requests
We're currently running kata-deploy-test for every issue opened, for
every comment in the issue.  Issues, themselves, shouldn't be triggering
those as they can't cause any code change.

With this in mind, let's restrict ourselves to run those on
pull-requests only.

Fixes: #1341

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-02-05 11:00:32 +01:00
Fabiano Fidêncio
b548114f59 qemu: Add security fixes for CVE-2020-35517
This series is based on
https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg01787.html, and
was kindly brought up by David Gilbert.

Fixes: #1361

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-02-04 22:26:20 +01:00
Christy Norman
11680efe4e agent: README update to install protoc for ppc64le
Add a bit to the agent README about installing protoc manually for Power (ppc64le)

Fixes: #1068

Signed-off-by: Christy Norman <christy@linux.vnet.ibm.com>
2021-02-04 17:03:31 +00:00
Tim Zhang
f16ab49b5b agent: fix non_camel_case_types lint and stop hiding the warning
Fixes: #1359

Signed-off-by: Tim Zhang <tim@hyper.sh>
2021-02-04 21:36:21 +08:00
Tim Zhang
8ffe4d6748 agent: fix unused_parens lint and stop hiding the warning
Fixes: #1359

Signed-off-by: Tim Zhang <tim@hyper.sh>
2021-02-04 21:24:04 +08:00
Tim Zhang
f70ca69d0d agent: remove #![allow(unused_unsafe)]
Fixes: #1359

Signed-off-by: Tim Zhang <tim@hyper.sh>
2021-02-04 21:21:48 +08:00
Tim Zhang
e28bf7a59d agent: fix dead_code lint
Fixes: #1359

Signed-off-by: Tim Zhang <tim@hyper.sh>
2021-02-04 21:18:45 +08:00
Tim Zhang
05da23acb7 agent: fix non_snake_case lint and remove ![allow(non_snake_case)]
Fixes: #1359

Signed-off-by: Tim Zhang <tim@hyper.sh>
2021-02-04 21:18:37 +08:00
Jakob Naucke
afb4197813 osbuilder: Build for glibc on s390x
Since there is no Rust target for musl on s390x, builds on s390x should use
glibc. This commit removes the "Cannot build Rust agent on s390x" restriction
in rootfs.sh and only installs musl in the build environment when it is
required.

Fixes: #1262

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-02-04 09:52:28 +01:00
Jakob Naucke
a1cedc567a agent: Build for glibc on s390x
Since there is no Rust target for musl on s390x, builds on s390x should
use glibc. This commit makes glibc the default on s390x as per the agent
Makefile.

Fixes: #1262

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-02-04 09:51:23 +01:00