Newer
Older
Athanasios Karmas
committed
#!/bin/bash
#title :create_JupyterLab_kernel.sh
#description :Script to create a spackified JupyterLab kernel conf and place it to NFS where it can be loaded by all users.
#usage :./create_JupyterLab_kernel.sh $BUILD-ENV
#==============================================================================
ENV=$1
Athanasios Karmas
committed
CONF_PATH="/srv/jupyterlab_kernels/int/release20210930"
Athanasios Karmas
committed
# load spack and spack repos
cp -r /srv/$ENV/spack/.spack ~
source /srv/$ENV/spack/share/spack/setup-env.sh
Athanasios Karmas
committed
spack repo add /srv/$ENV/ebrains-spack-builds
Athanasios Karmas
committed
# prepare the env file
mkdir $CONF_PATH/bin
Athanasios Karmas
committed
#!/usr/bin/env bash
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 %gcc@10.3.0 >> $CONF_PATH/bin/env.sh
Athanasios Karmas
committed
# end of env creation
cat <<EOF >>$CONF_PATH/bin/env.sh
python -m ipykernel_launcher -f \$@
EOF
chmod +x $CONF_PATH/bin/env.sh
# create the new kernel's configuration file
mkdir $CONF_PATH/spack_python_kernel_release_20210930
cat <<EOF >$CONF_PATH/spack_python_kernel_release_20210930/kernel.json
{
"argv": ["$CONF_PATH/bin/env.sh", "{connection_file}"],
"display_name": "EBRAINS_release_20210930",
"name": "spack_python_kernel_release_20210930",
"language": "python"
}
EOF