Commit Graph

8021 Commits

Author SHA1 Message Date
Eric Ernst
f6ae15826e agent: drop unused fields from network
We don't utilize routes or inteface vectors. Let's drop them.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-12-02 17:03:41 -08:00
Chelsea Mafrica
cb4bf486ef
Merge pull request #3179 from likebreath/1202/clh_v20.0
Upgrade to Cloud Hypervisor v20.0
2021-12-02 15:31:14 -08:00
Bo Chen
4756a04b2d virtcontainers: clh: Re-generate the client code
This patch re-generates the client code for Cloud Hypervisor v19.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>
2021-12-02 12:09:12 -08:00
Bo Chen
0bf4d2578a versions: Upgrade to Cloud Hypervisor v20.0
Highlights from the Cloud Hypervisor release v20.0: 1) Multiple PCI
segments support (now support up to 496 PCI devices); 2) CPU pinning; 3)
Improved VFIO support; 4) Safer code; 5) Extended documentation; 6) Bug
fixes.

Details can be found: https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v20.0

Fixes: #3178

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-12-02 12:09:05 -08:00
GabyCT
6edddcced9
Merge pull request #3175 from GabyCT/topic/limitations
docs: Update limitation document regarding docker swarm
2021-12-02 12:03:36 -06:00
Gabriela Cervantes
647082b2c8 docs: Update limitation document regarding docker swarm
This PR removes the information about docker swarm and docker compose
as currently for kata 2.0 we have not support for docker swarm and docker
compose and the links and references that the document is referring are
currently not part of kata 1.0

Fixes #3174

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2021-12-02 16:38:13 +00:00
bin
39b35d0073 agent: user container ID as watchable storage key for hashmap
Use sandbox ID as the key will cause the failed containers' storage
leak.

Fixes: #3172

Signed-off-by: bin <bin@hyper.sh>
2021-12-02 23:28:25 +08:00
Bin Liu
4895015eac
Merge pull request #3166 from fengwang666/dax-bug-fix
runtime: Enable FUSE_DAX kernel config for DAX
2021-12-02 16:08:06 +08:00
zhanghj
1e6f58e562 packaging: add help information for '-f' option in install_go.sh
add help info for force install, and remove unused '-p' option.

Fixes: #3168

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2021-12-02 02:58:12 -05:00
Bin Liu
3992d28f00
Merge pull request #3152 from liubin/fix/3140-create-empty-dir
agent: copy empty directories for watchable-bind mounts
2021-12-02 14:46:25 +08:00
bin
2af95bc536 agent: create directories for watchable-bind mounts
In function `update_target`, if the updated source is a directory,
we should create the corresponding directory.

Fixes: #3140

Signed-off-by: bin <bin@hyper.sh>
2021-12-02 06:31:03 +08:00
Feng Wang
6105e3ee85 runtime: enable FUSE_DAX kernel config for DAX
Otherwise DAX device cannot be set up.

Fixes #3165

Signed-off-by: Feng Wang <feng.wang@databricks.com>
2021-12-01 13:38:57 -08:00
GabyCT
45854147d0
Merge pull request #3164 from GabyCT/topic/fixconfigtoml
runtime: Update comments for virtcontainers to use kata 2.0
2021-12-01 12:19:26 -06:00
Gabriela Cervantes
591d4af1ea runtime: Update comments for virtcontainers to use kata 2.0
This PR updates the comments in the configuration.toml to point to
the current kata containers repository instead of the kata 1.x.

Fixes #3163

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2021-12-01 16:16:46 +00:00
Fupan Li
87f350db53
Merge pull request #3125 from jodh-intel/update-rust-crate-versions
Update rust crate versions
2021-12-01 18:00:33 +08:00
James O. D. Hunt
bc7fde2096
Merge pull request #3154 from GabyCT/topic/removedebian
osbuilder: Remove debian as a rootfs
2021-12-01 09:29:02 +00:00
Gabriela Cervantes
923e098db6 osbuilder: Remove debian as a rootfs
Currently we do not have debian as part of the kata CI as we
do not have a mantainer, this PR removes debian as a supported
rootfs in order to have only the distros that we are supporting
and mantainining.

Fixes #3153

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2021-11-30 19:31:33 +00:00
James O. D. Hunt
afb96c0044 agent: Wrap remaining nix errors with anyhow
Wrap `nix` `Error`'s in an `anyhow` error for consistency with the way
`rustjail` handles errors.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-30 13:26:15 +00:00
James O. D. Hunt
aba572e01d rustjail: Wrap remaining nix errors with anyhow
Replace `Result` values that use a "bare" `nix` `Error` like this:

```rust
return Err(nix::Error::EINVAL.into());
```

... to the following which wraps the nix` error in an `anyhow` call for
consistency with the other errors returned by `rustjail`:

```rust
return Err(anyhow!(nix::Error::EINVAL));
```

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-30 13:24:04 +00:00
James O. D. Hunt
30d6007893 uevent: Fix clippy issue in test code
Remove a bare `return` from a test function. This looks wrong but isn't
because the callers are all tests that just wait for a state change
caused by this test function.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-30 12:58:15 +00:00
James O. D. Hunt
4a2be13c60 agent: Upgrade nix version for security fix
Running `cargo audit` showed that the `nix` package for the agent and
the `rustjail` and `vsock-exporter` local crates need to be updated to
resolve rust security issue
[RUSTSEC-2021-0119](https://rustsec.org/advisories/RUSTSEC-2021-0119).
Hence, bumped `nix` to the latest version (which required changes to
work with the new, simpler `errno` handling).

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-30 12:58:15 +00:00
James O. D. Hunt
256d5008dc agent: Update crate versions
Run `cargo update` to update to the latest crate dependency versions.

The agent is an application so this includes expanding the partially
specified semvers to full semver values for the following crates,
which makes those crates consistent with the other agent dependencies:

- `futures`
- `regex`
- `scan_fmt`
- `tokio`

Fixes: #3124.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-30 12:58:15 +00:00
James O. D. Hunt
13257986ae agent-ctl: Update rust lockfile
Ran `cargo update` to bump crate versions.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-30 12:58:15 +00:00
James O. D. Hunt
4ebdd424de forwarder: Update rust lockfile
Ran `cargo update` to bump crate versions.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-30 12:58:15 +00:00
James O. D. Hunt
6007322daa agent: Fixed invalid error message
Remove the format specifier in the `"failed to get VFIO group"` error
returned by `vfio_device_handler()`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-30 12:58:15 +00:00
Fabiano Fidêncio
3e3e3a0253
Merge pull request #3149 from fidencio/2.4.0-alpha0-branch-bump
# Kata Containers 2.4.0-alpha0
2021-11-29 20:24:19 +01:00
Fabiano Fidêncio
72b8144b56 release: Kata Containers 2.4.0-alpha0
- osbuilder: fix missing cpio package when building rootfs-initrd image
- osbuilder: add coreutils to guest rootfs
- workflows: only allow org members to run `/test_kata_deploy`
- agent: use temp directory for test containers
- tools/osbuilder: build QAT kernel in fedora 34
- agent: refactor find_process function and add test cases
- Hypervisor cleanup, refactoring
- agent: clear cargo test warnings
- docs: Add a code PR advice document
- tools: Automatically revert kata-deploy changes
- runtime: delete netmon
- agent: Remove some unwrap and expect calls
- agent: fixed the `make optimize` bug
- docs: make kata-deploy more visible
- workflows: Add back the checks for running test-kata-deploy
- kata-deploy: Ensure we test HEAD with `/test_kata_deploy`
- docs: update using-SPDK-vhostuser-and-kata.md
- Update k8s SR-IOV plugin environment variables to work properly with Kata
- watchers: don't dereference symlinks when copying files
- kata-deploy: Add back stable & latest tags
- agent: fix the issue of missing create a new session for container
- runtime: Update containerd to 1.5.8
- qemu: fix snap build on ppc64le
- virtcontainers: fix failing template test on ppc64le
- agent: Update README
- Remove cruft, do some simple non-functional cleanup in the runtime
- macvlan: drop bridged part of name
- clh: Fix race condition that prevent start pods
- Update CRI-O documentation
- cgroups: Fix systemd cgroup support
- runtime: merge virtcontainers/pkg/types into virtcontainers/types
- workflows: Remove non-used main.yaml
- agent/src: improve unit test coverage for src/namespace.rs
- doc: update kata metrics documentation
- runtime: delete not used codes
- versions: bump golang to 1.17.x
- release: Use ${GOPATH}/bin/yq for upload-libseccomp-tarball action
- agent-ctl: Allow API specification in JSON format
- virtcontainers: Lint protection types
- agent: check environment variables if empty or invalid
- runtime: Revert "runtime: use containerd package instead of cri-containerd"
- rustjail: Fix created time of container
- agent: Remove dynamic tracing APIs
- kernel: add VFIO kernel dependencies for ppc64le
- logging: Always run crate tests

8ee67aae osbuilder: fix missing cpio package when building rootfs-initrd image
f59d3ff6 osbuilder: add coreutils to guest rootfs
5e7c1a29 workflows: only allow org members to run `/test_kata_deploy`
857501d8 tools/osbuilder: build QAT kernel in fedora 34
a32e02a1 agent: use temp directory as root of test containers
f0734f52 docs: Remove extraneous whitespace
aff32756 docs: Add a code PR advice document
d41c375c docs: Add more advice to the UT advice doc
baf4f76d docs: More detail on running tests as different users
fcf45b0c docs: Use more idiomatic rust string check
9fed7d0b docs: Mention anyhow for error handling in UT doc
318b3f18 docs: No present continuous in UT advice doc
e8bb6b26 docs: Correct repo name usage
c1111a1d docs: Use leading caps for lang names in UT advice doc
597b239e docs: Remove TOC in UT advice doc
cf360fad docs: Move unit test advice doc from tests repo
bc955814 docs: Move doc requirements section higher
6a0b7165 agent: refactor find_process function and add test cases
5ba2f52c tools: Quote functions arguments in the update repos script
5dbd752f tools: Remove the check for the VERSION file
85eb743f tools: Make hub usage slightly less fragile
76540dbd tools: Automatically revert kata-deploy changes
36d73c96 tools: Do the kata-deploy changes on its own commit
c8e22daf tools: Use vars for the registry in the update repo script
ac958a30 tools: Use vars for the yaml files used in the update repo script
edca8292 tools: Rewrite the logic around kata-deploy changes
31f6c2c2 tools: Update comments about the kata-deploy yaml changes
75bb3401 shimv2/service: fix defer funtions never run with os.Exit()
bd3217da agent: Remove redundant returns
adab6434 agent: Remove some unwrap and expect calls
351cef7b agent: Remove unwrap from verify_cid()
a7d1c70c agent: Improve baremount
09abcd4d agent-ctl: Remove some unwrap and expect calls
35db75ba agent-ctl: Remove redundant returns
46e45958 agent-ctl: Simplify main
c7349d0b agent-ctl: Simplify error handling
ddc68131 runtime: delete netmon
705687dc docs: Add kata-deploy as part of the install docs
acece849 docs: Use the default notation for "Note" on install README
143fb278 kata-deploy: Use the default notation for "Note"
45d76407 kata-deploy: Don't mention arch specific binaries in the README
0c6c0735 agent: fixed the `make optimize` bug
a7c08aa4 workflows: Add back the checks for running test-kata-deploy
ce0693d6 agent: clear cargo test warnings
ce92cadc vc: hypervisor: remove setSandbox
2227c46c vc: hypervisor: use our own logger
4c2883f7 vc: hypervisor: remove dependency on persist API
34f23de5 vc: hypervisor: Remove need to get shared address from sandbox
c28e5a78 acrn: remove dependency on sandbox, persistapi datatypes
a0e0e186 hypervisors: introduce pkg to unbreak vc/persist dependency
b5dfcf26 watcher: tests: ensure there is 20ms delay between fs writes
78dff468 agent/device: Adjust PCIDEVICE_* container environment variables for VM
4530e7df agent/device: Use simpler structure in update_spec_devices()
b6062278 agent/device: Correct misleading comment on test case
89ff7000 agent/device: Remove unnecessary check for empty container_path
c855a312 agent/device: Make DevIndex local to update_spec_devices()
084538d3 agent/device: Change update_spec_device to handle multiple devices at once
d6a3ebc4 agent/device: Obtain guest major/minor numbers when creating DevNumUpdate
f4982130 agent/device: Check for conflicting device updates
f10e8c81 agent/device: Batch changes to the OCI specification
46a4020e agent/device: Types to represent update for a device in the OCI spec
e7beed54 agent/device: Remove unneeded clone() from several device handlers
2029eeeb agent/device: Improve update_spec_device() final_path handling
57541315 agent/device: Correct misleading parameter name in update_spec_device()
0c51da3d agent/device: Correct misleading error message in update_spec_device()
94b7936f agent/device: Use nix::sys::stat::{major,minor} instead of libc::*
296e76f8 watchers: handle symlinked directories, dir removal
2b6dfe41 watchers: don't dereference symlinks when copying files
3c9ae7fb kata-deploy: Ensure we test HEAD with `/test_kata_deploy`
0380b9bd runtime: Update containerd to 1.5.8
112ea258 qemu: fix snap build by disabling libudev
d5a18173 virtcontainers: fix failing template test on ppc64le
6955d144 kata-deploy: Add back stable & latest tags
bbaf57ad agent: fix the issue of missing create a new session for container
46fd5069 docs: update using-SPDK-vhostuser-and-kata.md
7e6f2b8d vc-utils: don't export unused function
860f3088 virtcontainers: move oci, uuid packages top level
8acb3a32 virtcontainers: remove unused package nsenter
4788cb82 vc-network: remove unused functions
b6ebddd7 oci: remove unused function GetContainerType
599bc0c2 agent: Update README
1e7cb4bc macvlan: drop bridged part of name
55412044 monitor: Fix monitor race condition doing hypervisor.check()
eb11d053 cri-o: Update deployment documentation
92e3a140 cri-o: Update links for the CRI-O github page
0a19340a cri-o: Remove outdated documentation
a3b3c85e workflows: Remove non-used main.yaml
09f7962f runtime: merge virtcontainers/pkg/types into virtcontainers/types
6acedc25 runtime: delete not used codes
395638c4 versions: bump golang to 1.17.x
570915a8 docs: update kata 2.0 metrics documentation
bcf181b7 cgroups: Fix systemd cgroup support
34307235 release: Use ${GOPATH}/bin/yq for upload-libseccomp-tarball action
6339fdd1 docs: update kata metrics architecture image
57bb7ffa agent: check environment variables if empty or invalid
8ab90e10 agent-ctl: Allow API specification in JSON format
eacfcdec runtime: Revert "runtime: use containerd package instead of cri-containerd"
e7856ff1 rustjail: Fix created time of container
b7b89905 virtcontainers: Lint protection types
7566b736 kernel: add VFIO kernel dependencies for ppc64le
87f67606 agent: Remove dynamic tracing APIs
b09dd7a8 docs: Fix typo
d47484e7 logging: Always run crate tests
5c9c0b6e build: Fix default target
b34ed403 cgroups: pass vhost-vsock device to cgroup
7362e1e8 runtime: remove prefix when cgroups are managed by systemd
1b1790fd agent/src: improve unit test coverage for src/namespace.rs

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-29 18:34:45 +01:00
Fabiano Fidêncio
f8aaefc919
Merge pull request #3147 from Bevisy/main-3144
osbuilder: fix missing cpio package when building rootfs-initrd image
2021-11-29 18:27:49 +01:00
Binbin Zhang
8ee67aae4f osbuilder: fix missing cpio package when building rootfs-initrd image
1. install cpio package before building rootfs-initrd image
2. add `pipefaili;errexit` check to the scripts

Fixes: #3144

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
2021-11-29 23:42:44 +08:00
Fabiano Fidêncio
879ec4e0e9
Merge pull request #3139 from bergwolf/coreutils
osbuilder: add coreutils to guest rootfs
2021-11-29 10:19:39 +01:00
Fabiano Fidêncio
a6219cb5e0
Merge pull request #3134 from fidencio/wip/only-allow-users-who-are-part-of-the-org-to-run-test-kata-deploy
workflows: only allow org members to run `/test_kata_deploy`
2021-11-29 07:55:40 +01:00
Peng Tao
f59d3ff600 osbuilder: add coreutils to guest rootfs
So that the debug console is more useful. In the meantime, remove
iptables as it is not used by kata-agent any more.

Fixes: #3138
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2021-11-29 11:22:07 +08:00
Fabiano Fidêncio
7364cd4983
Merge pull request #3129 from liubin/fix/3122-use-tempdir-for-test-container
agent: use temp directory for test containers
2021-11-26 23:11:27 +01:00
Fabiano Fidêncio
5e7c1a290f workflows: only allow org members to run /test_kata_deploy
Let's take advantage of the "is-organization-member" action and only
allow members who are part of the `kata-containers` organization to
trigger `/test_kata_deploy`.

One caveat with this approach is that for the user to be considered as
part of an organization, they **must** have their "Organization
Visibility" configured as Public (and I think the default is Private).

This was found out and suggested by @jcvenegas!

Fixes: #3130

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-26 23:02:51 +01:00
Julio Montes
06d28d50ed
Merge pull request #3136 from devimc/2021-11-26/fixQATci
tools/osbuilder: build QAT kernel in fedora 34
2021-11-26 15:38:57 -06:00
Julio Montes
857501d8dd tools/osbuilder: build QAT kernel in fedora 34
kernel compiled in fedora 35 (latest) is not working, following error
is reported:

```
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF
Note
```

Build QAT kernel in fedora 34 container to fix it

fixes #3135

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-11-26 13:56:43 -06:00
bin
a32e02a1ee agent: use temp directory as root of test containers
Some tests in sandbox.rs need root user to run, because they need create
directories under /run/agent directories, actually this is a limit
that shouldn't be there. By using a temp directory for test containers
will not need run tests as root user.

Fixes: #3122

Signed-off-by: bin <bin@hyper.sh>
2021-11-26 15:18:38 +08:00
Manabu Sugimoto
7b35615191 agent: Log unknown seccomp system calls
Kata agent logs unknown system calls given by seccomp profiles
in advance before the log file descriptor closes.

Fixes: #2957

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-11-26 15:10:04 +09:00
Peng Tao
c3de161168
Merge pull request #3118 from liubin/fix/3117-refactor-find_process
agent: refactor find_process function and add test cases
2021-11-26 10:22:48 +08:00
Peng Tao
01b6ffc0a4
Merge pull request #3028 from egernst/hypervisor-hacking
Hypervisor cleanup, refactoring
2021-11-26 10:21:49 +08:00
James O. D. Hunt
9412be39ba
Merge pull request #3092 from liubin/fix/3091-fix-test-warnings
agent: clear cargo test warnings
2021-11-25 17:22:27 +00:00
James O. D. Hunt
a813378ac5
Merge pull request #3100 from jodh-intel/docs-code-pr-advice
docs: Add a code PR advice document
2021-11-25 15:46:13 +00:00
James O. D. Hunt
f0734f52c1 docs: Remove extraneous whitespace
Remove trailing whitespace in the unit test advice doc.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-25 14:44:49 +00:00
James O. D. Hunt
aff3275608 docs: Add a code PR advice document
Add a document giving advice to code PR authors.

Fixes: #3099.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-25 14:44:46 +00:00
James O. D. Hunt
d41c375c4f docs: Add more advice to the UT advice doc
Add information to the unit test advice document on test strategies and
the test environment.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-25 14:44:40 +00:00
James O. D. Hunt
baf4f76d97 docs: More detail on running tests as different users
Add some more detail to the unit test advice document about running
tests as different users.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-25 14:44:40 +00:00
James O. D. Hunt
fcf45b0c92 docs: Use more idiomatic rust string check
Rather than comparing a string to a literal in the rust example,
use `.is_empty()` as that approach is more idiomatic and preferred.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-25 14:44:40 +00:00
James O. D. Hunt
9fed7d0bde docs: Mention anyhow for error handling in UT doc
Add a comment stating that `anyhow` and `thiserror` should be used in
real rust code, rather than the unwieldy default `Result` handling
shown in the example.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-25 14:44:40 +00:00
James O. D. Hunt
318b3f187b docs: No present continuous in UT advice doc
Change some headings to avoid using the present continuous tense which
should not be used for headings.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-25 14:44:40 +00:00
James O. D. Hunt
e8bb6b2666 docs: Correct repo name usage
Change reference from "runtime repo" to "main repo" in unit test advice
document.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-25 14:44:40 +00:00