Commit Graph

5325 Commits

Author SHA1 Message Date
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
Jianyong Wu
17512dc3cb nemu: enable compile nemu for arm64 on x86 host
This patch enable compile nemu for arm64 in container
on x86 host.

fixed: #577
Signed-off-by: Jianyong Wu  <jianyong.wu@arm.com>
2019-07-22 17:46:41 +08: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
Marco Vedovati
8ebaac02d1 rootfs: move code from rootfs.sh to lib.sh
Move some of the functions in rootfs.sh (generate_dockerfile,
detect_go_version) in scripts/lib.sh, to make those functions reusable
outside of rootfs.sh.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-07-20 09:01:03 +02:00
Eric Ernst
3655b4c197
Merge pull request #445 from grahamwhaley/20190424_minikube_docs
install: Add minikube instructions
2019-07-19 17:11:16 -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
Jose Carlos Venegas Munoz
cd9ab72636
Merge pull request #333 from egernst/1.9.0-alpha0-branch-bump
# Kata Containers 1.9.0-alpha0
2019-07-18 16:23:19 -05: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
Eric Ernst
bdbc806770 release: Kata Containers 1.9.0-alpha0
- rootfs: upgrade docker images for fedora
- rootfs: Make sure etc exists.

edb770e rootfs: upgrade docker images for fedora
27dddf0 rootfs: Make sure etc exists.

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-07-18 12:49:36 -07:00
Graham Whaley
8e29464b46 install: README: add Minikube entry
Add Minikube to the list of 'cloud' providers installation instructions.
Whilst there, order the list alphabetically.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2019-07-18 13:28:55 +00:00
Graham Whaley
f97fe323a1 install: add Minikube installation instructions
Add instructions of how to setup and install Kata under
Minikue.

Fixes: #444

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2019-07-18 13:28:55 +00:00
Chengguang Xu
097156d837 docs: Fix workaround solution for ConfigPath
In the workaround solution of ConfigPath, there is a '$@'
missing in the script, so add it.

Fixes: #515

Signed-off-by: Chengguang Xu <cgxu519@zoho.com.cn>
2019-07-18 20:20:12 +08:00
James O. D. Hunt
dfda61c681
Merge pull request #510 from eadamsintel/qat-with-kata
QAT: Add initial Intel QAT Kata instructions
2019-07-18 09:14:44 +01:00
James O. D. Hunt
fb454f87f7
Merge pull request #332 from jcvenegas/fedora-update
rootfs: upgrade docker images for fedora
2019-07-18 08:40:22 +01: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
Eric Adams
0402d41ca3 QAT: Add initial Intel QAT Kata instructions
These instructions cover how to install the out of tree
QAT drivers to the host, build a custom kata kernel and
rootfs, and build a QAT accelerated OpenSSL container
image.

Fixes: #509

Signed-off-by: <eric.adams@intel.com>
2019-07-17 15:25:32 -07:00
Jose Carlos Venegas Munoz
b25f6caf85
Merge pull request #644 from jcvenegas/release-pipeline
release: add pipeline
2019-07-17 17:16:36 -05:00
Jose Carlos Venegas Munoz
920965eb79 release: add pipeline
add pipeline to integrate all  release jobs.

Signed-off-by: Jose Carlos Venegas Munoz <jcvenega@jcvenega-nuc.zpn.intel.com>
2019-07-17 17:01:21 -05:00
Jose Carlos Venegas Munoz
edb770ee63 rootfs: upgrade docker images for fedora
Use fedora 30 in docker images.

Fixes: #331

Signed-off-by: Jose Carlos Venegas Munoz <jcvenega@jcvenega-nuc.zpn.intel.com>
2019-07-17 13:54:53 -05:00
Marco Vedovati
39370c2aea rootfs-builder: support provisioning existing rootfs
Add the use case of provisioning an existing rootfs directory with the
components / configurations needed to generate a Kata compatible images.
This supports use cases such as using a rootfs built outside of
osbuilder, and providing a overlay for dracut built initrds.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-07-17 19:47:14 +02: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
Eric Ernst
16d2142f93
Merge pull request #641 from bergwolf/qemu-migration
qemu: replace private migration patch with the upstream one
2019-07-17 09:12:46 -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
Peng Tao
04407ac2ce qemu: replace private migration patch with the upstream one
Then we can use x-ignore-shared to do migration and drop the
extra patch once we move to qemu 4.1.0 or later.

Fixes: #640
Depends-on: github.com/kata-containers/runtime#1799
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-17 00:47:57 -07:00
GabyCT
7d38b84203
Merge pull request #329 from amshinde/make-sure-etc-exists-for-chrony
rootfs: Make sure etc exists.
2019-07-16 16:38:56 -05: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
Ganesh Maharaj Mahalingam
3e4989db42 vendor: update govmm and match code
update govmm to support virtiofs memory hotplug
Commits:
    0c900f5 Allow sharing of memory backend file
    f695ddf qemu: add migration incoming defer support
    f0f18dd qmp: add virtio-blk multiqueue
    7d3deea qemu: Add a virtio-blk-pci device driver support

Fixes: #1745
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2019-07-11 20:16:15 -07:00
Manohar Castelino
4fed346d53 Firecracker: Enable jailer by default
Add jailer support to configuration files.
Also enable jailer by default in Kata containers.

Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
2019-07-11 21:32:45 +00:00
Manohar Castelino
78ea50c36c virtcontainers: Jailer: Add jailer support for firecracker
Firecracker provides a jailer to constrain the VMM. Use this
jailer to launch the firecracker VMM instead of launching it
directly from the kata-runtime.

The jailer will ensure that the firecracker VMM will run
in its own network and mount namespace. All assets required
by the VMM have to be present within these namespaces.
The assets need to be copied or bind mounted into the chroot
location setup by jailer in order for firecracker to access
these resouces. This includes files, device nodes and all
other assets.

Jailer automatically sets up the jail to have access to
kvm and vhost-vsock.

If a jailer is not available (i.e. not setup in the toml)
for a given hypervisor the runtime will act as the jailer.

Also enhance the hypervisor interface and unit tests to
include the network namespace. This allows the hypervisor
to choose how and where to lauch the VMM process, vs
virtcontainers directly launching the VMM process.

Fixes: #1129

Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
2019-07-11 21:32:36 +00:00
GabyCT
d3fd4efad0
Merge pull request #636 from devimc/topic/snap/fixSnap
snap: add bc to build-packages
2019-07-11 11:48:38 -05:00
Archana Shinde
5e67e04666
Merge pull request #1779 from vijaydhanraj/ACRN-Runtime
HV: kata-runtime support for ACRN hypervisor
2019-07-11 09:42:19 -07:00