forked from kaspermunch/PopulationGenomicsCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-jupyter
executable file
·41 lines (33 loc) · 1.71 KB
/
start-jupyter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
eval "$(conda shell.bash hook)"
echo "-----> Population Genomics Course"
if [ ! -d "/usr/Material/Data" ]
then
echo "downloading data"
mkdir -p /usr/Material/Data
wget https://zenodo.org/record/7551294/files/Data.tar.gz?download=1 -O /usr/Material/Data.tar.gz
tar -zxvf /usr/Material/Data.tar.gz -C /usr/Material/Data
rm -f /usr/Material/Data.tar.gz
fi
if [ ! -d "${CONDA_DIR}/envs/popgen_au_env" ]
then
mkdir -p ${CONDA_DIR}/envs/popgen_au_env
wget -t 10 -O ${CONDA_DIR}/envs/popgen.tar.gz https://zenodo.org/record/7551294/files/popgen_au_env.tar.gz?download=1;
tar -zxvf ${CONDA_DIR}/envs/popgen.tar.gz -C ${CONDA_DIR}/envs/popgen_au_env
rm -f ${CONDA_DIR}/envs/popgen.tar.gz
fi
#conda activate ${CONDA_DIR}/envs/popgen_au_env
echo "-----> Installing course kernels on jupyterlab"
${CONDA_DIR}/envs/popgen_au_env/bin/python -m ipykernel install --user --name="args_dashboard" --display-name "args dashboard" && \
${CONDA_DIR}/envs/popgen_au_env/bin/R -e "IRkernel::installspec(user=TRUE, name = 'popgen_course', displayname = 'popgen course')" && \
${CONDA_DIR}/envs/popgen_au_env/bin/python -m bash_kernel.install && \
fix-permissions "/home/${NB_USER}" && \
ln -s /usr/Material /home/${NB_USER}/work/Course_Material
cp /usr/uCloud/Configurations/kernelBash.json ~/.local/share/jupyter/kernels/bash/kernel.json && \
ln -sf ${CONDA_DIR}/envs/popgen_au_env/lib/libcrypto.so.3 ${CONDA_DIR}/envs/popgen_au_env/lib/libcrypto.so.1.0.0
#jupyter labextension install /usr/Splashscreen/
printf "\n================== "
printf "\n Start JupyterLab \n"
printf "================== \n\n"
#add course name as variable to be used
bash -c "COURSE=${COURSE} jupyter lab --NotebookApp.token='' "