Commit Graph

5693 Commits

Author SHA1 Message Date
Archana Shinde
d64641174e docs: Update Readme to remove hypervisor information
The repo https://github.com/kata-containers/qemu has been
archived. We should remove this, as this is not the only
hypervisor we support now.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-10-19 14:03:57 -07:00
Archana Shinde
b4f9fb513e docs: Remove docs for nemu
This hypervisor is no longer supported with Kata.
Remove related docs.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-10-19 13:35:33 -07:00
Christophe de Dinechin
96a4ed7d70 Makefile: Replace @RUNTIME_NAME@ with the target in generated files
In commit 966bd57 for PR #902, the makefile was changed to automate
the replacement of user variables. However, one variable was treated
specially in the original `sed` replacements, namely `RUNTIME_NAME`
which was replaced by `$(TARGET)`.

This commit adds the `RUNTIME_NAME` variable to the makefile in order
to ensure that the replacement works correctly.

Fixes: #993

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-10-19 18:13:49 +02:00
Julio Montes
f162e7e960
Merge pull request #948 from justin-he/max_ports
virtcontainers: Append max_ports to virtio-serial device
2020-10-19 08:55:06 -05:00
Tim Zhang
7159fc2eda agent: simplify ttrpc error construction
Fixes: #975

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-19 13:50:30 +08:00
Bin Liu
ed711b5ab1
Merge pull request #983 from bergwolf/snap
snap: install libseccomp-dev
2020-10-17 20:58:27 +08:00
Peng Tao
0f8949868c snap: install libseccomp-dev
To build qemu with virtio-fs support.

Fixes: #982
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-17 17:44:56 +08:00
Xu Wang
80cfd01130
Merge pull request #936 from bergwolf/default-virtiofs
runtime: set virtio-fs as default fs sharing method
2020-10-17 17:28:30 +08:00
Peng Tao
9a351509d2 package: drop qemu-virtiofs shim
We have enabled qemu-virtiofs by default.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-17 11:42:56 +08:00
Peng Tao
5f47f224ff
Merge pull request #945 from fidencio/wip/virtiofs-performance-improvements-backport-and-default-settings
VirtioFS: backports & default settings to improve performance
2020-10-17 11:13:22 +08:00
Peng Tao
6ed669a17b packaging: install virtiofsd for normal qemu build as well
For experimental-virtiofs, we use it to test virtiofs with DAX. Let's
rename its virtiofsd to virtiofsd-dax.

Depends-on: github.com/kata-containers/tests#2951
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-17 10:58:27 +08:00
Peng Tao
e5262b1c29
Merge pull request #970 from jodh-intel/2.0-dev-agent-ctl-add-missing-apis
tools: Make agent-ctl support more APIs
2020-10-17 10:12:40 +08:00
Jia He
da79b4be67 virtcontainers: Append max_ports to virtio-serial device
Allow API consumers to change the maximum number of ports in the
virtio-serial devices, setting a lower number of ports can improve the
boot time and reduce the attack surface.

Before this patch on arm64:
[    0.028664] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.055031] printk: console [hvc0] enabled

After this patch on arm64:
[    0.028484] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.031370] printk: console [hvc0] enabled

Fixes: #2676
Signed-off-by: Jia He <justin.he@arm.com>
2020-10-16 23:40:54 +08:00
Peng Tao
bcf4853062 runtime: enable virtiofs by default
We've been shipping it for a long time. It's time to make it default
replacing the old obsolet 9pfs.

Fixes: #935
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-16 15:58:35 +08:00
Peng Tao
0d5d69e8cd
Merge pull request #902 from c3d/bug-v2/launchpad-1878234-access
Validate runtime annotations
2020-10-16 15:47:45 +08:00
Peng Tao
e0da3af40b
Merge pull request #974 from egernst/kernel-bump
kernel: update to 5.4.71
2020-10-16 15:41:58 +08:00
James O. D. Hunt
e2221d34bf tools: Improve agent-ctl README
Add a summary to help understand how to use the `agent-ctl` tool.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-16 07:43:41 +01:00
Peng Tao
6f46be2f2e
Merge pull request #962 from egernst/config-update
config: make virtio-fs part of standard kernel
2020-10-16 10:06:02 +08:00
Fupan Li
cacb27fe4b
Merge pull request #942 from Tim-Zhang/optimize-error-handling
agent: Optimize error handling
2020-10-16 09:15:22 +08:00
Eric Ernst
2d1f2c7b95 kernel: update to 5.4.71
vsock fix was backported to 5.4 stable, so we can drop this patch.

Fixes: #973

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2020-10-15 16:21:10 -07:00
Salvador Fuentes
18553459d1
Merge pull request #961 from chavafg/topic/update-k8s-1.18
versions: Update Kubernetes, containerd, cri-o and cri-tools
2020-10-15 16:54:21 -05:00
Eric Ernst
d3c9862059 config: make virtio-fs part of standard kernel
Basic virtio-fs support has made it upstream in the Linux kernel, as
well as in QEMU and Cloud Hypervisor. Let's go ahead and add it to the
standard configuration.

Since the device driver / DAX handling is still in progress for
upstream, we will want to still build a seperate experimental kernel for
those who are comfortable trading off bleeding edge stability/kernel
updates for improved FIO numbers.

Fixes: #963

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2020-10-15 12:21:41 -07:00
James O. D. Hunt
edf02af1d4 tools: Make agent-ctl support more APIs
Added new `agent-ctl` commands to allow the following agent API calls to
be made:

- `AddARPNeighborsRequest`
- `CloseStdinRequest`
- `CopyFileRequest`
- `GetMetricsRequest`
- `GetOOMEventRequest`
- `MemHotplugByProbeRequest`
- `OnlineCPUMemRequest`
- `ReadStreamRequest`
- `ReseedRandomDevRequest`
- `SetGuestDateTimeRequest`
- `TtyWinResizeRequest`
- `UpdateContainerRequest`
- `WriteStreamRequest`

Fixes: #969.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-15 17:33:25 +01:00
James O. D. Hunt
5620180302 tools: Remove commented out code in agent-ctl
Remove a few lines of commented out code.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-15 17:33:00 +01:00
James O. D. Hunt
9bac4ee651 tools: Log request in agent-ctl tool if debug enabled
Display the API request before making the call so users can see what is
sent to the agent.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-15 17:32:23 +01:00
James O. D. Hunt
68821f0814 tools: Rename agent-ctl command to GetGuestDetails
Rename the `GuestDetails` command to `GetGuestDetails` to match the
actual agent API name.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-15 17:32:20 +01:00
James O. D. Hunt
8553f06298 tools: Fix comment in agent-ctl
Correct a comment in the agent control tool.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-15 16:54:34 +01:00
Julio Montes
238e4562e0
Merge pull request #965 from jodh-intel/2.0-dev-agent-fix-crashers
agent: fix crashers if API requests empty
2020-10-15 09:53:11 -05:00
Peng Tao
6612b0c4bf
Merge pull request #953 from liubin/fix/952
rustjail: add length check for uid_mappings in rootless euid mapping
2020-10-15 20:42:09 +08:00
Peng Tao
bcda074e5a
Merge pull request #964 from liubin/fix/957-use-regex-to-filter-kata-contaienrs
kata-monitor: use regexp to check if runtime is kata containers
2020-10-15 20:41:54 +08:00
Tim Zhang
6ba294a11e agent: remove unwrap() for e.as_errno()
Use `{:?}` to print `e.as_errno()` instead of using `{}`
to print `e.as_errno().unwrap().desc()`.

Avoid panic only caused by error's content.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 19:46:00 +08:00
Tim Zhang
e77482fe16 agent: Use ? instead of match when the error returns directly
It's more clear and more readable.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 19:45:55 +08:00
bin liu
1b7ed32836 kata-monitor: use regexp to check if runtime is kata containers
To support a few common configurations for Kata, including:

- `io.containerd.kata.v2`
- `io.containerd.kata-qemu.v2`
- `io.containerd.kata-clh.v2`

`kata-monintor` changes to use regexp instead of direct string comparison.

Fixes: #957

Signed-off-by: bin liu <bin@hyper.sh>
2020-10-15 18:42:44 +08:00
Tim Zhang
47ff2fb9a0 agent: use anyhow context to attach context to Error instead of match
Context is clearer than match for these situations.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 18:16:54 +08:00
Tim Zhang
2f690a2bb0 agent: remove useless match
Remove useless match.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 18:16:54 +08:00
James O. D. Hunt
cb6231c1bc
Merge pull request #930 from YchauWang/update-docs-2.0-6
docs: update the build kata containers kernel document
2020-10-15 11:15:25 +01:00
Tim Zhang
1d8def6663 agent: Use ok_or_else instead of match for Option -> Result
Using ok_or is clearer than match.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 18:15:14 +08:00
James O. D. Hunt
8495306641 agent: Fix crasher if AddARPNeighbors request empty
Check if the ARP neighbours specified in the `AddARPNeighbors` API is
set before using it to avoid crashing the agent.

Fixes: #955.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-15 11:12:40 +01:00
James O. D. Hunt
3d084c7d23 agent: Fix crasher if UpdateRoutes request empty
Check if the routes specified in the `UpdateRoutes` API is set before
using it to avoid crashing the agent.

Fixes: #949.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-15 11:12:38 +01:00
James O. D. Hunt
5615e5a7fe agent: Fix crasher if UpdateInterface request empty
Check if the interface specified in the `UpdateInterface` API is set
before using it to avoid crashing the agent.

Fixes: #950.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-15 11:12:35 +01:00
Tim Zhang
0dce817ebb agent: replace match Result with or_else
`or_else` is suitable for more complicated situations.
We can use it to return Ok in Err handling.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 17:58:51 +08:00
Tim Zhang
7bf4073d8d agent: replace unnecessary match Result with map_err
Replace `match Result` whose Ok hand is useless.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 17:58:43 +08:00
Tim Zhang
7f9e5913e0 agent: replace check! with map_err for readability
It's ambiguous and not easy to read to call method use macro.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 17:37:33 +08:00
Tim Zhang
09aca49ed7 agent: remove check! in child process because we cant' see logs.
The check macro will log the errors but the log in child process can't
be seen, just ignore it.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 17:33:16 +08:00
Tim Zhang
a18899f1a3 agent: refactor namespace::setup to optimize error handling
- Replace the return value with anyhow::Result.
- Remove if let Err.
- Remove match.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 17:28:20 +08:00
Tim Zhang
a3c64e5ce5 agent: replace if let Err with or_else
Fixes #934

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 17:27:10 +08:00
Tim Zhang
6ffa8283f0 agent: replace if let Err with map_err
Fixes #934

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-10-15 17:26:40 +08:00
bin liu
863f918a2c rustjail: add length check for uid_mappings in rootless euid mapping
This might be a copy miss, gid_mappings is checked twice, one should
be uid_mappings.

Fixes: #952

Signed-off-by: bin liu <bin@hyper.sh>
2020-10-15 16:43:52 +08:00
Salvador Fuentes
720eab78bb versions: Update Kubernetes, containerd, cri-o and cri-tools
Kubernetes: from 1.17.3 to 1.18.9
CRI-O: from 0eec454168e381e460b3d6de07bf50bfd9b0d082 (1.17) to 1.18.3
Containerd: from 3a4acfbc99aa976849f51a8edd4af20ead51d8d7 (1.3.3) to 1.3.7
cri-tools: from 1.17.0 to 1.18.0

Fixes: #960.
Depends-on: github.com/kata-containers/tests#2958

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-10-14 18:02:37 -04:00
Eric Ernst
71be16c401
Merge pull request #933 from egernst/cgroup-updates
cgroup and cpuset fixes from 1.x
2020-10-14 08:41:52 -07:00