Commit Graph

4961 Commits

Author SHA1 Message Date
Peng Tao
a76443485c
Merge pull request #319 from lifupan/device_cgroup
Port rootfs access fix to rust agent
2020-06-23 11:06:17 +08:00
Peng Tao
285411ae89
Merge pull request #314 from jodh-intel/2.0-dev-collect-script-more-twists
runtime: Use more folds in collect script
2020-06-23 10:52:58 +08:00
Julio Montes
18c882b0fa
Merge pull request #316 from bpradipt/2.0-ppc64le
qemu: Remove Qemu version check in ppc64le unit test
2020-06-22 11:02:11 -05:00
David Gibson
53473eb2fa qemu: Fix kernel_irqchip=split option for IOMMU enabled sandbox
When an x86 sandbox has a vIOMMU (needed for VFIO), it needs the
'kernel_irqchip=split' option or it can't start.  fdcd1f3a2 attempts to set
that, but ends up just writing it to a temporary (looks like Go for range
loops pass by value).

Fixes: #2694

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-06-22 16:40:18 +02:00
Adrian Moreno
b97287090b qemu: enable iommu on q35
Add a configuration option and a Pod Annotation

If activated:
- Add kernel parameters to load iommu
- Add irqchip=split in the kvm options
- Add a vIOMMU to the VM

Fixes #2694
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-06-22 16:37:20 +02:00
Adrian Moreno
7faaa06a52 qemu: support appending a vIOMMU device
Add a new function appendIOMMU() to the qemuArch interface
and provide an implementation on amd64 architecture.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-06-22 16:37:20 +02:00
Adrian Moreno
03735fb9ee vendor: update govmm to bring iommu support
Bring support for vIOMMU. Commit:

7efaf0b1cd

https://github.com/intel/govmm/pull/127

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-06-22 16:37:20 +02:00
Julio Montes
5c35e3e757
Merge pull request #322 from bpradipt/fwport-ppc64le
[Forward port] Bring ppc64le fixes to 2.0 dev tree
2020-06-22 09:14:39 -05:00
David Gibson
f2c6eb1639 qemu: Don't use non-existent pmu=off cpu parameter on POWER
The ppc64 specific qemu setup code adds a "pmu=off" parameter to the cpu
model if the nestedRun option is set.  But, not only does availability of
the pmu have nothing to do with nesting on POWER, there is no "pmu=" cpu
opton for ppc64 at all.

So, simply remove it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-06-22 23:43:57 +10:00
Pradipta Kr. Banerjee
2d241a6acc qemu: Remove hard-coding of Qemu machine options for ppc64le
Hard-coded Qemu machine options create challenges when running Kata
with latest Qemu (v5.0) or with latest processor version.
This patch makes it configurable by leveraging the existing machine_accelerators
option in configuration.toml.

This patch fixes #2657 for ppc64le

Signed-off-by: bpradipt@in.ibm.com
2020-06-22 06:36:43 +00:00
Pradipta Kr. Banerjee
b4d3a0af87 qemu: Fix Qemu binary path for Power across distros
The default ppc64le Qemu binary path was specific for Ubuntu.
This patch fixes the default binary path for both Fedora and Ubuntu

Fixes: #2738

Signed-off-by: bpradipt@in.ibm.com
2020-06-22 06:35:03 +00:00
David Gibson
773582c56b qemu: Don't apply x86 specific kernel parameters on ppc64le
qemu_ppc64le.go applies the "tsc=reliable", "no_timer_check" and
"noreplace-smp" kernel parameters, despite those being x86 specific.  So,
just remove them.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-06-22 00:27:43 +10:00
GabyCT
510287204b
Merge pull request #673 from fidencio/wip/shimv2-and-crio
shimv2: Add "cri-o" debugging instructions
2020-06-18 10:09:44 -05:00
Fabiano Fidêncio
e9666a9d22 shimv2: Add "cri-o" debugging instructions
Let's add information on how to debug shimv2 when using cri-o, similarly
to what already is present with containerd.

Fixes: #672

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-06-18 01:01:34 +02:00
fupan.lfp
3e00bdffaf agent: fix the issue of broken logger for agent as init process
Dup a new file descriptor for temporary logger writer,
since this logger would be dropped and it's writer would
be closed out of if definition scope, which would cause
the logger process thread terminated if it used the original
pipe write fd.

Fixes: #318

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-06-16 17:13:29 +08:00
fupan.lfp
2548426b0f device: Do not allow container access to the guest rootfs device
With this change, a container is not longer given access to
the underlying root partition.
This is done by explicitly adding the root partition
to the device cgroup of the container.

Fixes: #317

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-06-16 17:13:18 +08:00
Pradipta Kr. Banerjee
21c9535ab4 qemu: Remove Qemu version check in ppc64le unit test
The Qemu version check in unit test case is no longer needed for
Power since we don't support Kata with Qemu version < 4.x.

Fixes: #315

Signed-off-by: bpradipt@in.ibm.com
2020-06-13 17:45:01 +00:00
James O. D. Hunt
dee2cd67f2 runtime: Use more folds in collect script
Improve the output of the data collection script to use lots more folds.
This makes it easier to review the information when viewing the pasted
output in a GitHub issue.

Fixes: #313.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-12 11:40:30 +01:00
James O. D. Hunt
9665868852 runtime: Ignore empty throttlers in collect script
Fix bug by ignoring empty throttlers in the data collection script.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-12 11:35:37 +01:00
James O. D. Hunt
c8015efaa7 runtime: Refector collect script
Add `start_section()` and `end_section()` functions to the data
collection script to allow new unfoldable sections to be created.

Redefine `show_header()` and `show_footer()` to use the new functions.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-12 11:31:34 +01:00
Julio Montes
46f2618340
Merge pull request #311 from jodh-intel/2.0-dev-collect-script-add-shimv2-version
runtime: Add containerd shim v2 version to collect script
2020-06-11 14:02:55 -05:00
Yang Bo
a665f227a7
Merge pull request #303 from lifupan/pause_resume
container pause/resume support
2020-06-11 20:28:41 +08:00
James O. D. Hunt
dae74d5d7a runtime: Add containerd shim v2 version to collect script
Now that the Kata containerd shim v2 can display a version string,
add those details to the data collection script.

Fixes: #309.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-11 08:54:58 +01:00
James O. D. Hunt
13f35f3a6f
Merge pull request #242 from jiangliu/netlink
Refine netlink crate to be reused by other projects
2020-06-11 08:22:54 +01:00
fupan.lfp
e6c0a0bfca container: add pause/resume container functions
add pause/resume container functions.

Fixes:#302

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-06-11 10:16:28 +08:00
James O. D. Hunt
c132bb6bf0
Merge pull request #308 from jodh-intel/2.0-dev-containerd2-add-version-option
shimv2: Add a "--version" cli option
2020-06-10 15:45:04 +01:00
Julio Montes
f9361df8bf
Merge pull request #305 from tedyu/sandbox-create-err
virtcontainers: Check the correct error variable for sandbox creation
2020-06-10 09:39:10 -05:00
James O. D. Hunt
0e08712dc8
Merge pull request #225 from jodh-intel/2.0-dev-trace-forwarder
src: Add trace forwarder component
2020-06-10 11:53:40 +01:00
James O. D. Hunt
f3a37bc67a shimv2: Add a "--version" cli option
All components should support a `--version` option to allow clear
identification of the version of the component being used.

Note that the build changes are required to allow the shim binary to
access the golang code generated by the build (such as the `version`
variable).

Fixes: #307.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-10 11:51:29 +01:00
James O. D. Hunt
56b8ad995b build: Fold long clean line
Folded the overly long clean rule across multiple lines.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-10 11:51:29 +01:00
James O. D. Hunt
6890693444
Merge pull request #244 from jodh-intel/2.0-dev-add-podman-to-collect-script
runtime: Add podman and containerd shim v2 to data collection script
2020-06-10 11:29:11 +01:00
fupan.lfp
fe4166342a container: change the container status from string to enum
Change the container's status from string type to
enum.

Fixes: #302

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-06-10 16:46:41 +08:00
Ted Yu
e469d6b99d virtcontainers: Check the correct error variable for sandbox creation
This PR makes the deferred func check the correct error variable.

Fixes #2759

Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-06-10 01:06:49 -07:00
James O. D. Hunt
48d3471cfe docs: Add trace forwarder doc reference
Add a pointer to the trace forwarder README to the top-level README.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-09 09:55:48 +01:00
James O. D. Hunt
9b987c17d9 src: Add trace forwarder component
Add a new system component, used only when tracing is enabled. The
component listens to the agent over VSOCK, forwarding trace spans
created by the agent in the virtual machine onwards to an OpenTelemetry
collector (such as Jaeger) running on the host.

Fixes: #224.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-09 09:55:47 +01:00
James O. D. Hunt
b165e2a437 runtime: Add containerd shim v2 to collect script
Capture log output from the Kata containerd shim v2.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-09 09:19:49 +01:00
James O. D. Hunt
ca8acf5895 runtime: Add podman to data collection script
Updated `kata-collect-data.sh` to gather basic podman details.

Fixes: #243.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-09 09:19:49 +01:00
James O. D. Hunt
ebbfa321ae runtime: Fix throttler log handling in collect script
Fix a long-standing bug where the KSM throttler logs would not be
collected by removing the last (unused) parameter to the
`find_system_journal_problems()` function.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-09 09:19:49 +01:00
James O. D. Hunt
40a37aa5c6 runtime: Re-order funcs in data collection script
Ensure functions defined before calling them in the data collection
script.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-09 09:19:49 +01:00
James O. D. Hunt
e0148c9cb9 runtime: Fix legacy package regex in collect script
The function that checks for legacy packages in the collect script was
missing pipes denoting regex alternation.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-09 09:15:59 +01:00
James O. D. Hunt
04eced50ad runtime: Fix whitespace in collect script
Remove extraneous whitespace from the `kata-collect-data.sh` script.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-09 09:15:59 +01:00
James O. D. Hunt
e5f5bc2278
Merge pull request #223 from jodh-intel/2.0-dev-kata-agent-ctl
tools: Add kata-agent-ctl
2020-06-08 17:41:17 +01:00
James O. D. Hunt
2e97fbfdc0 docs: Reference kata-agent-ctl doc
Add a link to the `kata-agent-ctl` README.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-08 11:22:19 +01:00
James O. D. Hunt
8a1949546c tools: Add agent-ctl tool
Add a low-level agent control tool that can manipulate the agent
via ttRPC.

Fixes: #222.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-08 11:22:19 +01:00
James O. D. Hunt
2e53d237ce logging: Add ability to convert between log level name and slog level
Added new functions to convert to/from a log level name (like `debug`)
to/from the equivalent `slog::Level::Debug`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-08 11:22:19 +01:00
James O. D. Hunt
e80124ec0f logging: Simplify and update copyright
Tiny simplification. Also updated the copyright.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-08 11:22:19 +01:00
James O. D. Hunt
b95ff30cbf cargo: Moved tempfile crate to dev deps
Don't require the `tempfile` crate unless building in dev mode (such as
when running tests).

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-08 11:22:19 +01:00
James O. D. Hunt
a2dce2dc71 logging: Move agent logger to a separate package
The agent logger is useful and generic enough that it can be used by
other components, so move the agent logging package to below a top level
`pkg` to encourage re-use.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-08 11:22:17 +01:00
GabyCT
0aad3fb8f9
Merge pull request #1065 from devimc/2020-06-03/qemu5/updateDefaulconfigsPatches
qemu: add kata patches for QEMU 5
2020-06-04 13:56:11 -05:00
Julio Montes
1239ad0ba3 qemu: add kata patches for QEMU 5
Add the following patches for QEMU 5:
* memory-backend-file/nvdimm: support read-only files as memory-backends
* 9p: removing coroutines of 9p to increase the I/O performance

fixes #1064

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-06-03 17:25:30 +00:00