Commit Graph

10377 Commits

Author SHA1 Message Date
Fabiano Fidêncio
b1454dbcaa packaging: Add get_last_modification()
Let's add a function to get the hash of the last commit modifying a
specific file.

This will help to avoid writing `git rev-list ...` into every single
build script used by the kata-deploy.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-25 15:16:59 +02:00
Fabiano Fidêncio
fa1bf8f75c packaging: Add and export CC_BUILDER_REGISTRY
CC_BUILD_REGISTRY, which points to quay.io/kata-containers/cc-builder,
will be used for storing the builder images used to build the artefacts
via the kata-deploy scripts.

The plan is to tag, whenever it's possible and makes sense, images like:
* ${CC_BUILDER_REGISTRY}:kernel-${sha}
* ${CC_BUILDER_REGISTRY}:qemu-${sha}
* ${CC_BUILDER_REGISTRY}:ovmf-${sha}
* ${CC_BUILDER_REGISTRY}:shim-v2-${go-toolchain}-{rust-toolchain}-${sha}
* ${CC_BUILDER_REGISTRY}:td-shim-${toolchain}-${sha}
* ${CC_BUILDER_REGISTRY}:virtiofsd-${toolchain}-${sha}

Where ${sha} is the sha of the last commit modifying the Dockerfile used
by the builder.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-25 15:03:06 +02:00
Fabiano Fidêncio
fb89a83c89
Merge pull request #5136 from arronwy/initramfs
initramfs: Add build script to generate initramfs
2022-10-25 15:01:22 +02:00
Yuan-Zhuo
d7bb4b5512 agent: support systemd cgroup for kata agent
1. Implemented a rust module for operating cgroups through systemd with the help of zbus (src/agent/rustjail/src/cgroups/systemd).
2. Add support for optional cgroup configuration through fs and systemd at agent (src/agent/rustjail/src/container.rs).
3. Described the usage and supported properties of the agent systemd cgroup (docs/design/agent-systemd-cgroup.md).

Fixes: #4336

Signed-off-by: Yuan-Zhuo <yuanzhuo0118@outlook.com>
2022-10-25 13:57:09 +08:00
Bo Chen
a151d8ee50
Merge pull request #5493 from fidencio/topic/update-clh
versions: Update Cloud Hypervisor to b4e39427080
2022-10-24 07:54:02 -07:00
Bin Liu
0f7088a4b1
Merge pull request #5501 from openanolis/update_install_guide
docs: update rust runtime installation guide
2022-10-24 17:49:34 +08:00
Bin Liu
4696eadfeb
Merge pull request #5488 from ManaSugi/fix/update-libseccomp-crate
rustjail: Upgrade libseccomp crate to v0.3.0
2022-10-24 17:03:30 +08:00
Bin Liu
badb2600b3
Merge pull request #5474 from openanolis/makefile
makefile: remove sudo when create symbolic link
2022-10-24 17:03:20 +08:00
Bin Liu
ab5f97759d
Merge pull request #5497 from Rouzip/remove-redundant
agent: remove redundant checks
2022-10-24 16:41:49 +08:00
Fabiano Fidêncio
190e623c40
Merge pull request #5317 from Champ-Goblem/fix-containerd-stats
shim: Ensure pagesize is set when reporting hugetlb stats
2022-10-24 10:24:49 +02:00
Fabiano Fidêncio
7248cf51c5
Merge pull request #5447 from hbrueckner/fix-5438
kata-ctl: Re-enable network tests on s390x (fixes 5438)
2022-10-24 10:23:35 +02:00
Zhongtao Hu
144efd1a7a docs: update rust runtime installation guide
As kata-deploy support rust runtime, we need to update the installation docs

Fixes:#5500
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-10-24 15:55:30 +08:00
James O. D. Hunt
65ef2a0a0b
Merge pull request #5089 from liubin/fix/4895-ignore-exit-error
agent: use NLM_F_REPLACE replace NLM_F_EXCL in rtnetlink
2022-10-24 08:46:54 +01:00
Zhongtao Hu
164ecca3f0
Merge pull request #5499 from zhaoxuat/main
fix readme content error at doc directory
2022-10-24 14:15:52 +08:00
zhaoxu
abf4f9b299 docs: kata 3.0 Architecture
fix readme content error

Fixes: #5498
Signed-off-by: zhaoxu <zhaoxu@megvii.com>
2022-10-24 11:07:34 +08:00
snir911
18283fd65a
Merge pull request #5192 from kata-containers/CCv0-validate-hp-size
CCv0: agent: validate hugepage size is supported
2022-10-23 08:15:16 +03:00
snir911
ee189d2ebe
Merge pull request #5455 from kata-containers/main-validate-hp-size
agent: validate hugepage size is supported
2022-10-23 08:15:05 +03:00
Rouzip
44d8de8923
agent: remove redundant checks
Remove redundant checks for executable files.

FIXes: #3730

Signed-off-by: Rouzip <1226015390@qq.com>
2022-10-22 23:31:18 +08:00
Fabiano Fidêncio
9d286af7b4 versions: Update Cloud Hypervisor to b4e39427080
An API change, done a long time ago, has been exposed on Cloud
Hypervisor and we should update it on the Kata Containers side to ensure
it doesn't affect Cloud Hypervisor CI and because the change is needed
for an upcoming work to get QAT working with Cloud Hypervisor.

Fixes: #5492

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-21 20:52:54 +02:00
Bin Liu
081ee48713 agent: use NLM_F_REPLACE replace NLM_F_EXCL in rtnetlink
Sometimes we will face EEXIST error when adding arp neighbour.
Using NLM_F_REPLACE replace NLM_F_EXCL will avoid fail if the
entry exists.

See https://man7.org/linux/man-pages/man7/netlink.7.html

Fixes: #4895

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-10-21 21:19:14 +08:00
Hendrik Brueckner
e95089b716 kata-ctl: add basic cpu check for s390x
Add a basic s390x cpu check for the "sie" feature to be present.
Also re-enable cpu check testing.

Fixes: #5438

Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
2022-10-21 12:04:28 +00:00
Hendrik Brueckner
871d2cf2c0 kata-ctl: Limit running tests to x86 and use native-tls on s390x
For s390x, use native-tls for reqwest because the rustls-tls/ring
dependency is not available for s390x.

Also exclude s390x, powerpc64le, and aarch64 from running the cpu
check due to the lack of the arch-specific implementation. In this
case, rust complains about unused functions in src/check.rs (both
normal and test context).

Fixes: #5438

Co-authored-by: James O. D. Hunt <james.o.hunt@intel.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
2022-10-21 11:54:26 +00:00
Fabiano Fidêncio
5ddbce0746
Merge pull request #5483 from fidencio/topic/CC-do-not-build-runtime-rs
CC | packaging: Don't build runtime-rs if no RUST_VERSION is provided
2022-10-21 12:06:16 +02:00
Wang, Arron
a5dd0cd3ab initramfs: Add build script to generate initramfs
The init.sh in initramfs will parse the verity scheme,
roothash, root device and setup the root device accordingly.

Fixes: #5135

Signed-off-by: Wang, Arron <arron.wang@intel.com>
2022-10-21 17:38:54 +08:00
Fabiano Fidêncio
53bcaf0547
Merge pull request #5314 from anakrish/anakrish-ccv0-optimize-integrity-no-wipe
CCv0: Optimize integrity device creation by avoiding a full device clear
2022-10-21 09:37:44 +02:00
Manabu Sugimoto
cbd84c3f5a rustjail: Upgrade libseccomp crate to v0.3.0
The libseccomp crate v0.3.0 has been released, so use it in the agent.

Fixes: #5487

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-10-21 15:40:05 +09:00
Bin Liu
1bf64c9a11
Merge pull request #5453 from openanolis/chao/fix_comment_typo
Makefile: fix an typo in runtime-rs makefile
2022-10-21 14:36:39 +08:00
Fabiano Fidêncio
299829aec0 packaging: Don't build runtime-rs if no RUST_VERSION is provided
As the CCv0 effort is not using the runtime-rs, let's add a mechanism to
avoid building it.

The easiest way to do so, is to simply *not* build the runtime-rs if the
RUST_VERSION is not provided, and then not providing the RUST_VERSION as
part of the cc-shim-v2-tarball target.

Fixes: #5462

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-20 21:54:45 +02:00
David Esparza
1c159d83ea
Merge pull request #5465 from fidencio/topic/re-work-QEMU-dockerfile
qemu: Re-work static-build Dockerfile
2022-10-20 13:32:03 -05:00
Zhongtao Hu
748be0fe3d makefile: remove sudo when create symbolic link
when using mock to package rpm, we cannot have sudo permission

Fixes: #5473
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-10-20 22:13:21 +08:00
Fabiano Fidêncio
2ca6319f18
Merge pull request #5466 from fidencio/topic/CC-fix-runtime-payload-ci-registry-address
CC | actions: Fix runtime-payload-ci registry address
2022-10-20 07:29:50 +02:00
Bin Liu
cd27ad144e
Merge pull request #5219 from openanolis/krt-modify
Modify agent-url return value in runtime-rs
2022-10-20 11:17:29 +08:00
Fabiano Fidêncio
323fb9cfe8
Merge pull request #5459 from fidencio/topic/add-github-action-to-automate-CC-release
CC | action: Automate CC payload release
2022-10-19 23:37:40 +02:00
Fabiano Fidêncio
b3bd4e432c actions: Fix runtime-payload-ci registry address
There was a typo in the registry name, which should be
quay.io/confidential-containers/runtime-payload-ci instead of
quay.io/repository/confidential-containers/runtime-payload-ci

Fixes: #5469

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-19 22:41:04 +02:00
Fabiano Fidêncio
65de96e774
Merge pull request #5461 from fidencio/topic/generate-a-CI-tarball-after-every-push
CC | actions: Publish a payload on every CCv0 push
2022-10-19 21:49:12 +02:00
Fabiano Fidêncio
227e717d27 qemu: Re-work static-build Dockerfile
Differently than every single other bit that's part of our repo, QEMU
has been using a single Dockerfile that prepares an environment where
the project can be built, but *also* building the project as part of
that very same Dockerfile.

This is a problem, for several different reasons, including:
* It's very hard to have a reproducible build if you don't have an
  archived image of the builder
* One cannot cache / ipload the image of the builder, as that contains
  already a specific version of QEMU
* Every single CI run we end up building the builder image, which
  includes building dependencies (such as liburing)

Let's split the logic into a new build script, and pass the build script
to be executed inside the builder image, which will be only responsible
for providing an environment where QEMU can be built.

Fixes: #5464

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-19 21:34:36 +02:00
Fabiano Fidêncio
74b2ab001d action: Automate CC payload release
Let's create a GitHub action to automate the Kata Containers payload
generation for the Confidential Containers project.

This GitHub action builds the artefacts (in parallel), merges them into
a single tarball, generates the payload with the resulting tarball, and
uploads the payload to the Confidential Containers quay.io.

It expects the tags to be used to be in the `CC-x.y.z` format, with x,
y, and z being numbers.

Fixes: #5330

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-19 19:40:30 +02:00
Fabiano Fidêncio
4648d8bec7 actions: Publish a payload on every CCv0 push
Let's have a GitHub action to publish the Kata Containers payload, after
every push to the CCv0 branch, to the Confidential Containers
`runtime-payload-ci` registry.

The intention of this action is to allow developers to test new
features, and easily bisect breakages that could've happened during the
development process.  Ideally we'd have a CI/CD pipeline where every
single change would be tested with the operator, but we're not yet
there.  In any case, this work would still be needed. :-)

It's very important to mention that this should be carefully considered
on whether it should or should not be merged back to `main`, as the flow
of PRs there is way higher than what we currently have as part of the
CCv0 branch.

Fixes: #5460

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-19 19:09:49 +02:00
Fabiano Fidêncio
c57f8ff669 packaging: Expand the vars on build-and-upload-payload.sh
Just for the sake of avoiding issues in the future.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-19 13:58:08 +02:00
Fabiano Fidêncio
f4437980b4 packaging: Allow passing an extra tag to build-and-upload-payload.sh
Let's modify the script so we allow passing an extra tag, which will be
used as part of the Kata Containers pyload for Confidential Containers
CI GitHub action.

With this we can pass a `latest` tag, which will make things easier for
the integration on the operator side.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-19 13:58:05 +02:00
Fabiano Fidêncio
54544dd617 packaging: Allow passing registry to build-and-upload-payload.sh
Let's make the registry an optional argument to be passed to the
`kata-deploy-build-and-upload-payload.sh` script, defaulting to the
official Confidential Containers payload registry.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-19 12:59:38 +02:00
Megan Wright
a06c6dd861 CCv0: Merge main into CCv0 branch
Merge remote-tracking branch 'upstream/main' into CCv0

Fixes: #5457
Signed-off-by: Megan Wright <megan.wright@ibm.com>
2022-10-19 11:01:13 +01:00
Bin Liu
faf363db75
Merge pull request #5414 from openanolis/chao/regulate_runtime_rs_makefile_comments
runtime-rs: regulate the comment in runtime-rs makefile
2022-10-19 15:36:00 +08:00
Snir Sheriber
72738dc11f agent: validate hugepage size is supported
before setting a limit, otherwise paths may not be found.
guest supporting different hugepage size is more likely with peer-pods where
podvm may use different flavor.

Fixes: #5191
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-10-19 09:55:33 +03:00
Chao Wu
f74e328fff Makefile: fix an typo in runtime-rs makefile
There is a typo in runtime-rs makefile.
_dragonball should be _DB

fixes: #5452

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-10-19 14:12:48 +08:00
Chao Wu
f205472b01 Makefile: regulate the comment style for the runtime-rs comments
In runtime-rs makefile, we use
```
```
to let make help print out help information for variables and targets,
but later commits forgot this rule.
So we need to follow the previous rule and change the current comments.

fixes: #5413
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-10-19 12:12:50 +08:00
Fabiano Fidêncio
c97b7b18e7
Merge pull request #5416 from zvonkok/patch-1
doc: Update how-to-run-kata-containers-with-SNP-VMs.md
2022-10-18 22:45:05 +02:00
Fabiano Fidêncio
f087380180
Merge pull request #5437 from fidencio/topic/backport-virtiofsd-build-inside-a-container
CC | backport | virtiofsd: Build inside a container
2022-10-18 19:57:17 +02:00
Fabiano Fidêncio
411888796b packaging: Fix kata-deploy-binaries-in-docker.sh with podman
Instad of bailing out whenever the docker group doesn't exist, just
consider podman is being used, and set the docker_gid to the user's gid.

Also, let's ensure to pass `--privileged` to the container, so
`/run/podman/podman.socket` (which is what `/var/run/docker.sock` points
to) can be passed to the container.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-10-18 15:11:20 +02:00
Hendrik Brueckner
9f2c7e47c9 Revert "kata-ctl: Disable network check on s390x"
This reverts commit 00981b3c0a.

Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
2022-10-18 11:12:18 +00:00