Installation¶
PYP is the command line interface (CLI) of nextPYP.
Supported operating systems¶
PYP has been tested and works on the following operating systems:
Step 1: Prerequisites for installation on a cluster¶
- SLURM Cluster
PYPuses a SLURM compute cluster to do the data processing. The login node of the SLURM cluster must be reachable on the network from the machine wherePYPwill be installed.
- Shared filesystem
PYPrequires that the web server and the SLURM cluster share a single filesystem (e.g. an NFS storage system) and it be mounted at the same mount point on every machine. For example, if the shared filesystem is mounted on the SLURM cluster nodes as/nfs/data, then those files should also be available on the web server machine as/nfs/data.
- Paswordless SSH access to the SLURM login node
The service account needs to have login access from the web server to the SLURM node via SSH without a password. This will require installing the public SSH key for the service account into the login system for the SLURM node. For a stock linux installation of sshd, that usually means copying the public key into a file like /home/account/.ssh/authorized_keys. But for SLURM clusters with a networked login system or SSO, you’ll need to consult your organization’s IT staff for SSH key installation instructions.
Step 2: (if needed) Install operating system packages¶
The only packages needed are Apptainer (formerly Singularity) and wget.
You can verify if these are installed in your system using:
command -v wget
command -v apptainer
If they are not, you will need admin privileges to install them. Installation instructions vary by operating system:
Before installing the packages, you will need first to enable the EPEL repository, if it was not enabled already:
sudo dnf install -y epel-release
Then you can install the packages:
sudo dnf install -y apptainer wget
Install wget:
sudo apt-get install -y wget
Download debian package for Apptainer:
wget https://github.com/apptainer/apptainer/releases/download/v1.1.0-rc.2/apptainer_1.1.0-rc.2_amd64.deb
Install Apptainer:
sudo apt-get install -y ./apptainer_1.1.0-rc.2_amd64.deb
Step 3: Download and run the installation script¶
First, create the folder where PYP will be installed. This folder must be on the shared
filesystem (unless you are installing in Standalone mode). If you mounted the shared filesystem at e.g. /nfs/data/, then create a folder
called something like /nfs/data/apps/PYP.
Then, navigate to the app folder you just created.
cd "/nfs/data/apps/PYP"
Then, choose which version of PYP you want to install.
Then, download the installation script for that version. Assuming you chose “latest”, run:
wget -O install-cli https://nextpyp.app/files/pyp/latest/install-cli
chmod u+x install-cli
curl -fsS -o install-cli https://nextpyp.app/files/pyp/latest/install-cli
chmod u+x install-cli
The next step is to run the installer.
./install-cli
The installer puts the tools into the current directory. Run it from a directory of its own: inside a nextPYP web install it stops, because it would replace that install’s cli/ folder and version record.
install-cli is the same short script as the website’s ./install, under another name: it finds the nextpyp program of the release, checks it against the SHA-256 stamped into the script, and that program does the work. Every file is checked against the release’s signed manifest before it is used (see Security), the release is kept whole under releases/, and the commands (pyp, psp, csp and the others) are links through current, so a failed or interrupted run never leaves a half-replaced command behind.
Running ./install-cli of a newer release in the same directory switches to it in one step and keeps the previous release; ./install-cli --rollback goes back to it. PYP_INSTALL_DIR=/some/dir ./install-cli installs into another directory.
SSH key. Submitting jobs to SLURM on another host needs an SSH key without a passphrase that may log in to your account. The installer makes one only when it is asked to: PYP_SSH_KEY=true ./install-cli, or PYP_SLURM_HOST set, or a y to its question at a terminal. An existing ~/.ssh/id_ed25519 or ~/.ssh/id_rsa is used as it is. Otherwise it says that no key was made and leaves ~/.ssh alone.
After the installation finishes (it should not take more than a couple of minutes), PYP is almost ready to use.
All that’s left is to confirm (or modify) the configuration file.
The container file¶
When a nextPYP web install is on the same machine (/opt/nextpyp, or the directory named by PYP_WEB_INSTALL), its compute container is used by reference: pyp.sif is a link to it and nothing is downloaded. PYP_CONTAINER_SOURCE=/path/to/pyp.sif does the same for a container you already have.
Otherwise the container (tens of GiB) is downloaded with a progress line, and a download that was stopped continues where it was. It is checked against the release’s manifest and stored as containers/pyp-<version>-<hash>.sif, where <hash> is the start of its SHA-256; a file gets that name only after the check, and pyp.sif is a link to it. config.toml names pyp.sif, so the path does not change when you install another version, and a job that already has the versioned file open keeps reading it.
An existing regular pyp.sif from an older installer is kept as pyp-before-<version>.sif. A second run leaves an existing config.toml in place.
The first ``config.toml``. PYP_BINDS=/data:/scratch/lab ./install-cli writes those folders as pyp.binds, and PYP_SLURM_HOST=login01 writes slurm.host. Without them the file carries both as comments. They are the two settings people most often miss: the commands see only your home directory and the folders in pyp.binds, so a command started in any other folder stops at Can't write to .../.pyp_history or Read-only file system; and without slurm.host the commands run on the machine you typed them on and submit nothing to SLURM.
Alternative to Step 3: install with pip¶
The same commands are published on PyPI as nextpyp-cli. The package holds ready-to-run programs, not Python code, so it has no Python dependencies; it needs Python 3.6 or newer only to run pip, and works on 64-bit x86 Linux. Apptainer (Step 2) is still required.
pip install nextpyp-cli
To install a specific version, use nextpyp-cli==<version>. Only numbered releases are published on PyPI.
error: externally-managed-environment? Install into a virtual environment
Recent distributions (Ubuntu 23.04 and later, Debian 12 and later, recent Fedora) refuse pip install into the system Python with this error. Install into a virtual environment instead; it needs no admin privileges:
python3 -m venv /nfs/data/apps/PYP/venv
/nfs/data/apps/PYP/venv/bin/pip install nextpyp-cli
If python3 -m venv fails on Ubuntu or Debian, install the python3-venv package first (sudo apt-get install -y python3-venv).
The commands are then in /nfs/data/apps/PYP/venv/bin: run pyp-setup from there below, upgrade with that folder’s pip, and in Step 6 put that folder on your PATH instead of the installation folder:
export PATH=$PATH:/nfs/data/apps/PYP/venv/bin
The container is too large for PyPI, so fetch it with pyp-setup, from the folder that should hold it:
cd /nfs/data/apps/PYP
pyp-setup
pyp-setup downloads the container of the exact version you installed, checks it against the release’s signed manifest and against the hash that came with the package, and writes config.toml in the current folder (or in PYP_INSTALL_DIR). It reuses a web install’s container and honors PYP_CONTAINER_SOURCE in the same way as the installation script (see The container file), and it leaves an existing config.toml in place.
To upgrade, run pip install --upgrade nextpyp-cli and then pyp-setup again: each version needs its own container.
Then continue with Step 4. In Step 6, pip has already put the commands on your PATH, so only PYP_CONFIG needs to be set:
export PYP_CONFIG=/nfs/data/apps/PYP/config.toml
Step 4: Review configuration¶
The installer created a default configuration file at config.toml in the installation folder.
This file is written in the TOML format.
The installer did its best to guess the correct configuration options for your environment, but almost certainly there are some settings that need review.
In particular, the slurm.host setting should be the hostname or address of the SLURM login node. If you happened to
install PYP on the SLURM login node, then congratulations! This setting is correct for you.
If PYP is installed on another machine instead, then be sure to correct the value to the real
SLURM login node.
Feel free to review any other configuration settings as well. The default configuration file has a few comments to describe the settings configured there, but you can find more information in the full documentation for the configuration file.
Note
To run PYP in Standalone mode, make sure there [slurm] section in the configuration file is removed.
Step 5 (recommended): Configure access system resources¶
Configure how to access system resources by specifying the following parameters:
pyp.scratchDirectory for large (multi-GB) temporary files on the compute nodes. This location should have fast read/write speeds, ideally in local storage.
pyp.bindsSince
PYPruns inside of a Singularity/Apptainer container, by default, no files from outside of the container will be visible toPYP. To make files visible toPYP, bind the directories containing those files into the container.
slurm.host(SLURM mode only)Hostname of a login node for the cluster.
slurm.path(SLURM mode only, optional)Path to the SLURM binaries on the login node.
slurm.queues(SLURM mode only)SLURM partitions for CPU jobs. The first entry is the default when a job does not name a partition.
slurm.gpuQueues(SLURM mode only)SLURM partitions that have GPUs. The first entry is the default for GPU jobs that do not set
slurm_queue_gpu.
slurm.templatesDir(SLURM mode only)Folder of SLURM submission templates (shared with the website when both are installed).
Here is an example of how to specify these options in the configuration file:
[pyp]
scratch = '/scratch/nextPYP'
binds = [ '/nfs', '/cifs' ]
[slurm]
host = 'slurm-login.myorganization.org'
path = '/opt/slurm/bin'
queues = [ 'normal' ]
gpuQueues = [ 'gpu' ]
templatesDir = '/nfs/data/apps/PYP/templates'
Step 6: Add PYP to your shell¶
Add the following code to your shell configuration file (e.g., .bashrc or .bash_profile if using bash):
export PATH=$PATH:/nfs/data/apps/PYP
export PYP_CONFIG=/nfs/data/apps/PYP/config.toml
Restart your shell for the changes to take effect.
If everything went well, you should be able to execute: pyp -h.