-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab917f4
commit 727bf7a
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,64 @@ | ||
# Example notebook | ||
|
||
- Using small file: [visualize_demo_output.ipynb](./visualize_demo_output.ipynb) | ||
- Using big file on Odyssey: [visualize_large_output.ipynb](./visualize_large_output.ipynb) | ||
|
||
# Environment | ||
|
||
Install Miniconda, and then: | ||
|
||
conda env create -n ac290 -f ./environment.yaml | ||
conda activate ac290 | ||
which ipython jupyter | ||
|
||
# Note on using Jupyter on Odyssey | ||
|
||
## Jupyter on login node | ||
|
||
ssh [email protected] -L 8889:localhost:8889 | ||
conda activate ac290 | ||
jupyter notebook --NotebookApp.token='' --no-browser --port=8889 | ||
|
||
Visit `localhost:8889` in browser. | ||
|
||
## Jupyter on compute node (with sbatch) | ||
|
||
Make a script like: | ||
|
||
#!/bin/bash | ||
#SBATCH -p test | ||
#SBATCH -N 1 | ||
#SBATCH -n 6 | ||
#SBATCH -t 1:00:00 | ||
#SBATCH --mem-per-cpu 3000 | ||
#SBATCH --job-name notebook | ||
#SBATCH --output jupyter-address-%J.log | ||
|
||
## get tunneling info | ||
jupyter_port=8889 # other number also works | ||
jupyter_ip=$(hostname -i) | ||
|
||
## print tunneling instructions to jupyter-log-{jobid}.txt | ||
echo -e " | ||
Copy/Paste this in your local terminal to ssh tunnel with remote | ||
----------------------------------------------------------------- | ||
ssh [email protected] -N -L ${jupyter_port}:${jupyter_ip}:${jupyter_port} | ||
----------------------------------------------------------------- | ||
|
||
Then open a browser on your local machine to the following address | ||
------------------------------------------------------------------ | ||
localhost:${jupyter_port} (prefix w/ https:// if using password) | ||
------------------------------------------------------------------ | ||
" | ||
|
||
## launch jupyter | ||
conda activate ac290 | ||
jupyter-notebook --NotebookApp.token='' --no-browser --port=${jupyter_port} --ip=$(jupyter_ip} | ||
|
||
Follow instruction in the generated log file. | ||
|
||
## Jupyter on compute node (with srun; doesn't work) | ||
|
||
Ref: https://informatics.fas.harvard.edu/port-forwarding-on-odyssey-nodes.html | ||
|
||
In principle it should work, but I keep getting `srun: Force Terminated job` after launching notebook. |