mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-01 07:47:15 +00:00
Merge pull request #4233 from fidencio/topic/virtiofsd-switch-to-the-rust-version
Build and distribute the rust version of virtiofsd
This commit is contained in:
commit
b780be99d7
1
.github/workflows/kata-deploy-push.yaml
vendored
1
.github/workflows/kata-deploy-push.yaml
vendored
@ -24,6 +24,7 @@ jobs:
|
||||
- firecracker
|
||||
- rootfs-image
|
||||
- rootfs-initrd
|
||||
- virtiofsd
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install docker
|
||||
|
1
.github/workflows/kata-deploy-test.yaml
vendored
1
.github/workflows/kata-deploy-test.yaml
vendored
@ -47,6 +47,7 @@ jobs:
|
||||
- rootfs-image
|
||||
- rootfs-initrd
|
||||
- shim-v2
|
||||
- virtiofsd
|
||||
steps:
|
||||
- name: get-PR-ref
|
||||
id: get-PR-ref
|
||||
|
1
.github/workflows/release.yaml
vendored
1
.github/workflows/release.yaml
vendored
@ -17,6 +17,7 @@ jobs:
|
||||
- rootfs-image
|
||||
- rootfs-initrd
|
||||
- shim-v2
|
||||
- virtiofsd
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install docker
|
||||
|
@ -27,7 +27,8 @@ all: cloud-hypervisor-tarball \
|
||||
qemu-tarball \
|
||||
rootfs-image-tarball \
|
||||
rootfs-initrd-tarball \
|
||||
shim-v2-tarball
|
||||
shim-v2-tarball \
|
||||
virtiofsd-tarball
|
||||
|
||||
%-tarball-build: $(MK_DIR)/dockerbuild/install_yq.sh
|
||||
$(call BUILD,$*)
|
||||
@ -57,6 +58,9 @@ rootfs-initrd-tarball:
|
||||
shim-v2-tarball:
|
||||
${MAKE} $@-build
|
||||
|
||||
virtiofsd-tarball:
|
||||
${MAKE} $@-build
|
||||
|
||||
merge-builds:
|
||||
$(MK_DIR)/kata-deploy-merge-builds.sh build
|
||||
|
||||
|
@ -35,6 +35,7 @@ RUN apt-get update && \
|
||||
gcc \
|
||||
git \
|
||||
make \
|
||||
unzip \
|
||||
xz-utils && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
|
@ -26,6 +26,7 @@ readonly firecracker_builder="${static_build_dir}/firecracker/build-static-firec
|
||||
readonly kernel_builder="${static_build_dir}/kernel/build.sh"
|
||||
readonly qemu_builder="${static_build_dir}/qemu/build-static-qemu.sh"
|
||||
readonly shimv2_builder="${static_build_dir}/shim-v2/build.sh"
|
||||
readonly virtiofsd_builder="${static_build_dir}/virtiofsd/build-static-virtiofsd.sh"
|
||||
|
||||
readonly rootfs_builder="${repo_root_dir}/tools/packaging/guest-image/build_image.sh"
|
||||
|
||||
@ -76,6 +77,7 @@ options:
|
||||
rootfs-image
|
||||
rootfs-initrd
|
||||
shim-v2
|
||||
virtiofsd
|
||||
EOF
|
||||
|
||||
exit "${return_code}"
|
||||
@ -140,6 +142,15 @@ install_clh() {
|
||||
sudo install -D --owner root --group root --mode 0744 cloud-hypervisor/cloud-hypervisor "${destdir}/opt/kata/bin/cloud-hypervisor"
|
||||
}
|
||||
|
||||
# Install static virtiofsd asset
|
||||
install_virtiofsd() {
|
||||
info "build static virtiofsd"
|
||||
"${virtiofsd_builder}"
|
||||
info "Install static virtiofsd"
|
||||
mkdir -p "${destdir}/opt/kata/libexec/"
|
||||
sudo install -D --owner root --group root --mode 0744 virtiofsd/virtiofsd "${destdir}/opt/kata/libexec/virtiofsd"
|
||||
}
|
||||
|
||||
#Install all components that are not assets
|
||||
install_shimv2() {
|
||||
GO_VERSION="$(yq r ${versions_yaml} languages.golang.meta.newest-version)"
|
||||
@ -166,6 +177,7 @@ handle_build() {
|
||||
install_kernel
|
||||
install_qemu
|
||||
install_shimv2
|
||||
install_virtiofsd
|
||||
;;
|
||||
|
||||
cloud-hypervisor) install_clh ;;
|
||||
@ -184,6 +196,8 @@ handle_build() {
|
||||
|
||||
shim-v2) install_shimv2 ;;
|
||||
|
||||
virtiofsd) install_virtiofsd ;;
|
||||
|
||||
*)
|
||||
die "Invalid build target ${build_target}"
|
||||
;;
|
||||
@ -221,6 +235,7 @@ main() {
|
||||
rootfs-image
|
||||
rootfs-initrd
|
||||
shim-v2
|
||||
virtiofsd
|
||||
)
|
||||
silent=false
|
||||
while getopts "hs-:" opt; do
|
||||
|
43
tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh
Executable file
43
tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh
Executable file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
ARCH=$(uname -m)
|
||||
|
||||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
source "${script_dir}/../../scripts/lib.sh"
|
||||
|
||||
virtiofsd_version="${virtiofsd_version:-}"
|
||||
|
||||
[ -n "$virtiofsd_version" ] || virtiofsd_version=$(get_from_kata_deps "externals.virtiofsd.version")
|
||||
[ -n "$virtiofsd_version" ] || die "failed to get virtiofsd version"
|
||||
|
||||
if [ "${ARCH}" != "x86_64" ]; then
|
||||
info "Only x86_64 binaries are distributed as part of the virtiofsd releases" && exit 1
|
||||
fi
|
||||
|
||||
pull_virtiofsd_released_binary() {
|
||||
info "Download virtiofsd version: ${virtiofsd_version}"
|
||||
virtiofsd_zip=$(get_from_kata_deps "externals.virtiofsd.meta.binary")
|
||||
[ -n "${virtiofsd_zip}" ] || die "failed to get virtiofsd binary URL"
|
||||
|
||||
mkdir -p virtiofsd
|
||||
|
||||
pushd virtiofsd
|
||||
curl --fail -L ${virtiofsd_zip} -o virtiofsd.zip || return 1
|
||||
unzip virtiofsd.zip
|
||||
mv -f target/x86_64-unknown-linux-musl/release/virtiofsd virtiofsd
|
||||
chmod +x virtiofsd
|
||||
rm -rf target
|
||||
rm virtiofsd.zip
|
||||
popd
|
||||
}
|
||||
|
||||
pull_virtiofsd_released_binary
|
@ -243,6 +243,17 @@ externals:
|
||||
url: "https://github.com/containerd/nydus-snapshotter"
|
||||
version: "v0.1.0"
|
||||
|
||||
virtiofsd:
|
||||
description: "vhost-user virtio-fs device backend written in Rust"
|
||||
url: "https://gitlab.com/virtio-fs/virtiofsd"
|
||||
version: "v1.2.0"
|
||||
meta:
|
||||
# From https://gitlab.com/virtio-fs/virtiofsd/-/releases/v1.2.0,
|
||||
# this is the link labelled virtiofsd-v1.2.0.zip
|
||||
#
|
||||
# yamllint disable-line rule:line-length
|
||||
binary: "https://gitlab.com/virtio-fs/virtiofsd/uploads/b26d9891caac83209a3fdd24bcf2ae86/virtiofsd-v1.2.0.zip"
|
||||
|
||||
languages:
|
||||
description: |
|
||||
Details of programming languages required to build system
|
||||
|
Loading…
Reference in New Issue
Block a user