Commit Graph

4961 Commits

Author SHA1 Message Date
Peng Tao
2bff7a16f5
Merge pull request #363 from liubin/feature/delete-sub-commands-332
runtime: delete unused sub-commands.
2020-07-13 11:06:27 +08:00
Peng Tao
dc0fa512b4
Merge pull request #398 from liubin/wip/add-pprof-interface
runtime: add pprof interface for shim
2020-07-13 11:03:07 +08:00
Peng Tao
866bc2f01d
Merge pull request #400 from liubin/wip/add-pod-overhead
runtime: add pod overhead metrics
2020-07-13 11:02:12 +08:00
Samuel Ortiz
1c56abb761 runtime: virtcontainers: vhost-user-blk/scsi are block device nodes
When checking if a device is an emulated vhost-user-blk or
vhost-user-scsi one, we should not only check for their major number but
also their device node type. They must be block devices.

Fixes: #401

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2020-07-11 01:28:17 +02:00
bin liu
bbf8517050 runtime: add pprof interface for shim
Add new http interfaces to support pprof:

- /sandboxes
- /debug/vars
- /debug/pprof/
- /debug/pprof/cmdline
- /debug/pprof/profile
- /debug/pprof/symbol
- /debug/pprof/trace

Fixes: #397

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-10 13:05:25 +08:00
bin liu
0790ca4933 runtime: add pod overhead metrics
Add pod overhead metrics for CPU and memory to help with calculating sandbox overhead.

Fixes: #399

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-10 11:33:52 +08:00
Fabiano Fidêncio
b9f0f57f1a
Merge pull request #396 from abdasgupta/ppc64le-support
PPC64LE Support
2020-07-09 16:07:29 +02:00
Abhishek Dasgupta
ae83c96da9 Modifie to proper CPU architecture name for ppc64le.
Rust core::arch understand ppc64le as powerpc64 architecture
instead of powerpc64le architecture.

Signed-off-by: Abhishek Dasgupta <abdasgupta@in.ibm.com>
2020-07-09 06:05:33 -04:00
Abhishek Dasgupta
f404f4d959 Modified Makefile to pick up correct architecture name for ppc64le.
Makefile is determining the architecture by running uname command
which gives ppc64le as output. But rust toolchain target is available
with the name powerpc64le for ppc64le arch. So this change took care of that.

Signed-off-by: Abhishek Dasgupta <abdasgupta@in.ibm.com>
2020-07-09 06:05:33 -04:00
Fabiano Fidêncio
cdbba6ac4b agent: Make LIBC configurable
Currently the default LIBC used to build the agent is "musl". However,
"musl" is not preset in a big portion of the distros *and* "gnu" libc
just works as expected.

Knowing that, let's add the option to the one building the project to
simply do `make LIBC=gnu` instead of expected the person to go through
the Makefile and replace musl by gnu there.

Fixes: #369

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-07-09 03:30:34 -04:00
Julio Montes
5a68e3490e
Merge pull request #360 from devimc/2020-06-29/forwardport/fixVFIOHotplug
[forwardport 2.0] create cgroup manager after creating the network
2020-07-08 13:26:39 -05:00
Julio Montes
2afbfcab99 virtcontainers: print a warning when the device to append is not supported
Print a warning message when the device to append to a QEMU VM is not
supported. This change is just to improve debuggability.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-08 09:36:36 -05:00
Julio Montes
919fc4cde5 virtcontainer/cgroup: create cgroup manager after creating the network
Create the cgroup manager once the network has been created, this way the
list of device will include the network VFIO devices attached to the sandbox,
when the physical enpoint is the network driver.

fixes #2774

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-08 09:36:28 -05:00
Julio Montes
a134c2e083 virtcontainers/network: Change signature of Enpoint Attach method
In order to use the device manager and receiver from the network enpoints,
the signature of the Attach method must change to revice a Sandbox instead of
a Hypervisor, this way devices can be added through the device manager API.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-08 09:32:49 -05:00
Julio Montes
9a9721c261 drivers: change BindDevicetoVFIO signature
BindDevicetoVFIO now returns the vfio path to the brand new vfio device bound

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-08 09:32:44 -05:00
Julio Montes
66219d164f device: support vfio cold plug
Depending on ColdPlug flag, cold or hot plug vfio devices. The VFIO device
won't be hot removed when such flag is false

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-08 09:32:39 -05:00
Julio Montes
3eb694c518 device: add ColdPlug flag
Add ColdPlug flag to DeviceInfo and DeviceState to identify whether a device
must be or was cold plugged

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-08 09:32:35 -05:00
bin liu
3cf8b470cd runtime: delete Stateful from SandboxConfig
Since all containers are started from shim v2, `Stateful` is not needed.

Fixes: #332

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-08 21:59:44 +08:00
bin liu
069505e2d5 runtime: delete unused sub-commands.
This PR delete codes not used anymore.

Fixes: #332

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-08 21:59:03 +08:00
Hui Zhu
e3a3818f7a
Merge pull request #388 from lifupan/2.0-dev
config: there is no need to check vhost-vosck for FC
2020-07-08 20:58:14 +08:00
Peng Tao
7eedc95de4
Merge pull request #384 from liubin/377/delete-agent-abstraction
runtime: remove agent abstraction
2020-07-08 17:12:08 +08:00
Hui Zhu
ce6cae0f77
Merge pull request #394 from liubin/393/handle-rpc-call-not-implemented
runtime: handle unimplemented RPC call by NotFound status code
2020-07-08 14:24:20 +08:00
Hui Zhu
6f1bfd25b6
Merge pull request #392 from liubin/391-fix-broken-links
runtime: fix wrong issue links
2020-07-08 14:23:45 +08:00
bin liu
a0a96db217 runtime: handle unimplemented RPC call by NotFound status code
For now, agent return status of NotFound when calling getOOMEvents, runtime should handle it correctly.

Fixes: #393

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-08 11:51:48 +08:00
bin liu
bd8f03a5ef runtime: remove agent abstraction
This PR will delete agent abstraction and use Kata agent as the only one agent.

Fixes: #377

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-08 10:07:40 +08:00
Fupan Li
350831b18b
Merge pull request #386 from liubin/2.0-add-metrics-docs
docs: add metrics design documents for Kata 2.0
2020-07-08 09:45:00 +08:00
Fupan Li
92697a197f
Merge pull request #297 from liubin/2-dev/metrics
Kata 2.0: add metrics for agent/guest/shim
2020-07-08 09:44:20 +08:00
bin liu
41c04648ad runtime: fix wrong issue links
Fix issue links in source codes.

Fixes: #391

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-07 16:35:43 +08:00
Fupan Li
57dfda9b3d
Merge pull request #365 from liubin/feature/delete-shim-364
runtime: clean up shim abstraction
2020-07-07 09:54:27 +08:00
Fupan Li
e1cbc60c13
Merge pull request #376 from liubin/368/delete-old-store
runtime: remove old store
2020-07-07 09:53:10 +08:00
fupan.lfp
83b2366560 config: there is no need to check vhost-vosck for FC
Since the FC used the hybrid vsock, there's no need
to check whether the vhost vsock suported by host.

Fixes: #387

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-07-06 16:02:37 +08:00
bin liu
d96b3063e0 docs: add metrics design documents for Kata 2.0
Add basic design for how metrics service works in Kata 2.0.

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-06 11:04:48 +08:00
GabyCT
3e6e3a2cd4
Merge pull request #380 from devimc/2020-07-02/versions/revertQEMU5
versions: Revert "versions: update QEMU to 5.0.0"
2020-07-03 13:10:39 -05:00
Julio Montes
b28b850a79 versions: Revert "versions: update QEMU to 5.0.0"
This reverts commit 15af20b6da.

kubernetes test are failing randomly with QEMU 5.0.0, let's go back to
QEMU 4.1.1 and debug the failures with QEMU 5

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

fixes #379

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-03 16:12:31 +00:00
Julio Montes
5ff530371e tools: fix branch and runime repo
Kata 2.0 lives in `github.com/kata-containers/kata-containers`, so all scripts
should point to it.
Currently the branch for Kata 2.0 is 2.0-dev not master, then the branch envar
must be used instead of hardcoding `master` as default branch.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-03 16:12:22 +00:00
Julio Montes
56b50785f0
Merge pull request #381 from bergwolf/oom
virtcontainers: GetOOMEvent should have no timeout
2020-07-03 07:18:34 -05:00
bin liu
24ea3f0127 virtcontainers: GetOOMEvent should have no timeout
So that waiter gets notified when oom happens.

Signed-off-by: bin liu <liubin0329@gmail.com>
2020-07-03 18:43:25 +08:00
Peng Tao
e35646cd38
Merge pull request #373 from likebreath/fix-248
agent: device: Allow "VmPath" to be used when adding block devices
2020-07-03 18:04:05 +08:00
bin liu
1b75daa00f runtime: add new command to collect metrics from Kata containers
Add a new command to collect metrics and return metrics to Prometheus.

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-02 17:54:54 +08:00
bin liu
5200ac0678 runtime: remove old store
Remove old store for Kata 2.0.

Fixes: #368

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-02 16:12:05 +08:00
bin liu
186fed2a11 runtime: add implementation of GetMetrics
add implementation of `GetMetrics` for runtime.

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-02 10:58:14 +08:00
bin liu
0c4c69de17 agent: add GetMetrics implementation
add implementation of `GetMetrics` for agent.

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-02 10:42:23 +08:00
bin liu
9fd3e48c80 agent: add new pb message GetMetrics
Add new message and generated codes for `GetMetrics` between runtime and agent.

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-02 10:41:17 +08:00
Bo Chen
4b01ec1f3c
Merge pull request #367 from bergwolf/rust-version
versions: specify rust version
2020-07-01 14:41:25 -07:00
Bo Chen
9c501f3d0a agent: device: Allow "VmPath" to be used when adding block devices
When the "PCIAddr" (BDF information) is available, we allow to use the
predicted "VmPath" (from kata-runtime) to locate the block device in the
agent. This is a special code path for supporting block-device/volume
passthrough w/ cloud-hypervisor when the BDF information is not
available (as of clh v0.8.0).

This is mainly porting the changes from kata-agent PR https://github.com/kata-containers/agent/pull/790,
as the related changes from kata-runtime is ported to kata 2.0 earlier
this week (https://github.com/kata-containers/kata-containers/pull/362).

Note that the upstream clh recently added the support of returning BDF
information for hotplugged devices. We will consolidate/remove this
special code path for the next upgrade of clh version in kata.

Fixes: #248

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-07-01 11:31:42 -07:00
Julio Montes
5649f3cfcb
Merge pull request #371 from devimc/2020-07-01/versions/qemu5
versions: update QEMU to 5.0.0
2020-07-01 12:20:10 -05:00
Julio Montes
15af20b6da versions: update QEMU to 5.0.0
New features that can improve/impact in kata containers:

x86:
    VMX features can be enabled/disabled via the "-cpu" flag.
    When nested virtualization is enabled with an option like
    "-cpu Haswell,+vmx", the set of VMX features will also be constrained to
    what was available on the corresponding CPU model.
    New "microvm" machine type that has virtio-mmio instead of PCI, and no ACPI
    support (so no hotplug too). The new machine type is meant as a baseline
    for performance optimizations of QEMU, firmware and guests. While inspired
    by Firecracker it is not entirely compatible with it (for example it does
    not have Firecracker's userspace IP stack and MicroVM Metadata Service).
    Reduce memory footprint when booting uncompressed kernels.

ARM:
    We now correctly support more than 256 CPUs when using KVM
    The virt board now supports memory hotplugging, when used with a UEFI
    guest BIOS and ACPI.
    virtio-iommu is now supported with machvirt.
    The Cortex-M7 CPU is now supported.

s390:
    Using KVM now explicitly requires a host kernel version of at least 3.15
    (which includes the 'flic' KVM device). This had been broken since QEMU
    2.10 already.

ppc64le:
    pseries machine type, now consumes less host resources when running a KVM
    guest with XIVE (with a recent enough host kernel). This allows running
    more concurrent guests with KVM accelerated XIVE.
    NVDIMMs with file backend is now supported and SLOF updated to work with
    iommu_platform=on for virtio devices.

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

fixes #372

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-01 09:26:16 -05:00
Xu Wang
2b619c0697
Merge pull request #362 from bergwolf/runtime-port-4
Runtime port  -- wave 3
2020-06-30 22:48:56 +08:00
Peng Tao
a06d01e114 versions: specify rust version
We can only handle SEMVER-style versions in the script.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-06-30 22:32:41 +08:00
Bo Chen
7ae4376bf4 clh: vsock: Use the updated VsockConfig
[ port runtime commit 364435a6a18bfbb1277512431040bf085554ffdf ]

The new release of clh v0.8.0 updated the 'VsockConfig' of its HTTP API,
which requires changes on our clh driver.

Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-06-30 04:04:39 -07:00