Skip to content
Snippets Groups Projects
Commit d8a92c0a authored by Jakob Kaiser's avatar Jakob Kaiser
Browse files

chore: make yashchiki dependencies more clear

Previously, we called the step where we installed packages needed by
yashchiki "bootstrapping". This is misleading since spack does also a
bootstrapping step which is different from this one.

Change-Id: I7a5ed4849324da8fb755d23c62df6eb67e308b76
parent 4d2e3696
No related branches found
No related tags found
No related merge requests found
...@@ -129,13 +129,9 @@ if [ -n "${YASHCHIKI_SPACK_VERBOSE:-}" ]; then ...@@ -129,13 +129,9 @@ if [ -n "${YASHCHIKI_SPACK_VERBOSE:-}" ]; then
SPACK_ARGS_REINDEX+=("--verbose") SPACK_ARGS_REINDEX+=("--verbose")
fi fi
# TODO: Keep in sync with <spack-repo>/lib/spack/spack/cmd/bootstrap.py since # Dependencies needed by yashchiki
# there is no straight-forward way to extract bootstrap dependencies yashchiki_dependencies=(
# automatically. If bootstrap dependencies should change we will notice because "environment-modules~X" # needed for module generation
# they won't be able to be fetched inside the container because of missing
# permissions.
spack_bootstrap_dependencies=(
"environment-modules~X"
) )
######### #########
......
...@@ -12,7 +12,7 @@ SOURCE_DIR="$(dirname "$(readlink -m "${BASH_SOURCE[0]}")")" ...@@ -12,7 +12,7 @@ SOURCE_DIR="$(dirname "$(readlink -m "${BASH_SOURCE[0]}")")"
source "${SOURCE_DIR}/commons.sh" source "${SOURCE_DIR}/commons.sh"
"${SPACK_INSTALL_SCRIPTS}/prepare_spack_as_root.sh" "${SPACK_INSTALL_SCRIPTS}/prepare_spack_as_root.sh"
sudo -Eu spack "${SPACK_INSTALL_SCRIPTS}/bootstrap_spack.sh" sudo -Eu spack "${SPACK_INSTALL_SCRIPTS}/install_dependencies.sh"
sudo -Eu spack "${SPACK_INSTALL_SCRIPTS}/install_spack.sh" && \ sudo -Eu spack "${SPACK_INSTALL_SCRIPTS}/install_spack.sh" && \
sudo -Eu spack ${MY_SPACK_CMD} compiler add --scope site /usr/bin && \ sudo -Eu spack ${MY_SPACK_CMD} compiler add --scope site /usr/bin && \
......
...@@ -51,7 +51,7 @@ echo "FETCHING..." ...@@ -51,7 +51,7 @@ echo "FETCHING..."
# concretize all spack packages in parallel # concretize all spack packages in parallel
packages_to_fetch=( packages_to_fetch=(
"${YASHCHIKI_SPACK_GCC}" "${YASHCHIKI_SPACK_GCC}"
"${spack_bootstrap_dependencies[@]}" "${yashchiki_dependencies[@]}"
"${spack_packages[@]}" "${spack_packages[@]}"
) )
# verify that all concretizations were successful # verify that all concretizations were successful
......
#!/bin/bash #!/bin/bash
# #
# Prepare spack by bootstrapping and installing the compiler via spack # Install dependencies needed during the spack install
# process and the container creation.
# #
set -euo pipefail set -euo pipefail
shopt -s inherit_errexit 2>/dev/null || true shopt -s inherit_errexit 2>/dev/null || true
...@@ -25,33 +26,9 @@ ccache -s ...@@ -25,33 +26,9 @@ ccache -s
# add system compiler # add system compiler
${MY_SPACK_CMD} compiler add --scope site /usr/bin ${MY_SPACK_CMD} compiler add --scope site /usr/bin
# provide spack support for environment modules
echo "BOOTSTRAPPING"
# add build_cache # add build_cache
${MY_SPACK_CMD} mirror add --scope site build_mirror file://${BUILD_CACHE_DIR} ${MY_SPACK_CMD} mirror add --scope site build_mirror file://${BUILD_CACHE_DIR}
install_from_buildcache "${spack_bootstrap_dependencies[@]}"
# We install all packages needed by boostrap here
for bootstrap_spec in "${spack_bootstrap_dependencies[@]}"; do
${MY_SPACK_CMD} "${SPACK_ARGS_INSTALL[@]+"${SPACK_ARGS_INSTALL[@]}"}" install --no-cache --show-log-on-error "${bootstrap_spec}"
done
num_packages_pre_boostrap="$(${MY_SPACK_CMD} find 2>&1 | head -n 1 | awk '/installed packages/ { print $2 }')"
num_packages_post_boostrap="$(${MY_SPACK_CMD} find 2>&1 | head -n 1 | awk '/installed packages/ { print $2 }')"
if (( num_packages_pre_boostrap < num_packages_post_boostrap )); then
cat <<EOF | tr '\n' ' ' >&2
ERROR: spack bootstrap command did install some packages on its own, this
should not happen, aborting..!
EOF
echo ""
exit 1
fi
if [ ${YASHCHIKI_BUILD_SPACK_GCC} -eq 1 ]; then if [ ${YASHCHIKI_BUILD_SPACK_GCC} -eq 1 ]; then
# check if it can be specialized # check if it can be specialized
spec_compiler="${YASHCHIKI_SPACK_GCC}" spec_compiler="${YASHCHIKI_SPACK_GCC}"
...@@ -74,3 +51,12 @@ if [ ${YASHCHIKI_BUILD_SPACK_GCC} -eq 1 ]; then ...@@ -74,3 +51,12 @@ if [ ${YASHCHIKI_BUILD_SPACK_GCC} -eq 1 ]; then
# add fresh compiler to spack # add fresh compiler to spack
${MY_SPACK_CMD} compiler add --scope site ${MY_SPACK_FOLDER}/opt/spack/linux-*/*/gcc-${YASHCHIKI_SPACK_GCC_VERSION}-* ${MY_SPACK_CMD} compiler add --scope site ${MY_SPACK_FOLDER}/opt/spack/linux-*/*/gcc-${YASHCHIKI_SPACK_GCC_VERSION}-*
fi fi
echo "INSTALL YASHCHIKI DEPENDENCIES"
install_from_buildcache "${yashchiki_dependencies[@]}"
# We install all packages needed by yashchiki here
for dep_spec in "${yashchiki_dependencies[@]}"; do
${MY_SPACK_CMD} "${SPACK_ARGS_INSTALL[@]+"${SPACK_ARGS_INSTALL[@]}"}" install --no-cache --show-log-on-error "${dep_spec}"
done
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