UCSF CoreHPC
Use the connection scripts below to run Neurodesktop on UCSF CoreHPC and access it in your local browser. Like the Stanford Sherlock setup, this uses a Slurm job for the desktop and an SSH tunnel to connect to it.
The scripts guide you through SSH configuration, resource requests, and container setup. Run them on your own computer.
Before you connect
Section titled “Before you connect”Have the following ready:
- Your UCSF CoreHPC username and login or session hostname from your welcome email.
- Access to the UCSF network, or the UCSF VPN when off campus.
- A lab storage directory mounted on CoreHPC where you can write the Neurodesk image and shared containers.
- On macOS, Terminal with Bash and SSH. On Windows, Git Bash with SSH.
The scripts check that Slurm and Apptainer are available on the login node before submitting a job.
Download and run the script
Section titled “Download and run the script”- Download connectUCSFcoreHPC_mac.sh to your Downloads folder.
- Open Terminal.
- Replace
/mnt/fac/YOUR_LAB/YOUR_DIRECTORYbelow with your lab storage directory, then run:
cd ~/Downloadsexport COREHPC_LAB_ROOT="/mnt/fac/YOUR_LAB/YOUR_DIRECTORY"bash connectUCSFcoreHPC_mac.shThis version also supports Linux and WSL. It reuses one SSH connection throughout the session.
Windows
Section titled “Windows”- Download connectUCSFcoreHPC_win.sh to your Downloads folder.
- Open Git Bash.
- Replace
/mnt/fac/YOUR_LAB/YOUR_DIRECTORYbelow with your lab storage directory, then run:
cd ~/Downloadsexport COREHPC_LAB_ROOT="/mnt/fac/YOUR_LAB/YOUR_DIRECTORY"bash connectUCSFcoreHPC_win.shRun these commands in Git Bash. Typing bash in PowerShell or Command Prompt may open WSL, which has its own SSH configuration. For WSL, use the macOS script.
The Windows script opens separate SSH connections for its commands. If needed, it offers to set up SSH key login on the bastion and login node to avoid repeated password prompts. Follow the prompts to reuse an existing key or create a new one. You may need to enter your CoreHPC password several times during this first setup.
Follow the connection prompts
Section titled “Follow the connection prompts”- If the SSH entries are missing, accept the prompt to add them to
~/.ssh/config. Enter your CoreHPC username and the login or session hostname from your welcome email. The script creates thecorehpc-bastionandcorehpcaliases and connects through the bastion. The bastion itself does not run Slurm jobs. - Complete authentication. On Windows, follow the SSH-key setup prompts if they appear.
- Choose the resources for a new desktop session. Press Enter to accept a default:
- Partition:
cpu. Choosegpuif you need a GPU. - Memory:
8G. Bare numbers are interpreted as gigabytes. - CPUs:
1. - Walltime:
02:00:00. The scripts accept up to4-00:00:00, or 96 hours. - GPUs:
1when you select thegpupartition. - Slurm account: the cluster default, unless your lab provides an account name.
- Partition:
- Wait for image preparation and the job to start. If the shared Neurodesktop image is missing, the script downloads it on the login node. If a different version is present, it asks before upgrading it.
- Open the local URL printed after
Notebook will be available atin your browser. It includes the port and authentication token for your session. Allow about 30 seconds for JupyterLab to start. - Open Neurodesktop from the JupyterLab launcher. Keep the terminal running while you use the desktop.
The scripts print the job ID, compute node, remaining walltime, and container log command. Use the URL from the current run, since the tunnel port can change when you reconnect.
Disconnect, reconnect, or stop
Section titled “Disconnect, reconnect, or stop”Press Ctrl+C in the terminal to close the tunnel. At Cancel the session now?, choose:
- No, the default, to keep the job running for a later connection.
- Yes to cancel the job and release its resources.
To reconnect, run the same commands for your operating system, including the lab storage setting. The script detects an existing running or queued neurodesktop job and offers to attach to it. Only one Neurodesktop session per user is supported by these scripts.
A network interruption leaves the batch job running. Reconnecting does not extend its walltime. Save your work before the allocation expires or you cancel the job.
Storage and software
Section titled “Storage and software”The desktop home directory is stored at ~/neurodesk/home on CoreHPC and persists between sessions. The scripts use the lab directory for these shared assets:
- Neurodesktop image:
$COREHPC_LAB_ROOT/neurodesk/neurodesktop_latest.sif. - Tool containers:
$COREHPC_LAB_ROOT/neurodesk/local/containers, also available inside the desktop at/neurodesktop-storage/containers.
The supplied scripts treat compute nodes as having no internet access. Download images and additional tool containers from the login node into lab storage before using them in the desktop.
If you use FreeSurfer, place your license at $COREHPC_LAB_ROOT/neurodesk/freesurfer_license.txt. The scripts configure this path for the container.
Troubleshoot a connection
Section titled “Troubleshoot a connection”- SSH authentication fails: check your UCSF network or VPN connection, credentials, and login hostname. Test
ssh corehpcfrom the same terminal you use for the script. - Repeated Windows password prompts: rerun the Windows script and complete SSH-key setup for both the bastion and login node.
- Lab storage is not visible: check
COREHPC_LAB_ROOTand confirm that the directory is mounted for your account. - The job stays queued: read the queue reason printed by the script. If the script stops waiting, the job stays queued. Run the script again to attach.
- The browser cannot connect: allow time for startup and use the URL printed by the current run. If the tunnel reports a port conflict, close an old tunnel and rerun the script.
- The desktop stops: inspect the job log using the command printed by the script. After a tunnel failure, the scripts also report Slurm state and recent log output when the connection is available.