This tutorial takes a new Rocky Linux host from nothing to a running HPCPerfStats site, then connects cluster nodes to it. It is for HPC operators doing a fresh install; for an existing stack, follow Upgrade the stack instead.
Steps 1 to 11 are the shortest path to a working site: prepare the host, start the container stack, install the node monitor RPM, then wire in the scheduler and the hpcperfstats-tools accounting connector.
Optional configuration and building the monitor RPM yourself follow the steps.
Every value you are asked to set has a reference entry in Pipeline configuration or Compose services.
You need:
- A Rocky Linux (or other EL-like) host for the central stack, with
sudoand a large/datavolume. - An unprivileged deployment account on that host, which runs every container (never
sudo podman). - TLS certificate and key PEM files for the site hostname (
fullchain.pemandprivkey.pem). - A directory of SSH keys for the pipeline, if the site rsyncs data from remote hosts.
- A Slurm login node where
sacctworks, for accounting ingest. - Root on the cluster nodes, to install the monitor RPM and edit scheduler prolog and epilog scripts.
In the commands below, <SERVICE_USER> is the deployment account name and <SITE_HOST> is the site FQDN.
To install Podman and prepare the kernel:
-
Install Podman and podman-compose:
sudo dnf install -y git podman podman-compose \ shadow-utils fuse-overlayfs slirp4netns
-
Enable memory overcommit. Valkey background saves use
fork(), and the kernel can reject that fork even with free RAM; Valkey warns at startup whenvm.overcommit_memoryis off.sudo sysctl -w vm.overcommit_memory=1 echo 'vm.overcommit_memory = 1' | \ sudo tee /etc/sysctl.d/99-valkey-overcommit.conf sudo sysctl --system
The file under
/etc/sysctl.d/keeps the setting across reboots. Addingvm.overcommit_memory = 1to/etc/sysctl.confworks too.
podman --version prints the installed version.
Every non-DNF download, cache, tool, temporary file, image layer, writable layer and volume lives under /data, so the root volume never fills.
To set up the storage roots:
-
Create the per-user directories:
SERVICE_USER=<SERVICE_USER> sudo mkdir -p /data/user/$SERVICE_USER/{cache,tmp,tools} sudo mkdir -p \ /data/podman/$SERVICE_USER/{storage,images,volumes,cache,tmp} sudo chown -R $SERVICE_USER:$SERVICE_USER \ /data/user/$SERVICE_USER /data/podman/$SERVICE_USER
<SERVICE_USER>: the deployment account. -
Add these login exports for the deployment account, with
<SERVICE_USER>replaced:Variable Value XDG_CACHE_HOME/data/user/<SERVICE_USER>/cacheTMPDIR/data/user/<SERVICE_USER>/tmpPIP_CACHE_DIR/data/user/<SERVICE_USER>/cache/pipnpm_config_cache/data/user/<SERVICE_USER>/cache/npmnpm_config_prefix/data/user/<SERVICE_USER>/tools/npmPLAYWRIGHT_BROWSERS_PATH/data/user/<SERVICE_USER>/cache/ms-playwright -
In the rootless
storage.conf, setgraphroot=/data/podman/<SERVICE_USER>/storageandimagestore=/data/podman/<SERVICE_USER>/images. -
In
containers.conf, setvolume_path=/data/podman/<SERVICE_USER>/volumesandimage_copy_tmp_dir=/data/podman/<SERVICE_USER>/tmp.
Small config files may stay under ~/.config, and /run/user/$UID stays as required ephemeral state.
Rootless subordinate IDs must cover the image uid 901860.
To allocate them:
-
Add a non-overlapping range of at least 1,048,576 IDs to both
/etc/subuidand/etc/subgid, then migrate Podman as the deployment account:sudo usermod --add-subuids 1000000-2048575 \ --add-subgids 1000000-2048575 <SERVICE_USER> podman system migrate
<SERVICE_USER>: the deployment account; pick a start that is unused on your site. -
Let containers restart after a reboot:
sudo loginctl enable-linger <SERVICE_USER> systemctl --user enable --now podman-restart.service
podman info shows the /data storage paths; check them before the first build.
To create the site Compose file:
-
Clone the repository and copy the template:
git clone https://github.com/TACC/hpcperfstats.git cd hpcperfstats cp docker-compose.yaml.example docker-compose.yamldocker-compose.yamlis gitignored and includes the trackeddocker-compose.defaults.yaml(Compose files). -
In
docker-compose.yaml, setvolumes -> ssh_keys -> deviceto the host directory of pipeline SSH keys, which mounts as/hpcperfstats/.ssh/. -
Set
volumes -> proxy_ssl_source -> deviceto the flat directory that holdsfullchain.pemandprivkey.pem(the example uses/opt/certs). For a Let's Encrypt tree, see Use Let's Encrypt certificates. -
Review the other
device:paths; the defaults below match the example.
Every bind device: must exist before the stack starts.
To create them with the example defaults:
-
Create the data, site and database directories:
sudo mkdir -p /data/hpcperfstats_data/site_data sudo mkdir -p /data/hpcperfstats_data/site_data/accounting sudo mkdir -p /data/hpcperfstats_data/site_data/archive sudo mkdir -p /data/hpcperfstats_data/site_data/daily_archive sudo mkdir -p /data/hpcperfstats_data/site_data/logs/current sudo mkdir -p /data/hpcperfstats_data/site_data/logs/log_archive sudo mkdir -p /data/hpcperfstats_data/rabbitmq sudo mkdir -p /data/hpcperfstats_site/staticfiles sudo mkdir -p /data/hpcperfstats_site/media sudo mkdir -p /data/hpcperfstats_db/pg18 sudo chown -R 70:70 /data/hpcperfstats_db/pg18
-
Create the
ssh_keysandproxy_ssl_sourcedevice paths you chose in Step 4.
/data/hpcperfstats_data/site_data appears as /hpcperfstats/ inside pipeline and web.
/data/hpcperfstats_db/pg18 must be owned by uid and gid 70 (Alpine postgres); a root-owned bind fails with Permission denied when the server creates its data directory.
The image bakes hpcperfstats.ini at build time, so set it before the first build.
To configure it:
-
Copy the example:
cp hpcperfstats.ini.example hpcperfstats.ini
-
Under
[DEFAULT], set the site keys:machine: cluster name.host_name_ext: FQDN suffix of the cluster nodes.server: FQDN of the host running the containers; nginx answers only for these names.restricted_queue_keywords: queue-name substrings whose jobs are skipped at accounting ingest, as['secure', 'secret']orsecure, secret.staff_email_domain: the email domain whose users are staff and see all jobs.timezone: the cluster's local timezone.secret_key: a long random string.
Leave the [RMQ], PostgreSQL, Valkey and path defaults alone: they are wired for Compose.
Pipeline configuration lists every other key, including the optional [SYSLOG] section for cluster syslog.
To build the images and start the site:
-
Run the full-site rebuild script from the checkout:
./scripts/rebuild_full_site.sh
The script builds the images, then starts the default stack with
up -d --no-build. The first build compiles CPython, numpy and the proxy from source, so it takes a while. -
Watch the startup logs:
podman-compose -p hpcperfstats logs
On first start,
webrunsmanage.py migrate, collects static files and verifies the SPA shells before Gunicorn starts (web). -
Open
https://<SITE_HOST>/in a browser.<SITE_HOST>: a name listed in[DEFAULT] server.
The site shows the job list, empty until data arrives. Use the same script for every later image refresh.
Each node runs the daemon hpcperfstatsd from an RPM built for your cluster: your site's build, or one you make with Build the monitor RPM.
To install it on each node:
-
Install the package as root; its
%postenables and starts the service:sudo dnf install ./hpcperfstatsd-<VERSION>-<RELEASE>.<ARCH>.rpm
<VERSION>-<RELEASE>.<ARCH>: the file name the build printed.
The RPM installs /usr/sbin/hpcperfstatsd, its conf /etc/hpcperfstats/hpcperfstats.conf and the systemd service hpcperfstats.
The unit is hpcperfstats, not hpcperfstatsd, which is the package and binary name.
rpm -q hpcperfstatsd prints the installed version; the per-node detail is in Install the RPM.
The monitor reads /etc/hpcperfstats/hpcperfstats.conf; the installed file lists every key with a comment.
To configure it on each node:
-
Unless the RPM was built with your site conf, edit
/etc/hpcperfstats/hpcperfstats.conf:Field Description serverHostname or IP of the RabbitMQ server (the site host) queueSystem or cluster name being monitored portRabbitMQ port (default 5672)user,passwordRabbitMQ account (default guest)sample_freqFast-tier sampling interval in seconds sample_freq_slowFull-sample interval in seconds ( >= sample_freq; used whenenable_slow_tieris 1)send_freqRabbitMQ send interval in seconds The shipped values:
server localhost queue default port 5672 user guest password guest sample_freq 30 sample_freq_slow 600 send_freq 300
-
Restart the service so it reads the conf:
sudo systemctl restart hpcperfstats
sudo systemctl stop hpcperfstatsstops it.sudo systemctl reload hpcperfstatssendsSIGHUP(the unit'sExecReload) after a config edit.
The daemon hpcperfstatsd sends samples to RabbitMQ over the administrative network; podman-compose -p hpcperfstats exec rabbitmq rabbitmqctl list_queues name messages consumers shows the queue for your queue name.
The default monitor learns the running job from /var/run/stats_jobid on each node.
To mark jobs, add to the scheduler prolog and epilog:
- In the prolog, write the job ID into
/var/run/stats_jobid. - In the epilog, write
-into/var/run/stats_jobid.
Shared-node fleets use a different monitor build instead (Shared-node fleets).
Job records come from Slurm sacct through hpcperfstats-sacct-gen in the hpcperfstats-tools package.
By default it runs sacct for a date range and POSTs the result to the API ingest endpoint.
To set up accounting ingest on the Slurm login node:
-
Install the tools from the checkout:
python3 -m pip install ./hpcperfstats-tools
-
Set
HPCPERFSTATS_TOOLS_INIto an INI file with[API] base_url;hpcperfstats-tools/hpcperfstats-tools.ini.exampleis the template. -
Run the ingest as a user whose Slurm permissions cover the jobs and accounts you need, with a staff-capable API key:
hpcperfstats-sacct-gen --api-key <API_KEY> hpcperfstats-sacct-gen 2024-01-01 2024-01-08 --api-key <API_KEY>
<API_KEY>: a staff-capable key from the site. The first form ingests today only (default range today .. today); the second ingests an inclusive date range.
--api-key is optional once a key is cached: each run that passes it saves the key in ~/.hpcperfstats-api for that [API] base_url, and later API-mode runs use the cached key.
Each successful POST also creates or overwrites the daily file {acct_path}/YYYY-MM-DD.txt (the same pipe-delimited body Slurm returned) when the body has at least one job row.
The API rejects a payload with fewer lines than the existing file for that date (HTTP 409), so a partial sacct export cannot replace a fuller one; header-only or empty POSTs skip the write without a 409.
API mode needs the shared data volume on web at /hpcperfstats/ (as on pipeline), so the API can write under acct_path (default /hpcperfstats/accounting).
To write the daily files without the API, see Load accounting from files.
The site works without these; apply the ones your site needs.
Set total_cores under [DEFAULT] in hpcperfstats.ini, the CPU budget for application parallelism; without it the code uses 40.
The image bakes the INI, so rerun ./scripts/rebuild_full_site.sh after the edit.
Pipeline configuration covers the pool and memory keys.
To serve a Let's Encrypt certificate, set volumes -> proxy_ssl_source -> device to /etc/letsencrypt in docker-compose.yaml, and uncomment the services.proxy.environment block with HPCPERFSTATS_SSL_CERTS_REL=live/your.hostname.
Never bind only the live/hostname leaf: its archive symlinks break.
Fleets where jobs share a node use a monitor built with --enable-shared-node-multi-jid instead of the /var/run/stats_jobid prolog in Step 10.
Apply migration 0036 and deploy the matching listend and sync_timedb consumer before installing that build.
It discovers job ids from process environments, does not use /var/run/stats_jobid, and adds %jobs and %affinity lines to each sample.
The consumer stores CPU and GPU affinity in job_affinity and stamps non-GPU host_data.dev as j:<jid>, so two jobs can share a host second; that dev key is the shared-node membership on host_data.
Payloads without those marks stay on empty dev.
An allocated node whose steps have finished stays tagged with the job, because the monitor reads the root slurmstepd title.
For older data, metrics count untagged samples toward a job on hosts it held alone (no other job in accounting or in job_affinity overlapping its window); a later accounting row for a co-tenant marks the job for recompute.
File mode writes the same daily files as Step 11 locally without calling the API:
hpcperfstats-sacct-gen -f /path/to/accounting \
2024-01-01 2024-01-08-f DIR is mutually exclusive with --api-key, DIR must already exist, and no API URL or key is required.
Place or sync the resulting .txt files where sync_acct.py expects them (acct_path); Accounting reimport loads them.
Build the RPM yourself when your site has none for the cluster; Build the monitor RPM covers the site conf, fleet scripts and rollout.
The monitor RPM builds with a static bundle: pinned libev and rabbitmq-c archives (plus libbpf when the eBPF profiler is enabled), linked into hpcperfstatsd with --enable-all-static.
x86 core counters come from perf_event directly, so no counter library is bundled.
To build the RPM:
-
Install the build prerequisites on the build host:
sudo dnf install \ gcc gcc-c++ make autoconf automake libtool cmake pkgconfig \ systemd-rpm-macros gzip tar curl perl gawk pciutils \ rdma-core-devel rpm-build
No DCGM or NVML development package is needed on any arch: the daemon loads
libdcgmandlibnvidia-mlat runtime against vendored headers. -
From
HPCPerfStats/monitor, prepare the rpmbuild tree and source tarball:./scripts/prepare_rpmbuild_dirs.sh
The script removes any prior
monitor/rpmbuild/andmonitor/embedded-static-prefix/, createsmonitor/rpmbuild/{SPECS,SOURCES,BUILD,RPMS,SRPMS,BUILDROOT}withhpcperfstats.specinSPECS, runsscripts/build_static_bundle.sh --deps-onlyintomonitor/embedded-static-prefix, runsautoreconf -fi,./configureandmake dist, and copieshpcperfstats-<version>.tar.gztorpmbuild/SOURCES. -
Run the
rpmbuildcommand the script prints, which looks like this:rpmbuild -ba --define "_topdir $(pwd)/rpmbuild" \ rpmbuild/SPECS/hpcperfstats.spec
Install the resulting hpcperfstatsd RPM on each node as in Step 8.
Optional build variants of scripts/build_static_bundle.sh:
| Command | Builds |
|---|---|
./scripts/build_static_bundle.sh |
Dependencies and the monitor binary, without rpmbuild |
./scripts/build_static_bundle.sh --deps-only |
Only the pinned dependency archives |
./scripts/build_static_bundle.sh --release |
A release-optimized monitor (same as HPC_BUNDLE_RELEASE_BUILD=1) |
./scripts/build_static_bundle.sh --disable-lustre |
Passes extra configure arguments through |
For development, python3 -m pip install -e ./hpcperfstats-tools installs the accounting tools editable.
The site host runs the Compose stack: proxy serves the web UI over TLS, web serves Django and the API, pipeline archives and ingests monitor data, db stores it, valkey caches, and rabbitmq receives samples from the nodes.
Each node runs hpcperfstatsd, which samples hardware and publishes to RabbitMQ; the scheduler tells it which job is running, and hpcperfstats-sacct-gen loads the matching accounting records.
Next, tune pools and memory for the host size in Pipeline configuration, and enable cluster syslog or site rsync from Compose services if you need them.