Commit Graph

5061 Commits

Author SHA1 Message Date
Archana Shinde
b169476be9 ipv6: Add support for ipv6
Do not ignore ipv6 addresses and routes. These are now processed
along with ipv4 addresses/routes. Add unit tests to verify ipv6.

Fixes #147

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-01-28 14:42:16 -08:00
Julio Montes
4a77b0f8ec rootless: use libcontainer API to detect rootless
libcontainer already has an API to detect if the runtime is running rootless.
Use libcontainer API instead of reinventing the wheel.

fixes #2415

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-28 21:59:51 +00:00
Graham Whaley
b602e62a0e docs: README: Minor grammatical updates
Minor updates on some wording and clarificaitons.

Fixes: #2144

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-01-28 11:04:07 +00:00
Archana Shinde
8cf66ce86b
Merge pull request #923 from devimc/topic/kernel/fixMaxCpus
kernel: use the maximum number of CPUs supported by KVM
2020-01-27 14:37:19 -08:00
GabyCT
7087d7ddc7
Merge pull request #917 from jcvenegas/fix-915
release: use absolute path for kubeconfig
2020-01-27 15:03:10 -06:00
Julio Montes
ba68012480 kernel: use the maximum number of CPUs supported by KVM
Since we don't know how many CPUs can have the host, we should
use the maximum number of CPUs supported by KVM (240).

255 is the maximum number of CPUs supported in the kernel, but the
maximmum number of CPUs recommended by KVM is 240, if more than 240
CPUs are used, next error will be returned by QEMU

```
Number of hotpluggable cpus requested (255) exceeds the
recommended cpus supported by KVM (240)
```

fixes #922
fixes kata-containers/runtime#2413

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-27 20:31:30 +00:00
Jose Carlos Venegas Munoz
f1f9414a59
Merge pull request #2411 from jcvenegas/fix-2397
vendor: update agent client
2020-01-27 12:48:26 -06:00
Salvador Fuentes
03573d4528
Merge pull request #921 from amshinde/config-ipv6-multiple-tables
network: Enable ipv6 config CONFIG_IPV6_MULTIPLE_TABLES
2020-01-27 09:42:08 -06:00
Jose Carlos Venegas Munoz
c26ce18672 vendor: update agent client
Update agent client to improve CI stability.

Changes:

660e61f Revert: client.go: HybridVSockDialer: Change Read EOT to recv peek
6cfb75d Revert: client.go: HybridVSockDialer: Check return size n of unix.Recvfrom
54eb918 Revert: client.go: HybridVSockDialer: Close dup fd after receive packet
2f49115 agent: Fix mem-hotplug on x86 when ARCH_MEMORY_PROBE is set

Fixes: #2397

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-01-27 15:29:52 +00:00
Julio Montes
09dfd79322
Merge pull request #2407 from teawater/virtio-mem2
qemu: Add virtio-mem support
2020-01-27 08:55:03 -06:00
Archana Shinde
e0a57b6a08 network: Enable ipv6 config CONFIG_IPV6_MULTIPLE_TABLES
Although CONFIG_IPV6 is enabled, this additional config is
needed so that multiple route tables are used for ipv6.
Without this, the kernel adds routes for "fe80::/64"
with proto kernel in the main table instead of the
local routing table.
This makes the behaviour similar to regular containers.

Fixes #920

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-01-24 16:14:22 -08:00
Julio Montes
003d0d637a
Merge pull request #589 from devimc/topic/design/updateHostCgroups
design: update host-cgroups documentation according to the new changes
2020-01-24 11:56:59 -06:00
Julio Montes
1fa12cf5a2 design: update host-cgroups documentation according to the new changes
update host-cgroups documentation according to the new changes in the runtime

fixes #588

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-24 15:53:18 +00:00
GabyCT
e416a0ec61
Merge pull request #2409 from devimc/topic/virtcontainers/cgroupsV2
virtcontainers: constrain docker container when sandbox_cgroup_only=true
2020-01-24 08:54:20 -06:00
Hui Zhu
01a12b003b qemu: Add virtio-mem support
This commit adds qemu virtio-mem support.
Then qemu can use virtio-mem support memory resize.

To enable this function, need the Linux and the qemu that support
virtio-mem.
Use command "echo 1 > /proc/sys/vm/overcommit_memory" to enable memory
overcommitment of the Linux kernel.  Because qemu virtio-mem device need
to allocate a lot of memory.
Set "enable_virtio_mem" of kata configuration to true.

Fixes: #2406

Signed-off-by: Hui Zhu <teawater@antfin.com>
2020-01-24 17:19:31 +08:00
Julio Montes
c3cf98aca6 virtcontainers: constrain docker container when sandbox_cgroup_only=true
The sandbox cgroup will be constrained if there is no container
type annotation, otherwise kata will rely on container engine's cgroup
configuration

Depends-on: github.com/kata-containers/tests#2255

fixes #2408

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-23 21:25:22 +00:00
GabyCT
a51efa9ada
Merge pull request #587 from dong-liuliu/xliu2/spdk-vhost-user
use-cases: Add initial SPDK vhost-user instructions
2020-01-23 13:35:36 -06:00
Graham Whaley
ec13b28567
Merge pull request #2404 from c3d/minor-fixes
Fix typo in 'sandbox'
2020-01-23 09:37:04 +00:00
Julio Montes
54482f18df virtcontainers: remove json cgroups struct tag
json struct tags are not longer needed in sandbox's structures

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-22 22:40:35 +00:00
Hui Zhu
b337428947 vendor: Update github.com/intel/govmm
Update github.com/intel/govmm.

shortlog:
    6667f4e qmp_test: Add TestExecMemdevAdd and TestExecQomSet
    201fd0a qmp: Add ExecMemdevAdd and ExecQomSet API
    e04be2c qmp: add ExecutePCIVhostUserDevAdd API
    13aeba0 qmp: support command 'chardev-remove'
    6d6b2d8 s390x: add s390x travis support

Fixes: #2406

Signed-off-by: Hui Zhu <teawater@antfin.com>
2020-01-22 13:50:54 +08:00
Liu Xiaodong
7f5873159a use-cases: Add initial SPDK vhost-user instructions
These instructions cover how to install and setup SPDK
vhost-user target, construct a vhost-user-blk device based
memory, configure the vhost-user-blk device to be available
for kata container, and run kata container with SPDK
vhost-user-blk device via docker.

Fixes: #586

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-01-21 22:34:38 -05:00
Archana Shinde
4d47c3fa8d
Merge pull request #585 from jodh-intel/add-debian-10
docs: Add Debian 10 to distro table
2020-01-21 16:56:22 -08:00
Christophe de Dinechin
316b5f2b2c virtcontainers: Fix typo in logger message
There is a typo "sandox" instead of "sandbox" in a logger warning

Fixes: #2405

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-01-21 17:04:33 +01:00
Julio Montes
7526f4957d
Merge pull request #398 from devimc/topic/imagebuilder/configureDockerRuntime
image-builder: make docker runtime configurable
2020-01-20 16:19:37 -06:00
Julio Montes
c407421a26 image-builder: make docker runtime configurable
Add DOCKER_RUNTIME variable to change container runtime depending on the
CI/environment.

fixes #397

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-20 20:39:04 +00:00
Julio Montes
73a63baab5
Merge pull request #2308 from tedyu/mount-detach-device
vc: Detach device when unable to store sandbox device
2020-01-20 14:14:11 -06:00
Ted Yu
1f957e1b87 vc: Detach device when unable to store sandbox device
In Container#mountSharedDirMounts, if sandbox.storeSandboxDevices() returns error, we should detach the device.

Fixes #2301

Signed-off-by: Ted Yu yuzhihong@gmail.com
2020-01-20 09:39:19 -08:00
Julio Montes
df802cc359
Merge pull request #2399 from Pennyzct/cleanup_dir_temp
unit-test: cleaning up stale files under /tmp
2020-01-20 09:38:55 -06:00
Julio Montes
ae6d43470a
Merge pull request #583 from grahamwhaley/20200115_toc_doc
docs: reqs: add link/recommendation to check-markdown
2020-01-20 08:43:10 -06:00
James O. D. Hunt
b5e741ba8b
Merge pull request #125 from lifupan/fix_agent_crash
agent: fix the issue of crash agent without spec
2020-01-20 11:29:16 +00:00
James O. D. Hunt
174f9abee8
Merge pull request #127 from lifupan/fix_cwd
fix the issue of missing restore process's cwd
2020-01-20 11:28:11 +00:00
James O. D. Hunt
e45be66e72 docs: Add Debian 10 to distro table
Now that [1] has landed, update the list of supported distros to include
Debian 10.

[1] - https://github.com/kata-containers/packaging/issues/647

Fixes: #584.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-01-20 09:34:13 +00:00
fupan.lfp
2be8661ffa agent: fix the issue of missing restore process's cwd
It should restore to it's previous cwd after it
create container in which it would change it's
cwd to container's bundle path.

Fixes: #126

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-01-20 11:00:48 +08:00
fupan.lfp
6c7453db78 agent: fix the issue of crash agent without spec
To check is the oci spec passed in, other wise,
it would crash the agent unwrap it directly.

Fixes: #124

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-01-18 18:26:01 +08:00
Julio Montes
0e4c497c68
Merge pull request #395 from fidencio/wip/cleanup_nsdax
image_builder: Remove nsdax binary after its usage
2020-01-17 10:33:28 -06:00
Fabiano Fidêncio
98ac62dec9 image_builder: Remove nsdax binary after its usage
Leaving nsdax behind may create some isses for the distro packages
of kata-osbuilder, as every package would have to take care of purging
the file on each distro.

Knowing that, we better remove the file as part of the script, mainly
because the file is already regenerated everytime in any case.

Fixes: #394

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-01-17 13:30:11 +01:00
Penny Zheng
7186c01d6e unit-test: delete what ioutil.TempFile creates
ioutil.TempFile creates a new temporary file in the directory dir.
It is the caller's responsibility to remove the file
when no longer needed.

Fixes: #2398

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-01-17 15:29:50 +08:00
Penny Zheng
0244d95edd unit-test: delete what ioutil.TempDir() creates
Normally, ioutil.TempDir will create a new temporary
dir under /tmp.
And we should do cleaning up after ioutil.TempDir().

Fixes: #2398

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-01-17 13:50:51 +08:00
Penny Zheng
aa62781aa7 unit-test: reconstuct TestMain
os.Exit will skip all deferred instructions.
So we should reconstruct TestMain to leave all setup-related
code in setup(), and all cleanup-related code in shutdown().

Fixes: #2398

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-01-17 13:50:42 +08:00
Julio Montes
d11696de9a
Merge pull request #2351 from devimc/topic/virtcontainers/cgroupsV2
support systemd cgroups and cgroupsV2
2020-01-16 16:37:40 -06:00
Graham Whaley
1af686c18d docs: reqs: add link/recommendation to check-markdown
Recommend the use of our own check-markdown tool to generate
TOCs.

Fixes: #582

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-01-16 10:02:20 +00:00
Jose Carlos Venegas Munoz
0751072ca7 release: use absolute path for kubeconfig
Use absolute path to kubeconfig to allow kubectl use it.

Fixes: #915

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-01-15 21:06:27 +00:00
Jose Carlos Venegas Munoz
94f4955167
Merge pull request #912 from jcvenegas/fix-911
actions: check for packaging before clone
2020-01-15 14:29:43 -06:00
GabyCT
6860373107
Merge pull request #906 from jcvenegas/fix-905
release: bump kata-containers repository
2020-01-15 13:18:00 -06:00
Julio Montes
d042d5c0da virtcontainers: fix unit tests
fix unit test that may need a cgroup path or root to create a new cgroup

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-15 19:03:36 +00:00
Julio Montes
776da0878e virtcontainers/hook: fix HookState
`HookState` was removed from libcontainer, fortunately it was an alias for
`specs.State`, use `specs.State` instead.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-15 19:03:36 +00:00
Julio Montes
f372b85848 virtcontainers: reimplement setupSandboxCgroup
Reimplement `setupSandboxCgroup` to support cgroupsV2 and systemd cgroups
using libcontainer instead of containerd/cgroups.
As an initial effort to support these cgroups, `sandbox_cgroup_only` must
be set to `true` in configuration file.

fixes #2350

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-15 19:03:36 +00:00
Julio Montes
9949daf4dc virtcontainers: move validCgroupPath
move `validCgroupPath` to `cgroups.go` since it's cgroups specific.
Now `validCgroupPath` supports systemd cgroup path and returns a cgroup path
ready to use, calls to `renameCgroupPath` are no longer needed.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-15 19:03:36 +00:00
Julio Montes
ce2795e949 virtcontainers: remove systemd paramenter from constraintGRPCSpec
systemd paramenter is no longer needed since `isSystemdCgroup` function
can be used to know if the cgroup path is a systemd cgroup path.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-15 19:03:36 +00:00
Julio Montes
8c63c18098 virtcontainers: add function to create a new cgroup manager
Add function to create a new cgroup manager depending on the cgroups path and
if the runtime is running rootless.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-01-15 19:03:36 +00:00