Skip to content

Commit

Permalink
kata-deploy: Add VERSION and versions.yaml to the final tarball
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
fidencio committed Jul 20, 2023
1 parent 5dddd7c commit 59fdd69
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-kata-static-tarball-amd64.yaml
Expand Up @@ -99,7 +99,7 @@ jobs:
path: kata-artifacts
- name: merge-artifacts
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
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-kata-static-tarball-arm64.yaml
Expand Up @@ -83,7 +83,7 @@ jobs:
path: kata-artifacts
- name: merge-artifacts
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
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-kata-static-tarball-s390x.yaml
Expand Up @@ -80,7 +80,7 @@ jobs:
path: kata-artifacts
- name: merge-artifacts
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
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion tools/packaging/kata-deploy/local-build/Makefile
Expand Up @@ -125,7 +125,7 @@ virtiofsd-tarball:
${MAKE} $@-build

merge-builds:
$(MK_DIR)/kata-deploy-merge-builds.sh build
$(MK_DIR)/kata-deploy-merge-builds.sh build "$(MK_DIR)/../../../../versions.yaml"

install-tarball:
tar -xf ./kata-static.tar.xz -C /
Expand Up @@ -11,6 +11,8 @@ set -o pipefail
set -o errtrace

kata_build_dir=${1:-build}
kata_versions_yaml_file=${2:-""}

tar_path="${PWD}/kata-static.tar.xz"

pushd "${kata_build_dir}"
Expand All @@ -24,6 +26,15 @@ do
tar -xvf "${c}" -C "${tarball_content_dir}"
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}"
(cd "${tarball_content_dir}"; tar cvfJ "${tar_path}" .)
popd

0 comments on commit 59fdd69

Please sign in to comment.