Commit Graph

1241 Commits

Author SHA1 Message Date
Hui Zhu
5231a3eddf Merge pull request #452 from cmaf/unit-virtcontainers-container
virtcontainers: Add unit test for types/container.go
2020-08-07 16:45:01 +08:00
Fabiano Fidêncio
ec84a94a61 Merge pull request #474 from merwick/2.0-dev
Kata 2.0-dev port of #2867 (NoReboot Knob)
2020-07-30 22:10:46 +02:00
Liam Merwick
c15ef219e5 qemu: Set govmmQemu NoReboot config Knob
The Kata architecture does not support rebooting VMs (the lifecycle
being start/exec/kill) and if a VM is killed (e.g. using sysrq-trigger),
the VM does not exit fully and other layers do not notice the state change.
Set the NoReboot config Knob so that govmmQemu.LaunchQemu() runs QEMU
with the --no-reboot command-line option.

Fixes: #2866

Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
2020-07-30 16:04:08 +01:00
Liam Merwick
5726926201 qemu: Add test for qemuConfig Knobs
Add TestQemuKnobs unit test to validate parameters passed to QEMU.

Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
2020-07-30 16:04:05 +01:00
Julio Montes
b94b46db08 Merge pull request #467 from jongwu/multidev
qemu: remove multidev in fsdev parameter on arm64
2020-07-30 08:07:59 -05:00
Fupan Li
a3c300f06b Merge pull request #459 from liubin/feature/458-add-structured-log
runtime: change un-structured log to structured log
2020-07-30 17:26:18 +08:00
bin liu
61d133f941 runtime: change un-structured log to structured log
Change some logger from directly calling logrus to use a
logrus instance to use structured log.

Fixes: #458

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-30 16:07:41 +08:00
Chelsea Mafrica
31d601b772 Merge pull request #429 from cmaf/unit-virtcontainers-cap
virtcontainers: Add function to capabilities test
2020-07-29 15:15:25 -07:00
Chelsea Mafrica
7169a269e1 Merge pull request #425 from cmaf/unit-virtcontainers-asset
virtcontainers: Expand unit test coverage for asset
2020-07-29 15:02:41 -07:00
Chelsea Mafrica
f24ad25d7b virtcontainers: Add unit test for types/container.go
Add unit tests for types/container.go. Tests were adapted from
sandbox_test.go since ContainerState is a sandbox state structure and
the transition tests are the same.

Fixes #451

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-29 16:10:44 +00:00
Jianyong Wu
1637e9d367 qemu: remove multidev in qemu/fsdev parameter on arm64
As the current qemu of arm64 is so old, the new multidev parameter
in 9pfsdev is not supported on arm64, so disabled it temporarily.

Fixes:#466
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2020-07-29 18:05:37 +08:00
Julio Montes
d5d7c22d42 Merge pull request #460 from devimc/2020-07-27/update-qemu5
update to QEMU 5
2020-07-28 10:11:04 -05:00
Peng Tao
3246bdce7c Merge pull request #445 from liubin/fix/444-remove-docs-about-shim-proxy
docs: remove shim/proxy topics and fix docs links
2020-07-28 20:06:02 +08:00
Chelsea Mafrica
e1a79e6945 virtcontainers: Add function to capabilities test
Add function that tests multiqueue functions in types/capabilities.go.

Fixes #428

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-27 16:15:50 +00:00
Chelsea Mafrica
d1d5c69b64 virtcontainers: Expand unit test coverage for asset
Add additional test cases that cover more asset types and functions to
increase unit test coverage.

Fixes #424

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-27 16:14:41 +00:00
Julio Montes
3c415d93fe virtcontainers: 9p: shares multiple devices with only one export
Use 'remap' behaviour to deal with multiple devices being shared with
a 9p export.

Fixes the following warning:

```
9p: Multiple devices detected in same VirtFS export, which might lead to file
ID collisions and severe misbehaviours on guest!
You should either use a separate export for each device shared from host or
use virtfs option 'multidevs=remap'!
```

fixes #378

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-07-27 10:18:18 -05:00
Peng Tao
322d85c48f Merge pull request #434 from evanfoster/add-container-creation-cleanup
sandbox: Stop and clean up containers that fail to create
2020-07-27 10:00:01 +08:00
bin liu
db93a1631e runtime: remove mock shim
Remove mock codes for shim

Fixes #444

Signed-off-by: bin liu <bin@hyper.sh>
2020-07-25 09:08:44 +08:00
Evan Foster
e5910c9b88 sandbox: Stop and clean up containers that fail to create
A container that is created and added to a sandbox can still fail
the final creation steps. In this case, the container must be stopped
and have its resources cleaned up to prevent leaking sandbox mounts.

Forward port of https://github.com/kata-containers/runtime/pull/2826

Fixes #2816

Signed-off-by: Evan Foster <efoster@adobe.com>
2020-07-24 09:25:47 -06:00
Chelsea Mafrica
0b3cbee815 virtcontainers: Add additional unit tests for sandbox
Add tests for state change, empty string failures for Volumes and
Sockets. Change two function names to accurately reflect tests.

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-24 02:57:41 +00:00
Chelsea Mafrica
07a307b4b1 virtcontainers: Remove duplicate unit tests
Remove tests from virtcontainers/sandbox_test.go which were moved to
virtcontainers/types/sandbox_test.go.

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-24 01:36:12 +00:00
Chelsea Mafrica
d914f01829 virtcontainers: Move unit tests for types/sandbox.go
Move unit tests that were in virtcontainers/sandbox_test.go relating
to Socket, Volume, and SandboxState to types/sandbox_test.go.

Change testSandboxStateTransition function to use SandboxState only
instead of Sandbox from virtcontainers/sandbox.go.

Fixes #435

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-24 01:36:00 +00:00
Chelsea Mafrica
f554cdec2c virtcontainers: Add to bridges unit test
Add function that creates new bridges to increase unit test coverage
for virtcontainers/types/bridges. Also adds test for address formats.

Fixes #422

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-07-16 16:34:49 +00:00
Penny Zheng
1d7d944f2c fc: refactor --daemonize option
Option --daemonize is invalid to firecarcker, and only valid to
jailer.

Fixes: #389

Signed-off-by: Penny Zheng penny.zheng@arm.com
2020-07-16 05:26:28 +00:00
Penny Zheng
7f3e8959c5 console-watcher: use console watcher to monitor guest console outputs
Import new console watcher to monitor guest console outputs, and will be
only effective when we turn on enable_debug option.
Guest console outputs may include guest kernel debug info, agent debug info,
etc.

Fixes: #389

Signed-off-by: Penny Zheng penny.zheng@arm.com
2020-07-16 05:26:19 +00:00
Penny Zheng
1099a28830 kata 2.0: delete use_vsock option and proxy abstraction
With kata containers moving to 2.0, (hybrid-)vsock will be the only
way to directly communicate between host and agent.
And kata-proxy as additional component to handle the multiplexing on
serial port is also no longer needed.
Cleaning up related unit tests, and also add another mock socket type
`MockHybridVSock` to deal with ttrpc-based hybrid-vsock mock server.

Fixes: #389

Signed-off-by: Penny Zheng penny.zheng@arm.com
2020-07-16 04:20:02 +00:00
Xu Wang
c052e46c66 Merge pull request #416 from bergwolf/cleanup
runtime: consolidate network types definition
2020-07-15 22:46:21 +08:00
Peng Tao
5b15e9ef4f runtime: consolidate types definition
We do not need the vc types translation for network data structures.
Just use the protocol buffer definitions.

Fixes: #415
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-07-15 17:48:31 +08:00
James O. D. Hunt
d88f8910ab Merge pull request #402 from sameo/2.0-dev
runtime: virtcontainers: vhost-user-blk/scsi are block device nodes
2020-07-15 09:25:26 +01:00
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
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
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
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
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
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