Using Jupyter notebooks on the frontends
Remote data analysis, compilations, and short test runs are possible by using Jupyter notebooks. The configuration for a Jupyter notebook server has to be done after loading the python module. As of August 3, 2021 the system version of python is 3.8.11. To access the python module provided by Anaconda3-2021.05 type in the terminal:
>> module load python/anaconda3
This loads many packages, including ipython, Jupyter and YT. If additional packages are needed in the Anaconda environment, contact Andrius.
To call jupyter-lab without background type in the terminal:
>> jupiter-lab --no-browser
It is possible to call jupyter-lab using background, type in the terminal:
>> nohup jupyter-lab --no-browser >& jlog &
it should appear an ID number of your job and creates jlog file containing all the "saved" Jupyter steps that are running.
To check the URL to use and open the Jupyter kernel in the browser type in the terminal:
>> cat jlog
After some command lines down, it should appear a text saying:
"Or copy and paste one of these URLs:
http://localhost:####/lab?token=...
or http://###.0.0.1:####/lab?token=...
"
where "####" is the localhost port ID. Copy & Paste any of those two links in your browser and you should be able to navigate into your home directory through the Jupyter server in your browser. By default, the server only accepts connections from the "localhost", so an ssh tunnel is needed. In a new terminal (on your computer) do:
>> ssh username@astro01.hpc.ku.dk -L ####:localhost:#### -N
Replace "username" by your username in the cluster. Then, go to a web browser and put http://localhost:####
What if ssh got lost in the pipeline?
This can happen when your computer is using many localhosts. In order to check how many localhost your computer is using, type in terminal:
>> ps -Af|grep ssh|grep localhost
You can remove the localhost not being used by typing in the terminal:
>> ps -Af|grep ssh|grep localhost|cut -c #-#
where '#-#' represents the command lines of the other localhosts in the list to be deleted. To double check before you kill them all, type in terminal:
>> ps -Af|grep ssh|grep localhost|cut -c #-#|xargs -n 1 echo
To kill those localhosts type in the terminal:
>> ps -Af|grep ssh|grep localhost|cut -c #-#|xargs -n 1 kill
To check how many localhosts are left (if any, double check):
>> ps -Af|grep ssh|grep localhost