Commit Graph

1973 Commits

Author SHA1 Message Date
Julio Montes
0832294ba1 pkg/katautils: Do not set init in the kernel command line
Currently kata sets the init process to systemd even when it isn't installed,
the criteria to determinate whether systemd is used as init or not
is very odd, since kata only checks whether the `image` option is set in the
configuration file, unfortunately not all images have systemd installed.
Instead kata should rely on the guest kernel and `osbuilder` to use the right
init process. `osbuilder` creates a symbolic link to `systemd` or `kata-agent`
depending on the `AGENT_INIT` environment variable.

fixes #1937

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-06 15:45:19 +00:00
Ace-Tang
20587519cd shim-v2: fix shim leak when hypervisor exit unexpectly
Fixes: #1929

in containerd-kata-v2, container can only be deleted in Delete
interface, or other shim operates(like kill/delete) all fails
since can not get container info.

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-08-06 15:48:26 +08:00
Eryu Guan
a9168a3fc9 virtiofs: wait for virtiofsd process to release its resources
We start virtiofsd in foreground (-f option), so we should wait for it
to reclaim its resources to avoid zombie process when qemu or virtiofsd
got killed unexpectedly.

Fixes: #1934
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
2019-08-06 14:55:22 +08:00
Jose Carlos Venegas Munoz
00e0aaa6e4
Merge pull request #1924 from ganeshmaharaj/vhost-fs-hotplug-cache-error
virtiofs: fix virtiofs crash when cache=none
2019-08-02 15:47:35 -05:00
James O. D. Hunt
4de74b4d67
Merge pull request #1928 from ganeshmaharaj/ignore-arcn-toml
acrn: Add toml to gitignore
2019-08-02 09:18:51 +01:00
Ganesh Maharaj Mahalingam
263fb64ec6 acrn: Add toml to gitignore
Add acrn's generated configuration toml file to the gitignore list.

Fixes: #1927
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2019-08-01 13:38:57 -07:00
Ganesh Maharaj Mahalingam
6e1e6a2297 virtiofs: fix virtiofs crash when cache=none
When virtio_fs_cache is set to none, the mount options for the folder
inside the guest should not contain the dax option else it leads to
invalid address errors and a crash of the daemon on the host.

Fixes: #1907
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2019-08-01 13:26:34 -07:00
Eric Ernst
74157c8b2b
Merge pull request #1861 from jcvenegas/k8s-1.15
versions: Upgrade to k8s 1.15
2019-07-31 21:30:41 -07:00
Ace-Tang
50c3e56aeb network: fix failed to remove network
in create sandbox, if process error, should remove network without judge
NetNsCreated is true, since network is created by kata and should be
removed by kata, and network.Remove has judged if need to delete netns
depend on NetNsCreated

Fixes: #1920

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-07-30 20:17:09 +08:00
Jose Carlos Venegas Munoz
0d0a84e903 versions: Upgrade to k8s 1.15
Bump CI to kubernetes 1.15.

Fixes: #1860

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-07-29 15:11:21 -05:00
Julio Montes
3255640d54
Merge pull request #1914 from devimc/topic/virtcontainers/supportSMPDie
virtcontainers: support SMP die
2019-07-26 18:03:56 -05:00
Julio Montes
7668aeb526 virtcontainers: support SMP die
CPU topology has changed in QEMU 4.1: socket > die > core > thread.
die option must be specified in order to hotplug CPUs on x86_64

Depends-on: github.com/kata-containers/packaging#657

fixes #1913

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-07-26 21:18:24 +00:00
Julio Montes
104c04d28f vendor: update govmm
Shortlog:
68cdf64 test: add cpu topology tests
e0cf9d5 qmp: add checks for the CPU toplogy
a5c1190 qemu: support x86 SMP die

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-07-26 16:53:28 +00:00
Jose Carlos Venegas Munoz
4bd3ea848d
Merge pull request #1895 from Ace-Tang/pass-vendor-to-qmp
qemu: support vfio pass x-pci-vendor-id and x-pci-device-id pass
2019-07-26 11:39:39 -05:00
James O. D. Hunt
792504eee2
Merge pull request #1910 from amshinde/remove-nested-vendor-dir
Remove nested vendor dir
2019-07-25 09:16:23 +01:00
Fupan Li
943136e18b
Merge pull request #1899 from bergwolf/ut
Fix UT failures with non-root
2019-07-25 11:46:08 +08:00
Archana Shinde
e41a6b94f9 vendor: Update vendor directories
Update top-level vendor with
"dep ensure add github.com/blang/semver@3.6.1"
dep check should not succeed.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-07-24 14:33:44 -07:00
Archana Shinde
95e8a7a15c dep: Remove nested vendor directories
It is not really recommended to have nested vendor directories.
dep does not work well with nested directories:
https://github.com/golang/dep/issues/985
Recommendation is to use flatten the vendor directories.

Hence remove any nested vendor directories.

Fixes #1909

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-07-24 14:33:22 -07:00
Eric Ernst
6ce5f30d6c
Merge pull request #1889 from WeiZhang555/persist-data
persist: manage "hypervisor.json" with new store
2019-07-23 08:19:11 -07:00
Wei Zhang
f3d0978c3f persist: improve readability
Address some comments for code readability, also add some unit tests.

Signed-off-by: Wei Zhang <weizhang555.zw@gmail.com>
2019-07-23 17:10:00 +08:00
Wei Zhang
3bfbbd666d persist: merge "network.json"
Merge "network.json" into "persist.json" so that new store can manage
network part.

Signed-off-by: Wei Zhang <weizhang555.zw@gmail.com>
2019-07-23 17:10:00 +08:00
Wei Zhang
99cf3f80d7 persist: merge "agent.json"
Manage "agent.json" with new store.

Signed-off-by: Wei Zhang <weizhang555.zw@gmail.com>
2019-07-23 17:10:00 +08:00
Wei Zhang
7d5e48f1b5 persist: manage "hypervisor.json" with new store
Fixes #803

Merge "hypervisor.json" into "persist.json", so the new store can take
care of hypervisor data now.

Signed-off-by: Wei Zhang <weizhang555.zw@gmail.com>
2019-07-23 17:09:11 +08:00
Hui Zhu
688732adee
Merge pull request #1897 from bergwolf/monitor
improve robustness w.r.t. dead hypervisor
2019-07-23 16:56:06 +08:00
Peng Tao
d5d7d82eeb vc: move container mount cleanup to container.go
For one thing, it is container specific resource so it should not
be cleaned up by the agent. For another thing, we can make container
stop to force cleanup these host mountpoints regardless of hypervisor
and agent liveness.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:29:32 -07:00
Peng Tao
e02f6dc067 shimv2: monitor sandbox liveness
When sandbox quits unexpected, clean things up as much as we can.

Fixes: #1896
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:29:32 -07:00
Peng Tao
262484de68 monitor: watch hypervisor
When hypervisor process is dead, notify watchers and mark agent dead.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:29:32 -07:00
Peng Tao
67c401c059 agent: use hypervisor pid as backup proxy pid for non-kata proxy cases
Then we can check hypervisor liveness in those cases to avoid long
timeout when connecting to the agent when hypervisor is dead.

For kata-agent, we still use the kata-proxy pid for the same purpose.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:29:32 -07:00
Peng Tao
835b6e9e1b sandbox: do not fail SIGKILL
Once we have found the container, we should never fail SIGKILL.
It is possible to fail to send SIGKILL because hypervisor might
be gone already. If we fail SIGKILL, upper layer cannot really
proceed to clean things up.

Also there is no need to save sandbox here as we did not change
any state.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:29:32 -07:00
Peng Tao
bc4460e12f sandbox: support force stop
When force is true, ignore any guest related errors. This can
be used to stop a sandbox when hypervisor process is dead.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:29:32 -07:00
Peng Tao
4130913ed7 agent: mark agent dead when failing to connect
Whenever we fail to connect, do not make any more attempts.
More attempts are possible during cleanup phase but we should
not try to connect any more there.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:27:52 -07:00
Peng Tao
c472a01006 container: allow to stop a paused container
When a container is paused and something goes terribly
wrong, we still need to be able to clean thing up. A paused
container should be able to transit to stopped state as well
so that we can delete it properly.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:27:52 -07:00
Peng Tao
f886c0bf35 vc: drop container SetPid API
It is not used by anyone.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:27:52 -07:00
Salvador Fuentes
ff5f1b4273
Merge pull request #1890 from devimc/topic/virtcontainers/useTestity
virtcontainers: convert virtcontainers tests to testify/assert
2019-07-22 16:17:24 -05:00
Archana Shinde
c7af16d363
Merge pull request #1904 from GabyCT/topic/checkgo
ci: Allow travis to use go install script
2019-07-22 11:36:59 -07:00
Gabriela Cervantes
f2e6a31dfc ci: Allow travis to use go install script
This allows travis to use the go install script instead of having a
hard coded golang version at travis.yml

Fixes #1903

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2019-07-22 02:07:56 -05:00
Eric Ernst
37c2872f29
Merge pull request #1892 from egernst/1.9.0-alpha0-branch-bump
# Kata Containers 1.9.0-alpha0
2019-07-19 11:56:16 -05:00
Peng Tao
3063391334 ut: skip TestBindUnmountContainerRootfsENOENTNotError for non-root
mount syscall requires root.

Fixes: #1898
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-19 08:44:51 -07:00
Peng Tao
c4583f4486 ut: skip TestStartNetworkMonitor for non-root
It requires root to manipulate netns and otherwise fails
like below:

=== RUN   TestStartNetworkMonitor
--- FAIL: TestStartNetworkMonitor (0.00s)
        Error Trace:    sandbox_test.go:1481
        Error:          Expected nil, but got: &errors.errorString{s:"Error switching to ns /proc/6648/task/6651/ns/net: operation not permitted"}

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-19 08:36:43 -07:00
Julio Montes
f2423e7d7c virtcontainers: convert virtcontainers tests to testify/assert
Convert virtcontainers tests to testify/assert to make the virtcontainers
tests more readable.

fixes #156

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-07-19 15:28:45 +00:00
Ace-Tang
50e263d943 qemu: support vfio pass x-pci-vendor-id and x-pci-device-id pass
since some vendor id like 1ded can not be identified by virtio-pci
driver, so need to pass a specified vendor id to qemu.

Fixes: #1894

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-07-19 21:04:22 +08:00
Ace-Tang
2cf4189244 vendor: update github.com/intel/govmm
update to commit 52b2309a55

Fixes: #1894

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-07-19 20:57:21 +08:00
Eric Ernst
f28de59210 release: Kata Containers 1.9.0-alpha0
- qemu: use x-ignore-shared to implement vm template
- virtiofs: Allow memory hotplug with virtiofs
- Firecracker Add jailer support for firecracker
- runtime: update govmm and move to virtio 1.0 for hotplugs
- HV: kata-runtime support for ACRN hypervisor
- versions: add crictl version which is compatible with OpenShift
- versions: update CRI-O to v1.14.6
- Fix fork exec test errors
- ci: Verify and block merge if other projects are not updated
- shimv2: Add missing page size to Hugetlb Stat

d14968b qemu: use x-ignore-shared to implement vm template
d392b22 virtiofs: Allow memory hotplug with virtiofs
050f8e9 runtime: Disable disable-modern for virtio QMP add
3e4989d vendor: update govmm and match code
4fed346 Firecracker: Enable jailer by default
78ea50c virtcontainers: Jailer: Add jailer support for firecracker
98a6973 virtcontainers: Add ACRN unit test cases
f246a79 virtcontainers: Add support for updating virtio-blk based container rootfs
d9a4157 virtcontainers: Add support for launching/managing ACRN based VMs
828e0a2 pkg/katautils: Add support for ACRN hypervisor config
adcac93 kata-check: Check and validate type-1 hypervisor for kata
4d26cee Make: Add ACRN hypervisor and generate configuration file
bdd8947 versions: add crictl version which is compatible with OpenShift
098501a versions: update CRI-O to v1.14.6
4968438 tests: Fix fork/exec test error
fcf9f9f test: Fix fd leak causing test error
5182a25 ci: Verify and block merge if other projects are not updated
da7f5f3 shimv2: Add missing page size to Hugetlb Stat

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-07-18 12:49:54 -07:00
Peng Tao
d987a30367
Merge pull request #1799 from bergwolf/template
qemu: use x-ignore-shared to implement vm template
2019-07-18 10:38:59 +08:00
Salvador Fuentes
e89195e70e
Merge pull request #1810 from ganeshmaharaj/virtiofs-hotplug
virtiofs: Allow memory hotplug with virtiofs
2019-07-17 09:21:26 -05:00
Peng Tao
d14968b66a qemu: use x-ignore-shared to implement vm template
qemu upstream has x-ignore-shared that works similar
to our private bypass-shared-memory. We can use it to
implement the vm template feature.

Fixes: #1798
Depends-on: github.com/kata-containers/packaging#641
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-17 05:37:22 -07:00
GabyCT
bc15e44245
Merge pull request #1649 from mcastelino/topic/jail
Firecracker Add jailer support for firecracker
2019-07-12 12:05:16 -05:00
Ganesh Maharaj Mahalingam
d392b22ee4 virtiofs: Allow memory hotplug with virtiofs
Kata with virtio-fs fails to do memory hotplugging. This is caused by
the fact that hot plugged memory is always backed by
'memory-backend-ram' while virtio-fs expects it to be backed by file and
shared for it to be able to use the system the way it is intended. This
chnage allows using file based memory backend for virtio-fs, hugepages
or when the user prefers to use a file backed memory

Fixes: #1745
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2019-07-12 09:25:30 -07:00
Manohar Castelino
3bd4bb66fb
Merge pull request #1868 from ganeshmaharaj/revert-virtio-disable-modern
runtime: update govmm and move to virtio 1.0 for hotplugs
2019-07-12 09:07:37 -07:00
Ganesh Maharaj Mahalingam
050f8e9715 runtime: Disable disable-modern for virtio QMP add
History: the previous version of kvm (unknown) and qemu-lite had an
issue using virtio 1.0 version when it came to device hotplug, which led
to the team to disable 1.0 version of virtio for hotplug (set
disable-modern=on). Please check
e99f6b2931
for further info.

We have since moved to QEMU4.0 and probably a later version of kvm as
default across all distros. This change is to move to virtio 1.0 for
hotplugging devices.

Fixes: #1870
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2019-07-11 20:16:15 -07:00