This very much depends on how your HPC is set up and what format the script is in.
Mostly likely you will need a python installation that has the jupyter package installed in it.
If the script is an
ipynb file, once you have jupyter installed, running the script is easy. The command to run the script is is, strangely,
jupyter nbconvert --to notebook --execute mynotebook.ipynb
You would wrap that in what ever submission script you would normally use with your HPC system. For example:
[USER@login1]$ cat submission.sh #!/bin/bash #SBATCH --nodes=1 srun jupyter nbconvert --to notebook --execute mynotebook.ipynb [USER@login1]$ sbatch submission.sh
(disclaimer: I am not a regular SLURM user)
So the hard bit is getting jupyter installed on your HPC system. Almost all HPCs have systems for installing python packages without the need for root permissions, but the route varies from system to system (this is independent of the scheduller - SLURM in this case).
Our system uses conda to manage package installation. You would first need to create an environment with jupyter installed so you would want to do something like:
module load conda conda create -n jupyter-env python=3 jupyter
You would also need to install any packages that the notebook required as well. Then you would need to load the env in batch submission script, so your script might look like:
[USER@login1]$ cat submission.sh #!/bin/bash #SBATCH --nodes=1 module load conda source activate jupyter-env srun jupyter nbconvert --to notebook --execute mynotebook.ipynb
Other systems might rely on pip and/or virtualenv. In pip you might try
[USER@login1]$ pip install jupyter --user