Commit Graph

4821 Commits

Author SHA1 Message Date
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
Hui Zhu
85256e0494
Merge pull request #236 from liubin/refactoring-proto-compilation
Agent: centrally manage proto files
2020-05-28 10:05:05 +08:00
Hui Zhu
38f196b06e
Merge pull request #233 from liubin/porting/agent-616
agent: porting https://github.com/kata-containers/agent/pull/616
2020-05-28 10:03:28 +08:00
Hui Zhu
d36ad1e730
Merge pull request #232 from bergwolf/runtime-port-1.11.0
port runtime commits up to 1.11.0 release
2020-05-28 09:56:56 +08:00
Julio Montes
25a1d7b2e3
Merge pull request #1061 from devimc/2020-05-27/static-build/fixQemu5
static-build: build qemu on ubuntu 20.04
2020-05-27 13:47:54 -05:00
Julio Montes
bef96a95e7 static-build: build qemu on ubuntu 20.04
Update ubuntu version to 20.04, due to the following linkage errors
is not possible to build QEMU 5 on ubuntu 18.04.

```
libmount.a(libmount_la-fs.o): In function `__mnt_fs_set_source_ptr':
(.text+0x9b1): undefined reference to `blkid_parse_tag_string'
libmount.a(libmount_la-tab.o): In function `mnt_table_find_source':
(.text+0x1dbf): undefined reference to `blkid_parse_tag_string'
libmount.a(libmount_la-utils.o): In function `mnt_tag_is_valid':
(.text+0x618): undefined reference to `blkid_parse_tag_string'
libmount.a(libmount_la-cache.o): In function `mnt_free_cache':
(.text+0x834): undefined reference to `blkid_put_cache'
libmount.a(libmount_la-cache.o): In function `mnt_cache_read_tags':
(.text+0xa24): undefined reference to `blkid_new_probe_from_filename'
(.text+0xa3d): undefined reference to `blkid_probe_enable_superblocks'
(.text+0xa4a): undefined reference to `blkid_probe_set_superblocks_flags'
(.text+0xa57): undefined reference to `blkid_probe_enable_partitions'
(.text+0xa64): undefined reference to `blkid_probe_set_partitions_flags'
(.text+0xa6c): undefined reference to `blkid_do_safeprobe'
(.text+0xb32): undefined reference to `blkid_free_probe'
(.text+0xb7c): undefined reference to `blkid_free_probe'
(.text+0xba0): undefined reference to `blkid_probe_lookup_value'
libmount.a(libmount_la-cache.o): In function `mnt_get_fstype':
(.text+0xef0): undefined reference to `blkid_new_probe_from_filename'
(.text+0xf09): undefined reference to `blkid_probe_enable_superblocks'
(.text+0xf16): undefined reference to `blkid_probe_set_superblocks_flags'
(.text+0xf1e): undefined reference to `blkid_do_safeprobe'
(.text+0xf4a): undefined reference to `blkid_free_probe'
(.text+0xf68): undefined reference to `blkid_probe_lookup_value'
libmount.a(libmount_la-cache.o): In function `mnt_resolve_tag':
(.text+0x130b): undefined reference to `blkid_evaluate_tag'
```

fixes #1060

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-05-27 16:24:22 +00:00
Julio Montes
b8c82a2c04 static-build: update qemu blacklist file
Remove `ppc_rom.bin` from the blacklist file since it's no longer
present in QEMU 5

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-05-27 16:24:22 +00:00
Julio Montes
481ca872fe
Merge pull request #1045 from justin-he/qemu_size
Further optimization for qemu binary size
2020-05-27 08:19:03 -05:00
Julio Montes
512908f7c2
Merge pull request #1059 from devimc/2020-05-26/static-build/qemu5
static-build: update QEMU build dependencies
2020-05-27 08:06:57 -05:00
bin liu
a3eb0c970e Agent: centrally manage proto files
In Kata 1.x, agent interface is defined in agent repo and vendored by runtime. But in Kata 2.0, agent and runtime will use ttrpc as protocol, and agent is using rust language, so runtime can't vendor agent again, have to compile from agent's protobuf files.

This PR will hold proto files under src/agent, and compile it to rust/go sources for agent/runtime. Typing `make generate-protocols` under root of this repo or `src/agent` can see how to use it.

Signed-off-by: bin liu <bin@hyper.sh>
2020-05-27 21:05:36 +08:00
Julio Montes
4989b49d8a static-build: update QEMU build dependencies
update QEMU build dependencies to support QEMU 5

fixes #1058

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-05-26 21:23:51 +00:00
GabyCT
da83738c93
Merge pull request #661 from grahamwhaley/20200526_minikube_containerd
install: minikube: add containerd details
2020-05-26 12:33:48 -05:00
Graham Whaley
d8e8754c19 install: minikube: add containerd details
We only documented how to launch minikube/kata with CRI-O. It is
trivial to flip this to containerd, and that also works with kata-deploy,
so document it.

Fixes: #660

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-05-26 17:20:40 +01:00
Alice Frosi
b4a51d8939 docs: add fragment exclusion tag
Document how to use the !arch tag added by #1042

Fixes: #1010

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2020-05-26 16:36:36 +02:00
Alice Frosi
1c6aae1e15 fragments: skip some config base on the arch
Not all the fragments in common are needed by all the arch. The fragment
can be skipped if the have the tag !arch. For example:
      # !s390x

Fixes: #1010

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2020-05-26 16:32:31 +02:00
Salvador Fuentes
a5ef8fcac0
Merge pull request #1047 from jcvenegas/vsock-fix-backport
sock: Add mising fix to experimental kernel
2020-05-26 09:16:03 -05:00
bin liu
9b9f2b2ff0 agent: porting https://github.com/kata-containers/agent/pull/616
this PR will port the original PR to kata 2.0.

Signed-off-by: bin liu <bin@hyper.sh>
2020-05-26 18:17:54 +08:00
Peng Tao
0e0f30b152 vc: fix device driver test
We should import kata-containers path.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 01:15:24 -07:00
Jose Carlos Venegas Munoz
202a877d36 utils: Fix case version check for stable releases
For stable versions the format used `x.y.z`.

kata-env was failing trying to make a new release from 1.11.0-rc to
1.11.0

This fix kata-env for releases 1.11+ where this regression was
introduced.

Fixes: kata-containers/runtime#2674
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:51:01 -07:00
Bo Chen
48b20e75f8 clh: vsock: Supply the right VsockConfig to Vmconfig
With the new HTTP API from CLH, it removes the support of multiple
virtio-vsock devices, as the Linux kernel does not support it.

Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-05-26 00:51:01 -07:00