From a67b93bb035f25f99cbfdf2b2ef99a0c882c2af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sun, 20 Feb 2022 20:16:30 +0100 Subject: [PATCH] snap: clh: Re-use kata-deploy script here MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current snap build for clh is broken as it's not aware of how to build the binary from sources. Instead of fixing it here, let's take advantage of the kata-deploy script, which is capable of building from sources, and re-use it here. Fixes: #3693 Signed-off-by: Fabiano FidĂȘncio --- snap/snapcraft.yaml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 4f90329c1d..173c0f7b73 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -320,17 +320,20 @@ parts: plugin: nil after: [godeps] override-build: | - export GOPATH=${SNAPCRAFT_STAGE}/gopath - yq=${SNAPCRAFT_STAGE}/yq - kata_dir=${GOPATH}/src/github.com/${SNAPCRAFT_PROJECT_NAME}/${SNAPCRAFT_PROJECT_NAME} - versions_file="${kata_dir}/versions.yaml" - version="$(${yq} r ${versions_file} assets.hypervisor.cloud_hypervisor.version)" - url="https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/${version}" - curl -L ${url}/cloud-hypervisor-static -o cloud-hypervisor - curl -LO ${url}/clh-remote + sudo apt-get -y update + sudo apt-get -y install ca-certificates curl gnupg lsb-release + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --batch --yes --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + sudo apt-get -y update + sudo apt-get -y install docker-ce docker-ce-cli containerd.io + sudo systemctl start docker.socket - install -D cloud-hypervisor ${SNAPCRAFT_PART_INSTALL}/usr/bin/cloud-hypervisor - install -D clh-remote ${SNAPCRAFT_PART_INSTALL}/usr/bin/clh-remote + export GOPATH=${SNAPCRAFT_STAGE}/gopath + kata_dir=${GOPATH}/src/github.com/${SNAPCRAFT_PROJECT_NAME}/${SNAPCRAFT_PROJECT_NAME} + cd ${kata_dir} + sudo -E NO_TTY=true make cloud-hypervisor-tarball + tar xvJpf build/kata-static-cloud-hypervisor.tar.xz -C /tmp/ + install -D /tmp/opt/kata/bin/cloud-hypervisor ${SNAPCRAFT_PART_INSTALL}/usr/bin/cloud-hypervisor apps: runtime: