Commit Graph

4802 Commits

Author SHA1 Message Date
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
Liu Jiang
4e31bcf8b2 netlink: clean all clippy warnings
Clean up all clippy warning.
Also fix a bug in dealing with IFLA_IFNAME attribute.
nlh.addattr_var(IFLA_IFNAME, name.as_ptr() as *const u8, name.len() + 1);
The `name` is a rust String, which doesn't including the trailing '\0',
so name.len() + 1 may cause invalid memory access.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-06-01 22:31:44 +08:00
Liu Jiang
f5cfd412e4 netlink: fix an error in formatting MAC address
When formatting MAC address, we should left-padding zeros instead
of right-padding.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-06-01 17:58:28 +08:00
Liu Jiang
de23ec1943 netlink: implement TryFrom instead of From to avoid unwrap()
Implment `TryFrom<IPAddress> for RtIPAddr` instead of From<IPAddress>,
so error code could be returned instead of unwrap().
Do the same for `TryFrom<Route> for RtRoute`.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-06-01 17:58:27 +08:00
Liu Jiang
1b8c2cba60 netlink: refine interface to reduce unsafe code
There are too much unsafe code in the netlink crate, we need to reduce
unsafe code as much as possible. To achieve this, methods are classified
as public interfaces and internal methods.

All public interface of RtnlHandle has been reimplemented as safe code,
only some public helper functions to manipulater Netlink message data
structures are implemented as unsafe code.

The code to parse IPv4/IPv6/MAC addresses has been moved to a dedicated
file named parser.rs.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-06-01 16:07:46 +08:00
Liu Jiang
3fe930b946 netlink: get rid of dependency on scan_fmt
The scan_fmt crate has dependency on other four crates, and it's trivial
to use std library to implement the same logic. Get rid of scan_fmt to
reduce the dependency chain.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-06-01 16:07:45 +08:00
Liu Jiang
710932df06 netlink: use features for slog and agent handler
Use features to enable/disable slog and agent handler on demand.
This helps to reduce dependency chains if slog/agent handler is unused.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-06-01 16:07:44 +08:00
James O. D. Hunt
f7d8fc37b4
Merge pull request #1050 from dsyer/v2cri
Detect v2 schema and use correct long form of cri plugin
2020-06-01 09:02:59 +01:00
Liu Jiang
bbd40203d4 netlink: group kata agent code into a dedicated file
Group kata agent specific code into a dedicated file, so we could easily
make it optional later.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-05-31 03:12:25 +08:00
Liu Jiang
4774814c73 netlink: get rid of dependency on rustjail
The netlink crate is a library to communicate with Linux kenrel by using
the netlink socket. It's generic enough to be reused by other clients.
So get rid of dependency on the rustjail crate by:
1) normalize all pub interfaces to return Result<T, nix::Error>,
2) add helpers to reduce duplicated code,
3) move parse_mac() into lib.rs,

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-05-31 03:02:48 +08:00