Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More flexibility in which Python to use #82

Open
fnattino opened this issue Jul 31, 2024 · 0 comments
Open

More flexibility in which Python to use #82

fnattino opened this issue Jul 31, 2024 · 0 comments

Comments

@fnattino
Copy link
Contributor

Currently we have two SLURM job script for spider, to support conda and tykky. We could maybe combine these two in a single more flexible script, something like:

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --time=24:00:00
#SBATCH --cpus-per-task=4
#SBATCH --partition=normal

source ~/.bashrc

NODE=`hostname -s`
PORT=`shuf -i 8400-9400 -n 1`
LPORT=${LPORT:-8889}
PYTHON=${PYTHON:-python}

echo "Run the following on your local machine: "
echo "ssh -i /path/to/private/ssh/key -N -L ${LPORT}:${NODE}:${PORT} ${USER}@spider.surf.nl"

${PYTHON} -m jupyter lab --no-browser --port=${PORT} --ip=${NODE}

With such a script, one could set to use Python from conda:

export PYTHON=`conda activate jupyter_dask && which python`
sbatch jupyter_dask_spider.bsh

or from tykky:

export PYTHON="${HOME}/hpc-container-wrapper/jupyter_dask/bin/python"
sbatch jupyter_dask_spider.bsh

or even from another container image to be retrieved e.g. from Docker Hub:

export PYTHON="apptainer exec docker://pangeo/pangeo-notebook:latest python"
sbatch jupyter_dask_spider.bsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant