Skip to content
Snippets Groups Projects
Commit bc8cc61b authored by Athanasios Karmas's avatar Athanasios Karmas
Browse files

update to take the appropriate spack env environmental variables without...

update to take the appropriate spack env environmental variables without having to list explicitly all the tools
parent 8ea60f6b
No related branches found
No related tags found
No related merge requests found
Pipeline #11036 failed with stage
in 9 minutes and 59 seconds
......@@ -8,12 +8,24 @@ INSTALLATION_ROOT=$1
SPACKIFIED_ENV=$2
LAB_KERNEL_PATH=$3
# load spack and spack repos
# capture the empty env
cd /opt/app-root/src
env >> before.txt
# load spack, spack repos and spack env
cp -r /srv/$INSTALLATION_ROOT/spack/.spack ~
source /srv/$INSTALLATION_ROOT/spack/share/spack/setup-env.sh
spack repo add /srv/$INSTALLATION_ROOT/ebrains-spack-builds
spack env activate $SPACKIFIED_ENV
module use /srv/$INSTALLATION_ROOT/spack/share/spack/modules/linux-centos7-broadwell/
source /srv/$INSTALLATION_ROOT/spack/var/spack/environments/$SPACKIFIED_ENV/loads
# prepare the env file
# capture the env after spack activation
cd /opt/app-root/src
env >> after.txt
# prepare the env file required for the JupyterLab kernel
mkdir $LAB_KERNEL_PATH/bin
cat <<EOF > $LAB_KERNEL_PATH/bin/env.sh
#!/usr/bin/env bash
......@@ -21,8 +33,11 @@ set -euxo pipefail
EOF
# load here all tools
spack load --sh -r python@3.8.11 py-ipykernel py-pip py-numpy@1.21.0 py-scipy py-pandas py-seaborn py-matplotlib arbor nest@3.0 neuron py-pynn tvb-data tvb-library meta-brainscales %gcc@10.3.0 >> $LAB_KERNEL_PATH/bin/env.sh
#spack env activate $SPACKIFIED_ENV --sh >> $LAB_KERNEL_PATH/bin/env.sh
#spack load --sh -r python@3.8.11 py-ipykernel py-pip py-numpy@1.21.0 py-scipy py-pandas py-seaborn py-matplotlib arbor nest@3.0 neuron py-pynn tvb-data tvb-library meta-brainscales %gcc@10.3.0 >> $LAB_KERNEL_PATH/bin/env.sh
# append the necessary env variables for spack env and tools
cd /opt/app-root/src
diff before.txt after.txt|grep ">"|cut -c 3- >> $LAB_KERNEL_PATH/bin/env.sh
# end of env creation
cat <<EOF >>$LAB_KERNEL_PATH/bin/env.sh
......
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