Commit Graph

2981 Commits

Author SHA1 Message Date
Jimmy Xu
fa7d00ec25 vendor: update github.com/intel/govmm
Update github.com/intel/govmm.

shortlog:
    cab4709 qemu: Add pcie-root-port device support.

Fixes: #2432

Signed-off-by: Jimmy Xu <junming.xjm@antfin.com>
2020-02-05 10:52:37 +08:00
Salvador Fuentes
a90dde04c4
Merge pull request #2435 from Pennyzct/arm_ci_bug_fix_2020_2_4
AArch64: fix golint error on ARM CI.
2020-02-04 17:10:02 -06:00
Sebastien Boeuf
b2fb86f3ff virtcontainers: clh: Set the serial to NULL instead of OFF
The guest Linux kernel might try to access the serial port, and in case
the serial is "off", this might cause some slowness because the port is
not emulated at all. Problem is, when the port is not emulated, the
default value when reading the I/O port will be 0, which has a special
meaning in case of the serial port. It means there is some data ready
to be read, which the kernel might try to read for some time, causing
global system slowness.

That's why it's safer to use "null" by default as this means the serial
port will be emulated but anything written to it will be redirected to
/dev/null.

Fixes #2437

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2020-02-04 18:25:31 +01:00
Fupan Li
7d667a92ee
Merge pull request #130 from Tim-Zhang/separate-logging
Agent: Separate logging into a single crate
2020-02-04 22:29:50 +08:00
Yang Bo
3c1252ea79 vsock: support log_vport and debug_console_vport
Fixes: #61, #64

Signed-off-by: Yang Bo <bo@hyper.sh>
2020-02-04 20:32:07 +08:00
Penny Zheng
96a49a894d AArch64: arm ci failed on stale Gopkg.lock.
Arm CI failed on the following error:

Gopkg.lock is out of sync:
github.com/opencontainers/runc/libcontainer/system:
imported or required, but missing from Gopkg.lock's input-imports.

Fixes: #2434

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-02-04 16:33:38 +08:00
Penny Zheng
9bf4b859a1 AArch64: fix golint error on ARM CI.
Recently, ARM CI frequently failed on the following golint error:

Error: pkg/rootless/rootless.go:57:2: comment on exported var
`IsRootless` should be of the form `IsRootless ...` (golint)

Fixes: #2434

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-02-04 12:07:12 +08:00
Tim Zhang
c373f846f5 agent: separate logging into a single crate
Since the codes in logging.rs is weakly related to the project,
separating it from the project will reduce coupling and make it reusable.

Fixes: #131

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-02-03 20:40:26 +08:00
Julio Montes
a91cb13be8
Merge pull request #2425 from haircommander/conmon-bump
versions: bump conmon version to v2.0.5
2020-01-30 11:01:56 -06:00
Peter Hunt
2560e65e75 versions: bump conmon version to v2.0.5
in hopes the old failures were fixed, and to investigate them if not

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2020-01-30 10:31:42 -05:00
Salvador Fuentes
01beb2fda9
Merge pull request #2423 from andreabolognani/virtcontainers-fix-error-message
virtcontainers: Fix error message in mockHypervisor
2020-01-29 13:02:53 -06:00
Archana Shinde
db679fb869
Merge pull request #2418 from devimc/topic/virtcontainers/improveRootless
rootless: use libcontainer API to detect rootless
2020-01-29 09:31:37 -08:00
Andrea Bolognani
693ad23846 virtcontainers: Fix error message in mockHypervisor
The error raised by toGrpc() mentions Firecracker instead of
mockHypervisor, which is incorrect; the fromGrpc() functions
right above it gets this right.

Fixes: #2424

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-01-29 18:19:35 +01:00
Julio Montes
61d826e1b7
Merge pull request #2420 from amshinde/ipv6-support
Add Ipv6 support
2020-01-29 08:15:55 -06:00
Archana Shinde
c5d79eb2c1 ipv6: Add support for ipv6 for netmon as well.
Netmon should now handle ipv6 addresses and routes as well.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-01-28 16:31:31 -08:00
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
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
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
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
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
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
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
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
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
Julio Montes
8057cd72c3 virtcontainers: add function to identify systemd cgroup path
Add function to identify if the given cgroup path is a systemd
cgroup path.
We need to parse the cgroup path to know which cgroup manager we have to use,
since some container engines do not use `--systemd-cgroup` runtime option.

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