Skip to content
Snippets Groups Projects
Commit 8da43f41 authored by Philipp Spilger's avatar Philipp Spilger
Browse files

Make spack folder location configurable and available via env var

Change-Id: I8d17a81df6ccd47d3bb956b50131a1aba16babf4
parent eea787d3
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ pipeline {
environment {
DOCKER_BASE_IMAGE = "debian:bullseye"
DEPENDENCY_PYTHON = "python@3.8.2"
YASHCHIKI_SPACK_PATH = "${env.WORKSPACE}/spack"
YASHCHIKI_IMAGE_NAME = "singularity_visionary_temp.img"
YASHCHIKI_SANDBOXES = "sandboxes"
YASHCHIKI_PROXY_HTTP = "http://proxy.kip.uni-heidelberg.de:8080"
......
......@@ -38,6 +38,7 @@ pipeline {
DOCKER_BASE_IMAGE = "centos:7"
// versions from system packages
DEPENDENCY_PYTHON = "python@3.8.3"
YASHCHIKI_SPACK_PATH = "${env.WORKSPACE}/spack"
YASHCHIKI_IMAGE_NAME = "singularity_asic_temp.img"
YASHCHIKI_SANDBOXES = "sandboxes"
YASHCHIKI_PROXY_HTTP = "http://proxy.kip.uni-heidelberg.de:8080"
......
......@@ -12,7 +12,7 @@ TARGET_FOLDER="$(find ${YASHCHIKI_SANDBOXES} -mindepth 1 -maxdepth 1)"
# We want the spack folder to be available inside the container image
# -> it needs to be bind mounted to the sandbox folder
sudo mount --bind "${PWD}/spack" "${TARGET_FOLDER}/opt/spack"
sudo mount --bind "${YASHCHIKI_SPACK_PATH}" "${TARGET_FOLDER}/opt/spack"
# TODO: singularity 3.1 produces SIF w/o setuid flags on files, using a newer
# singularity for the image build
......
......@@ -21,7 +21,7 @@ mkdir -p "${META_DIR_OUTSIDE}"
)
(
cd "${WORKSPACE}/spack"
cd ${YASHCHIKI_SPACK_PATH}
git log > "${META_DIR_OUTSIDE}/spack_git.log"
if [ "${CONTAINER_BUILD_TYPE}" = "testing" ]; then
gerrit_get_current_change_commits \
......
......@@ -9,15 +9,15 @@ source "${SOURCE_DIR}/commons.sh"
# hard-link source cache into spack folder to avoid duplication.
# https://github.com/spack/spack/pull/12940 introduced a new format for the
# cache, so we switch from $HOME/download_cache to $HOME/source_cache
mkdir -p "${PWD}/spack/var/spack/cache/"
mkdir -p "${YASHCHIKI_SPACK_PATH}/var/spack/cache/"
find "${SOURCE_CACHE_DIR}" -mindepth 1 -maxdepth 1 -print0 \
| xargs -r -n 1 "-I{}" -0 cp -vrl '{}' "${PWD}/spack/var/spack/cache/"
| xargs -r -n 1 "-I{}" -0 cp -vrl '{}' "${YASHCHIKI_SPACK_PATH}/var/spack/cache/"
# set download mirror stuff to prefill outside of container
export MY_SPACK_FOLDER="$PWD/spack"
export MY_SPACK_FOLDER="${YASHCHIKI_SPACK_PATH}"
export MY_SPACK_BIN="${MY_SPACK_FOLDER}/bin/spack"
PATH_COMPILERS="${PWD}/spack/etc/spack/compilers.yaml"
PATH_COMPILERS="${MY_SPACK_FOLDER}/etc/spack/compilers.yaml"
# Add fake system compiler (needed for fetching)
# This is NOT the correct version but we need to concretize with the same
......@@ -165,7 +165,7 @@ else
fi
# update cache in any case to store successfully loaded files
rsync -av "${PWD}/spack/var/spack/cache/" "${SOURCE_CACHE_DIR}/"
rsync -av "${MY_SPACK_FOLDER}/var/spack/cache/" "${SOURCE_CACHE_DIR}/"
if (( fetch_failed != 0 )); then
# propagate error
......
......@@ -20,7 +20,7 @@ From: ${DOCKER_BASE_IMAGE}
%setup
# bind-mount spack-folder as moving involves copying the complete download cache
mkdir \${SINGULARITY_ROOTFS}/opt/spack
mount --no-mtab --bind "${WORKSPACE}/spack" "\${SINGULARITY_ROOTFS}/opt/spack"
mount --no-mtab --bind "${YASHCHIKI_SPACK_PATH}" "\${SINGULARITY_ROOTFS}/opt/spack"
# bind-mount ccache
mkdir \${SINGULARITY_ROOTFS}/opt/ccache
mount --no-mtab --bind "${HOME}/spack_ccache" "\${SINGULARITY_ROOTFS}/opt/ccache"
......
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