Commit Graph

1911 Commits

Author SHA1 Message Date
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
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
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
Vijay Dhanraj
98a69736c5 virtcontainers: Add ACRN unit test cases
This patch adds unit test cases for acrn specific changes.

Fixes: #1778
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2019-07-10 10:49:24 -07:00
Vijay Dhanraj
f246a799aa virtcontainers: Add support for updating virtio-blk based container rootfs
Thist patch adds the following,
1. ACRN only supports virtio-blk and so the rootfs for the VM
   sits at /dev/vda. So to get the container rootfs increment the
   globalIndex by 1.
2. ACRN doesn't hot-plug container rootfs (but uses blkrescan) to
   update the container rootfs. So the agent can be provided the virtpath
   rather than the PCIaddr avoiding unneccessary rescaning to find the
   virthpath.

v1->v2:
Removed the workaround of incrementing index for
virtio-blk device and addressed it acrn.

Fixes: #1778

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2019-07-10 10:49:24 -07:00
Vijay Dhanraj
d9a4157841 virtcontainers: Add support for launching/managing ACRN based VMs
This patch adds the following,
1. Implement Sandbox management APIs for ACRN.
2. Implement Sandbox operation APIs for ACRN.
3. Add support for hot-plugging virtio-blk based
(using blk rescan feature) container rootfs to ACRN.
4. Prime devices, image and kernel parameters for
launching VM using ACRN.

v2->v3:
Incrementing index to keep track of virtio-blk devices
created. This change removes the workaround introduced
in block.go.

v1->v2:
1. Created issue #1785 to address the UUID TODO item.
2. Removed dead code.
3. Fixed formatting of log messages.
4. Fixed year in copyright message.
5. Removed acrn_amd64.go file as there are no amd64 specific
   changes. Moved the code to acrn_arch_base.go.

Fixes: #1778

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2019-07-10 10:49:24 -07:00
Vijay Dhanraj
828e0a2205 pkg/katautils: Add support for ACRN hypervisor config
This patch adds support for,
1. Extracting and configuring ACRN hypervisor from toml.
2. Add ACRN hypervisor ctl for controlling ACRN hypervisor.
This will be used for updating virtio-blk based
container rootfs using blk rescan feature.

v2->v3:
Fixed acrnctl path.

v1->v2:
Trimmed hypervisor config options as needed by ACRN.

Fixes: #1778

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2019-07-10 10:49:24 -07:00
Vijay Dhanraj
adcac9368f kata-check: Check and validate type-1 hypervisor for kata
ACRN hypervisor is a type-1 hypervisor and this patch
adds support to check and validate if the system is
capable of running kata containers with ACRN hypervisor.

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

v3->v4:
Implemented a generic way to identify hypervisor and
test VM creation.

v2->v3:
1. Removed cgo structs and defined go structs.
2. Suppressed lint warnings due to unused createVM struct.

v1->v2:
1. Created an issue #1784 to address TODO item.
2. Fixed formatting of the log message.
3. Currently ACRN is only supported on amd64. So
   moved ACRN specific code to kata-check_amd64.go.

Fixes: #1778

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2019-07-10 10:47:31 -07:00
Vijay Dhanraj
4d26ceee79 Make: Add ACRN hypervisor and generate configuration file
This patch covers the following aspects,
1. Add ACRN as a supported hypervisor for amd64 architecture.
2. Build and install configuration file for ACRN hypervisor.

v1->v2:
1. Deleted autogenerated configuration-acrn.toml.
2. Trimmed configuration options not used by ACRN.

Fixes: #1778

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2019-07-10 10:46:47 -07:00
Salvador Fuentes
a4e6af0316
Merge pull request #1873 from openSUSE/crictl-openshift
versions: add crictl version which is compatible with OpenShift
2019-07-10 10:10:26 -05:00
Sascha Grunert
bdd89473fd
versions: add crictl version which is compatible with OpenShift
Fixes #1872

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-07-10 11:02:34 +02:00