Commit Graph

5066 Commits

Author SHA1 Message Date
Julio Montes
ad7dce47ca
Merge pull request #625 from Tim-Zhang/update-makefile
agent: Add target optimize for Makefile
2020-08-27 07:58:50 -05:00
Tim Zhang
32b86a8d8b agent: Add target optimize for Makefile
Run `make optimize` will strip the binary.

Fixes: #626

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-08-27 18:44:27 +08:00
James O. D. Hunt
fd3b9ff9ed
Merge pull request #553 from jodh-intel/2.0-dev-agent-support-unix-address
server: Allow address to be specified
2020-08-27 11:43:34 +01:00
Fupan Li
f1fd00da78
Merge pull request #571 from eryugey/eguan/2.0-dev
rustjail: default permission of device node should be 666
2020-08-27 11:19:58 +08:00
Julio Montes
c14d44aba8
Merge pull request #568 from Jakob-Naucke/vfio-ap-fragment
packaging: Add VFIO-AP fragment for s390x
2020-08-26 07:59:09 -05:00
Eryu Guan
0a9b8e0ae2 rustjail: default permission of device node should be 666
Otherwise file owner in container may not read/write such devices.

Fixes: #570
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
2020-08-26 20:43:12 +08:00
Fupan Li
6f2eab40d3
Merge pull request #555 from jodh-intel/2.0-dev-agent-fix-shutdown-crash
console: Fix crash if debug console disabled
2020-08-26 19:59:27 +08:00
Bin Liu
b4c105336e
Merge pull request #563 from bergwolf/guest-hooks
agent: support guest hooks
2020-08-26 17:36:32 +08:00
James O. D. Hunt
81644003eb server: Allow address to be specified
Allow the default (VSOCK) ttRPC server address to be changed using a new
`KATA_AGENT_SERVER_ADDR` environment variable (for testing and
debugging).

Fixes: #552.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-08-26 10:19:31 +01:00
Peng Tao
8e18cec804
Merge pull request #504 from cmaf/unit-virtcontainers-utils-utils
virtcontainers: Add to utils unit tests
2020-08-26 13:52:05 +08:00
Peng Tao
5fbac0a380
Merge pull request #556 from evanfoster/shutdown-agent
sandbox: Disconnect from agent after VM shutdown
2020-08-26 13:47:36 +08:00
Peng Tao
bb30759e4e agent: add guest hooks UT
To test the guest hooks implementation.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-26 13:35:01 +08:00
Peng Tao
095ebb8ca3 agent: fix OCI hook handling
We should call write_sync with proper arguments.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-26 11:18:02 +08:00
Peng Tao
03a4d107ba agent: support guest hooks
Scan guest hooks upon creating new sandbox and append
them to guest OCI spec before running containers.

Fixes: #485
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-26 11:18:02 +08:00
Peng Tao
e7bfeb418a agent: construct container bundle in tmpfs location
Save container spec under bundle path and bind mount container rootfs
under bundle path.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-26 11:18:02 +08:00
Jakob-Naucke
2ee40027e5
packaging: Add VFIO-AP fragment for s390x
Add vfio-ap.conf to the s390 kernel config fragments, which includes
the necessary flags for passing an IBM Adjunct Processor (AP) device
over VFIO.

Fixes: #567

Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
Reviewed-by: alicefr <afrosi@redhat.com>
2020-08-25 17:10:35 +02:00
Julio Montes
60770f4629
Merge pull request #566 from Jakob-Naucke/revendor-govmm-vfio-ap
runtime: Re-vendor GoVMM for hotplugging IBM Adjunct Processor (AP) devices over VFIO
2020-08-25 08:46:25 -05:00
Julio Montes
e6757de2ac
Merge pull request #543 from likebreath/clh_backporting
clh: Port cloud-hypervisor related changes from kata-runtime
2020-08-25 08:42:03 -05:00
Jakob-Naucke
4c30b2554f
runtime: Re-vendor GoVMM for VFIO-AP support
This is a re-vendor of intel/govmm, with support for hot-plugging IBM
Adjunct Processor (AP) devices over VFIO. This is necessary for
enabling AP device pass-through in Kata (see #491).

    39c372a Add support for hot-plugging IBM VFIO-AP devices
    f5bdd53 travis: disable amd64 jobs
    1af1c0d github: enable github actions
    4831c6e travis: Run coveralls after success
    cf0f05d qemu: add iommu_platform knob for qemuParams
    175ac49 typo fix

Fixes: #565

Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-25 10:35:11 +02:00
Evan Foster
282bff9f94 sandbox: Disconnect from agent after VM shutdown
When a one-shot pod dies in CRI-O, the shimv2 process isn't killed until
the pod is actually deleted, even though the VM is shut down. In this
case, the shim appears to busyloop when attempting to talk to the (now
dead) agent via VSOCK. To address this, we disconnect from the agent
after the VM is shut down.

This is especially catastrophic for one-shot pods that may persist for
hours or days, but it also applies to any shimv2 pod where Kata is
configured to use VSOCK for communication.

See github.com/kata-containers/runtime#2719 for details.
Fixes #2719

Signed-off-by: Evan Foster <efoster@adobe.com>
2020-08-24 09:53:28 -06:00
Salvador Fuentes
29aae01779
Merge pull request #559 from snir911/doc
docs: remove outdated dependencies from agent docs
2020-08-24 10:19:29 -05:00
Julio Montes
5b707234d8
Merge pull request #511 from Jakob-Naucke/forward-s390x-packaging
[forward-port] packaging: s390x kernel config fragments
2020-08-24 09:44:04 -05:00
Alice Frosi
9f1a3d15db
kernel: add s390x fragment
Support for s390x kernel fragments.

Fixes: #1041

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:36:01 +02:00
Alice Frosi
f13506163b
kernel: config CONFIG_GENERIC_MSI_IRQ_DOMAIN
Moved CONFIG_GENERIC_MSI_IRQ_DOMAIN in arch base.conf.
The config is not selected for s390x

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:36:01 +02:00
Alice Frosi
b67325c3ac
kernel: add missing configs
Some kernel configs need additional dependencies:
  - CONFIG_NO_HZ depends on
      CONFIG_GENERIC_CLOCKEVENTS
  - CONFIG_CGROUP_PERF depends on
      CONFIG_PERF_EVENTS
        CONFIG_HAVE_PERF_EVENTS
  - CONFIG_BLK_DEV_LOOP depends on
      CONFIG_BLK_DEV
        CONFIG_BLOCK

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:36:00 +02:00
Alice Frosi
454dd85432
kernel: config CONFIG_ PARAVIRT
Moved CONFIG_ PARAVIRT to each arch base.conf.

CONFIG_ PARAVIRT only defined in x86, arm64, arm in arch/$arch/Kconfig.

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:36:00 +02:00
Alice Frosi
62b45064d4
kernel: config CONFIG_NO_HZ_FULL
Moved CONFIG_NO_HZ_FULL config to each arch base.conf.

The config CONFIG_NO_HZ_FULL depends on CONFIG_HAVE_CONTEXT_TRACKING.
See https://github.com/torvalds/linux/blob/
a811c1fa0a02c062555b54651065899437bacdbe/kernel/time/Kconfig#L96

The context tracking is not supported on s390x yet.
See https://github.com/torvalds/linux/blob/
a811c1fa0a02c062555b54651065899437bacdbe/Documentation/features/time/
context-tracking/arch-support.txt#L27

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:35:59 +02:00
Alice Frosi
6dca74ba72
kernel: moved acpi hotplug config
Moved:
---
CONFIG_HOTPLUG_PCI_ACPI=y
CONFIG_PNPACPI=y
---
from hotplug to acpi.
In this way, it is possible to skip these config if the acpi feature is
not supported.

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:35:59 +02:00
Alice Frosi
7c85decc82
kernel: config CONFIG_PCI_MSI_IRQ_DOMAIN
For certain kernel version CONFIG_PCI_MSI_IRQ_DOMAIN is only supported
on x86 and arm64.
See https://github.com/torvalds/linux/blob/
219d54332a09e8d8741c1e1982f5eae56099de85/drivers/pci/Kconfig#L55

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:35:44 +02:00
Alice Frosi
efe51b291c
kernel: fragment for pmem
The option CONFIG_VIRTIO_PMEM is not supported on s390x.
It requires nvdimm support.

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:25:34 +02:00
Alice Frosi
08d046d994
kernel: config CONFIG_HAVE_NET_DSA
The kernel config CONFIG_HAVE_NET_DSA is not supported on s390x.
See https://github.com/torvalds/linux/blob/master/net/dsa/Kconfig#L4.
Config moved to arch directory.

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:25:34 +02:00
Alice Frosi
7b49fa121b
kernel: fragments not supported on s390x
Add !s390x tag to skip these group of fragments for s390x.

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-08-24 14:25:30 +02:00
Peng Tao
ccfb73cb8c agent/agent-ctl: update Cargo.lock
rustc 1.45.2 would just ask for these depenedencies.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-24 19:31:08 +08:00
Chelsea Mafrica
fd13c93c6a virtcontainers: Add msg to existing utils unit tests
Add message to existing unit tests that use arrays and loops for easier
debugging.

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-08-23 19:49:40 -07:00
Chelsea Mafrica
c3fc09b95b virtcontainers: Add to utils unit tests
Expand unit tests for virtcontainers/utils/utils.go to include testing
CleanupFds, CPU calculations, ID string creation, and memory alignment
functions.

Fixes #490

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-08-23 19:49:40 -07:00
Peng Tao
942041ecd7
Merge pull request #548 from Tim-Zhang/fix-action-check-subsystem
action: Fix subsystem check
2020-08-24 10:27:30 +08:00
Snir Sheriber
965825564d docs: remove outdated dependencies from agent docs
switched from grpc to ttrpc (a7041c27d)

Fixes: #558

Signed-off-by: Snir Sheriber <snir911@gmail.com>
2020-08-23 14:26:40 +03:00
James O. D. Hunt
d12f920b3f console: Fix crash if debug console disabled
The logic for the debug console meant that if the debug console was
_disabled_, the agent was guaranteed to crash on function exit due to
the unsafe code block. Fixed by simplifying the code to use the standard
`Option` idiom for optional values.

Fixes: #554.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-08-21 17:52:58 +01:00
James O. D. Hunt
572de288f0 sandbox: Remove unnecessary thread
Don't create a thread to wait for the ttRPC server to end - it isn't
required as the operation should be blocked on.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-08-21 17:52:58 +01:00
James O. D. Hunt
d5fbba3b0a main: Remove commented out and redundant code
Remove confusing commented out code and some stray testing code.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-08-21 17:52:58 +01:00
James O. D. Hunt
1b2fe4a5be agent: Refactor main function
Move the sandbox creation into a new function.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-08-21 17:52:58 +01:00
James O. D. Hunt
bac79eeef0 main: Display config in announce
Add the configuration details in the announcement log call.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-08-21 17:52:58 +01:00
James O. D. Hunt
e2952b5354 main: Simplify version handling
Print a simple version string rather than delaying the output
to display a structured version string. The structured output
is potentially more useful but:

- This output is not consistent with other components.

- Delaying the output makes `--version` unusable in some
  environments (since a lot of setup is called before the
  version string can be output).

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-08-21 17:52:15 +01:00
Tim Zhang
cfa35a90b2 action: Fix subsystem check
\h is not a valid metacharacter in javascript which is used in
github-action.
Use \s\t to replace it.

Fixes: #551

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-08-21 23:49:43 +08:00
Pradipta Kumar
bba2773d7d
Merge pull request #482 from Amulyam24/fix-ppc64le-rootfs
osbuilder : ppc64le support for rust agent based rootfs/initrd image
2020-08-21 12:46:10 +05:30
Jose Carlos Venegas Munoz
39b53f4467 clh: enable build using Podman
[ Port from packaging commit 4e1b5729f47d5f67902e1344521bc5b121673046 ]

Build clh with Podman, allow build the vmm in the Podman CI

Virtiofs qemu has to be build as this is requried by clh.

Fixes: #461

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-08-20 14:00:31 -07:00
Jose Carlos Venegas Munoz
04b156f604 qemu-virtiofs: Update to qemu 5.0 + virtiofs + dax
[ Port from packaging commit cbe53bdb14e303830fa9f2d5a7f3c9161a32f033 ]

Update build scripts for qemu-virtiofs.

- virtiofs-0.3 patches are not needed
- Sync build on how vanilla qemu is built
- Apply patches for virtiofsd if any (none today)
- Apply patches that are used for the qemu vanilla
- Apply patches in order

Fixes: #461

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-08-20 14:00:28 -07:00
Bo Chen
3ec05a9f95 clh: Add support to unplug block devices
[ Port from runtime commit 44b58e4151d1fc7debed41274b65c37233a437e3 ]

This patch enables kata+clh to unplug block devices, which is required
to pass cri-o integration tests.

Fixes: #461

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-08-20 14:00:24 -07:00
Bo Chen
45e32e1b77 clh: Set 'Id' explicitly while hotplugging block device
[ Port from runtime commit 03fb9c50c180d3359178c30e06f1122df312ae76 ]

To support unplug block device, we need to set the 'Id' explicitly while
hotplugging devices with cloud-hypervisor HTTP API.

Fixes: #461

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-08-20 14:00:21 -07:00
Jose Carlos Venegas Munoz
895959d007 clh: Provide cpu topology to API
[ Port from runtime commit 39897867bc89667daaafdd141367ec4a5fdc9247 ]

API now requires cpu topology.

Fixes: #461

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-08-20 14:00:18 -07:00