From 0afcc57a9201466ac0cf9d822e3e33f766be8a11 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 15 Nov 2022 15:32:31 +0800 Subject: [PATCH 1/4] package: add nydus to release artifacts Install nydus related binaries under /opt/kata/libexec/ Fixes: #5726 Signed-off-by: Bin Liu (cherry picked from commit abb9ebeecef29c25542f8ad2a3755f96c18b3418) --- .github/workflows/kata-deploy-push.yaml | 1 + .github/workflows/kata-deploy-test.yaml | 1 + .github/workflows/release.yaml | 1 + .../kata-deploy/local-build/Makefile | 3 ++ .../local-build/kata-deploy-binaries.sh | 17 ++++++++ tools/packaging/static-build/nydus/build.sh | 41 +++++++++++++++++++ 6 files changed, 64 insertions(+) create mode 100755 tools/packaging/static-build/nydus/build.sh diff --git a/.github/workflows/kata-deploy-push.yaml b/.github/workflows/kata-deploy-push.yaml index 090f89195e..bdd0aeb2bd 100644 --- a/.github/workflows/kata-deploy-push.yaml +++ b/.github/workflows/kata-deploy-push.yaml @@ -25,6 +25,7 @@ jobs: - rootfs-image - rootfs-initrd - virtiofsd + - nydus steps: - uses: actions/checkout@v2 - name: Install docker diff --git a/.github/workflows/kata-deploy-test.yaml b/.github/workflows/kata-deploy-test.yaml index e0d6afd7c1..746f94c9b2 100644 --- a/.github/workflows/kata-deploy-test.yaml +++ b/.github/workflows/kata-deploy-test.yaml @@ -44,6 +44,7 @@ jobs: - cloud-hypervisor - firecracker - kernel + - nydus - qemu - rootfs-image - rootfs-initrd diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 544d50fb4e..b5f585937e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,6 +13,7 @@ jobs: - cloud-hypervisor - firecracker - kernel + - nydus - qemu - rootfs-image - rootfs-initrd diff --git a/tools/packaging/kata-deploy/local-build/Makefile b/tools/packaging/kata-deploy/local-build/Makefile index d68d101832..078a679d85 100644 --- a/tools/packaging/kata-deploy/local-build/Makefile +++ b/tools/packaging/kata-deploy/local-build/Makefile @@ -24,6 +24,7 @@ all-parallel: $(MK_DIR)/dockerbuild/install_yq.sh all: serial-targets \ firecracker-tarball \ kernel-tarball \ + nydus-tarball \ qemu-tarball \ shim-v2-tarball \ virtiofsd-tarball @@ -49,6 +50,8 @@ kernel-tarball: kernel-experimental-tarball: ${MAKE} $@-build +nydus-tarball: + ${MAKE} $@-build qemu-tarball: ${MAKE} $@-build diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh index e1e7250788..3e36d710db 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -27,6 +27,7 @@ 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.sh" +readonly nydus_builder="${static_build_dir}/nydus/build.sh" readonly rootfs_builder="${repo_root_dir}/tools/packaging/guest-image/build_image.sh" @@ -73,6 +74,7 @@ options: firecracker kernel kernel-experimental + nydus qemu rootfs-image rootfs-initrd @@ -151,6 +153,17 @@ install_virtiofsd() { sudo install -D --owner root --group root --mode 0744 virtiofsd/virtiofsd "${destdir}/opt/kata/libexec/virtiofsd" } +# Install static nydus asset +install_nydus() { + info "build static nydus" + "${nydus_builder}" + info "Install static nydus" + mkdir -p "${destdir}/opt/kata/libexec/" + ls -tl . || true + ls -tl nydus-static || true + sudo install -D --owner root --group root --mode 0744 nydus-static/nydusd "${destdir}/opt/kata/libexec/nydusd" +} + #Install all components that are not assets install_shimv2() { GO_VERSION="$(yq r ${versions_yaml} languages.golang.meta.newest-version)" @@ -177,6 +190,7 @@ handle_build() { install_image install_initrd install_kernel + install_nydus install_qemu install_shimv2 install_virtiofsd @@ -188,6 +202,8 @@ handle_build() { kernel) install_kernel ;; + nydus) install_nydus ;; + kernel-experimental) install_experimental_kernel;; qemu) install_qemu ;; @@ -234,6 +250,7 @@ main() { firecracker kernel kernel-experimental + nydus qemu rootfs-image rootfs-initrd diff --git a/tools/packaging/static-build/nydus/build.sh b/tools/packaging/static-build/nydus/build.sh new file mode 100755 index 0000000000..97686642ab --- /dev/null +++ b/tools/packaging/static-build/nydus/build.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2022 Ant Group +# +# SPDX-License-Identifier: Apache-2.0 + +set -o errexit +set -o nounset +set -o pipefail + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +source "${script_dir}/../../scripts/lib.sh" + +ARCH=${ARCH:-$(arch_to_golang "$(uname -m)")} + +nydus_url="${nydus_url:-}" +nydus_version="${nydus_version:-}" + +info "Get nydus information from runtime versions.yaml" +[ -n "$nydus_url" ] || nydus_url=$(get_from_kata_deps "externals.nydus.url") +[ -n "$nydus_url" ] || die "failed to get nydus url" +[ -n "$nydus_version" ] || nydus_version=$(get_from_kata_deps "externals.nydus.version") +[ -n "$nydus_version" ] || die "failed to get nydus version" + +nydus_tarball_url="${nydus_url}/releases/download" + +file_name="nydus-static-${nydus_version}-linux-${ARCH}.tgz" +download_url="${nydus_tarball_url}/${nydus_version}/${file_name}" + +info "Download nydus version: ${nydus_version} from ${download_url}" +curl -o ${file_name} -L $download_url + +sha256sum="${file_name}.sha256sum" +sha256sum_url="${nydus_tarball_url}/${nydus_version}/${sha256sum}" + +info "Download nydus ${sha256sum} from ${sha256sum_url}" +curl -o ${sha256sum} -L $sha256sum_url + +sha256sum -c ${sha256sum} +tar zxvf ${file_name} From bc5bbfa60fdca0be764cd8056e34cefd787e4d62 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Thu, 10 Nov 2022 17:19:14 +0800 Subject: [PATCH 2/4] versions: update nydusd version To the latest stable v2.1.1. Fixes: #5635 Signed-off-by: Peng Tao (cherry picked from commit a636d426d9b0433e66c26aae625b0d0bb75f9180) --- src/runtime/virtcontainers/nydusd.go | 1 + src/runtime/virtcontainers/nydusd_test.go | 4 ++-- versions.yaml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/runtime/virtcontainers/nydusd.go b/src/runtime/virtcontainers/nydusd.go index 177e3044d1..56cd263cff 100644 --- a/src/runtime/virtcontainers/nydusd.go +++ b/src/runtime/virtcontainers/nydusd.go @@ -167,6 +167,7 @@ func (nd *nydusd) args() ([]string, error) { logLevel = "debug" } args := []string{ + "virtiofs", "--hybrid-mode", "--log-level", logLevel, "--apisock", nd.apiSockPath, "--sock", nd.sockPath, diff --git a/src/runtime/virtcontainers/nydusd_test.go b/src/runtime/virtcontainers/nydusd_test.go index 34e0111ac4..481866ffcc 100644 --- a/src/runtime/virtcontainers/nydusd_test.go +++ b/src/runtime/virtcontainers/nydusd_test.go @@ -99,13 +99,13 @@ func TestNydusdArgs(t *testing.T) { apiSockPath: "/var/lib/api.sock", debug: true, } - expected := "--log-level debug --apisock /var/lib/api.sock --sock /var/lib/vhost-user.sock" + expected := "virtiofs --hybrid-mode --log-level debug --apisock /var/lib/api.sock --sock /var/lib/vhost-user.sock" args, err := nd.args() assert.NoError(err) assert.Equal(expected, strings.Join(args, " ")) nd.debug = false - expected = "--log-level info --apisock /var/lib/api.sock --sock /var/lib/vhost-user.sock" + expected = "virtiofs --hybrid-mode --log-level info --apisock /var/lib/api.sock --sock /var/lib/vhost-user.sock" args, err = nd.args() assert.NoError(err) assert.Equal(expected, strings.Join(args, " ")) diff --git a/versions.yaml b/versions.yaml index c0be81c376..56aa353a3b 100644 --- a/versions.yaml +++ b/versions.yaml @@ -240,12 +240,12 @@ externals: nydus: description: "Nydus image acceleration service" url: "https://github.com/dragonflyoss/image-service" - version: "v2.1.0-alpha.4" + version: "v2.1.1" nydus-snapshotter: description: "Snapshotter for Nydus image acceleration service" url: "https://github.com/containerd/nydus-snapshotter" - version: "v0.2.3" + version: "v0.3.3" ovmf: description: "Firmware, implementation of UEFI for virtual machines." From c712057ae7d1e4d1bd1d93d7d33ece4265fedf87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Fri, 16 Dec 2022 09:55:15 +0100 Subject: [PATCH 3/4] release: Adapt kata-deploy for 3.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit kata-deploy files must be adapted to a new release. The cases where it happens are when the release goes from -> to: * main -> stable: * kata-deploy-stable / kata-cleanup-stable: are removed * stable -> stable: * kata-deploy / kata-cleanup: bump the release to the new one. There are no changes when doing an alpha release, as the files on the "main" branch always point to the "latest" and "stable" tags. Signed-off-by: Fabiano FidĂȘncio --- tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml | 2 +- tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml b/tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml index 9302495a0c..90f2c698c8 100644 --- a/tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml +++ b/tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml @@ -18,7 +18,7 @@ spec: katacontainers.io/kata-runtime: cleanup containers: - name: kube-kata-cleanup - image: quay.io/kata-containers/kata-deploy:3.0.0 + image: quay.io/kata-containers/kata-deploy:3.0.1 imagePullPolicy: Always command: [ "bash", "-c", "/opt/kata-artifacts/scripts/kata-deploy.sh reset" ] env: diff --git a/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml b/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml index 7dadc094fe..408de3e248 100644 --- a/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml +++ b/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml @@ -16,7 +16,7 @@ spec: serviceAccountName: kata-label-node containers: - name: kube-kata - image: quay.io/kata-containers/kata-deploy:3.0.0 + image: quay.io/kata-containers/kata-deploy:3.0.1 imagePullPolicy: Always lifecycle: preStop: From ea74df1270f5471e0f51acda1233a083e5b44c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Fri, 16 Dec 2022 09:55:15 +0100 Subject: [PATCH 4/4] release: Kata Containers 3.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - stable-3.0 | kata-deploy: Fix the pod of kata deploy starts to occur an error - Stable-3.0 | Upgrade to Cloud Hypervisor v28.0 - stable-3.0 | Snap CI backports - stable-3.0 | package: add nydus to release artifacts 19f51c7cc release: Adapt kata-deploy for 3.0.1 d3f7b829f versions: update nydusd version 1bf7f2f68 package: add nydus to release artifacts 9cf1af873 runtime: clh: Re-generate the client code 4d6ca7623 versions: Upgrade to Cloud Hypervisor v28.0 719017d68 clh: return faster with dead clh process from isClhRunning 569ecdbe7 clh: fast exit from isClhRunning if the process was stopped fa8a0ad49 clh: don't try to stop clh multiple times 8fbf862fa cloud-hypervisor: Fix GetThreadIDs function 9141acd94 versions: Update Cloud Hypervisor to b4e39427080 9a0ab92f6 runtime: clh: Use the new API to boot with TDX firmware (td-shim) f3eac35b5 runtime: clh: Re-generate the client code 8a7e0efd1 versions: Upgrade to Cloud Hypervisor v27.0 a152f6034 runk: Ignore an error when calling kill cmd with --all option 50bf4434d log-parser: Simplify check 74791ed38 runtime: Fix gofmt issues 778ebb6e6 golang: Stop using io/ioutils b5661e988 versions: Update golangci-lint 88c13b682 versions: bump containerd version b8ce291dd build: update golang version to 1.19.2 f5e5ca427 github: Parallelise static checks eaa7ab746 snap: Unbreak docker install 8d2fd2449 snap: Use metadata for dependencies ab83ab6be snap: Build virtiofsd using the kata-deploy scripts 1772df5ac snap: Create a task for installing docker 2e4958644 virtiofsd: Build inside a container Signed-off-by: Fabiano FidĂȘncio --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4a36342fca..cb2b00e4f7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0 +3.0.1