Install nextPYP¶
These instructions install the web interface with an interactive wizard. You’ll download a script, answer a short list of questions, and end up with a working instance of nextPYP.
To pass every setting on the command line instead, see Installer settings.
To install the
PYPcommand-line tools (no web interface), follow these instructions.Words like service account, container, and bind are defined in the glossary at the end of this page.
Before you start¶
nextPYP runs on Linux on x86_64 only. It has been tested on:
You’ll also want:
A current desktop browser
Current or previous major version of Chrome, Firefox, Edge, or Safari. You will use this to access nextPYP after the install.
Plenty of storage
Cryo-EM and cryo-ET projects need significant space, on the order of terabytes. At the very least, plan on a multi-terabyte partition (a local SSD or a large network share). nextPYP does best with fast local storage, but slower remote storage works too. If you put the data on a typical tens-of-gigabytes OS disk, you’ll run out of space quickly.
Tip
To see what disks you have and how much free space is left, run:
df -hIf the root filesystem is only a few tens of gigabytes (common on cloud images), mount a larger data disk first and put the install and storage folders there. An administrator install puts only a few small files on the OS disk (the
nextpypcommand in/usr/binis a three-line launcher, plus the systemd units and the sudo rule), so/needs no room to speak of when the website and data live elsewhere. Command-line installs on a disk smaller than 1 TiB (storage) or 100 GiB (install folder) needPYP_STORAGE_OK=true/PYP_HERE_OK=true; see Installer settings.GPU card(s) (optional)
Only some processing steps need a GPU (for example ML-based particle picking, MotionCor3, or AreTomo). The NVIDIA driver must already be installed;
nvidia-smishould list the GPU before you install nextPYP.nextPYPuses Apptainer and passes--nvfor NVIDIA and--rocmfor AMD. The installer recordsPYP_NV=trueorPYP_ROCM=trueininstall.env. MotionCor3, AreTomo, Relion’s CUDA build, and the CUDA PyTorch steps remain NVIDIA-only; on an AMD-only machine those programs will not run.
The website needs Apptainer (formerly Singularity) and wget or curl. In most cases you do not install these yourself: when either is missing, the installer asks Install Apptainer and wget now? [Y/n], and the default is yes. Those steps run as root. On a regular-account install you can install them only if your account can use sudo; otherwise answer n and have an administrator install them by hand before you run ./install. A command-line install does not install anything unless you pass PYP_INSTALL_DEPS=true (Installer settings).
Installing Apptainer and wget by hand
Apptainer is not in the Debian or Ubuntu repositories. On Ubuntu, the Apptainer project publishes a signed package archive:
sudo apt-get install -y wget software-properties-common
sudo add-apt-repository -y ppa:apptainer/ppa
sudo apt-get update
sudo apt-get install -y apptainer
On Debian, download the package from the Apptainer releases, compare its checksum with the one published there, and install it with sudo apt-get install -y ./apptainer_<version>_amd64.deb. PYP_INSTALL_DEPS does not do this for you: the installer never downloads a package from a web page and installs it as root.
Ubuntu 23.10 and later also need an AppArmor profile for Apptainer; the package from the archive above installs one. If Apptainer still fails with Permission denied, see Troubleshooting.
Apptainer is in the EPEL repository. Enable it first, then install the packages:
sudo dnf install -y epel-release
sudo dnf install -y apptainer wget
On RedHat-based systems and on Ubuntu these are the same commands PYP_INSTALL_DEPS=true runs, in the same order. They are listed by ./install --print-root-steps and skipped when Apptainer is already installed and a downloader is present. On other systems PYP_INSTALL_DEPS=true stops and says so. ./install then runs apptainer --version. A command that exists but cannot read /etc/apptainer/apptainer.conf stops the install. A root install also requires that directory to be searchable and that file to be readable by other accounts, because the account that runs nextPYP is not root.
How the installer checks downloads, what runs as root, and which account does what are described in the Security page.
Choose your install¶
Two choices, independent of each other:
Which account — a regular user account, or an administrator account with
sudo.Where jobs run — a desktop workstation, or a SLURM compute cluster.
The tabs below (and later on this page) follow those choices. Pick the combination that matches how you will run nextPYP.
Which account should I use?
Regular user account: you are installing for yourself, on one computer, and you will start nextPYP from your own login. No sudo is needed once Apptainer is on the machine. If Apptainer is missing, your administrator installs it once — or, if you do have sudo, the wizard can offer to install it for you. Having sudo does not mean you have to pick the administrator tab.
Administrator account: several people will use this install, you want it to start at boot as a system service under its own service account, or you want jobs to run as each person. Run the installer with sudo.
Where will jobs run?
Desktop workstation: jobs run locally on the same machine as the website.
Compute cluster: jobs are submitted to SLURM and run on compute nodes.
1. Make the folders¶
Once Apptainer is installed, a regular-account install needs no sudo.
Find your data disk. nextPYP stores its data in a storage folder that the wizard asks for. It should be on a disk with at least a terabyte free, in a folder you own. df -h lists the disks and free space; ls -ld /PATH/TO/YOUR/DISK shows who owns a folder. If the disk already has a folder that belongs to you, or your home folder is on a large disk, use that:
df -h
mkdir -p /PATH/TO/YOUR/DISK/nextpyp
A freshly mounted disk is usually owned by root, and mkdir there fails with Permission denied. In that case ask your administrator to create the folder and make it yours; these are the two commands they run:
sudo mkdir -p /PATH/TO/YOUR/DISK/nextpyp
sudo chown "<your login>": /PATH/TO/YOUR/DISK/nextpyp
Replace /PATH/TO/YOUR/DISK with the mount point df -h showed, for example /mnt/data. Give that folder at the Storage folder question. Do not put data under /opt, /srv, /usr, /var, /etc, or /tmp: the installer and nextpyp config refuse system folders.
Make a folder for the program. This folder holds the installer, the website container, and the database. A few hundred megabytes is enough. Your home folder works:
mkdir -p ~/nextPYP
cd ~/nextPYP
Check that Apptainer is installed. apptainer --version prints a version when it is. If it prints command not found, ask your administrator to install it (the commands are under Before you start). The installer cannot do this for you without sudo.
A regular-account cluster install works, but everything runs as your login: the website, the SSH connection to the login node, sbatch, and every job file. Jobs cannot run as other linked users. Your login also owns the shared programs folder. Port 8080 is not opened for you; compute nodes must still reach the website on it. The website runs as a systemd user service, so the machine must allow lingering and a long-running service.
The four folders are the ones under Cluster folders, owned by your login instead of a service account. Create them before you run the installer. Make a folder for the program as well:
mkdir -p ~/nextPYP
cd ~/nextPYP
Check that Apptainer is installed. apptainer --version prints a version when it is. If it prints command not found, ask your administrator to install it.
Make the install folder. The program files go on the web server’s local disk, owned by root or your administrator account — never by the service account. A few hundred megabytes is enough. The installer’s canonical location is /opt/nextpyp, and the wizard offers it as the default:
sudo mkdir -p /opt/nextpyp
cd /opt/nextpyp
Warning
Installing to a networked folder works, but it is slower because the website reads its files from that folder. Keep the install folder on the local filesystem.
Make the data folders.
One storage folder, on a disk with at least a terabyte free, owned by root. The installer creates local, shared, sharedExec, and scratch under it.
sudo mkdir -p /PATH/TO/YOUR/DISK/nextpyp
Create the folders under Cluster folders before you run the installer. On a root-squashed export root cannot create or hand over folders. The installer then creates each folder as the account that should own it, which works when that account may write in the parent; when it cannot, it stops with Could not create <folder> for <account> and you ask your storage team to create that folder.
The service account must already exist in your directory service (LDAP or similar) with the same UID on the web server, the login nodes, and the shared filesystem, and with a shell that can run commands over SSH. That account is an ordinary directory login, not a local nologin system user. The installer accepts it when the install profile is cluster. If the account is not found, the installer creates a local system account that the cluster does not know, so avoid that on a real cluster.
Cluster folders¶
A cluster install separates the folders that a workstation install keeps under one storage folder. Create them before running the installer. The wizard asks for each one; the command line passes them as variables (see Installer settings).
PYP_SHARED_DATA(required)All data shared between the web server and the compute nodes, on the networked filesystem, mounted at the same path everywhere. Owned by the service account (or your login on a regular-account cluster install). It grows to tens or hundreds of terabytes. Example:
/nfs/nextpyp/shared.PYP_SHARED_EXEC(required)Executables and configuration shared with the compute nodes, including the compute container (tens of GiB). On the networked filesystem, owned by an administrator account or
root(or your login on a regular-account cluster install), readable but not writable by the service account on an administrator install. Example:/nfs/nextpyp/sharedExec.PYP_SCRATCH(required)Temporary space for jobs, on fast local disk on each compute node, at the same path on every node. Hundreds of gigabytes at a minimum. The installer does not create or check it on the nodes. When jobs run as linked users (Run jobs as each OS user), every user writes here, so use mode
1777or a per-job path. Example:/scratch/nextpyp.PYP_LOCAL(optional)The database and website logs, on fast local disk on the web server. Defaults to
localunder the install folder. Example:/nvme/nextpyp/local.PYP_USERandPYP_GROUPThe service account and its group. On a cluster the account must be a directory account with the same UID on every machine.
PYP_GROUPis needed when the account’s primary group does not share its name.
2. Download the installer¶
install is a readable shell script. Download it, inspect it if you like, then mark it executable:
wget -O install https://nextpyp.app/files/pyp/latest/install
chmod u+x install
curl -fsS -o install https://nextpyp.app/files/pyp/latest/install
chmod u+x install
sudo wget -O install https://nextpyp.app/files/pyp/latest/install
sudo chmod u+x install
sudo curl -fsS -o install https://nextpyp.app/files/pyp/latest/install
sudo chmod u+x install
-O install / -o install always writes the file named install, so a second download does not automatically create a copy named``install.1``.
Note
To install a specific version, replace latest in the URL with the version number, for example https://nextpyp.app/files/pyp/0.7.0/install.
3. Run it¶
The install script downloads the website container (about 400 MiB) and sets everything up, then starts a background download of the compute container (tens of GiB; the installer prints its size). The website is usable before that download finishes. When Apptainer is missing, the installer installs it as a root step (only when using an administrator account).
To start the wizard, run:
./install
On a machine that has sbatch on PATH, force a workstation install:
PYP_PROFILE=workstation ./install --interactive
PYP_PROFILE=cluster ./install --interactive
--interactive is required: any PYP_* setting alone turns the questions off. This command works whether or not sbatch is on PATH.
Answer the questions in What you’ll be asked. With Apptainer already installed, nothing in the run needs sudo. If Apptainer is missing, the first question is Install Apptainer and wget now? [Y/n]: answer n unless you can use sudo, and ask your administrator to install it.
Tip
A wrong answer is caught at the question and asked again. If ./install stops later (a download fails, the website does not come up), fix the cause and run ./install again: it continues from where it stopped. ./install --interactive asks the questions again, with your earlier answers as the defaults.
Run the installer as sudo ./install — your everyday login first, then sudo, then ./install, with nothing in between. sudo tells the installer which login ran it; that login becomes the administrator who owns the program files (nextPYP.sif, nextpyp, and the containers) and who can later run nextpyp upgrade and the other administrator commands.
If you are already logged in as root (no sudo), the installer does not know which person should own those files and asks for an everyday login. You can also pass PYP_ADMIN=<login> or PYP_ALLOW_ROOT_OWNER=true; see Installer settings.
Any PYP_* setting in front of ./install turns the questions off. For the wizard, leave them out. For a fully scripted install, see Installer settings.
sudo ./install
On a machine that has sbatch on PATH, force a workstation install:
sudo PYP_PROFILE=workstation ./install --interactive
sudo PYP_PROFILE=cluster ./install --interactive
--interactive is required: any PYP_* setting alone turns the questions off. This command works whether or not sbatch is on PATH. Setting PYP_SLURM_HOST, PYP_SLURM_PATH, or PYP_SLURM_LOCAL=true also forces a cluster install the same way.
Answer the questions in What you’ll be asked. If ./install stops with an error, fix the cause and run sudo ./install --interactive.
What you’ll be asked¶
Press Enter to accept the default shown in brackets. The wizard asks only the questions that apply to your choices: a cluster is detected when sbatch is on PATH (or when you set PYP_PROFILE=cluster), and the service-account questions appear only under sudo. The text in the first column is the prompt as it appears on the terminal.
Prompt |
Default |
Asked on |
What to answer |
|---|---|---|---|
|
|
everyone, when missing |
The install runs as root, so on a regular-account install it needs |
|
|
everyone |
Where the program files go. The folder you ran |
|
|
administrator |
The account that runs the website. The installer creates it when it does not exist. If the name is an existing login with a shell, the installer warns and asks |
|
the account’s group, or a group with the same name |
administrator |
Skipped when a group named after the account already exists. When the group does not exist, the installer asks |
|
the mount point of the largest filesystem with at least 1 TiB |
workstation |
Type the folder you created in step 1, not the bare mount point. |
|
|
cluster |
A folder on the shared filesystem, owned by the service account (or your login on a regular-account install). Do not accept the default on a real cluster: |
|
|
cluster |
A folder on the shared filesystem. On an administrator install it is owned by an administrator and readable by the service account; on a regular-account install it is owned by your login. |
|
|
cluster |
Fast local storage on the web server for the database. |
|
|
cluster |
Node-local fast storage on every compute node. The installer does not create or check it on the nodes. The next prompt, |
|
blank |
everyone |
The folders that hold your microscope data, for example |
|
|
workstation |
|
|
|
cluster |
|
|
|
cluster |
The address compute nodes use to call the website back. It must not be |
|
|
administrator |
The systemd unit is installed either way. |
|
|
regular account |
Writes a systemd user unit and enables lingering, so the website is also started at boot. |
|
|
everyone |
Shown after the plan. |
Each answer is checked when you give it. A path that is not absolute, a system directory, a file where a folder is needed, a folder the service account could not reach: the installer says what is wrong with the value you typed and asks the same question again, keeping your earlier answers. Nothing on the machine is changed until you answer the last question.
The answers are saved in .np/answers in the install directory, as plain NAME=value lines that are read as data and never run. They are the defaults the next time, and a PYP_* setting you give on the command line always wins over a saved answer. If an install stops partway (a download fails, the website does not come up), run ./install again: it continues from where it stopped, with the settings it was started with. Once the install has finished, ./install prints nextPYP is already installed. Nothing to do. and exits; change settings with nextpyp config set instead (see Operate). Replacing program files on an older install is on Installer settings.
What a successful run looks like¶
The lines that matter are the plan, then Website is answering. and Finished installing. The compute container keeps downloading after the installer exits; nextpyp fetch-status shows that download (./nextpyp fetch-status from the install folder on a regular-account install).
Tip
The first systemctl start can take a couple of minutes while Apptainer loads the website container. The unit allows five minutes before it times out — that wait is normal, not a hang.
This is a workstation install. Cluster questions are skipped.
The installer will:
- Install nextPYP in ...
- Store data in ... (local, shared, and scratch under it)
- Open the website at http://localhost:8080/
- Listen on this computer only. Authentication: login
...
Website is answering.
Finished installing nextPYP ...
This machine has sbatch, so this is a cluster install. SLURM and shared folders follow.
The installer will:
- Shared data: ...
- Shared programs: ...
- Website files: ...
- Scratch: ...
- Submit jobs to SLURM on ...
- Listen on the network. Authentication: login
...
Creating an SSH key for ... so the website can reach ...: ...
Add this public key to ...@... if that is another machine: ...
Website is answering.
Finished installing nextPYP ...
4. Open the website and create the administrator account¶
The wizard uses login mode by default, so the first page you see asks you to create the administrator account.
At the machine (or a remote desktop): open http://localhost:8080 in a browser.
Over SSH: when the website listens only on this computer, forward the port for now:
ssh -L 8080:localhost:8080 <server>then open http://localhost:8080 on your laptop. Or enable remote access once you are ready.
On the network (cluster installs, and workstation installs that answered
n): open http://hostname:8080, wherehostnameis the network name of the server.
Fill out the form and click Create Administrator.
Note
If you are logged into the server remotely over SSH and the website listens only on this computer, you will not be able to visit it in a browser just yet. Remote network access is off by default; use the SSH forward above, or head to Enable remote access after the website is up.
A command-line install that did not set PYP_AUTH=login opens the website with no accounts; see Installer settings.
5. Add your data folders¶
nextPYP runs inside containers, which see only the folders they are given. Until you bind your data folders, the website cannot see your microscope data, and the Projects page shows a banner saying no data folders are configured.
Add each folder with nextpyp config add. The command checks the path, writes the pyp.binds setting, and tells you to restart.
Tip
On a regular-account install the nextpyp command is not on PATH; run it as ./nextpyp from the install folder. On an administrator install it is in /usr/bin; run it with sudo.
cd ~/nextPYP
./nextpyp config add pyp.binds /mnt/data/raw
./nextpyp config add pyp.binds /mnt/data/projects
./nextpyp restart
sudo nextpyp config add pyp.binds /mnt/data/raw
sudo nextpyp config add pyp.binds /mnt/data/projects
sudo nextpyp restart
The website and its jobs run as the service account, so that account must be able to read the folders. A home folder on Ubuntu is mode 750 and is not readable by other accounts; keep data outside /home, or open it with setfacl -m u:nextpyp:rx <folder> on each folder on the path.
Folders under /opt, /usr, /var, /etc, /srv, /run, and the other system directories are refused. nextpyp config get pyp.binds prints the list. nextpyp config remove pyp.binds /mnt/data/raw takes one folder back out. nextpyp configure asks for the data folders, remote access, and the authentication mode together; see Operate.
Next steps¶
Enable remote access if other people (or you, from another computer) will open the website.
Add people on the administration page. On an administrator install, you can also run jobs as each OS user.
Operate has the everyday commands: start, stop, restart, logs, and
fetch-status.Follow a tutorial to process a first dataset.
Connect the SLURM cluster to authorize the SSH key and run the test job. Do this before submitting any jobs.
Edit the SLURM cluster templates so jobs get your site’s partitions, accounts, and other
#SBATCHoptions. The installer placestemplates/default.pebin the install directory and pointsslurm.templatesDirthere; change that file, or add more.pebfiles, before submitting any jobs.Add people on the administration page. On an administrator install, you can also run jobs as each OS user.
Operate has the everyday commands: start, stop, restart, logs, and
fetch-status.Follow a tutorial to process a first dataset.
If the website does not answer¶
Check the user service:
systemctl --user status nextpyp
Active: active (running) means it is up. If you answered n to Start nextPYP when you log in, or the service is not running, start it from the install folder:
cd ~/nextPYP
./nextpyp start
./nextpyp logs shows the website log, and journalctl --user -u nextpyp shows the service output.
Check the system service:
sudo systemctl status nextPYP
Active: active (running) means it is up. sudo systemctl start nextPYP, stop, and restart control the service. sudo nextpyp logs shows the website log, and sudo journalctl -u nextPYP shows the service output.
Then test the website from the shell:
wget http://localhost:8080 -O -
A working website answers HTTP request sent, awaiting response... 200 OK followed by a short HTML page whose title is nextPYP. If you get Connection refused or an error page instead, see troubleshooting.
Words used on these pages¶
- service account¶
A separate Linux user that runs the website, so the website cannot touch your own files. Only an administrator install needs one. The default name is
nextpyp.- Apptainer¶
The program that runs nextPYP’s software in portable seld-contained images called containers. The installer installs it when it is missing.
- container¶
One file holding a program and everything it needs. nextPYP has two: the website container (
nextPYP.sif, about 400 MiB) and the compute container (pyp.sif, tens of GiB).- bind¶
Telling a container which of your folders it may see. nextPYP cannot see your data until its folders are bound. The list of bound folders is the
pyp.bindssetting.- systemd¶
The service manager on Linux. It starts nextPYP at boot and restarts it if it stops. An administrator install uses a system unit named
nextPYP; a regular-account install uses a user unit namednextpyp.- config.toml¶
The settings file. You normally change it with
nextpyp config set, not by hand.- workstation and cluster¶
A workstation install runs jobs on the same machine. A cluster install submits jobs to a SLURM scheduler and needs the shared folders described under Cluster folders. Force the cluster questions with
PYP_PROFILE=cluster ./install --interactive(or by settingPYP_SLURM_HOST,PYP_SLURM_PATH, orPYP_SLURM_LOCAL=truethe same way).