...
  View open merge request
Commits (4)
......@@ -237,6 +237,28 @@ Now, you can paste the URL (usually of the form
provided by JupyterLab into the tunneled browser.
## Start JupyterLab on a compute node of an HPC centre
In [job-scripts/](job-scripts/), there's example scripts showing how to start a job that runs JupyterLab on a compute node.
### On Nesh
With [`nesh-linux-cluser-jupyterlab.sh`](job-scripts/nesh-linux-cluser-jupyterlab.sh), you can submit a job as follows:
```shell
qsub -l elapstim_req=<hh:mm:ss> -b <node-no> -l cpunum_job=<cpu-no> -l memsz_job=<mem-size> -q clmedium
```
Checking the status of the job and retrieving the URL on which to connect to JupyterLab is done with:
```shell
bash nesh-linux-cluster-jupyterlab.sh <jobid>
```
### At HLRN Berlin
TBD.
## Appendix: Trouble Shooting
- If you get `ImportError: [...]: version GLIBC_[...] not found` errors on
......
#!/bin/bash
#PBS -N jupyterlab
#PBS -j oe
#PBS -o LOG/
#PBS -M
#PBS -A
if [ -n "${1}" ]; then
status=$(checkjob ${1} | echo $(string=$(grep 'State'); echo ${string##*:}))
if [ "$status" == 'Idle' ]; then
echo $(showstart ${1} | echo "$(grep 'Estimated Rsv based start in') (worst case estimate)")
else
checkjob ${1} | grep "WallTime"
ofile=$(checkjob -v ${1} | grep "OutputFile"); ofile=${ofile%%)};ofile=${ofile##*:}
cat ${ofile##*:} | grep -m1 -e 'token' || echo 'Jupyter Lab not yet running...'
fi
else
echo "host $(hostname)" && \
cd ${HOME}/notebooks
source $HOME/miniconda3/bin/activate base && \
jupyter lab --ip=$(hostname) --no-browser
fi
#!/bin/bash
#PBS -N jupyterlab -o jupyterlab.out -j o
## submit with
# qsub nesh-linux-cluster-jupyterlab.sh -l elapstim_req=<hh:mm:ss> -b <node-no> -l cpunum_job=<cpu-no> -l memsz_job=<mem-size> -q clmedium
## get job info and token (if running)
# ./nesh-linux-cluster-jupyterlab.sh <jobid>
if [ -n "${1}" ]; then
status=$(qstat ${1} -f | echo $(string=$(grep 'Current State'); echo ${string##* }))
if [ "$status" == 'Queued' ]; then
echo $(qstat ${1} -f | echo "$(grep 'Planned Start Time') (worst case estimate)")
else
qstat ${1} -f | echo "scale=2; $(string=$(grep 'Remaining Elapse'); echo ${string//[!0-9]})/60" | \
echo "$(bc) minutes remaining elapse time at" $(qcat -o -b -n25 ${1} | grep -m1 -e 'host') &&
qcat -o -b -n25 ${1} | grep -m1 -e 'token' || echo 'Jupyter Lab not yet running...'
fi
else
cd $PBS_O_WORKDIR
echo "host $(hostname)" && \
source $HOME/miniconda3/bin/activate base && \
jupyter lab --ip=$(hostname) --no-browser
#jupyter lab --ip=$(ifconfig ib0 | awk '/inet / {print$2};') --no-browser
fi