Commit Graph

5222 Commits

Author SHA1 Message Date
Bo Chen
48b20e75f8 clh: vsock: Supply the right VsockConfig to Vmconfig
With the new HTTP API from CLH, it removes the support of multiple
virtio-vsock devices, as the Linux kernel does not support it.

Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:51:01 -07:00
Bo Chen
4887ce059c versions: Move to cloud-hypervisor v0.7.0
Changes:

96be8229 release: Release v0.7.0
5115ad6e vmm: config: Support on/off/true/false for all booleans
d5bfa2df vmm, vhost_user_block: Make parameter names match --disk
2f0bc06b vmm: Update default devices names as "internal"
aaba6e77 vmm: Add virtio-console to the list of Migratable devices
9ab4bb1a devices: serial: Expect an identifier upon device creation
06487131 vm-virtio: pci: Expect an identifier upon device creation
eeb7e10d vm-virtio: mmio: Expect an identifier upon device creation
9d84ef50 vmm: Make the virtio identifier mandatory
14350f5d devices: ioapic: Expect an identifier upon device creation
55687157 vm-virtio: iommu: Expect an identifier upon device creation
052eff1c vm-virtio: console: Expect an identifier upon device creation
354c2a4b vm-virtio: vhost-user-net: Expect an identifier upon device creation
46e0b3ff vm-virtio: vhost-user-blk: Expect an identifier upon device creation
bb7fa71f vm-virtio: vhost-user-fs: Expect an identifier upon device creation
ec5ff395 vm-virtio: vsock: Expect an identifier upon device creation
9b53044a vm-virtio: mem: Expect an identifier upon device creation
1592a929 vm-virtio: pmem: Expect an identifier upon device creation
2e91b738 vm-virtio: rng: Expect an identifier upon device creation
9eb7413f vm-virtio: net: Expect an identifier upon device creation
be946caf vm-virtio: blk: Expect an identifier upon device creation
ff9c8b84 vmm: Always generate the next device name
81831413 vmm: Add an identifier to the ioapic device
e4386c8b vmm: Add an identifier to the virtio-iommu device
75ddd2a2 vmm: Add an identifier to the --console device
eac350c4 vmm: Add an identifier to the virtio-mem device
6802ef54 vmm: Add an identifier to the --rng device
d71d52e9 vmm: Fix virtio-console creation with virtual IOMMU
b08fde59 vmm: Fix virtio-rng creation with virtual IOMMU
8031ac33 vmm: Fix virtio-vsock creation with virtual IOMMU
50134969 Jenkins: Run musl unit and integration tests on master branch
ce794f78 ci: Pass target triple to the test scripts
33b0e158 resources: Add musl tools and toolchain to the Dockerfile
ad9374bd dev_cli: Add --libc to the build and test commands
8cef3574 vmm: seccomp: Add fork, gettid and pipe2 syscalls to permitted list
ce7678f2 vmm: seccomp: Add tkill syscall to permitted list
12758d7f vmm: seccomp: Add epoll_pwait syscall to permitted list
86fcd19b build: Initial musl support
a5de4955 vmm: Only allow removal of specific types of virtio device
9ed880d7 vmm: Add an identifier to the --fs device
7e0ab6b5 vmm: Fix pmem device creation
3012975c tests: Enhance vsock integration test to support hotplug
6c2bca5f bin: ch-remote: Add support for adding vsock devices
8de7448d vmm: api: Add "add-vsock" API entry point
bf09a1e6 openapi: Add "id" field to VsockConfig
a76cf086 vmm: vm: Remove vsock device from config
99422324 vmm: vm: Add "add_vsock()"
1d61c476 vmm: device_manager: Add support for hotplugging virtio-vsock devices
f8501a3b vmm: config: Move --vsock syntax to VsockConfig
6e049e0d vmm: Add an identifier to the --vsock device
10348f73 vmm, main: Support only zero or one vsock devices
9d1f95a3 openapi: Add missing "id" field
30e2e515 build(deps): bump serde_json from 1.0.51 to 1.0.52
dd9d0d04 build(deps): bump micro_http from `0d87a94` to `c9ffb90`
cdc8493a build(deps): bump thiserror from 1.0.15 to 1.0.16

Fixes: kata-containers/runtime#2658
Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:51:01 -07:00
Jose Carlos Venegas Munoz
54f12461db clh: memory: remove pmem size argument
Pmem size now is calculated by the hypervisor. This is not required
anymore. Remove it to simplify the code.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:51:01 -07:00
Jose Carlos Venegas Munoz
83891592c1 versions: Move to latest cloud-hypervisor
Changes:

f5debc4 build(deps): bump libssh2-sys from 0.2.16 to 0.2.17
37dfb4c build(deps): bump hermit-abi from 0.1.11 to 0.1.12
e1a07ce vmm: vm: Unpark the threads before shutdown when the current state is paused
1df38da vmm, tests: Make specifying a size optional for virtio-pmem
7481e4d vmm: config: Validate that shared memory is enabled if using vhost-user
2ac6971 vmm: MemoryManager: Cleanup the usage of std::ffi/io/result
3f42f86 vmm: Add the 'shared' and 'hugepages' controls to MemoryConfig
d6aa717 build(deps): bump syn from 1.0.17 to 1.0.18
3eaeba4 vm-virtio: Fix FS_IO callback for virtio-fs
df14a68 build(deps): bump smallvec from 1.3.0 to 1.4.0
e685854 gh: Separate the build and release jobs
c790bba tests: Migrate from Ubuntu Eoan to Focal
e525af7 build(deps): bump ryu from 1.0.3 to 1.0.4
3e8a6ba ci: Ignore test_snapshot_restore
9ebf052 build(deps): bump cc from 1.0.51 to 1.0.52
f6b150a ci: Add integration test for VM migration
9f08f53 build(deps): bump pin-utils from 0.1.0-alpha.4 to 0.1.0
9c7215d docs: Add the vhost-user-blk test doc
3574437 build(deps): bump cc from 1.0.50 to 1.0.51
4fc75cf vm-virtio: Implement Snapshottable trait for Console
d41ce90 vm-virtio: Implement Snapshottable trait for Pmem
f626bd6 build(deps): bump parking_lot_core from 0.7.1 to 0.7.2
5a380a6 vmm: memory_manager: Support non-power-of-2 block sizes
f8ee89a build(deps): bump arc-swap from 0.4.5 to 0.4.6
49322c5 vm-virtio: Implement the Snapshottable trait for Net
24c2b67 vm-virtio: Improve virtio-net rx queue processing
03dd249 vm-virtio: Restore queues based on used index
cf707da vm-virtio: Extend Queue helpers
c22fd39 vmm: Remove virtio device's userspace mapping on hot-unplug
0a97c25 vmm: Extend MemoryManager to remove userspace mappings
b2de1cd vm-virtio: Implement shutdown() for virtio-fs
fbcf3a7 vm-virtio: Implement userspace_mappings() for virtio-pmem
b035399 vm-virtio: Implement userspace_mappings() for virtio-fs
3fb0a02 vm-virtio: Get userspace mappings from VirtioDevice
8b823e5 build(deps): bump backtrace-sys from 0.1.35 to 0.1.36
c23b488 ci: Factorize virtio-fs hotplug integration tests
f68b08b tests: add integration tests for vm.add-fs route
18f7789 vmm: Add hotplugged virtio devices to the DeviceManager list
c2abadc vmm: Add ability to add virtio-fs device post-boot
bb2139a vmm/api: Add vm.add-fs route
d35e775 vmm: Update KVM userspace mapping when PCI BAR remapping
49cc73a vm-virtio: pci: Make sure to return the correct list of BARs
187b1ee vm-virtio: Implement the Snapshottable trait for Block
a484aa7 vm-virtio: Implement the Snapshottable trait for Rng
ac7178e vmm: Keep migratable devices list as a Vec
b6fdbf7 vm-virtio: Implement Snapshottable trait for MmioDevice
12fec55 vm-virtio: Add helpers to update queue indexes
fd45e94 vm-virtio: Add the ability to serialize a Queue
b7faf4f vhost_user_fs: Add the WRITE_KILL_PRIV write flag.
0870028 vhost_user_fs: Add the IOCTL_COMPAT_32 flag
592cfba vhost_user_fs: Add the EXPLICIT_INVAL_DATA capability flag
621ea83 vhost_user_fs: Add the ZERO_MESSAGE_OPENDIR capability flag
a2830da vhost_user_fs: Add the CACHE_SYMLINKS flag
926a414 vhost_user_fs: Add support for MAX_PAGES
747f31d vhost_user_fs: Add the ABORT_ERROR flag
5eb903a vhost_user_fs: Add support for FOPEN_CACHE_DIR
97e2d5d vhost_user_fs: Add support for CopyFileRange
b8cfdab pci: configuration: Use correct algorithm for BAR size reporting
9bd5ec8 pci, vfio, vm-virtio: Specify a PCI revision ID of 1 for virtio-pci
e7e0e8a vmm, devices: Add firmware debug port device
82d0cdf vhost_user_net: Simplify match values for handle_event()
a517be4 vhost_user_blk: Add multithreaded multiqueue support
13c8283 vhost_user_blk: Make everything private when possible
a31f5f8 vhost_user_blk: Move disk initialization to VhostUserBlkBackend
e78e34b vhost_user_blk: Make DiskFile sharable across threads
808586e vhost_user_blk: Simplify the code by removing VringWorker
ea82632 tests: Enhance test_pmem_hotplug to also unplug device
6389418 tests: Enhance test_disk_hotplug to also unplug device
f9a0445 vmm: vm: Remove device from configuration after unplug
444e5c2 vmm: device_manager: Generalise NoAvailableVfioDeviceName
5bab9c3 vmm: device_manager: Assign ids to pmem/net/disk devices if absent
514491a vmm: device_manager: Support unplugging virtio-pci devices
2fa652a vm-virtio: pci: Add virtio_device() accessor
476e4ce vmm: device_manager: Add virtio-pci devices into id to BDF map
b38470d vmm: config: Add "id" parameter to {Net, Disk, Pmem}Config
1beb62e vmm: vm: Don't panic on kernel load error

Fixes: kata-containers/runtime#2609
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:51:01 -07:00
Julio Montes
c1959f3df3 virtcontainers: constrain runtime after creating network
Runtime must setup the network before moving itself into the cgroup, otherwise
it won't be able to get the vhost/net queues file descriptors for the
hypervisor.

Signed-off-by: Julio Montes <julio.montes@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:51:01 -07:00
Julio Montes
5f9d141159 virtcontainers: update sandbox's device cgroup
Update sandbox's device cgroup before hotpluggin a device and after it has
been removed from the VM, this way the device cgroup in the host is
fully honoured and the hypervisor will have access only to the devices needed
for the sandbox, improving the security.

Signed-off-by: Julio Montes <julio.montes@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:51:00 -07:00
Julio Montes
e6aac8390e virtcontainers: remove all the code related to HasCRIContainerType
All the code related to HasCRIContainerType is useless and no longer needed
since the CRIContainerType annotation is not considered for constraining or
not the sandbox

Signed-off-by: Julio Montes <julio.montes@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:50:23 -07:00
Julio Montes
8f5a69373b virtcontainers: apply constraints to the sandbox cgroup
Kata relies on the cgroup parent created and configured by the container
engine, but sometimes the sandbox cgroup is not configured and the container
may have access to all the resources, hence the runtime must constrain the
sandbox and update the list of devices with the devices hotplugged in the
hypervisor.

Fixes: kata-containers/runtime#2605
Signed-off-by: Julio Montes <julio.montes@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:50:23 -07:00
Julio Montes
9cdc899c76 pkg/cgroups: update the list of devices for the hypervisor
The hypervisor needs access to `/dev/vfio/vfio` to use VFIO devices.
Remove all devicemapper devices from the allowed list, the device cgroup
must be updated when before hotpluggin any device.

Signed-off-by: Julio Montes <julio.montes@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:50:23 -07:00
Julio Montes
44ed777c0f pkg/cgroups: add methods to add and remove device from the cgroup
add `AddDevice` and `RemoveDevice` to cgroup manager to allow adding
and removing devices from the device cgroup

Signed-off-by: Julio Montes <julio.montes@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:50:23 -07:00
Julio Montes
045c7ae9a3 pkg/cgroups: implement functions to get information from a host device
Add functions to convert a host device to a cgroup device or linux device,
the first one is used to update the device cgroup and the second one to
update the resources in the OCI spec.

Signed-off-by: Julio Montes <julio.montes@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:50:23 -07:00
Julio Montes
387d3d34dc device: add GetHostPath() to generic device
`GetHostPath()` method returns the device path in the host, this way the
runtime can get the device information for updating the sandbox's device
cgroup.

Signed-off-by: Julio Montes <julio.montes@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:50:23 -07:00
Fupan Li
83f116b483
Merge pull request #228 from bergwolf/makefile
fix build with go 1.14
2020-05-26 15:45:36 +08:00
Peng Tao
97909ea2b9 gitignore: do not ignore Cargo.lock
We already include it in the repo.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:24:45 -07:00
Peng Tao
f53901ad43 makefile: add more build targets
To make it easy to build and test.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-25 23:30:42 -07:00
Peng Tao
4fdb4cffd5 runtime: update vendor/modules.txt
go 1.14 requires it to match go.mod and exposes a backtrace with
slightly difference.

Fixes: #227
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-25 23:30:42 -07:00
Peng Tao
6bc69760c0 vendor: move ttrpc proto code out of vendor
We do not really depend on the go agent generated grpc code any more.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-25 23:30:42 -07:00
Peng Tao
f7b941b6bf
Merge pull request #231 from lifupan/fix_ttrpc
Fix ttrpc changes caused building issues
2020-05-26 14:29:56 +08:00
fupan.lfp
555f620653 agent: hardcode the Cargo.lock file
Hardcode the Cargo.lock file to prevent dependencies
change which would cause some compatible issues.

Fixes: #230

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-05-26 11:39:07 +08:00
fupan.lfp
08e3d259ca agent: fix the issue of building error with latest ttrpc
Since the ttrpc upgraded with async supported, which isn't
compatible with current agent, thus it's better to change
the dependency to a stable branch.

Fixes: #229

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-05-26 11:14:39 +08:00
Jose Carlos Venegas Munoz
448efe512d sock: Add mising fix to experimental kernel
Cloud hypervisor uses vsock, without this patch CI
for cloud hypervisor is not stable.

Patch information:
```
There was a race condition between bind() and listen() that was hit very
rarely when using Kata Containers and Cloud-Hypervisor. It's been
identified the problem is really coming from the virtio-vsock driver,
which is fixed by those new kernel patches uploaded for each version of
the kernels used by Kata Containers.
```

Update:
Fixed to make it build with kernel 5.6

Fixes #932

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-05-25 22:58:30 +00:00
Dave Syer
e2d08dcf43 kata-deploy: detect v1 schema and use correct long form of cri
CRI has a v2 schema that seems to be the default in a lot of
containerd installations. It uses a "long" form for the plugin
id in the TOML config file.

Fixes #881

Signed-off-by: Dave Syer <dsyer@pivotal.io>
2020-05-22 07:28:50 +01:00
Julio Montes
3d53c5d231
Merge pull request #1049 from GabyCT/topic/addcentos8
obs: Add CentOS 8
2020-05-20 13:22:18 -05:00
Gabriela Cervantes
34136ac396 obs: Add CentOS 8
Build packages for CentOS 8.

Fixes #1048

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2020-05-19 12:43:24 -05:00
GabyCT
e9dc1c90be
Merge pull request #1053 from jcvenegas/fix-1052
pkgs: Remove debian 10
2020-05-19 07:23:15 -05:00
Jose Carlos Venegas Munoz
4c375f850a pkgs: Remove debian 10
Debian 10 has been broken for a while but CI started
to detected recently.

Remove package until find a way to build it.

Fixes: #1052

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-05-18 22:39:17 +00:00
Graham Whaley
4b130fb180
Merge pull request #994 from alicefr/kernel-config-5.4
s390x: update kernel config
2020-05-15 13:14:05 +01:00
James O. D. Hunt
478dfa4b52
Merge pull request #216 from lifupan/ttrpc_runtime
switch to Ttrpc for runtime
2020-05-11 09:26:11 +01:00
fupan.lfp
1d6e7ac405 change the protocols from grpc to ttrpc
Switch protocols from grpc to ttrpc

Fixes: #148

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-05-09 17:39:34 +08:00
fupan.lfp
010b7a9fba vendor: add the ttrpc protos
add the ttrpc protocol files

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-05-09 15:36:43 +08:00
fupan.lfp
663c7e7921 vendor: update the required vendors
update the required vendors

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-05-08 20:38:12 +08:00
Jia He
0b43941fdc qemu/configs: Add the tuned config for aarch64-softmmu
This remains the original aarch64-softmmu *explicit* default config. And
borrows the tuned configuration from i386-softmmu except the board specific
ones.

Fixes: #1044
Signed-off-by: Jia He <justin.he@arm.com>
2020-05-08 13:50:21 +08:00
Jia He
d8d7f96b69 scripts: Disable capstone for reducing qemu binary size
Capstone is a disassembly framework which is not required for Kata.

Disabling it in configure can reduce ~6M bytes on arm64.

-rwxr-xr-x  71977368 May  8 09:32 qemu-system-aarch64.with.capstone*
-rwxr-xr-x  65676640 May  8 09:39 qemu-system-aarch64.without.capstone*

Fixes: #1044
Signed-off-by: Jia He <justin.he@arm.com>
2020-05-08 13:50:07 +08:00
Yang Bo
84e389d9d1
Merge pull request #210 from bergwolf/travis
travis: enable linux-ppc64le
2020-05-07 16:35:49 +08:00
Peng Tao
6d129546e3 travis: enable linux-ppc64le
Use build jobs to enable it.

Fixes: #209
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-06 03:03:07 -07:00
Jose Carlos Venegas Munoz
47d34f5810
Merge pull request #1035 from jcvenegas/fix-1034
Release: Fix path to releasea pipeline
2020-05-05 23:17:44 -05:00
Peng Tao
cb6b0e1370
Merge pull request #204 from chavafg/topic/merge-osbuilder
Merge osbuilder/1.11.0-rc0 into kata-containers 2.0-dev branch
2020-05-06 11:02:06 +08:00
Salvador Fuentes
f75e1c2ce0
Merge pull request #1037 from GabyCT/topic/adddocu
release: Add documentation repository
2020-05-05 20:27:23 -05:00
Gabriela Cervantes
b257df53d6 release: Add documentation repository
This PR adds the documentation repository for the update-repository-version
verification.

Fixes #1027

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2020-05-05 15:57:04 -05:00
Jose Carlos Venegas Munoz
79fd667d40 Release: Fix path to releasea pipeline
Rename directory name from release_pieline to release_pipeline

Fixes: #1034

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-05-05 19:54:57 +00:00
Alice Frosi
f15557dde4 s390x: update kernel config
Update kernel configs for s390x for version 5.4.x

Fixes: #993

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2020-05-05 13:08:54 +02:00
Archana Shinde
c14b7b5b33
Merge pull request #1030 from devimc/topic/kernel/qemu5vmlinux
qemu5-x86: boot uncompressed kernels to reduce memory footprint ~15%
2020-05-01 08:55:47 -07:00
Graham Whaley
997312e574 CI: enable Travis for static checks
Enable the Travis CI configuration to perform static CI checks
on PRs to this repo.

Fixes: #1031

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-04-30 14:45:59 +01:00
Salvador Fuentes
629cc0ae8d rootfs-builder: remove EulerOS
EulerOS does not work with rust agent.

further info:
https://github.com/kata-containers/osbuilder/issues/387

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-30 08:27:25 -05:00
Salvador Fuentes
586d26480c rootfs-builder: Add license header to rootfs_lib_template.sh
Add license header to `tools/osbuilder/rootfs-builder/template/rootfs_lib_template.sh`

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-30 08:20:46 -05:00
Graham Whaley
cdc8aaad6a kata-pkgsync: Fix spelling mistake
Whilst enabling the static CI checks for this repo, it picked up
a spelling mistake. We'll need to fix that before we can enable
the CI.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-04-30 13:28:38 +01:00
Julio Montes
14a01d8eb5
Merge pull request #205 from bergwolf/travis
runtime: import new path
2020-04-30 07:23:10 -05:00
Peng Tao
e90c5d45b3 runtime: build with vendor
So that we don't have to download dependencies.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-04-29 19:25:40 -07:00
Peng Tao
cd9e309f63 travis: enable runtime root required UTs
We check both root and non-root cases.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-04-29 18:39:03 -07:00
Peng Tao
06b3f313a2 shimv2: do not reset service config
Only load runtime config when it is not set.
We do not expect a service's runtime config to change while
it is running.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-04-29 18:39:03 -07:00