Commit Graph

10377 Commits

Author SHA1 Message Date
Fabiano Fidêncio
07e76c7392 packaging: Pass RUST_VERSION when building shim-v2
We need to pass the RUST_VERSION, in the same way done for GO_VERSION,
as nowadays both the go and the rust runtime are built.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-18 12:23:26 +02:00
James O. D. Hunt
dd60a0298d
Merge pull request #5439 from jodh-intel/kata-ctl-s390x-disable-tls
kata-ctl: Disable network check on s390x
2022-10-18 09:58:09 +01:00
Zvonko Kaiser
ac403cfa5a doc: Update how-to-run-kata-containers-with-SNP-VMs.md
If the needed libraries (for virtfs) are installed on the host,
 QEMU will pick it up and enable it. If not installed and you
do not enable the flag, QEMU will just ignore it, and you end
up without 9p support. Enabling it explicitly will fail if the
needed libs are not installed so this way we can be sure that
it gets build.

Fixes: #5418

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2022-10-17 05:56:19 -07:00
James O. D. Hunt
00981b3c0a kata-ctl: Disable network check on s390x
s390x apparently does not support rust-tls, which is required by the
network check (due to the `reqwest` crate dependency).

Disable the network check on s390x until we can find a solution to the
problem.

> **Note:**
>
> This fix is assumed to be a temporary one until we find a solution.
> Hence, I have not moved the network check code (which should be entirely
> generic) into an architecture specific module.

Fixes: #5435.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-10-17 10:24:06 +01:00
Rouzip
39363ffbfb
runtime: remove same function
Add EnterNetNS in virtcontainers to remove same function.

FIXes #5394

Signed-off-by: Rouzip <1226015390@qq.com>
2022-10-17 10:59:13 +08:00
James O. D. Hunt
c322d1d12a kata-ctl: arch: Improve check call
Rework the architecture-specific `check()` call by moving all the
conditional logic out of the function.

Fixes: #5402.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-10-15 11:41:53 +01:00
Fabiano Fidêncio
821dd63710 snap: Build virtiofsd using the kata-deploy scripts
Let's build virtiofsd using the kata-deploy build scripts, which
simplifies and unifies the way we build our components.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 0bc5baafb9)
2022-10-15 10:42:43 +02:00
Fabiano Fidêncio
8797a87bfd snap: Create a task for installing docker
Let's have the docker installation / configuration as part of its own
task, which can be set as a dependency of other tasks whcih may or may
not depend on docker.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit cb4ef4734f)
2022-10-15 10:42:33 +02:00
Fabiano Fidêncio
babd9924c6 virtiofsd: Build inside a container
When moving to building the CI artefacts using the kata-deploy scripts,
we've noticed that the build would fail on any machine where the tarball
wasn't officially provided.

This happens as rust is missing from the 1st layer container.  However,
it's a very common practice to leave the 1st layer container with the
minimum possible dependencies and install whatever is needed for
building a specific component in a 2nd layer container, which virtiofsd
never had.

In this commit we introduce the second layer containers (yes,
comtainers), one for building virtiofsd using musl, and one for building
virtiofsd using glibc.  The reason for taking this approach was to
actually simplify the scripts and avoid building the dependencies
(libseccomp, libcap-ng) using musl libc.

Fixes: #5425

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 7e5941c578)
2022-10-15 10:41:45 +02:00
Fabiano Fidêncio
ff8bfdfe3b
Merge pull request #5426 from fidencio/topic/build-virtiofsd-in-a-2nd-layer-container
virtiofsd: Build inside a container
2022-10-15 00:26:56 +02:00
Fabiano Fidêncio
f0041f01ed
Merge pull request #5422 from wedsonaf/verify_cid
image_rpc: always call `verify_cid` after determining the cid
2022-10-14 15:43:30 +02:00
Fabiano Fidêncio
0bc5baafb9 snap: Build virtiofsd using the kata-deploy scripts
Let's build virtiofsd using the kata-deploy build scripts, which
simplifies and unifies the way we build our components.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-14 13:44:03 +02:00
Fabiano Fidêncio
cb4ef4734f snap: Create a task for installing docker
Let's have the docker installation / configuration as part of its own
task, which can be set as a dependency of other tasks whcih may or may
not depend on docker.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-14 12:41:21 +02:00
Fabiano Fidêncio
7e5941c578 virtiofsd: Build inside a container
When moving to building the CI artefacts using the kata-deploy scripts,
we've noticed that the build would fail on any machine where the tarball
wasn't officially provided.

This happens as rust is missing from the 1st layer container.  However,
it's a very common practice to leave the 1st layer container with the
minimum possible dependencies and install whatever is needed for
building a specific component in a 2nd layer container, which virtiofsd
never had.

In this commit we introduce the second layer containers (yes,
comtainers), one for building virtiofsd using musl, and one for building
virtiofsd using glibc.  The reason for taking this approach was to
actually simplify the scripts and avoid building the dependencies
(libseccomp, libcap-ng) using musl libc.

Fixes: #5425

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-14 12:41:21 +02:00
Fabiano Fidêncio
842d278206
Merge pull request #5427 from fidencio/topic/CC-update-TDX-kernel-and-qemu-repos
CC | backport TDX kernel and qemu repo updates
2022-10-14 12:19:06 +02:00
Fabiano Fidêncio
af4f3cdfbd versions: Update TDX QEMU
The previously used repo will be removed by Intel, as done with the one
used for TDX kernel.  The TDX team has already worked on providing the
patches that were hosted atop of the QEMU commit with the following hash
4c127fdbe81d66e7cafed90908d0fd1f6f2a6cd0 as a tarball in the
https://github.com/intel/tdx-tools repo, see
https://github.com/intel/tdx-tools/pull/162.

On the Kata Containers side, in order to simplify the process and to
avoid adding hundreds of patches to our repo, we've revived the
https://github.com/kata-containers/qemu repo, and created a branch and a
tag with those hundreds of patches atop of the QEMU commit hash
4c127fdbe81d66e7cafed90908d0fd1f6f2a6cd0.  The branch is called
4c127fdbe81d66e7cafed90908d0fd1f6f2a6cd0-plus-TDX-v3.1 and the tag is
called TDX-v3.1.

Knowing the whole background, let's switch the repo we're getting the
TDX QEMU from.

Fixes: #5419

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 35d52d30fd)
2022-10-14 10:03:33 +02:00
Fabiano Fidêncio
bfc3c45854 versions: Update TDX kernel
The previously used repo has been removed by Intel.  As this happened,
the TDX team worked on providing the patches that were hosted atop of
the v5.15 kernel as a tarball present in the
https://github.com/intel/tdx-tools repos, see
https://github.com/intel/tdx-tools/pull/161.

On the Kata Containers side, in order to simplify the process and to
avoid adding ~1400 kernel patches to our repo, we've revived the
https://github.com/kata-containers/linux repo, and created a branch and
a tag with those ~1400 patches atop of the v5.15.  The branch is called
v5.15-plus-TDX, and the tag is called 5.15-plus-TDX (in order to avoid
having to change how the kernel builder script deals with versioning).

Knowing the whole background, let's switch the repo we're getting the
TDX kernel from.

Fixes: #5326

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 9eb73d543a)
2022-10-14 10:03:26 +02:00
Zhongtao Hu
5d17cbeef7
Merge pull request #5383 from openanolis/chao/update_comments_in_event_manager
Dragonball: remove redundant comments in event manager
2022-10-14 15:50:37 +08:00
Fabiano Fidêncio
c745d6648d
Merge pull request #5420 from fidencio/topic/update-tdx-qemu-repo
versions: Update TDX QEMU
2022-10-13 20:57:37 +02:00
Fabiano Fidêncio
e42fce6ece
Merge pull request #5407 from wedsonaf/fail-gracefully
image_rpc: Make `init_attestation_agent` fail gracefully
2022-10-13 18:57:35 +02:00
Fabiano Fidêncio
938de13c50
Merge pull request #5400 from wedsonaf/indirection
image_rpc: avoid double and triple indirections
2022-10-13 18:57:19 +02:00
Fabiano Fidêncio
c1fa5d60b7
Merge pull request #5149 from arronwy/kernel
kernel: Integrate initramfs into Guest kernel
2022-10-13 18:02:56 +02:00
Fabiano Fidêncio
325bafa7d8
Merge pull request #5169 from arronwy/configuration
config: Add root hash value and measure config to kernel params
2022-10-13 18:02:26 +02:00
Bin Liu
b23a24ab2f
Merge pull request #5417 from liubin/fix/typo-get_contaier_type
runtime-rs: fix typo get_contaier_type to get_container_type
2022-10-13 22:35:23 +08:00
Bin Liu
c7b38532f0
Merge pull request #5412 from tzY15368/improve-cmd-descriptions
kata-ctl: improve command descriptions for consistency
2022-10-13 19:17:42 +08:00
Fabiano Fidêncio
35d52d30fd versions: Update TDX QEMU
The previously used repo will be removed by Intel, as done with the one
used for TDX kernel.  The TDX team has already worked on providing the
patches that were hosted atop of the QEMU commit with the following hash
4c127fdbe81d66e7cafed90908d0fd1f6f2a6cd0 as a tarball in the
https://github.com/intel/tdx-tools repo, see
https://github.com/intel/tdx-tools/pull/162.

On the Kata Containers side, in order to simplify the process and to
avoid adding hundreds of patches to our repo, we've revived the
https://github.com/kata-containers/qemu repo, and created a branch and a
tag with those hundreds of patches atop of the QEMU commit hash
4c127fdbe81d66e7cafed90908d0fd1f6f2a6cd0.  The branch is called
4c127fdbe81d66e7cafed90908d0fd1f6f2a6cd0-plus-TDX-v3.1 and the tag is
called TDX-v3.1.

Knowing the whole background, let's switch the repo we're getting the
TDX QEMU from.

Fixes: #5419

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-13 11:53:29 +02:00
Bin Liu
4d9dd8790d runtime-rs: fix typo get_contaier_type to get_container_type
Change get_contaier_type to get_container_type

Fixes: #5415

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-10-13 17:12:43 +08:00
Bin Liu
2de29b6f69
Merge pull request #5088 from liubin/fix/5087-force-shutdown-shim
runtime-rs: force shutdown shim process in it can't exit
2022-10-13 16:55:05 +08:00
Fabiano Fidêncio
d934d87482
Merge pull request #5404 from fidencio/topic/update-tdx-kernel-repo
versions: Update TDX kernel
2022-10-13 09:14:44 +02:00
Tingzhou Yuan
70676d4a99 kata-ctl: improve command descriptions for consistency
This change improves the command descriptions for kata-ctl and can avoid certain confusions in command functionality.

Fixes #5411

Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>
2022-10-13 04:10:23 +00:00
Wedson Almeida Filho
cde438ceb7 image_rpc: always call verify_cid after determining the cid
Prior to this patch, we were missing a call to `verify_cid` when the cid
was derived from the image path, which meant that the host could specify
something like "prefix/..", and we would use ".." as the cid. Paths
derived from this (e.g., `bundle_path`) would not be at the intended
tree.

This patch factors the code out of `pull_image` so that it can be more
easily tested. Tests are added for a number of cases.

Fixes #5421

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
2022-10-13 03:59:18 +01:00
Bin Liu
3b70c72436
Merge pull request #5395 from wllenyj/dragonball-s390
ci: skip s390x for dragonball.
2022-10-13 09:03:08 +08:00
Bin Liu
157d3cdcb1
Merge pull request #5397 from openanolis/chao/delete_redundant_dragonball_comment
Dragonball: delete redundant comments in blk_dev_mgr
2022-10-13 09:01:59 +08:00
Wedson Almeida Filho
c7e4548fc2 image_rpc: Make init_attestation_agent fail gracefully
Without this, a failure in `init_attestion_agent` would lead to a panic.

Fixes #5406

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
2022-10-12 16:39:25 +01:00
Wedson Almeida Filho
2e90c62c31 image_rpc: avoid double and triple indirections
This also slightly improves readability by decluttering the function
declaration and call site.

Fixes #5405

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
2022-10-12 16:24:05 +01:00
Fabiano Fidêncio
9eb73d543a versions: Update TDX kernel
The previously used repo has been removed by Intel.  As this happened,
the TDX team worked on providing the patches that were hosted atop of
the v5.15 kernel as a tarball present in the
https://github.com/intel/tdx-tools repos, see
https://github.com/intel/tdx-tools/pull/161.

On the Kata Containers side, in order to simplify the process and to
avoid adding ~1400 kernel patches to our repo, we've revived the
https://github.com/kata-containers/linux repo, and created a branch and
a tag with those ~1400 patches atop of the v5.15.  The branch is called
v5.15-plus-TDX, and the tag is called 5.15-plus-TDX (in order to avoid
having to change how the kernel builder script deals with versioning).

Knowing the whole background, let's switch the repo we're getting the
TDX kernel from.

Fixes: #5326

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-12 16:54:43 +02:00
James O. D. Hunt
d3ee8d9f1b
Merge pull request #5388 from jodh-intel/kata-ctl
kata-ctl: Move development to main branch
2022-10-12 14:29:35 +01:00
James O. D. Hunt
00a42f69c0 kata-ctl: cargo: 2021 -> 2018
Revert to the 2018 edition of rust for consistency with other rust
components.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-10-12 11:46:51 +01:00
James O. D. Hunt
fb63274747 kata-ctl: rustfmt + clippy fixes
Make this file conform to the standard rust layout conventions and
simplify the code as recommended by `clippy`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-10-12 11:46:48 +01:00
wllenyj
1f1901e059 dragonball: fix clippy warning for aarch64
Added aarch64 check.

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-10-12 18:29:00 +08:00
wllenyj
a343c570e4 dragonball: enhance dragonball ci
Unified use of Makefile instead of calling `cargo test` directly.

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-10-12 17:53:01 +08:00
wllenyj
6a64fb0eb3 ci: skip s390x for dragonball.
Currently, Dragonball only supports x86_64 and aarch64 platforms.

Fixes: #4381

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-10-12 15:27:45 +08:00
Bin Liu
7aacba0abc
Merge pull request #5282 from liubin/fix/4730-rs-emptydir
runtime-rs: support ephemeral storage for emptydir
2022-10-12 09:53:59 +08:00
Chao Wu
a743e37daf Dragonball: delete redundant comments in blk_dev_mgr
delete redundent derive part for BlockDeviceMgr.

fixes: #5396

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-10-11 19:41:47 +08:00
Chao Wu
d2bf2f5dd0
Merge pull request #5393 from LetFu/5392/fixInstallKata30RustRuntimeShimGuideTypo
docs: fix a typo in rust-runtime-installation-guide
2022-10-11 19:27:31 +08:00
James O. D. Hunt
2b345ba29d build: Add kata-ctl to tools list
Update the top-level Makefile to build the `kata-ctl` tool by default.

Fixes: #4499, #5334.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-10-11 10:05:16 +01:00
James O. D. Hunt
f7010b8061 kata-ctl: docs: Write basic documentation
Provide a basic document explaining a little about the `kata-ctl`
command.

Fixes: #5351.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-10-11 10:04:48 +01:00
Bin Liu
ffdd7e1ad8
Merge pull request #4961 from wllenyj/dragonball-ut-2
Built-in Sandbox: add more unit tests for dragonball
2022-10-11 14:12:25 +08:00
Bin Liu
39702c19d5
Merge pull request #5276 from bergwolf/github/readme
readme: remove libraries mentioning
2022-10-11 13:19:18 +08:00
chmod100
862eaef863 docs: fix a typo in rust-runtime-installation-guide
Fixes: #5392

Signed-off-by: chmod100 <letfu@outlook.com>
2022-10-11 02:31:29 +00:00