Commit Graph

2192 Commits

Author SHA1 Message Date
Tim Zhang
eac003462d Merge pull request #3370 from lifupan/fix_namespace
agent: fix the issue of creating new namespaces for agent
2022-01-21 10:25:43 +08:00
Bo Chen
2d799cbfa3 virtcontainers: clh: Re-generate the client code
This patch re-generates the client code for Cloud Hypervisor v21.0.
Note: The client code of cloud-hypervisor's (CLH) OpenAPI is
automatically generated by openapi-generator [1-2].

[1] https://github.com/OpenAPITools/openapi-generator
[2] https://github.com/kata-containers/kata-containers/blob/main/src/runtime/virtcontainers/pkg/cloud-hypervisor/README.md

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-01-20 17:48:10 -08:00
Fabiano Fidêncio
5ce9011a36 govmm: s390x: Skip broken tests
For now a bunch of tests are simply not working.

Let's skip them all, and re-enable them once
kata-containers/kata-containers/issues/3500 gets fixed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-20 01:04:35 +01:00
Fabiano Fidêncio
8bcaed0b4f govmm: Adapt license headers to kata-containers
Both projects follow the same license, Apache-2.0, but the header saying
that comes from govmm is different from the one expected for the tests
present on the kata-containers repo.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-19 18:02:46 +01:00
Fabiano Fidêncio
6dd6577986 govmm: Ignore govet checks, at least for now
govet checks have been ignored on govmm repo, but those are enabled on
kata-containers one.  So, in order to avoid failing our CIs let's just
keep ignoring the checks for the govmm structs and have an issue opened
for fixing it whenever someone has cycles to do it.

The important bit here is, we're not making anything worse that it
already is. :-)

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-19 18:02:46 +01:00
Fabiano Fidêncio
de678a3aaa govmm: Remove non-relevant top files
govmm, from now on, should follow the same guidelines from contributing,
copying, and etc as kata-containers does.

The go.mod is not needed anymore as the project lives inside the
runtime.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-19 18:02:46 +01:00
Fabiano Fidêncio
ec6655af87 govmm: Use govmm from our own pkg
Let's stop using govmm from kata-containers/govmm and let's start using
it from our own repo.

Fixes: #3495

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-19 18:02:46 +01:00
Fabiano Fidêncio
fb7f98bd2e Merge govmm into kata-containers 2022-01-19 09:40:15 +01:00
Julio Montes
c0e28b54a1 Merge pull request #3460 from devimc/2021-01-17/vendorGovmm
vendor: update govmm
2022-01-18 15:54:11 -06:00
Julio Montes
49223e67af runtime: remove enable_swap option
`enable_swap` option was added long time ago to add
`-realtime mlock=off` to the QEMU's command line.
Kata now supports QEMU 6, `-realtime` option has been deprecated and
`mlock=on` is causing unexpected behaviors in kata.
This patch removes support for `enable_swap`, `-realtime` and `mlock=`
since they are causing bugs in kata.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-01-18 11:12:29 -06:00
Jakob Naucke
5285ac2b57 runtime: -Wl,--s390-pgste for s390x
for linking. Required for basic KVM checks on some kernels (e.g. the
one RHEL is currently shipping), cf.
6621441db5/target/s390x/kvm/meson.build (L15-L16).

Fixes: #3469
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-01-18 11:32:03 +01:00
Julio Montes
41e0c414a4 vendor: update govmm
bring SGX support and other fixes

shortlog:
8939b0f qemu: add support for SGX
b17f073 qemu: update readonly flag for block devices
f971801 qemu: only set wait parameter for server mode socket based
        char device
82cc01d qemu: Fix 32 bit int overflow in test file
1d1a231 qemu: Add support for legacy serial device
9a2bbed qemu: Remove -realtime in favor of -overcommit
fe83c20 qemu: Add support for --no-shutdown Knob
1ed5271 qmp: wait for POWERDOWN event in ExecuteSystemPowerdown()

fixes #3080

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-01-17 09:20:47 -06:00
Eric Ernst
9277317098 agent: resolve unused variables in tests
A few tests have unused or unread variables. Let's clean these up...

Fixes: #3530
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-01-16 14:09:03 -08:00
Sebastian Hasler
adffd3f8b6 scripts: Use shebang /usr/bin/env bash
Not all distros have `/bin/bash`, e.g. NixOS.

Fixes: #3450

Signed-off-by: Sebastian Hasler <sebastian.hasler@stuvus.uni-stuttgart.de>
2022-01-13 22:53:28 +01:00
liangxianlong
878ab93c15 runtime: Provide protection for shared data
The k.reqHandlers should be protected by locks when used

Fixes #3440

Signed-off-by: liangxianlong <liang.xianlong@zte.com.cn>
2022-01-13 14:48:10 +08:00
James O. D. Hunt
ef835b5948 Merge pull request #3418 from yangfeiyu20102011/main
runtime: it should rollback when failed in Sandbox AddInterface
2022-01-12 10:22:36 +00:00
Bin Liu
a561159f7b Merge pull request #3423 from liubin/fix/3422-ignore-some-generated-files
libs: add some generated files to .gitignore
2022-01-12 15:46:21 +08:00
bin
85f5ae190e runtime: close span before return from function in case of error
Return before closing span will cause invalid spans, so span should
be closed before function return.

Fixes: #3424

Signed-off-by: bin <bin@hyper.sh>
2022-01-11 19:45:41 +08:00
bin
106df33ff8 libs: add some generated files to .gitignore
Generated protocols files should not be inclued in Git repo.

And also add Cargo.lock in oci/protocols directory to .gitignore.

Fixes: #3422

Signed-off-by: bin <bin@hyper.sh>
2022-01-11 19:29:27 +08:00
yangfeiyu
b133a2368a runtime: it should rollback when failed in Sandbox AddInterface
When Sandbox AddInterface() is called, it may fail after endpoint.HotAttach,
we'd better rollback and call save() in the end.

Fixes: #3419

Signed-off-by: yangfeiyu <yangfeiyu20102011@163.com>
2022-01-11 18:43:43 +08:00
Feng Wang
c486c2ca18 agent: fix the broken protobuf generation code
After the protocols are moved to upper libs (PR3355),
the runtime protocol generation is broken. This fixes it.

Fixes: #3414

Signed-off-by: Feng Wang <feng.wang@databricks.com>
2022-01-10 15:37:00 -08:00
Gabriela Cervantes
ad16d75c07 runtime: Remove docker comments for kata 2.0 configuration.tomls
This PR removes the reference of how to use disable_new_netns
configuration with docker as for kata 2.0 we are not supporting docker
and this information was used for kata 1.x

Fixes #3400

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-01-06 16:08:10 +00:00
James O. D. Hunt
66510b977d Merge pull request #3392 from zhsj/fix-doc
docs: fix agent proto file path
2022-01-06 14:31:34 +00:00
Eric Ernst
e073c0936b Merge pull request #3279 from egernst/containerd-vendor-bump
vendor: update to containerd v1.6.0-beta.4
2022-01-05 11:13:05 -08:00
Shengjing Zhu
905e124b77 docs: fix agent proto file path
Fixes: #3391

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2022-01-06 00:22:49 +08:00
Bin Liu
94f14cf6f7 Merge pull request #3363 from zhsj/remove-binary
vc: remove swagger binary
2022-01-05 20:40:33 +08:00
Bin Liu
f622d9491f Merge pull request #3253 from stevenhorsman/agent-config-cmdline
agent: Refactor command line parsing to use a framework
2022-01-05 20:25:57 +08:00
Fupan Li
615224e993 agent: move the protocols to upper libs
move the protocols to upper libs thus it can
be shared between agent and other rust runtime.

Depends-on: github.com/kata-containers/tests#4306

Fixes: #3348

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2022-01-05 16:58:06 +08:00
Fupan Li
330e3dcc93 agent: move the oci crate to upper libs
Move the oci crate to upper libs thus it can be
shared between agent and other rust runtimes.

Fixes: #3348

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2022-01-05 16:58:06 +08:00
Bin Liu
b2166560fa Merge pull request #3375 from zhaojizhuang/debianrootfs
osbuilder: Restore Debian as a rootfs
2022-01-05 10:27:47 +08:00
Eric Ernst
7b03d78f15 vendor: update to containerd v1.6.0-beta.4
Update our containerd vendoring. In particular, we're interested in
grabbing the updated annotation definitions for defining sandbox sizing.

- go get github.com/containerd/containerd@v1.6.0-beta.4
- edit go.mod to remove containerd v1.5.8 replacement directive
- go mod vendor
- go mod tidy

Fixes: #3276

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-01-04 17:15:17 -08:00
GabyCT
caa4e89dfc Merge pull request #3366 from Kvasscn/kata_dev_fix_kata-collect-data_typo
runtime: fix a typo in kata-collect-data.sh
2022-01-04 17:03:34 -06:00
James O. D. Hunt
a838a598ef Merge pull request #3354 from liubin/fix/3353-return-error-details
agent: return detail error message for RPC calls from shim
2022-01-04 14:06:25 +00:00
stevenhorsman
1c4edb9619 agent: Refactor arg parsing to use clap
Fixes: #3284

Co-authored-by: Samuel Ortiz <samuel.e.ortiz@protonmail.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2022-01-04 09:14:08 +00:00
zhaojizhuang
3093f93a6f osbuilder: Restore Debian as a rootfs
Restore Debian as a rootfs.
1. revert of #3154, but some change
2. update debian version to 10.11
3. update  `libstdc++-6-dev` to `libstdc++-8-dev`
4.  changes discarded in QAT are not restored

Fixes: #3372
Signed-off-by: zhaojizhuang <571130360@qq.com>
2022-01-04 11:54:34 +08:00
Fupan Li
ea1a173854 agent: fix the issue of creating new namespaces for agent
The tokio's spawn will only create an future async task
instead of a new real thread, thus executing unshare to
create a new namespace in tokio's async task would make
the agent process to join in the new created namespace,
which isn't expected.

Thus, we'd better to to the unshare in a real thread to
prevent moving the agent process into a new namespace.

Fixes: #3369

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2021-12-30 13:32:22 +08:00
zhanghj
2254fa8657 runtime: fix a typo in kata-collect-data.sh
Fix a typo while to check if mountpoint exist.

Fixes: #3365

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2021-12-28 10:03:18 +08:00
Shengjing Zhu
2d0f9d2d06 vc: remove swagger binary
Fixes: #3362

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2021-12-25 22:41:29 +08:00
bin
cf91307c66 agent: return detail error message for rpc calls from shim
For calls from shim to agent, the return error will be processed like this:

match self.do_start_container(req).await {
    Err(e) => Err(ttrpc_error(ttrpc::Code::INTERNAL, e.to_string())),
    Ok(_) => Ok(Empty::new()),
}

The e.to_string() return only a part of the error(for example set by context()),
this may lead lack of information.

The `format!("{:?}", err)` will return more info.

Fixes: #3353

Signed-off-by: bin <bin@hyper.sh>
2021-12-24 17:17:29 +08:00
Fupan Li
0fe20854e7 Merge pull request #2481 from Bevisy/main-1494
Makefile: update `make go-test` call
2021-12-24 09:57:06 +08:00
James O. D. Hunt
ba22a04265 Merge pull request #2958 from ManaSugi/ignore-unknown-systemcall
agent: Ignore unknown seccomp system calls
2021-12-23 12:12:47 +00:00
Peng Tao
8b6fbf9108 Merge pull request #3331 from dubek/mount-remove-var
agent: mount: Remove unneeded mount_point local variable
2021-12-23 11:53:14 +08:00
Jakob Naucke
137e217b85 docs: Fix outdated k8s link
in virtcontainers readme

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-22 19:40:25 +01:00
Dov Murik
91abebf92e agent: mount: Remove unneeded mount_point local variable
We already have a `mount_path` local Path variable which holds the mount
point.

Use it instead of creating a new `mount_point` variable with identical
type and content.

Fixes: #3332

Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
2021-12-22 14:11:50 +02:00
James O. D. Hunt
b1f4e945b3 security: Update rust crate versions
Update the rust dependencies that have upstream security fixes. Issues
fixed by this change:

- [`RUSTSEC-2020-0002`](https://rustsec.org/advisories/RUSTSEC-2020-0002) (`prost` crate)
- [`RUSTSEC-2020-0036`](https://rustsec.org/advisories/RUSTSEC-2020-0036) (`failure` crate)
- [`RUSTSEC-2021-0073`](https://rustsec.org/advisories/RUSTSEC-2021-0073) (`prost-types` crate)
- [`RUSTSEC-2021-0119`](https://rustsec.org/advisories/RUSTSEC-2021-0119) (`nix` crate)

This change also includes:

- Minor code changes for the new version of `prometheus` for the agent.

- A *downgrade* of the version of the `futures` crate to the (new)
  latest version (`0.3.17`) since version `0.3.18` was removed [1].

Fixes: #3296.

[1] - See https://crates.io/crates/futures/versions

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-12-22 07:41:16 +00:00
James O. D. Hunt
c2578cd9a1 docs: Clarify where to run agent API generation commands
Make it clear when reading the table in the agent's "Change the agent
API" documentation that the commands in the "Generation method" column
should be run in the agent repo.

Fixes: #3317.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-12-20 15:45:36 +00:00
James O. D. Hunt
2ebae2d279 Merge pull request #3287 from jodh-intel/docs-split-arch-doc
Split architecture doc into separate files
2021-12-20 10:11:30 +00:00
Chelsea Mafrica
1653dd4a30 tracing: Add span name to logging error
Add span name to logging error to help with debugging when the context
is not set before the span is created.

Fixes #3289

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-12-16 12:44:42 -08:00
James O. D. Hunt
6f9efb4043 docs: Move arch doc to separate directory
Move the architecture document into a new `docs/design/architecture/` directory
in preparation for splitting it into more manageable pieces.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-12-16 12:26:17 +00:00
Steve Horsman
39cf2b27c1 Merge pull request #3261 from stevenhorsman/native-agent-config-opt
agent: Add config file option to cli
2021-12-16 10:00:56 +00:00