Commit Graph

7381 Commits

Author SHA1 Message Date
Eric Ernst
652cff16b4 release: Kata Containers 2.3.3
- back port:: runtime: make selinux configurable
- stable-2.3 | kata-deploy: Use (kata with) qemu as the default shim-v2 binary
- stable-2.3 | shim: log events for CRI-O
- stable-2.3 | agent: fix invalid hooks env issues
- stable-2.3 | packaging: Use `patch` for applying patches

0b6e9f83 runtime: make selinux configurable
408477a2 kata-deploy: Use (kata with) qemu as the default shim-v2 binary
9431498e shim: log events for CRI-O
406f00a3 packaging: Use `patch` for applying patches
7af719e4 agent: handle hook process result
9b34cf46 agent: valid envs for hooks
9c195364 agent: Fix execute_hook() args error
9bea3a42 agent: check environment variables if empty or invalid

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-03-01 08:38:59 -08:00
Fabiano Fidêncio
48732f5c4f
Merge pull request #3794 from egernst/backport-selinux-build
back port:: runtime: make selinux configurable
2022-03-01 08:54:23 +01:00
Tanweer Noor
0b6e9f8365 runtime: make selinux configurable
removes --tags selinux handling in the makefile (part of it introduced here: d78ffd6)
and makes selinux configurable via configuration.toml

Fixes: #3631
Signed-off-by: Tanweer Noor <tnoor@apple.com>
2022-02-28 20:58:46 -08:00
snir911
d2d579f1aa
Merge pull request #3745 from fidencio/stable-2.3-kata-deploy-use-kata-with-qemu-as-the-default-shim-v2-binary
stable-2.3 | kata-deploy: Use (kata with) qemu as the default shim-v2 binary
2022-02-22 14:29:39 +02:00
snir911
a373dc0270
Merge pull request #3744 from liubin/backport/3736
stable-2.3 | shim: log events for CRI-O
2022-02-22 12:30:16 +02:00
Fabiano Fidêncio
408477a263 kata-deploy: Use (kata with) qemu as the default shim-v2 binary
When using kata-deploy, no `containerd-shim-kata-v2` binary is deployed,
but we do deploy a `kata` runtime class, which seems very much
incosistent.

As the default configuration for kata-containers points to QEMU, let's
also use kata with QEMU as the default shim-v2 binary.

Fixes: #3228, #3734

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 11220f052f)
2022-02-22 09:57:04 +01:00
bin
9431498e14 shim: log events for CRI-O
CRI-O start shim process without setting TTRPC_ADDRESS,
that the forwarding events goroutine will get errors.

For CRI-O runtime, we can log the events to log file.

Fixes: #3733

Signed-off-by: bin <bin@hyper.sh>
2022-02-22 16:27:00 +08:00
Fabiano Fidêncio
41cc86751b
Merge pull request #3716 from liubin/backport/3668
stable-2.3 | agent: fix invalid hooks env issues
2022-02-19 08:39:23 +01:00
Fabiano Fidêncio
bf9b364678
Merge pull request #3725 from Jakob-Naucke/backport-fix-apply-patches
stable-2.3 | packaging: Use `patch` for applying patches
2022-02-19 08:38:55 +01:00
Jakob Naucke
406f00a3a2
packaging: Use patch for applying patches
`tools/packaging/scripts/apply_patches.sh` uses `git apply $patch`, but
this will not apply to subdirectories. If one wanted to apply with
`git apply`, they'd have to run it with `--directory=...`
_relative to the Git tree's root_ (absolute will not work!). I suggest
we just use `patch`, which will do what we expected `git apply` would
do.

`patch` is also added to build containers that require it.

Fixes: #3690
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-02-18 16:55:23 +01:00
bin
7af719e47c agent: handle hook process result
Current hook process is handled by just calling
unwrap() on it, sometime it will cause panic.

By handling all Result type and check the error can
avoid panic.

Fixes: #3649

Signed-off-by: bin <bin@hyper.sh>
2022-02-18 15:29:11 +08:00
bin
9b34cf46da agent: valid envs for hooks
Envs contain null-byte will cause running hooks to panic,
this commit will filter envs and only pass valid envs to hooks.

Fixes: #3667

Signed-off-by: bin <bin@hyper.sh>
2022-02-18 15:28:55 +08:00
Binbin Zhang
9c1953641b agent: Fix execute_hook() args error
1. The hook.args[0] is the hook binary name which shouldn't be included
in the Command.args.
2. Add new unit tests

Fixes: #2610

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
Signed-off-by: bin <bin@hyper.sh>
2022-02-18 15:28:50 +08:00
bin
9bea3a42a7 agent: check environment variables if empty or invalid
Invalid environment variable key/value will cause set_env panic.

Refer: https://doc.rust-lang.org/std/env/fn.set_var.html#panics

Fixes: #3006

Signed-off-by: bin <bin@hyper.sh>
2022-02-18 13:18:01 +08:00
Fabiano Fidêncio
1af292c9e6
Merge pull request #3585 from snir911/2.3.2-branch-bump
# Kata Containers 2.3.2
2022-02-03 08:05:22 +01:00
Snir Sheriber
67947b5f05 release: Kata Containers 2.3.2
- stable-2.3 | workflows: Use base instead of head ref for kata-deploy-test
- stable-2.3-backports
- [backport from main] agent: fix the issue of missing create a new session for container
- stable-2.3 - kata-deploy: validate conf file can be created
- stable-2.3 | kata-monitor: increase delay before syncing with the container manager
- stable-2.3 | versions: Upgrade to Cloud Hypervisor v21.0
- stable-2.3: backport lint fixes from main
- stable-2.3 | runtime: -Wl,--s390-pgste for s390x
- stable-2.3 | kata-manager: Retrieve static tarball
- stable-2.3 | ci: Pass function arguments in static-checks.sh

977f1f5b workflows: Use base instead of head ref for kata-deploy-test
99ed596a workflows: Fix typo in kata-deploy-push action
13b7d93b workflows: Ensure a label change re-triggers the actions
b8463224 workflows: Ensure force-skip-ci skips all actions
8c8571f4 workflows: Use the correct branch ref on test kata-deploy
620bb97e runtime: Provide protection for shared data
770d4acf tools: Fix groupname if it differs from username
cedb01d2 runtime: close span before return from function in case of error
a661e538 agent: fix the issue of missing create a new session for container
bed0f3c8 kata-deploy: validate conf file can be created
786c667e kata-monitor: increase delay before syncing with the container manager
e3b00f39 runtime: -Wl,--s390-pgste for s390x
3260adc4 virtcontainers: clh: Re-generate the client code
cc64461f versions: Upgrade to Cloud Hypervisor v21.0
f2c6cd08 ci: Pass function arguments in static-checks.sh
78afa10a agent: resolve unused variables in tests
a8298676 agent: remove unused field in mount handling
87f9a690 agent: drop unused fields from network
fc012a2b agent: clear cargo test warnings
63c5a8aa uevent: Fix clippy issue in test code
d1530afa kata-manager: Retrieve static tarball

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-02-01 20:02:37 +02:00
Fabiano Fidêncio
f2cbfad8b0
Merge pull request #3580 from fidencio/wip/stable-2.3-fix-kata-deploy-ref-branch
stable-2.3 | workflows: Use base instead of head ref for kata-deploy-test
2022-02-01 18:23:33 +01:00
Fabiano Fidêncio
977f1f5bb6 workflows: Use base instead of head ref for kata-deploy-test
Although I've done tests on my own fork using `head_ref` and those
worked, it seems those only worked as the PR was coming from exactly the
same repository as the target one.

Let's switch to base_ref, instead, which we for sure have as part of our
repo.

The downside of this is that we run the test with the last merged PR,
rather than with the "to-be-approved" PR, but that's a limitation we've
always had.

Fixes: #3482

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 3924470c8f)
2022-02-01 17:05:31 +01:00
Fabiano Fidêncio
e9aaefb135
Merge pull request #3575 from snir911/stable-2.3-backports232
stable-2.3-backports
2022-01-31 20:19:11 +01:00
Fabiano Fidêncio
99ed596ae4 workflows: Fix typo in kata-deploy-push action
A `:` was missed when d87ab14fa7 was
introduced.

Fixes: #3485

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-31 12:45:05 +02:00
Fabiano Fidêncio
13b7d93b4f workflows: Ensure a label change re-triggers the actions
This is needed in order to ensure that, for instance, if `force-skip-ci`
label is either added or removed later, the jobs related to the actions
will be restarted and accordingly checked.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-31 12:44:37 +02:00
Fabiano Fidêncio
b8463224c8 workflows: Ensure force-skip-ci skips all actions
Before this change it was only applied to the static-checks, but if
we're already taking the extreme path of skipping the CI, we better
ensure we skip all the actions and not just a few of them.

Fixes: #3471

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-31 12:44:33 +02:00
Fabiano Fidêncio
8c8571f4ba workflows: Use the correct branch ref on test kata-deploy
The action used for testing kata-deploy is entirely based on the action
used to build the kata-deploy tarball, but while the latter is able to
use the correct branch, the former always uses `main`.

This happens as the `issue_comment`, from GitHub actions, passed the
"default branch" as the GITHUB_REF.

As we're not the first ones to face such a issue, I've decided to take
one of the approaches suggested at one of the checkout's issues,
https://github.com/actions/checkout/issues/331, and take advantage of a
new action provided by the community, which will get the PR where the
comment was made, give us that ref, and that then can be used with the
checkout action, resulting on what we originally wanted.

Fixes: #3443

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-31 12:33:12 +02:00
liangxianlong
620bb97e3f 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-31 12:32:55 +02:00
Sebastian Hasler
770d4acf8b tools: Fix groupname if it differs from username
The script `tools/packaging/static-build/qemu/build-base-qemu.sh`
previously failed on systems where the user's groupname differs from the
username

Fixes: #3461

Signed-off-by: Sebastian Hasler <sebastian.hasler@stuvus.uni-stuttgart.de>
2022-01-31 12:32:47 +02:00
bin
cedb01d295 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-31 12:32:14 +02:00
Peng Tao
1ccc95fba1
Merge pull request #3563 from lifupan/stable-2.3-backport-3063
[backport from main] agent: fix the issue of missing create a new session for container
2022-01-29 14:24:17 +08:00
Fupan Li
a661e53892 agent: fix the issue of missing create a new session for container
When the container didn't had a tty console, it would be in a same
process group with the kata-agent, which wasn't expected. Thus,
create a new session for the container process.

Fixes: #3063

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2022-01-28 09:44:04 +08:00
snir911
5475d7a7e9
Merge pull request #3561 from snir911/stable-2.3-backport-3433
stable-2.3 - kata-deploy: validate conf file can be created
2022-01-27 19:28:11 +02:00
Snir Sheriber
bed0f3c801 kata-deploy: validate conf file can be created
As containerd doesn't exist at cleanup

Fixes: #3429
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-01-27 17:08:48 +02:00
Peng Tao
04426d65ba
Merge pull request #3554 from fgiudici/stable-2.3_monitor_sync
stable-2.3 | kata-monitor: increase delay before syncing with the container manager
2022-01-27 16:49:37 +08:00
Fabiano Fidêncio
3e1955effd
Merge pull request #3535 from likebreath/0121/backport_clh_v21.0
stable-2.3 | versions: Upgrade to Cloud Hypervisor v21.0
2022-01-27 08:02:15 +01:00
Eric Ernst
52dd41dacb
Merge pull request #3532 from egernst/stable-backport-lints
stable-2.3: backport lint fixes from main
2022-01-25 16:37:32 -08:00
Francesco Giudici
786c667e60 kata-monitor: increase delay before syncing with the container manager
When we detect a new kata sandbox from the sbs fs, we add that to the
sandbox cache to retrieve metrics.
We also schedule a sync with the container manager, which we consider
the source of truth: if the kata pod is not yet ready the container
manager will not report it and we will drop it from our cache.
We will add it back only when we re-sync, i.e., when we get an event
from the sbs fs (which means a kata pod has been terminated or a new one
has been started).

Since we use the sync with the container manager to remove pods from the
cache, we can wait some more before syncing (and so reduce the chance to
miss a kata pod just because it was not ready yet).

Let's raise the waiting time before starting the sync timer.

Fixes: #3550

Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
2022-01-25 18:18:10 +01:00
Jakob Naucke
cf5a79cfe1
Merge pull request #3528 from Jakob-Naucke/backport-pgste
stable-2.3 | runtime: -Wl,--s390-pgste for s390x
2022-01-24 15:00:44 +01:00
Jakob Naucke
e3b00f398b
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).

Must also be applied to netmon in backport.

Fixes: #3469
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
Co-authored-by: Amulya Meka <amulmek1@in.ibm.com>
2022-01-24 12:36:58 +01:00
Jakob Naucke
67950aefd5
Merge pull request #3330 from Jakob-Naucke/backport-kata-manager-static
stable-2.3 | kata-manager: Retrieve static tarball
2022-01-24 12:02:02 +01:00
Jakob Naucke
bd4ab0c4d5
Merge pull request #3526 from Jakob-Naucke/static-args
stable-2.3 | ci: Pass function arguments in static-checks.sh
2022-01-24 11:39:11 +01:00
Bo Chen
3260adc4a1 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>
(cherry picked from commit 2d799cbfa3)
2022-01-21 13:11:20 -08:00
Bo Chen
cc64461fc8 versions: Upgrade to Cloud Hypervisor v21.0
Highlights from the Cloud Hypervisor release v21.0: 1) Efficient Local
Live Migration (for Live Upgrade); 2) Recommended Kernel is Now 5.15; 3)
Bug fixes on OpenAPI yaml spec file, avoid deadlock for live-migration,
etc.

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

Fixes: #3519

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit 7e15e99d5f)
2022-01-21 13:11:20 -08:00
Jakob Naucke
f2c6cd0808
ci: Pass function arguments in static-checks.sh
e.g. when called from the tests repo

Fixes: #3525
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-01-21 14:57:16 +01:00
Eric Ernst
78afa10ab9 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 16:03:14 -08:00
Eric Ernst
a829867674 agent: remove unused field in mount handling
In our parsing of mountinfo, majority of the fields are unused.
Let's stop saving these.

Fixes: #3180

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-01-16 13:26:46 -08:00
Eric Ernst
87f9a69035 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>
2022-01-16 13:26:42 -08:00
bin
fc012a2bab agent: clear cargo test warnings
Function parameters in test config is not used. This
commit will add under score before variable name
in test config.

Fixes: #3091

Signed-off-by: bin <bin@hyper.sh>
2022-01-16 13:19:59 -08:00
James O. D. Hunt
63c5a8aa53 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>
2022-01-16 12:21:14 -08:00
Peng Tao
365e358115
Merge pull request #3402 from snir911/2.3.1-branch-bump
# Kata Containers 2.3.1
2022-01-11 16:56:05 +08:00
Snir Sheriber
a2e524f356 release: Kata Containers 2.3.1
- stable-2.3 | kata-deploy: fix tar command in dockerfile
- stable-2.3 | versions: Upgrade to Cloud Hypervisor v20.2
- stable-2.3 Missing backports
- stable-2.3 | docs: Fix kernel configs README spelling errors
- docs: Fix outdated links
- stable-2.3 | versions: Upgrade to Cloud Hypervisor v20.1
- Backport osbuilder: Revert to using apk.static for Alpine
- stable-2.3 | runtime: only call stopVirtiofsd when shared_fs is virtio-fs
- Backport versions: Use Ubuntu initrd for non-musl archs
- stable-2.3 | Upgrade to Cloud Hypervisor v20.0 and Openapi-generator v5.3.0
- stable-2.3 | packaging: Fix missing commit message in building kata-runtime
- stable-2.3 | runtime: enable vhost-net for rootless hypervisor
- [backport] agent: create directories for watchable-bind mounts
- runtime: enable FUSE_DAX kernel config for DAX

dfbe74c4 kata-deploy: fix tar command in dockerfile
9e7eed7c versions: Upgrade to Cloud Hypervisor v20.2
53cf1dd0 tools/packaging: add copyright to kata-monitor's Dockerfile
a4dee6a5 packaging: delint tests dockerfiles
fd87b60c packaging: delint kata-deploy dockerfiles
2cb4f7ba ci/openshift-ci: delint dockerfiles
993dcc94 osbuilder: delint dockerfiles
bbd7cc2f packaging: delint kata-monitor dockerfiles
9837ec72 packaging: delint static-build dockerfiles
8785106f packaging/qemu: Use QEMU script to update submodules
a915f082 packaging/qemu: Use partial git clone
ec3faab8 security: Update rust crate versions
1f61be84 osbuilder: Add protoc to the alpine container
d2d8f9ac osbuilder: avoid to copy versions.txt which already deprecated
ca30eee3 kata-manager: Retrieve static tarball
0217abce kata-deploy: Deal with empty containerd conf file
572b25dd osbuilder: be runtime consistent also with podman build
84e69ecb agent: user container ID as watchable storage key for hashmap
77b6cfbd docs: Fix kernel configs README spelling errors
24085c95 docs: Fix outdated k8s link
514bf74f docs: Replicate branch rename on runtime-spec
77a2502a cri-o: Update links for the CRI-O github page
6413ecf4 docs: Backport source reorganization links
a0bed72d versions: Upgrade to Cloud Hypervisor v20.1
d03e05e8 versions: Use fixed, minor version for Alpine
0f7db91c osbuilder: Revert to using apk.static for Alpine
271d67a8 runtime: only call stopVirtiofsd when shared_fs is virtio-fs
7c15335d versions: Use Ubuntu initrd for non-musl archs
15080f20 virtcontainers: clh: Upgrade to openapi-generator v5.3.0
c2b8eb3c virtcontainers: clh: Re-generate the client code
fe0fbab5 versions: Upgrade to Cloud Hypervisor v20.0
be5468fd packaging: Fix missing commit message in building kata-runtime
18bb9a5d runtime: enable vhost-net for rootless hypervisor
3458073d agent: create directories for watchable-bind mounts
0e91503c runtime: enable FUSE_DAX kernel config for DAX

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-01-06 20:51:21 +02:00
snir911
3d4dedefda
Merge pull request #3396 from snir911/stable-2.3-fix-kata-deploy
stable-2.3 | kata-deploy: fix tar command in dockerfile
2022-01-06 20:36:36 +02:00
snir911
919fc56daa
Merge pull request #3397 from likebreath/0105/backport_clh_v20.2
stable-2.3 | versions: Upgrade to Cloud Hypervisor v20.2
2022-01-06 11:22:41 +02:00