Foldspace
Foldspace allows to schedule and run web services on compute nodes of CINECA HPC clusters, and to access them via your local browser. Currently the web services provided are Jupyter, MLflow, Code server and VNC.
How to install Foldspace
Foldspace can be installed via pip, provided that the following requirements are satisfied:
OS: GNU/Linux, MacOS or Windows (WSL suggested);
to have completed all the steps for the ssh access to CINECA clusters;
to have an active Project Account on the cluster you want to access with Foldspace;
Python: version 3.8 or greater
We suggest to create a Python virtual environment for Foldspace installation; in the examples below, for the sake of clarity, we will create a foldspace_venv virtual environment in your $HOME folder as an example:
python3 -m venv $HOME/foldspace_venv # or you can choose any path you like
source $HOME/foldspace_venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install foldspace
This enable the foldspace command in your shell.
Note
To use the foldspace command in future sessions, simply activate the Python environment. For instance, following the Bash example above, run:
source $HOME/foldspace_venv/bin/activate
Foldspace can be used as described in the next sections.
How to use Foldspace
Foldspace allows to schedule and run web services on compute nodes of a CINECA HPC clusters, and to access them from your local browser. Behind the scenes, this is achieved submitting a job in which a web server will run, and forwarding the server port on the compute node to your local host, via ssh. Thus you will need to specify to Foldspace:
which cluster you want to use
which web service you want to start (i.e. which job you want to submit among the availiable ones)
any (optional) additional option for the job (i.e. walltime, number of tasks, number of nodes, partition, gpus…)
The general syntax to access the web services (tools) provided by Foldspace is the following:
foldspace --user <your username> --cluster <cluster name> --tool <name of the tool to start> [any slurm directive you like]
and the values allowed for the options are the following:
Option |
Value |
References |
|---|---|---|
|
your username on CINECA clusters |
|
|
leonardo |
|
g100 |
||
pitagora |
||
|
jupyter-latest |
|
codeserver |
||
mlflow |
||
vnc |
||
[optional slurm directives] |
You can tune the resources of your server job passing to foldspace any slurm directive |
To better clarify, here is a list of examples of possible commands you might want to run:
Start Code Server on Galileo100 for 2 hours:
foldspace --user <your username> --cluster g100 --tool codeserver --time 02:00:00
Start Jupyter on Leonardo Booster partition using 4 tasks and a GPU for 90 minutes:
foldspace --user <your username> --cluster leonardo --tool jupyter-latest --partition boost_usr_prod --ntasks 4 --gres gpu:1 --time 01:30:00 # or simply -p boost_usr_prod --n 4 --gres gpu:1 -t 01:30:00
Start a VNC interface on Pitagora DCGP partition using a single task (default) and a specific Project Account:
foldspace --user <your username> --cluster pitagora --tool vnc --partition dcgp_fua_prod --account <your account on Pitagora>
Note
If no options are specified, the default configuration is a job with a 30-minute walltime and a single CPU on the serial partition; therefore, you may want to specify at least the --time option.
When you launch the foldspace command, an SSH certificate will be implicitly requested as in How to configure smallstep client, so a browser page will be opened to insert your HPC credentials and your OTP. Then Foldspace will submit the job, and as soon as the job will be running it will show a link to be opened in your browser, as well as temporary credentials to access your server if needed. Here below, you can find an example of a typical Foldspace execution:
Tip
Although the tunneled services utilize the HTTP protocol, all traffic is fully encrypted through the SSH tunnel.
- When you want to quit, follow the instructions in the terminal and then press Enter. You will be asked to choose among
cancel the job
disconnect to the server but keep the job running, so that you can connect to it once again from a different shell before the job walltime is reached.
To re-connect to a running job, just run
foldspace --user <your username> --cluster <cluster where the tool is running>
Warning
Please note that while you are disconnected the job is still running, so you are still using the budget of your Project Account for computational resources.
Tip
All the logs of the tools are stored in $HOME/.foldspace/sessions. If you need, you can safely delete the $HOME/.foldspace directory when no Foldpsace tools are running. Please do not redirect your job output and errors via the --output and --error Slurm options, since it may compromise the foldspace expected behaviour.
Available tools

Jupyter

Code server

MLflow

VNC