Skip to main content
U.S. flag

An official website of the United States government

Dot gov

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Https

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Jupyter Notebook on Ceres

0. (If using VPN) Connect to SCINet VPN (see instructions for configuring SCINet VPN)

1. Log into Ceres via SSH (see Ceres Quick Start Guide for instructions).

2. Submit the Jupyter notebook SLURM job script with the following command

sbatch /reference/containers/jupyter_notebook/6.0.1/jupyter_notebook.job

3. After the job has started, view the $HOME/jnotebook-JOBID.out file for login information (where JOBID is the SLURM job ID reported by the sbatch command)

VPN Users:

1. Connect to SCINet VPN and point your web browser to http://sn-cn-1-0.scinet.ars.usda.gov:58432

2. log in to Jupyter Notebook using the following credentials:

TOKEN: n+6s/gvXdOO2MLoAVkG5


SSH users:

1. SSH tunnel from your workstation using the following command (macOS or Linux only; for how to enter this in PuTTY on Windows see the Ceres Jupyter User Guide)

ssh -N -L 8787:sn-cn-1-0:58432 jane.doe@login.scinet.science

and point your web browser to http://localhost:8787

2. log in to Jupyter Notebook using the following credentials:

TOKEN: n+6s/gvXdOO2MLoAVkG5


When done using Jupyter Notebook, terminate the job by:

1. Exit the Session

2. On the Ceres command line, issue the command

scancel -f 890924

4. (If using VPN) Point your web browser to the listed hostname / port (in this example, http://sn-cn-1-0.scinet.ars.usda.gov:58432), then enter your SCINet user name and the temporary password (valid only for this job only; in this example n+6s/gvXdOO2MLoAVkG5)

5. (If using SSH Port Forwarding instead of VPN) See "SSH Port Forwarding" directions below for directions.

### Using Jupyter Notebook

1. Once logged in, users are presented their home directory.

2. To launch a new notebook – Click the “New” button on top left.

3. Select the language (Python3 in this document) or open an existing document using the file browser(If opening a new notebook click on “Untitled” next to the Jupyter logo to rename the notebook)

4. In a new notebook, users are presented with an empty cell. This can be used for writing and executing code or even shell commands

Type the command and then press CTRL + ENTER

To execute shell commands start with “!” followed by any shell commands

5. For moreinformation andofficial documentation see https://jupyter-notebook.readthedocs.io/en/stable/notebook.html

### Stopping Jupyter Session

1. To stop the notebook, do File → Close and Halt. This closes the tab but doesn’t stop the session

2. Select the tab with the main Jupyter page and press “Quit” this will stop the server and also the slurm batch job.

### SSH Port Forwarding (instead of VPN) Windows + PuTTY users

1. Open a new PuTTY window

2. In Session > Host Name, enter: login.scinet.science

3. In the category: Connection > SSH > Tunnels, enter 8787 in Source Port, the Destination hostname:port listed in the job script output (in this example: sn-cn-1-0:58432), click “Add”, then click “Open”

4. Point your browser to http://localhost:8787. Enter your SCINet user name, and one-time password listed in the job script output file.

5. macOS / Linux users

1. Enter the use a new macOS/Linux terminal window and enter the SSH command listed in thejob script output file. In this example:

ssh -N -L 8787:sn-cn-1-0:58432 jane.user@login.scinet.science

There will be no output after logging in. Keep the window / SSH tunnel open for the duration of the session.

2. Point your browser to http://localhost:8787. Enter your SCINet user name, and one-time token listed in the job script output file.