kata-deploy: Add VERSION and versions.yaml to the final tarball

Let's make things simpler to figure out which version of Kata
Containers has been deployed, and also which artefacts come with it.

This will help us immensely in the future, for the TEEs use case, so we
can easily know whether we can deploy a specific guest kernel for a
specific host kernel.

Fixes: #7394

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-07-20 17:52:24 +02:00
parent 5dddd7c5d1
commit 59fdd69b85
5 changed files with 15 additions and 4 deletions

View File

@ -99,7 +99,7 @@ jobs:
path: kata-artifacts path: kata-artifacts
- name: merge-artifacts - name: merge-artifacts
run: | run: |
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts ./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts versions.yaml
- name: store-artifacts - name: store-artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View File

@ -83,7 +83,7 @@ jobs:
path: kata-artifacts path: kata-artifacts
- name: merge-artifacts - name: merge-artifacts
run: | run: |
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts ./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts versions.yaml
- name: store-artifacts - name: store-artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View File

@ -80,7 +80,7 @@ jobs:
path: kata-artifacts path: kata-artifacts
- name: merge-artifacts - name: merge-artifacts
run: | run: |
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts ./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts versions.yaml
- name: store-artifacts - name: store-artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View File

@ -125,7 +125,7 @@ virtiofsd-tarball:
${MAKE} $@-build ${MAKE} $@-build
merge-builds: merge-builds:
$(MK_DIR)/kata-deploy-merge-builds.sh build $(MK_DIR)/kata-deploy-merge-builds.sh build "$(MK_DIR)/../../../../versions.yaml"
install-tarball: install-tarball:
tar -xf ./kata-static.tar.xz -C / tar -xf ./kata-static.tar.xz -C /

View File

@ -11,6 +11,8 @@ set -o pipefail
set -o errtrace set -o errtrace
kata_build_dir=${1:-build} kata_build_dir=${1:-build}
kata_versions_yaml_file=${2:-""}
tar_path="${PWD}/kata-static.tar.xz" tar_path="${PWD}/kata-static.tar.xz"
pushd "${kata_build_dir}" pushd "${kata_build_dir}"
@ -24,6 +26,15 @@ do
tar -xvf "${c}" -C "${tarball_content_dir}" tar -xvf "${c}" -C "${tarball_content_dir}"
done done
pushd ${tarball_content_dir}
shim="containerd-shim-kata-v2"
shim_path=$(find . -name ${shim} | sort | head -1)
prefix=${shim_path%"bin/${shim}"}
echo "$(git describe)" > ${prefix}/VERSION
[[ -n "${kata_versions_yaml_file}" ]] && cp ${kata_versions_yaml_file} ${prefix}/
popd
echo "create ${tar_path}" echo "create ${tar_path}"
(cd "${tarball_content_dir}"; tar cvfJ "${tar_path}" .) (cd "${tarball_content_dir}"; tar cvfJ "${tar_path}" .)
popd popd