From 952cea5f5dee2c02046621fb723a1a3b85a87ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sat, 26 Mar 2022 12:37:27 +0100 Subject: [PATCH 1/2] tools: Add a generate_vendor.sh script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This script is responsible for generating a tarball with all the rust vendored code that is needed for fully building kata-containers on a disconnected environment. Signed-off-by: Fabiano FidĂȘncio (cherry picked from commit 2eb07455d0e7d98b7b64b861dde58fb548d89ced) --- tools/packaging/release/generate_vendor.sh | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 tools/packaging/release/generate_vendor.sh diff --git a/tools/packaging/release/generate_vendor.sh b/tools/packaging/release/generate_vendor.sh new file mode 100755 index 0000000000..bde8811081 --- /dev/null +++ b/tools/packaging/release/generate_vendor.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2022 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -o errexit +set -o nounset +set -o pipefail + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +script_name="$(basename "${BASH_SOURCE[0]}")" + +# This is very much error prone in case we re-structure our +# repos again, but it's also used in a few other places :-/ +repo_dir="${script_dir}/../../.." + +function usage() { + + cat <> .cargo/config + vendor_dir_list+=" $dir/vendor $dir/.cargo/config" + echo "${vendor_dir_list}" + popd + done + popd + + tar -cvzf ${1} ${vendor_dir_list} +} + +main () { + [ $# -ne 1 ] && usage && exit 0 + create_vendor_tarball ${1} +} + +main "$@" From f840de5acb9471919b70b39d64b03e0bd1220159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sat, 26 Mar 2022 12:46:16 +0100 Subject: [PATCH 2/2] workflows,release: Ship *all* the rust vendored code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of only vendoring the code needed by the agent, let's ensure we vendor all the needed rust code, and let's do it using the newly introduced enerate_vendor.sh script. Fixes: #3973 Signed-off-by: Fabiano FidĂȘncio (cherry picked from commit 3606923ac80aab82f425f158547a0ccc3aa0f9a7) --- .github/workflows/release.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ca2db149cb..d29872e101 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -140,13 +140,10 @@ jobs: - uses: actions/checkout@v2 - name: generate-and-upload-tarball run: | - pushd $GITHUB_WORKSPACE/src/agent - cargo vendor >> .cargo/config - popd tag=$(echo $GITHUB_REF | cut -d/ -f3-) tarball="kata-containers-$tag-vendor.tar.gz" pushd $GITHUB_WORKSPACE - tar -cvzf "${tarball}" src/agent/.cargo/config src/agent/vendor + bash -c "tools/packaging/release/generate_vendor.sh ${tarball}" GITHUB_TOKEN=${{ secrets.GIT_UPLOAD_TOKEN }} hub release edit -m "" -a "${tarball}" "${tag}" popd