From 1fc599f33c18dc7b71525635d9ee4a5d9e32ddd7 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Tue, 27 Jun 2023 11:19:29 +0200 Subject: [PATCH] ci-automation: Publish torcx_output_root to bincache `build_image` depends on accesss to the torcx manifest and the "content addressable nature" of the directory. We currently rely on the torcx output root structure being preserved in the container image. While we're moving the torcx output root out of the container image, preserve its contents so that they can be restored from bincache. --- ci-automation/image.sh | 8 +++++++- ci-automation/packages.sh | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ci-automation/image.sh b/ci-automation/image.sh index f45b78eaac..92e9a22cd5 100644 --- a/ci-automation/image.sh +++ b/ci-automation/image.sh @@ -84,11 +84,17 @@ function _image_build_impl() { official_arg="--noofficial" fi + local torcx_root_tar="torcx_root.tar.zst" apply_local_patches + copy_from_buildcache "images/${arch}/${vernum}/torcx/${torcx_root_tar}" . + # build image and related artifacts ./run_sdk_container -x ./ci-cleanup.sh -n "${image_container}" -C "${packages_image}" \ -v "${vernum}" \ - mkdir -p "${CONTAINER_IMAGE_ROOT}" + mkdir -p "${CONTAINER_IMAGE_ROOT}" "${CONTAINER_TORCX_ROOT}" + ./run_sdk_container -n "${image_container}" -C "${packages_image}" \ + -v "${vernum}" \ + tar --zstd -xf "${torcx_root_tar}" -C "${CONTAINER_TORCX_ROOT}" ./run_sdk_container -n "${image_container}" -C "${packages_image}" \ -v "${vernum}" \ ./set_official --board="${arch}-usr" "${official_arg}" diff --git a/ci-automation/packages.sh b/ci-automation/packages.sh index add6fc3c61..1d4faf42c8 100644 --- a/ci-automation/packages.sh +++ b/ci-automation/packages.sh @@ -123,6 +123,11 @@ function _packages_build_impl() { # generate image + push to build cache docker_commit_to_buildcache "${packages_container}" "${packages_image}" "${docker_vernum}" + # publish torcx output root for consumption by build_image + local torcx_root_tar="torcx_root.tar.zst" + tar --zstd -cpf "${torcx_root_tar}" -C "${torcx_tmp}/torcx" . + copy_to_buildcache "images/${arch}/${vernum}/torcx" "${torcx_root_tar}" + # Publish torcx manifest and docker tarball to "images" cache so tests can pull it later. create_digests "${SIGNER}" \ "${torcx_tmp}/torcx/${arch}-usr/latest/torcx_manifest.json" \