Commit Graph

5606 Commits

Author SHA1 Message Date
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
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
bin
6586f3b725 docs: update configuration for passing annotations in conatinerd
Using "io.containerd.kata.v2" instead of deprecated "io.containerd.runc.v1".

Fixes: #1629

Signed-off-by: bin <bin@hyper.sh>
(cherry picked from commit b0e4618e84)
2021-04-08 12:34:52 +02:00
Fabiano Fidêncio
f5adc4c114 docs: Remove ubuntu installation guide
The installation guide points to 1.x packages from OBS.  For 2.x we
decided to stop building packages on OBS in favour of advertising
kata-deploy.

Apart from this, Ubuntu itself doesn't provide packages for
kata-containers.

Fixes: #1588

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit ede1ab8670)
2021-04-08 12:34:17 +02:00
Fabiano Fidêncio
a67bdc369a docs: Update snap install guide
As this repo is specific to the kata-containers 2.x, let's stop
mentioning / referring to the 1.x here, including how to setup and use
the snap package for 1.x.

Fixes: #1601

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 4a38ff41f0)
2021-04-08 12:33:58 +02:00
bin
67be55834d docs: update how-to-use-k8s-with-cri-containerd-and-kata.md
Update how-to-use-k8s-with-cri-containerd-and-kata.md to fit the latest
Kubernetes way.
And also changed CNI plugin from flannel to bridge, that will be easy to run.

Fixes: #1325

Signed-off-by: bin <bin@hyper.sh>
(cherry picked from commit 2c47277ca1)
2021-04-08 12:27:01 +02:00
Fabiano Fidêncio
abfff68de6 docs: Update CentOS install docs
There are two changes here.  There first one being relying on the
`centos-release-advanced-virtualization` package instead providing the
content of the repo ourselves; and the second one being installing
`kata-containers` (2.x) instead of the `kata-runtime` one (1.x).

Fixes: #1583

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 1ce29fc959)
2021-04-08 12:26:54 +02:00
Fabiano Fidêncio
0466ee04da docs: Update Fedora install docs
The package to be installed on Fedora is `kata-containers` instead of
`kata-runtime`.  The difference being `kata-runtime` is the 1.x package,
while `kata-containers` is the 2.x one.

Fixes: #1582

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 3f90561bf1)
2021-04-08 12:26:47 +02:00
Fabiano Fidêncio
6b223194a9 docs: Remove SLE installation guide
The content of the SLE installation guide is related to the 1.x
packages, as SUSE doesn't provide katacontainers 2.x packages.

Fixes: #1586

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit 2888ceb024)
2021-04-08 12:26:41 +02:00
Tim Zhang
fb01d51573 agent-ctl: update ttrpc version
Fixes: #1657

Signed-off-by: Tim Zhang <tim@hyper.sh>
2021-04-08 18:24:20 +08:00