Giter Site home page Giter Site logo

leonardo-jupyter's Introduction

Launch Jupyter lab from HPC compute nodes

This guide provides a straightforward approach to launching a Jupyter Lab server from a compute node of an HPC cluster (I am using the Leonardo for this tutorial). This tutorial is tested on

  • Leonardo Cineca supercomputer
  • SISSA Ulysses
  • Moroccan Marwan cluster

the same steps are valid and should work for all the other clusters.

HPC cluster side (Leonardo supercomputer as an example)

  1. Prior to proceeding, confirm that Jupyter Notebook is installed in your home directory on the login node. Once verified, follow these steps:
  • Generate a configuration file for jupyter:s
(ZHPC) [zdahbi00@login01 jupyter-server]$ jupyter lab --generate-config
  • Generate a hashed password that you will use to login to jupyter:
Enter password: 
Verify password: 
[JupyterPasswordApp] Wrote hashed password to /leonardo/home/userexternal/zdahbi00/.jupyter/jupyter_server_config.json
  1. Modify the configuration file jupyter_lab_config.py:
(ZHPC) [zdahbi00@login01 jupyter-server]$ vim ~/.jupyter/jupyter_lab_config.py
(ZHPC) [zdahbi00@login01 jupyter-server]$ head ~/.jupyter/jupyter_lab_config.py
# Configuration file for lab.

c = get_config()  #noqa
c.NotebookApp.open_browser = False
c.NotebookApp.port = 6666  

where 6666 is the port (you can change it: choose any 4 numbers!).

  1. Choose the resources you want to allocate by modifying the job script jupy_leonardo.job and execute the job.
(ZHPC) [zdahbi00@login01 jupyter-server]$ sbatch jupyter.job 
  1. Run squeue -u your_username and get the hostname of the allocated node. For leonardo supercomputer, the hostnames of the compute nodes are something like lrdnxxxx.

Local machine side (Your local terminal)

  1. Modify line 3 of the script run_jupy.sh by changing username with the username you use to login to the cluster as well as the domain name used to access the cluster.
#!/bin/sh

ssh -L 6666:$1:6666 -t [email protected] 'jupyter lab'
  1. From the local terminal, run the script by passing the hostname of the node from the command line
(base) โžœ  ~ ./run_jupy.sh lrdnxxxx
  1. If you have followed the steps correctly. You will be able to access jupyter notebook in the compute node from the browser through:

http://127.0.0.1:6666

You will see a case where you should put the password you set before and press Enter to access Jupyter Lab kernel of the compute nodes:

jupy.png

Done!!

leonardo-jupyter's People

Contributors

dahbiz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.