Commit Graph

5614 Commits

Author SHA1 Message Date
Fabiano Fidêncio
8b9607a742
Merge pull request #1839 from fidencio/2.0.4-branch-bump
# Kata Containers 2.0.4
2021-05-13 12:17:27 +02:00
Fabiano Fidêncio
1c62bd1240 release: Kata Containers 2.0.4
- [backport] runtime: fix static check errors
- [backport] versions: Upgrade to cloud-hypervisor v15.0
- qemu: kill virtiofsd if failure to start VMM
- docs: Document limitation regarding subpaths
- Makefile: Replace @RUNTIME_NAME@ with the target in generated files
- runtime: handle io.katacontainers.config.hypervisor.virtio_fs_extra_args

3d33250e agent: Wrong pid method used
afe4df04 agent: Fix compiler checks
f859f8af agent: Fixes for static and compiler checks
657d7552 agent: simplify ttrpc error construction
7d96f22b ci: add `cargo clippy` for agent
2f67e831 agent: fix clippy for rustc 1.5
4f9b5faf agent: clear match_like_matches_macro/vec_resize_to_zero warnings
974e0e3b agent: clear module_inception/type_complexity warnings
91e12404 agent: clear clippy warnings
02aaab22 agent: clear clippy `len_zero` warnings
165988a3 rustjail: clear clippy warnings
9d49a69f oci: clear clippy warnings
cab530cb agent: clear redundant_field_names clippy warning
8d16767b logging: clear clippy warnings
01b2bbc1 runtime: fix static check errors
c60951f5 actions: enable unit tests in PR check
c750ce13 agent: makefile: Add codecov target
0704641c makefile: agent: Add self documented help
04dcbd4d github: Update ubuntu version to 20.04
f1c63380 github: Add github actions
ee202408 versions: Upgrade to cloud-hypervisor v15.0
aad549fe qemu: kill virtiofsd if failure to start VMM
16e358b3 docs: Document limitation regarding subpaths
a8137eef Makefile: Replace @RUNTIME_NAME@ with the target in generated files
351a01bd runtime: handle io.katacontainers.config.hypervisor.virtio_fs_extra_args

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-05-12 23:18:45 +02:00
Fabiano Fidêncio
8d185e1972
Merge pull request #1730 from cmaf/backport-fix-runtime-UTs-1539
[backport] runtime: fix static check errors
2021-05-07 08:18:32 +02:00
Hui Zhu
80e891664f
Merge pull request #1785 from likebreath/0430/backport_clh_v15.0
[backport] versions: Upgrade to cloud-hypervisor v15.0
2021-05-06 11:00:47 +08:00
Chelsea Mafrica
3d33250eac agent: Wrong pid method used
no method named `as_pid` found for struct `namespace::Namespace` in the current scope
   --> src/namespace.rs:219:14
    |
34  | pub struct Namespace {
    | -------------------- method `as_pid` not found for this
...
219 |             .as_pid()
    |              ^^^^^^ method not found in `namespace::Namespace`

Switch to get_pid()

Fixes #1698

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:19:10 -07:00
Chelsea Mafrica
afe4df0449 agent: Fix compiler checks
Remove unneeded return statement.

Fixes #1698

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:19:07 -07:00
Chelsea Mafrica
f859f8af22 agent: Fixes for static and compiler checks
Remove unused function remountRo() to pass static checks.

Fixes #1698

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:19:01 -07:00
Tim Zhang
657d75524d agent: simplify ttrpc error construction
Fixes: #975

Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:59 -07:00
bin liu
7d96f22b13 ci: add cargo clippy for agent
To run `cargo clippy`, this commit includes changes:

- add a new Makefile target to run `cargo clippy`
- move `make`/`make check` to last step to let a fast retrun if `fmt`/`clippy` failed

Fixes: #951

Signed-off-by: bin liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:57 -07:00
Tim Zhang
2f67e831e3 agent: fix clippy for rustc 1.5
Fixes: #1461

Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:55 -07:00
bin liu
4f9b5fafcc agent: clear match_like_matches_macro/vec_resize_to_zero warnings
This commit fix these warnings for Rust v1.47.0:

- match_like_matches_macro
- vec_resize_to_zero

Signed-off-by: bin liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:52 -07:00
bin liu
974e0e3b31 agent: clear module_inception/type_complexity warnings
To clear these two warnings, this commit did changes:

- add `#![allow(clippy::module_inception)]` to target files
- use type alias for tuple of `(MessageHeader, Vec<u8>)`

Signed-off-by: bin liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:45 -07:00
bin liu
91e12404f3 agent: clear clippy warnings
This commit clears clippy warings for agent package.

Signed-off-by: bin liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:42 -07:00
bin liu
02aaab2213 agent: clear clippy len_zero warnings
Use `.is_empty()` instead of `.len() == 0`, `.len() >0`
and `.len() != 0`

Signed-off-by: bin liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:40 -07:00
bin liu
165988a394 rustjail: clear clippy warnings
This commit clears clippy warings for rustjail package.

Signed-off-by: bin liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:38 -07:00
bin liu
9d49a69fd0 oci: clear clippy warnings
This commit clears clippy warings for oci package.

Signed-off-by: bin liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:30 -07:00
bin liu
cab530cb1f agent: clear redundant_field_names clippy warning
add `#![allow(clippy::redundant_field_names)]` can skip check
`protocols` package, and fix redundant_field_names in other
packages.

Signed-off-by: bin liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:18:18 -07:00
bin liu
8d16767bec logging: clear clippy warnings
This commit contains two changes:

- clear clippy warnigns
- add pkg/logging/Cargo.lock to .gitignore

Signed-off-by: bin liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:17:57 -07:00
Peng Tao
01b2bbc1c8 runtime: fix static check errors
It turns out we have managed to break the static checker in many
difference places with the absence of static checker in github action.
Let's fix them while enabling static checker in github actions...

Fixes #1698

Signed-off-by: Peng Tao <bergwolf@hyper.sh>

(This is a partial backport of
https://github.com/kata-containers/kata-containers/pull/1539)
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:17:55 -07:00
Peng Tao
c60951f51e actions: enable unit tests in PR check
Right now we only run UTs for agent. We need to run it for *ALL*
components.

Fixes: #1538
Signed-off-by: Peng Tao <bergwolf@hyper.sh>

(backport: https://github.com/kata-containers/kata-containers/pull/1539)
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:17:53 -07:00
Carlos Venegas
c750ce13af agent: makefile: Add codecov target
Add target to run codecov report locally.

Useful to identify what are the missing lines
to be covered by unit test.

Fixes: #1487

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>

(backport https://github.com/kata-containers/kata-containers/pull/1489)
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:17:50 -07:00
Carlos Venegas
0704641c03 makefile: agent: Add self documented help
Add comments that allow self document variables and targets

Fixes: #1436

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>

(backport https://github.com/kata-containers/kata-containers/pull/1437)
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2021-05-03 21:17:43 -07:00
GabyCT
04dcbd4d21 github: Update ubuntu version to 20.04
This PR updates the ubuntu version from 18.04 to 20.04 that will be used
for the github actions.

Fixes #1295

Signed-off-by: GabyCT <gabriela.cervantes.tellez@intel.com>
2021-05-03 21:17:39 -07:00
GabyCT
f1c633806d github: Add github actions
This PR adds the github actions for this repository.

Fixes #1205

Signed-off-by: GabyCT <gabriela.cervantes.tellez@intel.com>
2021-05-03 21:17:30 -07:00
Bo Chen
ee202408f8 versions: Upgrade to cloud-hypervisor v15.0
Quotes from the cloud-hypervisor release v15.0:

This release is the first in a new version numbering scheme to represent that
we believe Cloud Hypervisor is maturing and entering a period of stability.
With this new release we are beginning our new stability guarantees.

Other highlights from the latest release include: 1) Network device rate
limiting; 2) Support for runtime control of `virtio-net` guest offload;
3) `--api-socket` supports file descriptor parameter; 4) Bug fixes on
`virtio-pmem`, PCI BARs alignment, `virtio-net`, etc.; 5) Deprecation of
the "LinuxBoot" protocol for ELF and bzImage in the coming release.

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

Note: The client code of cloud-hypervisor's OpenAPI is automatically
generated by `openapi-generator` [1-2]. As the API changes do not
impact usages in Kata, no additional changes in kata's runtime are
needed to work with the current version of cloud-hypervisor.

[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

Fixes: #1779

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit 1ca6bedf3e)
2021-04-30 10:29:55 -07:00
Fabiano Fidêncio
1ced542251
Merge pull request #1767 from egernst/backport-vmm-fix
qemu: kill virtiofsd if failure to start VMM
2021-04-29 23:21:30 +02:00
Fabiano Fidêncio
64a144f439
Merge pull request #1773 from c3d/backport/1728-on-2.0
docs: Document limitation regarding subpaths
2021-04-28 20:14:46 +02:00
Eric Ernst
aad549fe34 qemu: kill virtiofsd if failure to start VMM
If the QEMU VMM fails to launch, we currently fail to kill virtiofsd,
resulting in leftover processes running on the host. Let's make sure we
kill these, and explicitly cleanup the virtiofs socket on the
filesystem.

Ideally we'll migrate QEMU to utilize the same virtiofsd interface that
CLH uses, but let's fix this bug as a first step.

Backport: remove ctx

Fixes: #1755

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2021-04-28 10:08:14 -07:00
Christophe de Dinechin
16e358b31b docs: Document limitation regarding subpaths
Subpaths are not supported at the moment. Document that fact.

Fixes: #1728

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
(cherry-picked from 7d5a4252b6)
2021-04-28 15:38:59 +02:00
Bin Liu
f96a4684af
Merge pull request #1762 from c3d/issue/1164-kata-collect-failure
Makefile: Replace @RUNTIME_NAME@ with the target in generated files
2021-04-28 11:24:37 +08:00
Christophe de Dinechin
a8137eef51 Makefile: Replace @RUNTIME_NAME@ with the target in generated files
In commit 966bd57 for PR #902, the makefile was changed to automate
the replacement of user variables. However, one variable was treated
specially in the original `sed` replacements, namely `RUNTIME_NAME`
which was replaced by `$(TARGET)`.

This commit adds the `RUNTIME_NAME` variable to the makefile in order
to ensure that the replacement works correctly.

Fixes: #993
Fixes: #1164

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
(cherry-picked from 96a4ed7d70)
2021-04-27 16:57:06 +02:00
Fabiano Fidêncio
364290e0a8
Merge pull request #1752 from pmores/virtiofsd-extra-args-annotation-handling-2.0
runtime: handle io.katacontainers.config.hypervisor.virtio_fs_extra_args
2021-04-26 20:33:43 +02:00
Pavel Mores
351a01bd7e runtime: handle io.katacontainers.config.hypervisor.virtio_fs_extra_args
Users can specify extra arguments for virtiofsd in a pod spec using the
io.katacontainers.config.hypervisor.virtio_fs_extra_args annontation.
However, this annotation was ignored so far by the runtime.  This commit
fixes the issue by processing the annotation value (if present) and
translating it to the corresponding hypervisor configuration item.

Fixes #1523

Signed-off-by: Pavel Mores <pmores@redhat.com>
2021-04-26 10:17:48 +02:00
Fabiano Fidêncio
ef11ce13ea
Merge pull request #1676 from fidencio/2.0.3-branch-bump
# Kata Containers 2.0.3
2021-04-09 20:58:56 +02:00
Fabiano Fidêncio
ea3f9b22a2 release: Kata Containers 2.0.3
- stable-2.x | backports for 2.0.3
- ci: Fix travis for stable-2.0
- stable-2.0 | kata-deploy: Fix test-kata.sh and do some small cleanups / improvements in the kata-deploy script
- stable-2.0 | build: Only keep one VERSION file
- stable-2.0 | cherry-pick fixes for test-kata-deploy GitHub actions
- stable-2.0 | A bunch of backports fixing documentation
- stable-2.0 | agent-ctl: update ttrpc version
- [backport] versions: Update cloud-hypervisor to release v0.14.1

624ff413 release: Do not git add kata-{deploy,cleanup}.yaml for the tests repo
6bb3f441 agent: update cpuset of container path
4d4aba2e kata-deploy: add runtimeclass that includes pod overhead
5f4f8ff3 release: automatically bump the version of the kata-deploy images
f0d63160 kata-cleanup: Explicitly add tag to the container image
4e868ad9 docs: update dev-guide to include fixes from 1.x
1c70ef54 ci: Fix travis for stable-2.0
55bdd1fc kata-deploy: Adapt regex for testing kata-deploy
6586f3b7 docs: update configuration for passing annotations in conatinerd
f5adc4c1 docs: Remove ubuntu installation guide
a67bdc36 docs: Update snap install guide
67be5583 docs: update how-to-use-k8s-with-cri-containerd-and-kata.md
abfff68d docs: Update CentOS install docs
0466ee04 docs: Update Fedora install docs
6b223194 docs: Remove SLE installation guide
fb01d515 agent-ctl: update ttrpc version
144be145 release: Get rid of "master"
017c7cf2 release: Use sudo to install hub
52c6b073 build: Only keep one VERSION file
e7bdeb49 github: Fix slash-command-action usage
c0ca9f9a github: Revert "github: Remove kata-deploy-test action"
81f38990 github: Remove kata-deploy-test action
e3efcfd4 runtime: Fix the format of the client code of cloud-hypervisor APIs
5a92333f runtime: Format auto-generated client code for cloud-hypervisor API
ec0424e1 versions: Update cloud-hypervisor to release v0.14.1

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-04-09 17:59:09 +02:00
Fabiano Fidêncio
86ad7e486c
Merge pull request #1671 from fidencio/wip/stable-2.0-backports-for-2.0.3
stable-2.x | backports for 2.0.3
2021-04-09 16:36:35 +02:00
Fabiano Fidêncio
624ff41318 release: Do not git add kata-{deploy,cleanup}.yaml for the tests repo
I was, mistakenly, `git add`ing those files unconditionally.

Fixes: #1672

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-04-09 14:40:17 +02:00
bin liu
6bb3f44100 agent: update cpuset of container path
After cpu hot-plugged is available, cpuset for containers will be written into
cgroup files recursively, the paths should include container's cgroup path, and up
to root path of cgroup filesystem.

Fixes: #1156, #1159

Signed-off-by: bin liu <bin@hyper.sh>
(cherry picked from commit a793b8d90d)
2021-04-09 12:52:31 +02:00
Eric Ernst
4d4aba2e64 kata-deploy: add runtimeclass that includes pod overhead
The overhead values may not be perfect, but this is a start, and a good
reference.

Fixes: #580

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
(cherry picked from commit 12582c2f6d)
2021-04-09 12:50:19 +02:00
Fabiano Fidêncio
5f4f8ff337 release: automatically bump the version of the kata-deploy images
Let's teach `update-repository-version.sh` to automatically bump the
version of the kata-deploy images to be used within that release, when
running against the `kata-containers` repo.

Fixes: #1665

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 2b5f79d685)
2021-04-09 12:50:19 +02:00
Fabiano Fidêncio
f0d6316004 kata-cleanup: Explicitly add tag to the container image
We have the tags explicitly set on kata-deploy, let's do the same for
kata-cleanup.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit f444adb51b)
2021-04-09 12:50:16 +02:00
Eric Ernst
4e868ad981 docs: update dev-guide to include fixes from 1.x
This addresses a few gaps with respect to fixes in 1.x docs:
  - Cleanup QEMU information in order to drop references to qemu-lite
  - Make sure we include directions for debug console in case of QEMU

Fixes: #574

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
(cherry picked from commit 8682d6b7ea)
2021-04-09 12:48:57 +02:00
GabyCT
a24ff2b51c
Merge pull request #1664 from GabyCT/topic/fixtravis2.0
ci: Fix travis for stable-2.0
2021-04-08 16:09:08 -05:00
Gabriela Cervantes
1c70ef544f ci: Fix travis for stable-2.0
This PR fixes travis in stable-2.0 as is taking the branch
from the travis environment instead of using main.

Fixes #1663

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2021-04-08 14:29:36 -05:00
Fabiano Fidêncio
e5df408f64
Merge pull request #1653 from fidencio/wip/stable-2.0-fix-kata-deploy-test-script
stable-2.0 | kata-deploy: Fix test-kata.sh and do some small cleanups / improvements in the kata-deploy script
2021-04-08 17:43:54 +02:00
Chelsea Mafrica
985b9fa479
Merge pull request #1652 from fidencio/wip/stable-2.0-only-keep-one-VERSION-file
stable-2.0 | build: Only keep one VERSION file
2021-04-08 08:19:46 -07:00
Fabiano Fidêncio
6d5e47bab1
Merge pull request #1649 from fidencio/wip/stable-2.0-cherry-pick-github-kata-deploy-stuff
stable-2.0 | cherry-pick fixes for test-kata-deploy GitHub actions
2021-04-08 16:58:16 +02:00
Fabiano Fidêncio
514af3624b
Merge pull request #1659 from fidencio/wip/stable-2.0-update-docs
stable-2.0 | A bunch of backports fixing documentation
2021-04-08 14:07:23 +02:00
Fupan Li
a6e3fb6514
Merge pull request #1658 from Tim-Zhang/fix-ttrpc-version-for-agent-ctl
stable-2.0 | agent-ctl: update ttrpc version
2021-04-08 20:06:47 +08:00
Fabiano Fidêncio
55bdd1fcf4 kata-deploy: Adapt regex for testing kata-deploy
On commit a649d33 we've started adding the specific version of the image
to be used, in order to ensure people using our content from a tarball
would be relying on the correct image.

However, later on, @bergwolf figured out it had some undesired side
effects, such as
https://github.com/kata-containers/kata-containers/runs/2235812941?check_suite_focus=true

What happens there is that the regular expression used to point the
image to a testing one doesn't take into consideration the $VERSION, and
that breaks the deployment.

Fixes: #1632

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit d43098ec21)
2021-04-08 13:39:57 +02:00