Commit Graph

1572 Commits

Author SHA1 Message Date
Hui Zhu
19115ef5f1 kata_proxy: Set Setsid to true when exec kata-proxy
There is an issue that ctrl-c stop vmcache server will stop all
containers that its VM is created by it.
The cause is kata-proxy and vmcache server use same tty, for example:
ps -e | grep kata
3617 pts/5    00:00:00 kata-runtime
3636 pts/5    00:00:00 kata-proxy
Ctrl-c will send signal to both kata-proxy and vmcache server.
Then the containers that its VM is created by this vmcache server will
quit with it.

Set Setsid to true when exec kata-proxy to handle this issue.

Fixes: #1726

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-05-23 11:47:53 +08:00
Salvador Fuentes
587b59ebfc
Merge pull request #1465 from jcvenegas/versions-containerd-1.2
versions: Update cri-containerd  yaml
2019-05-22 16:35:55 -05:00
Julio Montes
618ae4d03b
Merge pull request #1722 from Ace-Tang/rm-ns
shimv2: remove use containerd ns as netns
2019-05-22 09:49:40 -05:00
Julio Montes
7b9a9ffb79
Merge pull request #1723 from lifupan/fixcleanup
fix the issue of hypervisor process is killed by kubelet
2019-05-22 08:44:37 -05:00
Julio Montes
82e51d42ab data: Revert pull request #1405
The rootfs image was fixed, now the DAX metadata and 2 MBRs headers are part
of the same image. Mounting the rootfs partiton with an offset of 2M is no
more needed, since the first MBR is read by partx or losetup by default.

fixes #1443

Signed-off-by: Julio Montes julio.montes@intel.com
2019-05-22 08:18:05 -05:00
lifupan
f301c957f6 shimv2: shutdown the sandbox when sandbox container exited
Kubelet would cleanup the pod cgroup resources and kill the processes
in the pod cgroups when it detected all of the containers in a pod exited,
thus shimv2 should close the hypervisor process once the podsandbox container
exited, otherwise, the hypervisor process would be killed by kubelet and
made shimv2 failed to shutdown the sandbox.

Fixes:#1672

Signed-off-by: lifupan <lifupan@gmail.com>
2019-05-22 06:32:27 +00:00
Ace-Tang
d6b3bffad8 shimv2: remove use containerd ns as netns
```
//the network namespace created by cni plugin
netns, err = namespaces.NamespaceRequired(ctx)
if err != nil {
        return nil, errors.Wrap(err, "create namespace")
}
```

the netns is a containerd namespace concept, it not netns, event a cni
set netns for this, this is a tricky way, so remove the logic.

Fixes: #1692

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-05-22 12:20:57 +08:00
lifupan
0d535f56e5 shimv2: kill a container return directly once the container termianted
According to CRI specs, kubelet will call StopPodSandbox()
at least once before calling RemovePodSandbox, and this call
is idempotent, and must not return an error if all relevant
resources have already been reclaimed. And in that call it will
send a SIGKILL signal first to try to stop the container, thus
once the container has terminated, here should ignore this signal
and return directly.

Fixes:#1672

Signed-off-by: lifupan <lifupan@gmail.com>
2019-05-22 04:14:12 +00:00
Julio Montes
e2d894d52a
Merge pull request #1717 from chavafg/topic/fix-static-checks
ci: Build kata-runtime before running static checks
2019-05-21 16:20:53 -05:00
Julio Montes
19288aab46 data/kata-collect-data: support kata containers snap
Use `kata-containers.runtime` that is the runtime binary, to
collect the data if the kata-runtime binary is not installed

fixes #1720

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-05-21 15:57:13 -05:00
Salvador Fuentes
0d98e248ff ci: Build kata-runtime before running static checks
We need to build kata-runtime to have the correct files
in place to be able to run the static checks script.

Fixes #1716.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-05-21 11:56:14 -05:00
Graham Whaley
f4da3f585a
Merge pull request #1309 from nitkon/unitTestFail
virtcontainers: Set test qemu version for unit test
2019-05-21 09:45:22 +01:00
lifupan
5e1f5ca735 shimv2: fix the issue of passing the wrong container id
It should pass the container id instead of sandbox id.

Fixes:#1672

Signed-off-by: lifupan <lifupan@gmail.com>
2019-05-21 16:40:52 +08:00
Fupan Li
100db8abdc
Merge pull request #1670 from xs3c/fix-vfio-hang
shim v2: Close vhostfd after vm get vhostfd
2019-05-21 14:53:26 +08:00
Nitesh Konkar
f7cc028891 vc:Execute TestQemuPPC64leMemoryTopology depending on qemu version
Set qemu major/minor version when
running unit test TestQemuPPC64leMemoryTopology
on ppc64le & execute the unit test accordingly.

Fixes: #1308

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
2019-05-20 22:37:30 +05:30
James O. D. Hunt
0fce78ccf6
Merge pull request #1682 from jodh-intel/add-missing-docs
Add missing docs
2019-05-20 17:50:48 +01:00
Xu Wang
3d4729d6b2
Merge pull request #1701 from bergwolf/debug-console
agent: fix agent debug console
2019-05-20 18:21:28 +08:00
Peng Tao
7381cd5b3f agent: fix agent debug console
We should not let shim or proxy read guest console socket if
agent debug console is set. Otherwise when we connect to it with
socat, it reads nothing since all output is read by the shim.

Fixes: #1700
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-05-17 19:59:18 -07:00
Archana Shinde
2744c94eb3
Merge pull request #1703 from nitkon/fixunittest
virtcontainers: Set correct Shmsize for ppc64le
2019-05-17 17:32:20 -07:00
Jose Carlos Venegas Munoz
b203fdb4a0 versions: Update cri-containerd yaml
Use only one version to install cri-contaienrd

- version could be a containerd version or a commit of the cri
repository.

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

Fixes: #1464

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-05-17 14:54:20 -05:00
Eric Ernst
e0dda36b5f
Merge pull request #1708 from chavafg/topic/machinetype-nemu
nemu-config: Add machine_type to config file
2019-05-17 12:12:55 -07:00
Salvador Fuentes
56ff870558
Merge pull request #1705 from devimc/topic/katautils/removeSystemdMasks
katautils: don't mask systemd units
2019-05-17 12:14:34 -05:00
Salvador Fuentes
6be5e5f182 nemu-config: Add machine_type to config file
nemu needs to be configured with:
`machine_type = "virt"` by default.

In addition, this commit removes
`machine_accelerators="virt"` which was added instead
of `machine_type` in a previous commit.

Fixes: #1707.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-05-17 11:29:14 -05:00
James O. D. Hunt
47d255a350
Merge pull request #1691 from bergwolf/virtiofsd
Add virtiofsd log and fix qemu hang due to virtiofsd vq setup failure
2019-05-17 16:26:52 +01:00
Nitesh Konkar
1789b65c93 virtcontainers: Set correct Shmsize for ppc64le
Fix the test case TestGetShmSizeBindMounted by
setting the right ShmSize for ppc64le.

Fixes: #1702

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
2019-05-17 18:54:28 +05:30
Julio Montes
d66d855e08 katautils: don't mask systemd units
The systemd units and files that are not needed in Kata Containers,
are removed when the image is created, therefore we don't need to mask
them.

fixes #1704

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-05-17 07:38:11 -05:00
Peng Tao
10c14bcb38
Merge pull request #1694 from marcov/bump-go-version
versions: Update golang to 1.11.10
2019-05-17 19:34:08 +08:00
Peng Tao
95d433c70b
Merge pull request #1679 from teawater/vmcache_defunct_proxy
kata_proxy: Open a special goroutine do cmd.Wait
2019-05-17 17:55:08 +08:00
Graham Whaley
7e0a3cc401
Merge pull request #1697 from GabyCT/topic/updatecrioversion
versions: Update CRI-O version to 1.14.1
2019-05-17 09:31:08 +01:00
Peng Tao
89e0dfae11 qemu: stop qemu process when virtiofsd quits
If virtiofsd fails to initialize and stops unexpected,
qemu might hang forever. We just stop the qemu process.
Resource cleanup will be done by others.

Fixes: #1690
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-05-16 20:29:58 -07:00
Peng Tao
d0aae80f55 qemu: print virtiofsd logs when debug is on
To help trace virtiofsd issues.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-05-16 20:29:58 -07:00
Archana Shinde
90539ac31b
Merge pull request #1676 from zhabinecho/fix-veth-arp-bug
network: delete IP addrs on bridge model to prevent ARP conflict
2019-05-16 15:14:24 -07:00
Marco Vedovati
c22b15d122 versions: Update golang to 1.11.10
Set the minimum golang version to 1.11.10, the latest stable 1.11 version
at the time of writing. Go 1.11 is required to build the agent with working
vsock support.

Fixes: #1693

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-05-16 19:03:19 +02:00
Manohar Castelino
d4f4644312
Merge pull request #1688 from egernst/1.7.0-branch-bump
# Kata Containers 1.7.0
2019-05-16 08:19:39 -07:00
Marco Vedovati
f89834a276 virtcontainers: avoid unnecessary error checking in startVM
Remove redundant error checking in startVM.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-05-16 12:31:51 +02:00
Marco Vedovati
a27a3e7049 virtcontainers: kill hypervisor if startSandbox fails
Make sure the hypervisor is stopped if startSandbox does not succeed, by
calling stopSandbox.

Fixes: #1636

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-05-16 12:31:51 +02:00
Gabriela Cervantes
5d527d719e versions: Update CRI-O version to 1.14.1
Now that CRI-O released a new version we can update it.

Fixes #1696

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2019-05-16 05:17:08 -05:00
Peng Tao
17079532bf
Merge pull request #1668 from WeiZhang555/use-newstore
persist: merge more files with `persist.json`
2019-05-16 17:38:30 +08:00
Graham Whaley
f382cec9e7
Merge pull request #1687 from devimc/topic/katautils/maskSystemdPackages
pkg/katautils: improve boot time disabling systemd units
2019-05-16 09:24:59 +01:00
Yang, Wei
071030b784 shimv2: Close vhostfd after vm get vhostfd
If kata containers is using vfio and vhost net,the unbinding
of vfio would be hang. In the scenario, vhost net kernel thread
takes a reference to the qemu's mm, and the reference also includes
the mmap regions on the vfio device file. so vhost kernel thread
would be not released when qemu is killed as the vhost file
descriptor still is opened by shim v2 process, and the vfio device
is not released because there's still a reference to the mmap.

Fixes: #1669

Signed-off-by: Yang, Wei <w90p710@gmail.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-05-16 13:31:11 +08:00
Eric Ernst
99acea93a9 release: Kata Containers 1.7.0
- Networking: Ensure that network namespace is propagated
- nemu-config: adjust defaults in configuration-nemu.toml
- support-vsock: load vhost_vsock module if it isn't built-in

bce0d60 unit-test: refine unit test
9b23d4f vsock_module: add 'vhost_vsock' kernel module in kata-check
f21d5a3 Support_vsock: only need to check whether device 'vhost_vsock' exists
09a7d15 nemu-config: adjust defaults in configuration-nemu.toml
66b93c7 Networking: Ensure that network namespace is propagated

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-05-15 17:44:36 -07:00
Julio Montes
a5e3550d4c pkg/katautils: improve boot time disabling systemd units
There are still some systemd units that fail to start for different
reasons. Disable these systemd units to improve boot time.

fixes #1686

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-05-15 12:12:47 -05:00
James O. D. Hunt
da2749c44d docs: Add missing docs
Add a few minimal documents to allow all the documentation in this
repository to be navigated from the top-level README.

Fixes #1681.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-05-15 16:28:29 +01:00
James O. D. Hunt
1563263c0d docs: Simplify link
Use a markdown link rather than a URL for virtcontainers docs.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-05-15 16:20:54 +01:00
Zha Bin
bdb1047a67 network: delete IP addrs on bridge model to prevent ARP conflict
Fixes: #1673

Signed-off-by: Zha Bin <zhabin@linux.alibaba.com>
2019-05-15 22:48:23 +08:00
Hui Zhu
00d03c1022 kata_proxy: Open a special goroutine do cmd.Wait
Got a defunct kata-proxy after kata quit when VMCache is enabled.
The reason is vmcache server opens kata-proxy but doesn't wait it.

If VMCache is disabled, kata-runtime will quit before kata-proxy.
So it will not meet the issue.

Open a special goroutine do cmd.Wait in kataProxy.start to handle
the isssue.

Fixes: #1678

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-05-15 21:36:26 +08:00
James O. D. Hunt
86d51f59d4
Merge pull request #1665 from mcastelino/topic/bug_fix_1664
Networking: Ensure that network namespace is propagated
2019-05-15 09:25:44 +01:00
Jose Carlos Venegas Munoz
8c04600684
Merge pull request #1663 from egernst/nemu-config-adjustments
nemu-config: adjust defaults in configuration-nemu.toml
2019-05-14 10:51:01 -05:00
James O. D. Hunt
576b8a510c
Merge pull request #1513 from Pennyzct/vsock
support-vsock: load vhost_vsock module if it isn't built-in
2019-05-14 11:08:48 +01:00
Penny Zheng
bce0d604e1 unit-test: refine unit test
We should refine unit test which involves func SupportsVsocks and newly
reconstructed struct kernelModule.

Fixes: #1512

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-05-14 13:31:25 +08:00