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

Added create_JupyterLab_kernel.sh script that creates a spackified JupyterLab...

Added create_JupyterLab_kernel.sh script that creates a spackified JupyterLab kernel conf and places it to NFS where it can be loaded by all users based on the instructions contributed by Eric Mueller
parent 8bd99f75
No related branches found
No related tags found
No related merge requests found
Pipeline #8331 canceled with stage
in 6 seconds
#!/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
CONF_PATH="/srv/$ENV/ebrains-spack-builds"
# load spack and spack repos
cp -r /srv/$ENV/spack/.spack ~
source /srv/$ENV/spack/share/spack/setup-env.sh
spack repo add $CONF_PATH
# prepare the env file
mkdir $CONF_PATH/bin
cat <<EOF $CONF_PATH/bin/env.sh
#!/usr/bin/env bash
set -euxo pipefail
EOF
# load here all tools
spack load --sh -r nest@3.0 \
py-ipykernel \
%gcc@10.3.0 >>$CONF_PATH/bin/env.sh
# 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
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