Skip to content
Snippets Groups Projects
Commit 0eaef8f8 authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

chore(update_build_caches): add more debug [DO-NOT-MERGE]

Change-Id: I43d641d4d8a7b7ffaedebbd9fd13bc8e7a87349c
parent 35bccdbe
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,8 @@ source "${sourcedir}/setup_env_spack.sh"
cd "$HOME"
ls -lisa ${SPEC_FOLDER_IN_CONTAINER}
install_from_buildcache "${spack_packages[@]+"${spack_packages[@]}"}"
if [ -n "${SPACK_ENVIRONMENT:-}" ]; then
......@@ -31,6 +33,7 @@ for package in "${spack_packages[@]+"${spack_packages[@]}"}"; do
echo "ERROR: Failed to concretize ${package} for install." >&2
exit 1
fi
ls -lisa ${SPEC_FOLDER_IN_CONTAINER}
echo "Installing: ${package} (parallelism factor ${SPACK_INSTALL_PARALLELISM})" >&2
for i in `seq 1 ${SPACK_INSTALL_PARALLELISM}`; do
......
......@@ -44,6 +44,9 @@ proot -w / -S ${TARGET_FOLDER} \
--bind="${BUILD_CACHE_OUTSIDE}:${BUILD_CACHE_INSIDE}" \
/opt/spack_install_scripts/update_build_cache_in_container.sh -q || exit 0
ls -l ${TARGET_FOLDER}/opt/build_cache/default
find ${TARGET_FOLDER}/opt/spack/opt/spack/
if [ -n "${CACHE_BUILD_TYPE:-}" ]; then
if [ ${CACHE_SOURCE_TYPE} != "oci" ]; then
echo "Unknown cache type"
......
......@@ -70,11 +70,13 @@ export SPACK_SHELL="bash"
get_hashes_in_spack() {
# we only return hashes that are actually IN spack, i.e., that reside under /opt/spack/opt/spack
spack find --no-groups -Lp | awk '$3 ~ /^\/opt\/spack\/opt\/spack\// { print $1 }' | sort
echo "DEBUG: Found $(spack find --no-groups -Lp | awk '$3 ~ /^\/opt\/spack\/opt\/spack\// { print $1 }' | sort | wc -l) installed hashes" >&2
}
# we store all hashes currently installed that are not already in the buildcache
get_hashes_to_store() {
echo "DEBUG: Number of new packages to be added to cache: $(comm -13 <(get_hashes_in_buildcache "${base_buildcache}") <(get_hashes_in_spack))" >&2
comm -13 <(get_hashes_in_buildcache "${base_buildcache}") <(get_hashes_in_spack)
}
......@@ -95,6 +97,9 @@ rm_tmpdir() {
}
trap rm_tmpdir EXIT
set -x
get_hashes_to_store \
| parallel -r ${args_progress} -j${num_jobs} \
tar Pcfz "${tmpdir_in_destination_folder}/{}.tar.gz" \"\$\(spack location -i /{}\)\"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment