Commit Graph

9695 Commits

Author SHA1 Message Date
Bin Liu
dd34540b8a
Merge pull request #5305 from liubin/fix/5301-delete-duplicated-PASSTHROUGH_FS_DIR
runtime-rs: delete duplicated PASSTHROUGH_FS_DIR const
2022-10-08 16:39:03 +08:00
Ji-Xinyou
9c1ac3d457 runtime-rs: return port on agent-url req
Add the server vport (1024) when requesting agent-url

Fixes: #5213
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-10-08 16:14:21 +08:00
Fabiano Fidêncio
ce73bc6dac
Merge pull request #5015 from vijaydhanraj/enable_acrn_kata2.x
Enable ACRN hypervisor support for Kata 2.x release
2022-10-08 09:27:59 +02:00
Bin Liu
4616363eec
Merge pull request #5365 from fengwang666/mount-bug-fix
agent: reduce reference count for failed mount
2022-10-08 14:27:38 +08:00
Fupan Li
1b7272c7ca
Merge pull request #5367 from fengwang666/signal-bug-fix
agent: don't exit early if signal fails due to ESRCH
2022-10-08 14:21:50 +08:00
Feng Wang
ef5a2dc3bf agent: don't exit early if signal fails due to ESRCH
ESRCH usually means the process has exited. In this case,
the execution should continue to kill remaining container processes.

Fixes: #5366

Signed-off-by: Feng Wang <feng.wang@databricks.com>
[Fix up cargo updates]
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-10-08 12:15:12 +08:00
Bin Liu
5ace4e2354
Merge pull request #5304 from liubin/fix/5299-delete-duplicated-get_bundle_path
kata-sys-util: delete duplicated get_bundle_path
2022-10-08 10:57:52 +08:00
Vijay Dhanraj
435c8f181a acrn: Enable ACRN hypervisor support for Kata 2.x release
Currently ACRN hypervisor support in Kata2.x releases is broken.
This commit re-enables ACRN hypervisor support and also refactors
the code so as to remove dependency on Sandbox.

Fixes #3027

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2022-10-07 07:40:32 -07:00
Feng Wang
c31cf7269e agent: reduce reference count for failed mount
The kata agent adds a reference for each storage object before mount
and skip mount again if the storage object is known. We need to
remove the object reference if mount fails.

Fixes: #5364

Signed-off-by: Feng Wang <feng.wang@databricks.com>
2022-10-06 21:37:59 -07:00
Fabiano Fidêncio
ff62cedd26
Merge pull request #5323 from fidencio/topic/fix-kata-deploy-build-behind-proxy
packaging: Mount $HOME/.docker in the 1st layer container
2022-10-05 21:18:29 +02:00
Fabiano Fidêncio
4da743f90b packaging: Mount $HOME/.docker in the 1st layer container
In order to ensure that the proxy configuration is passed to the 2nd
layer container, let's ensure the $HOME/.docker/config.json file is
exposed inside the 1st layer container.

For some reason which I still don't fully understand exporting
https_proxy / http_proxy / no_proxy was not enough to get those
variables exported to the 2nd layer container.

In this commit we're creating a "$HOME/.docker" directory, and removing
it after the build, in case it doesn't exist yet.  The reason we do this
is to avoid docker not running in case "$HOME/.docker" doesn't exist.

This was not tested with podman, but if there's an issue with podman,
the issue was already there beforehand and should be treated as a
different problem than the one addressed in this commit.

Fixes: #5077

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-05 15:25:07 +02:00
Archana Shinde
6e2d39c588
Merge pull request #5311 from likebreath/0930/clh_v27.0
Upgrade to Cloud Hypervisor v27.0
2022-10-04 10:56:00 -07:00
Fabiano Fidêncio
d5572d5fd5
Merge pull request #5106 from norbjd/fix/microvm-machine-options
microvm: Remove kernel_irqchip=on option
2022-10-04 12:19:37 +02:00
Champ-Goblem
89e62d4edf shim: Ensure pagesize is set when reporting hugetbl stats
The containerd stats method and metrics API are broken with Kata 2.5.x, the stats fail to load and the metrics API responds with status code 500

This seems to be down to the conversion from the stats reported by the agent RPC `StatsContainer` where the field `Pagesize` is not
completed by the `setHugetlbStats` method. In the case where multiple sized tables stats are reported, this causes containerd to register two metrics
with the same label set, rather than each being partitioned by the `page` label.

Fixes: #5316
Signed-off-by: Champ-Goblem <cameron@northflank.com>
2022-10-04 09:16:30 +01:00
Bo Chen
067e2b1e33 runtime: clh: Use the new API to boot with TDX firmware (td-shim)
The new way to boot from TDX firmware (e.g. td-shim) is using the
combination of '--platform tdx=on' with '--firmware tdshim'.

Fixes: #5309

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-10-03 10:30:54 -07:00
Bo Chen
5d63fcf344 runtime: clh: Re-generate the client code
This patch re-generates the client code for Cloud Hypervisor v27.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

Fixes: #5309

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-10-03 10:30:42 -07:00
Bo Chen
fe61070426 versions: Upgrade to Cloud Hypervisor v27.0
This release has been tracked in our new [roadmap project ](https://github.com/orgs/cloud-hypervisor/projects/6) as iteration v27.0.

**Community Engagement**
A new mailing list has been created to support broader community discussions.
Please consider [subscribing](https://lists.cloudhypervisor.org/g/dev/); an announcement of a regular meeting will be
announced via this list shortly.

**Prebuilt Packages**
Prebuilt packages are now available. Please see this [document](https://github.com/cloud-hypervisor/obs-packaging/blob/main/README.md)
on how to install. These packages also include packages for the different
firmware options available.

**Network Device MTU Exposed to Guest**
The MTU for the TAP device associated with a virtio-net device is now exposed
to the guest. If the user provides a MTU with --net mtu=.. then that MTU is
applied to created TAP interfaces. This functionality is also exposed for
vhost-user-net devices including those created with the reference backend.

**Boot Tracing**
Support for generating a trace report for the boot time has been added
including a script for generating an SVG from that trace.

**Simplified Build Feature Flags**
The set of feature flags, for e.g. experimental features, have been simplified:

* msvh and kvm features provide support for those specific hypervisors
(with kvm enabled by default),
* tdx provides support for Intel TDX; and although there is no MSHV support
now it is now possible to compile with the mshv feature,
* tracing adds support for boot tracing,
* guest_debug now covers both support for gdbing a guest (formerly gdb
feature) and dumping guest memory.

The following feature flags were removed as the functionality was enabled by
default: amx, fwdebug, cmos and common.

**Asynchronous Kernel Loading**
AArch64 has gained support for loading the guest kernel asynchronously like
x86-64.

**GDB Support for AArch64**
GDB stub support (accessed through --gdb under guest_debug feature) is now
available on AArch64 as well as as x86-64.

**Notable Bug Fixes**
* This version incorporates a version of virtio-queue that addresses an issue
where a rogue guest can potentially DoS the VMM,
* Improvements around PTY handling for virtio-console and serial devices,
* Improved error handling in virtio devices.

**Deprecations**
Deprecated features will be removed in a subsequent release and users should
plan to use alternatives.

* Booting legacy firmware (compiled without a PVH header) has been deprecated.
All the firmware options (Cloud Hypervisor OVMF and Rust Hypervisor Firmware)
support booting with PVH so support for loading firmware in a legacy mode is no
longer needed. This functionality will be removed in the next release.

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

Note: To have the new API of loading firmware for booting (e.g. boot
from td-shim), a specific commit revision after the v27.0 release is
used as the Cloud Hypervisor version from the 'versions.yaml'.

Fixes: #5309

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-10-03 10:25:04 -07:00
Fabiano Fidêncio
0143036b84
Merge pull request #5303 from liubin/fix/5296-typo-unknow
kata-sys-util: fix typo `unknow`
2022-10-03 15:29:45 +02:00
norbjd
17de94e118 microvm: Remove kernel_irqchip=on option
`kernel_irqchip` option doesn't seem to bring any benefits and, on the
contrary, its usage cause issues when using the microvm machine type.

With this in mind, let's remove it.

Fixes: #1984, #4386

Signed-off-by: norbjd <norbjd@users.noreply.github.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-03 11:48:05 +02:00
Bin Liu
3aeaa6459d runtime-rs: delete duplicated PASSTHROUGH_FS_DIR const
The const PASSTHROUGH_FS_DIR defined twice, delte one.

Fixes: #5301

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-30 15:53:08 +08:00
Bin Liu
43ae972335 kata-sys-util: delete duplicated get_bundle_path
get_bundle_path has already defined in spec.rs,
delete it from fs.rs.

Fixes: #5299

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-30 15:50:58 +08:00
Bin Liu
ac04831223 kata-sys-util: fix typo unknow
Change `unknow` to `unknown`.

Fixes: #5296

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-30 15:47:34 +08:00
Bin Liu
68e8a86aec runtime: fix incorrect comment for SetFsSharingSupport function
The comment for SetFsSharingSupport is not suitable, correct the
function name.

Fixes: #5285

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-30 15:44:44 +08:00
Bin Liu
805e80b2a2
Merge pull request #5278 from openanolis/chao/update_linux_loader_ut
dragonball: update ut for kernel config
2022-09-30 11:12:29 +08:00
Bin Liu
357d323803
Merge pull request #5244 from GabyCT/topic/debugosbuilder
versions: Update gperf url to avoid libseccomp random failures
2022-09-30 10:10:54 +08:00
Bin Liu
8d4ced3c86 runtime-rs: support ephemeral storage for emptydir
Add support for ephemeral storage and k8s emptydir.

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

Fixes: #4730

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-30 09:10:20 +08:00
David Esparza
9b033f174b
Merge pull request #5292 from GabyCT/topic/updateoci
versions: Update oci version
2022-09-29 16:29:11 -05:00
Greg Kurz
7b4c3c0cab
Merge pull request #5288 from jongwu/fix_cmdline_arm
dragonball: fix no "as_str" error on Arm
2022-09-29 18:59:00 +02:00
Gabriela Cervantes
a241276592 versions: Update gperf url to avoid libseccomp random failures
This PR updates the gperf url to avoid random failures when installing
libseccomp as it seems that the mirrror url produces network random
failures in multiple CIs.

Fixes #5294

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-09-29 16:52:46 +00:00
Gabriela Cervantes
a617a63481 versions: Update oci version
This PR updates the oci version that we are using in kata containers.

Fixes #5291

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-09-29 15:32:48 +00:00
Jianyong Wu
6d585d5919 dragonball: fix no "as_str" error on Arm
Cmdline struct update in the latest linux-loader lib and its as_str
method is changed to as_cstring, thus we need fix it according whereas
the old as_str method is used.

Fixes: #5287
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2022-09-29 21:06:31 +08:00
Bin Liu
68f6dbb202
Merge pull request #5284 from gkurz/fix-release-script
tools: release: fix bogus version check
2022-09-29 20:46:11 +08:00
Greg Kurz
421729f991 tools: release: fix bogus version check
Shell expands `*"rc"*` to the top-level `src` directory. This results
in comparing a version with a directory name. This doesn't make sense
and causes the script to choose the wrong branch of the `if`.

The intent of the check is actually to detect `rc` in the version.

Fixes: #5283
Signed-off-by: Greg Kurz <groug@kaod.org>
2022-09-29 11:31:43 +02:00
Bin Liu
949ffcc457
Merge pull request #5281 from liubin/fix/5280-update-cargo-lock
runtime-rs: update Cargo.lock
2022-09-29 17:16:21 +08:00
Bin Liu
1352e31180
Merge pull request #5200 from openanolis/agent_rwlock
refactor(runtime-rs): Use RwLock in runtime-agent
2022-09-29 13:15:41 +08:00
Bin Liu
457b0beaf0 runtime-rs: update Cargo.lock
src/dragonball/Cargo.toml is updated and the Cargo.lock is not
commited into repo.

Fixes: #5280

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-29 13:15:01 +08:00
Bin Liu
abbdf89a06
Merge pull request #5271 from liubin/fix/4729-add-close-io-for-kubectl-cp
runtime-rs: fix shim close_io call to support kubectl cp
2022-09-29 13:10:49 +08:00
Peng Tao
046ddc6463 readme: remove libraries mentioning
There are two duplicated mentioning of the rust libraries in README.md.
Let's just remove them all as the section is intended to list out core
Kata components rather than general libraries.

Fixes: #5275
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-09-29 12:10:50 +08:00
Chao Wu
f89ada2de1 dragonball: update ut for kernel config
Since linux loader is updated in the Dragonball and the api for Cmdline
has been changed ( as_str() changed to as_cstring() ), we need to update
unit test in Dragonball.

fixes: #5277

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-09-29 11:35:45 +08:00
Bin Liu
0e899669ee runtime-rs: fix shim close_io call to support kubectl cp
Add close_io to shim and call agent's close_stdin in close_io.

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

Fixes: #4729

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-29 09:35:17 +08:00
quanweiZhou
901893163f
Merge pull request #5198 from openanolis/share-fs-comment
runtime-rs: add comments for runtime-rs shared directory
2022-09-29 09:12:01 +08:00
Greg Kurz
7294e2fa9e
Merge pull request #4387 from snir911/tmp-workflow-main
workflow: trigger test-kata-deploy with pull_request and fix workflow_dispatch
2022-09-28 16:42:51 +02:00
Zhongtao Hu
96cf21fad0 runtime-rs: add comments for runtime-rs shared directory
add comments for runtime-rs shared directory

Fixes:#5197
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-09-28 15:46:34 +08:00
Zhongtao Hu
2f1a4b02ee
Merge pull request #5254 from openanolis/chao/update_linux_loader
Dragonball: update linux_loader to 0.6.0
2022-09-28 15:04:09 +08:00
Bin Liu
0f6884b8c3
Merge pull request #5252 from zhaoxuat/main
modify virtio_net_dev_mgr.rs wrong code comments
2022-09-28 11:34:20 +08:00
Bin Liu
d0be4a285e
Merge pull request #5260 from GabyCT/topic/fixrunkdoc
docs: Update urls in runk documentation
2022-09-28 11:30:39 +08:00
Zhongtao Hu
ff053b0808
Merge pull request #5220 from liubin/fix/5184-rs-inotify
runtime-rs: support watchable mount
2022-09-28 11:19:53 +08:00
Zhongtao Hu
319caa8e74
Merge pull request #5097 from openanolis/dbg-console
runtime-rs: debug console support in runtime
2022-09-28 10:30:22 +08:00
Peng Tao
33b0720119
Merge pull request #5193 from openanolis/origin/kata-deploy
kata-deploy: ship the rustified runtime binary
2022-09-28 10:19:16 +08:00
Gabriela Cervantes
9bd941098e docs: Update urls in runk documentation
This PR updates the urls that we have in the runk documentation.

Fixes #5259

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-09-27 15:45:43 +00:00