Deployment Guide
This guide covers production deployment of Waldur Site Agent using systemd services.
Deploying on Kubernetes? Use the published Helm chart instead:
1 2 3helm repo add waldur https://waldur.github.io/waldur-site-agent helm repo update helm install waldur-site-agent waldur/waldur-site-agentThe chart runs the same agent modes described below as separate deployments. See the chart README for available versions and configurable values.
Deployment Overview
The agent can run in 4 different modes, deployed as separate systemd services:
- agent-order-process: Processes orders from Waldur
- agent-report: Reports usage data to Waldur
- agent-membership-sync: Synchronizes memberships
- agent-event-process: Event-based processing (alternative to #1 and #3)
Service Combinations
Option 1: Polling-based (traditional)
- agent-order-process
- agent-membership-sync
- agent-report
Option 2: Event-based (requires STOMP)
- agent-event-process
- agent-report
Note: Each offering is served by one combination, chosen by its stomp_enabled
setting: agent-order-process skips offerings with stomp_enabled: true, and
agent-event-process acts only on those, so both may run against one configuration
with mixed offerings. Run one instance of agent-event-process and of
agent-order-process; agent-report and agent-membership-sync may run more.
The Helm chart enforces the single instance, including during rollouts; see
High Availability.
One-shot usage report
waldur_site_report -c /etc/waldur/waldur-site-agent-config.yaml runs the same usage report as
agent-report and exits. The exit status is non-zero when any offering fails, so a timer
or cron job can alert on it. Use it when the report has to run at a fixed time, and leave
waldur-agent-report.service disabled. Running both pushes usage twice.
The command does not write the liveness heartbeat. On a host that also runs a daemon, that run must not refresh the daemon's heartbeat file, or a stalled daemon keeps looking alive.
Waldur leaves a usage-reporting agent Active between runs. The report service does not go idle, and the offering's usage-reporting integration does not go disconnected, however long the gap is. The processor's last run and the integration row's last request time are the record of the last report. The other agent services still go idle after 10 minutes without a processor run, and the other integration rows still go disconnected after an hour without a request. A failed report is this command's non-zero exit, which the timer or cron can alert on.
A systemd timer that starts a oneshot service does not start a second run while the first is still active. Cron does not. Wrap the command so a slow run cannot overlap the next one:
1 2 | |
flock -n does not start the report when the lock is held, and it exits non-zero.
An alert on any non-zero status also fires while a run is still going.
Systemd Service Setup
Download Service Files
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
The units run waldur_site_agent as root and find it on systemd's search path, which includes
/usr/local/bin where the Installation Guide puts it (systemd 239 or newer is
needed for a command name without a path; Ubuntu 24.04 ships 255, Rocky Linux 9 ships 252). If
the agent lives elsewhere, put the absolute path in ExecStart= with a drop-in
(systemctl edit <unit>). The units restart the agent 30 seconds after it exits with an error.
Logging to files instead of the journal
Each mode also has an agent-file-logging.service variant that appends output to
/var/log/waldur-site-agent-<mode>.log and -error.log instead of the journal. It uses
StandardOutput=append:, which needs systemd 240 or newer. Rotate the files with logrotate
(copytruncate); journalctl then shows only systemd's own start and stop messages for these
units, not the agent's output.
1 2 3 4 5 | |
Enable and Start Services
Option 1: Polling-based Deployment
1 2 3 4 5 6 7 8 9 10 11 | |
Option 2: Event-based Deployment
1 2 3 4 5 6 7 8 | |
Heartbeat file per service
Each agent process writes a liveness heartbeat file, checked by
waldur_site_healthz --liveness-only. Several services on one host must not share it, or any of
them touching it keeps a stalled one looking alive, so each unit sets its own path with
WALDUR_SITE_AGENT_HEARTBEAT_PATH in its own runtime directory:
/run/waldur-site-agent-<mode>/heartbeat, for example
/run/waldur-site-agent-event-process/heartbeat. Without the variable the agent uses
/tmp/waldur-site-agent-heartbeat.
Check a unit's liveness with:
1 2 | |
It exits 0 while the heartbeat is younger than 300 seconds (--max-age). In event mode the
agent stops refreshing it while a STOMP consumer stays disconnected for longer than
WALDUR_SITE_AGENT_STOMP_UNHEALTHY_AFTER_MINUTES (default 15), so the check fails about that
long plus 300 seconds into a broker outage.
Service Management
Check Service Status
1 2 3 4 5 | |
View Logs
1 2 3 4 5 6 7 8 | |
Restart Services
1 2 3 4 5 | |
Configuration Management
Configuration File Location
The default configuration file location is /etc/waldur/waldur-site-agent-config.yaml.
Update Configuration
- Edit configuration file:
1 | |
- Validate configuration:
1 | |
- Restart services:
1 | |
Event-Based Processing Setup
STOMP Configuration
For STOMP-based event processing, enable it per offering and keep the backends the event handlers need:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
- The STOMP login uses the offering's static
waldur_api_token. A configuration that combinesstomp_enabled: truewith OIDC-only authentication fails validation, and the agent exits. global_proxydoes not apply to the STOMP WebSocket yet. If the broker is only reachable through a proxy, sethttps_proxy(orhttp_proxy) in the unit's environment.waldur_site_agent -m event_processstill needsagent-reportfor usage reporting.
Monitoring and Alerting
Health Checks
A unit can be active while its agent is stuck, so check both the unit and its heartbeat:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Log Rotation
Systemd handles log rotation automatically via journald. Configure retention:
1 2 3 4 5 6 | |
Sentry Integration
Add Sentry DSN to configuration for error tracking:
1 | |
Set environment in systemd service files:
1 2 | |
Security Considerations
File Permissions
1 2 3 | |
API Token Security
- For the source offering: the token user needs OFFERING.MANAGER role on the offering
- For Waldur federation (
waldurbackend): the target token user needs customer owner (can be a non-SP customer) and ISD identity manager (managed_isdsset) - Use dedicated service accounts in Waldur
- Rotate API tokens regularly
- Store tokens securely (consider using systemd credentials)
Network Security
- Restrict outbound connections to Waldur API endpoints
- Use TLS for all connections
- Configure firewall rules appropriately
Troubleshooting
Before digging into a specific symptom below, run:
1 | |
This checks the Waldur side of the setup — API reachability, token auth, offering state, loaded
components — and the backend: it calls each offering's backend diagnostics (for SLURM, the SLURM
tools and accounting database), and exits non-zero if either side fails. For SLURM, follow up
with waldur_site_diagnose_slurm_account <allocation-account> -c /etc/waldur/waldur-site-agent-config.yaml
(the resource's backend ID in Waldur) for a deeper check that compares actual SLURM account state against what Waldur expects.
Common Issues
Service Won't Start
- Check configuration syntax:
1 | |
- Check service logs:
1 | |
Backend Connection Issues
- Test backend connectivity:
1 2 3 4 5 6 | |
- Check permissions and PATH
Agent Identity Registration Is Refused
Symptom — every cycle, for the same offering:
1 2 3 4 | |
The offering does exist. Waldur registers an agent identity only for the offering types listed
under waldur_offering_uuid, and reports any other type
as a missing object rather than as an unsupported one.
The agent keeps processing the offering: the identity, its service and its processors are telemetry, and the agent's actual work — orders, membership sync, usage reporting — goes through the marketplace API and does not touch them. What you lose until the offering type is accepted:
- the agent does not appear in Waldur's agent monitoring view, so there is no version, uptime, dependency or processor information for it;
- log shipping never starts. A shipper is keyed by the agent identity's UUID, so without an
identity there is nothing to attach a batch to — and the endpoint that receives the batches
applies the same offering-type restriction, so it would refuse them anyway. Agent logs stay in
the service's own output (
journalctl -u waldur-agent-*.service).
What to do:
- Confirm the offering's type, using the agent's own token:
1 2 3 | |
- If it comes back
404, the UUID inwaldur_offering_uuidis wrong or belongs to another Waldur instance — the offering name in the log line comes from your configuration file, not from the API, so a stale UUID looks identical to this symptom. - If the type is not one of the supported ones, either move the agent to an offering of a supported type, or ask your Waldur operator to widen the accepted types on the server.
Waldur API Issues
- Test API connectivity:
1 | |
- Verify SSL certificates if using HTTPS
Debug Mode
Enable debug logging by setting log_level in the agent configuration file:
1 | |
Performance Tuning
Environment variables
Set these in a unit drop-in (systemctl edit <unit>):
All names start with WALDUR_SITE_AGENT_:
| Variable | Default | Effect |
|---|---|---|
…ORDER_PROCESS_PERIOD_MINUTES |
5 |
order_process polling interval (fractions allowed) |
…MEMBERSHIP_SYNC_PERIOD_MINUTES |
5 |
membership_sync polling interval (whole minutes) |
…REPORT_PERIOD_MINUTES |
30 |
report interval (whole minutes) |
…RECONCILIATION_PERIOD_MINUTES |
60 |
Event mode: periodic reconciliation (whole minutes) |
…STOMP_UNHEALTHY_AFTER_MINUTES |
15 |
Event mode: STOMP downtime before liveness fails |
…HEARTBEAT_PATH |
/tmp/waldur-site-agent-heartbeat |
Liveness heartbeat file (set per unit) |
In event mode the reconciliation covers orders, resource API keys, offering users and the project hierarchy.
A fractional value for a "whole minutes" variable stops the agent at startup.
1 2 3 | |
Resource Limits
Add resource limits to service files:
1 2 3 | |
Backup and Recovery
Configuration Backup
1 2 3 4 5 6 7 | |
Service State
The agent is stateless, but consider backing up:
- Configuration files
- Custom systemd service modifications
- Log files (if needed for auditing)
Scaling Considerations
Multiple Backend Support
The agent supports multiple offerings in a single configuration file. Each offering can use different backends:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
Each backend's plugin must be installed in the agent's environment (see Installation).
High Availability
For HA deployment:
- Run one set of services per offering configuration; two agents processing the same offering
race each other on orders and API key commands. An API key acknowledgement does not name the
command it answers, so a race can leave Waldur storing a rotated-away key value that the
backend no longer accepts. The Helm chart refuses more than one replica of
event-process or order-process, and any rollout strategy other than
Recreate, which would run the old and new pod together; for systemd and Docker deployments this note is the only guard - Restart is automatic (
Restart=on-failure); use the per-unit liveness check above for monitoring - Implement cluster-level monitoring
- Consider using configuration management tools (Ansible, Puppet, etc.)