[PYTHON] How to use jupyter notebook with ABCI

Preparation

Use 3 terminals.

  1. A shell for connecting to ABCI.
  2. For port forwarding
  3. For SSH tunnel

The shell machine assignments used in the following "procedures" are as follows.

--[username @ es1 ~] $: ABCI's interactive shell (where you log in and enter first) --[username @ g0001 ~] $: ABCI compute node (where you can enter with qrsh) --[username @ local ~] $: Local shell

procedure

  1. Run compute node with qrsh

    [username@es1 ~]$ GROUP=YOUR_GROUP_NAME
    [username@es1 ~]$ qrsh -g $GROUP -l rt_F=1 -l h_rt=01:00:00
    

2. Get the host name

Make a note of the acquired value as you will need it later.

 ```bash
 [username@g0001 ~]$ hostname
 g0001.abci.local
 ```

3. Run jupyter-notebook

 ```bash
 [username@g0001 ~]$ jupyter notebook --ip=`hostname` --port=8888 --no-browser
 ```

4. Port forwarding on your local PC

 ```bash
 [username@local ~]$ username=your_user_name_in_abci
 [username@local ~]$ identity_file=~/.ssh/your_identity_file
 [username@local ~]$ ssh -i $identity_file -L 10022:es:22 -l $username as.abci.ai
 Welcome to ABCI access server.
 Please press any key if you disconnect this session.
 ```

5. Create an SSH tunnel in another terminal

Note that the host name obtained in 2 is used.

 ```bash
 [username@local ~]$ qrsh_host_name=g0001
 [username@local ~]$ username=your_user_name_in_abci
 [username@local ~]$ identity_file=~/.ssh/your_identity_file
 [username@local ~]$ ssh -N -L 8888:$qrsh_host_name:8888 -l $username -i $identity_file -p 10022 localhost

 ```

Access `http://127.0.0.1:8888/?token=~` displayed in 6.3

Since the local URL is displayed in the shell of the calculation node running jupyter-notebook, when you access it, Jupyter-notebook opens in the browser.

## reference

-[ABCI User Guide: Launching Jupyter Notebook](https://docs.abci.ai/ja/tips/jupyter-notebook/#start-jupyter-notebook)


Recommended Posts

How to use jupyter notebook with ABCI
How to use Jupyter Notebook
Jupyter Notebook Basics of how to use
How to use Jupyter notebook [Super Basic]
Use pip with Jupyter Notebook
How to use IPython Notebook
How to use jupyter notebook without polluting your environment with Docker
Use Cython with Jupyter Notebook
Python: How to use async with
How to use virtualenv with PowerShell
Use markdown with jupyter notebook (with shortcut)
How to use FTP with Python
Easy to use Jupyter notebook (Python3.5)
I want to use a virtual environment with jupyter notebook!
Use nb extensions with Anaconda's Jupyter notebook
I want to blog with Jupyter Notebook
How to use ManyToManyField with Django's Admin
Use Jupyter Lab and Jupyter Notebook with EC2
How to use Cmder with PyCharm (Windows)
How to use Ass / Alembic with HtoA
How to execute commands in jupyter notebook
How to use Japanese with NLTK plot
How to use CUT command (with sample)
How to use SQLAlchemy / Connect with aiomysql
How to use JDBC driver with Redash
How to batch start a python program created with Jupyter notebook
How to use Python-shell
How to use tf.data
How to use virtualenv
How to use Seaboan
How to use shogun
How to use Pandas 2
How to use Virtualenv
How to use numpy.vectorize
How to use pytest_report_header
How to use partial
How to use Bio.Phylo
How to use SymPy
How to use x-means
How to use IPython
How to use virtualenv
How to use Matplotlib
How to use iptables
How to use numpy
How to use TokyoTechFes2015
How to use venv
How to use dictionary {}
How to use Pyenv
How to use list []
How to use python-kabusapi
How to use OptParse
How to use return
How to use dotenv
How to use pyenv-virtualenv
How to use Go.mod
How to use imutils
Use nim with Jupyter
How to use import
How to use GCP trace with open Telemetry
How to use tkinter with python in pyenv
Jupyter Notebook Settings-How to use (EC2 Amazon Linux 2)