Commit Graph

5290 Commits

Author SHA1 Message Date
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
Liu Jiang
6995178903 netlink: use bool for condition flags
Minor improvements for netlink by using bool for condition flags.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-05-31 02:58:10 +08:00
James O. D. Hunt
43db1284e9
Merge pull request #239 from Tim-Zhang/neigh
agent: port https://github.com/kata-containers/agent/pull/784
2020-05-29 15:56:52 +01:00
Tim Zhang
635c7a785a agent: port https://github.com/kata-containers/agent/pull/784
Add grpc API for adding arp neighbours for a network
interface. These are expected to be static arp entries
sent by the runtime.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-05-29 22:28:10 +08:00
Graham Whaley
d1b4873bf5
Merge pull request #1042 from alicefr/skip-common-frag-config
fragments: skip some config base on the arch
2020-05-29 14:21:57 +01:00
Graham Whaley
f3cf6a039d
Merge pull request #1063 from jongwu/virt
qemu: add virt board specific optimized qemu config for arm
2020-05-29 14:20:27 +01:00
Peng Tao
1d2f611a80
Merge pull request #240 from Tim-Zhang/fix-generate-protocols
agent: fix make generate-protocols errors
2020-05-29 17:41:10 +08:00
Tim Zhang
cb58075a26 agent: fix make generate-protocols errors
Got:
make PROTO_FILE=agent.proto generate-protocol
google/protobuf/descriptor.proto: Read access is denied for file: /usr/local/include/google/protobuf/descriptor.proto

This commit will fix this error.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-05-29 16:05:04 +08:00
GabyCT
506ba67106
Merge pull request #235 from chavafg/2.0-dev
Move versions.yaml to root directory and use it for osbuilder scripts
2020-05-28 11:18:30 -05:00
Salvador Fuentes
4718a8398f
Merge pull request #1032 from grahamwhaley/20200430_travis
CI: enable Travis static checks
2020-05-28 11:07:02 -05:00
Salvador Fuentes
81e11c9f7c osbuilder: remove references to agent and runtime repos
tools/osbuilder/scripts/lib.sh was making references to agent and
runtime repositories to get golang, rust, cmake and musl versions.
Since runtime and agent repos are consolidating, we only need to
make reference to our versions.yaml in this (kata-containers) repo.

Fixes: #234.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-05-28 10:33:25 -05:00
Salvador Fuentes
a449786544 versions: move versions.yaml to top directory
Instead of having the versions.yaml in the runtime source,
it makes more sense to have it in the root directory of
the project.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-05-28 10:33:25 -05:00
Jianyong Wu
d81fdde6b0 qemu: add virt board specific optimized qemu config for arm
qemu contains all device support for all the board qemu supported
on arm. But we use virt machine in most cases, so there are lots
of code in no relationship with virt then never used.
Here, we add a customized config, named arm-softmmu.mak.virt for
virt board. There is around 5M decrease of qemu binary using this
customized config compared with the common config.
arm-softmmu.mak includes and customizes the pci.mak and usb.mak to let
the change in aarch64-softmmu take effect. also arm-softmmu.mak.virt
is base on arm-softmmu.mak.

comparison of qemu binary between using common config and virt config
-rwxr-xr-x  1 root root 64190080 May 28 12:49 qemu-system-aarch64*
-rwxr-xr-x  1 root root 59061584 May 27 18:14 qemu-system-aarch64.virt*

Fixes: #1062
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2020-05-28 13:47:58 +08:00