Waldur Site Agent
A stateless Python application that synchronizes data between Waldur Mastermind and service provider backends. Manages account creation, usage reporting, and membership synchronization across different cluster management systems.
Architecture
The agent uses a uv workspace architecture with pluggable backends:
- Core Package:
waldur-site-agent(base classes, common utilities) - Plugin Packages: Standalone backend implementations under
plugins/(see table below)
Agent Modes
order_process: Fetches orders and pending resource API key commands from Waldur and manages backend resourcesreport: Reports usage data from backend to Waldurmembership_sync: Synchronizes user membershipsevent_process: Event-based processing using STOMP
Installation
The core agent and every plugin are published to PyPI. The core package contains
no backends, so install it together with the plugins you need — all packages share
the same version number, so keep them in sync. waldur-site-agent-basic-username-management
provides the default username backend (base); include it unless the offering sets
another username_management_backend:
1 | |
See the plugin table below for the full list of published packages.
For Kubernetes, released Helm charts are published to a chart repository hosted on GitHub Pages:
1 2 3 4 | |
Release candidates are pre-release versions — add --devel to see and install
them. Configurable values are documented in the
chart README.
Usage
1 | |
-m,--mode:order_process(default),report,membership_syncorevent_process-c,--config-file: path to the configuration file (defaultwaldur-site-agent-config.yamlin the working directory)
Command-line tools
| Command | Purpose |
|---|---|
waldur_site_agent |
Run the agent in one mode |
waldur_site_diagnostics |
Check the configuration, Waldur access and the order processing backend; see Validation for what it checks |
waldur_site_load_components |
Create the offering's components in Waldur from backend_components |
waldur_site_healthz |
Liveness (heartbeat age) and readiness (Waldur reachable) probe for containers |
waldur_site_create_homedirs |
Create home directories for the offering's users |
waldur_sync_offering_users |
Run username generation and state transitions for the offering users once |
waldur_sync_resource_limits |
Reconcile resource limits once — by default the backend's limits are written to Waldur |
waldur_site_test_order |
Generate an order from a template and run it through a mock (or, with --use-real-backend, the real) backend |
waldur_site_load_historical_usage |
Backfill historical usage into Waldur |
The utility commands accept -c for the configuration file like the agent does;
waldur_site_healthz spells it --config-file (plus --max-age, --heartbeat-path and
--liveness-only). Run any of them with --help.
Logging
The agent emits structured logs in JSON format to stdout. This applies to both the core agent and CLI tools.
Example log entry:
1 | |
The level is set by log_level in the configuration file (default INFO).
Environment Variables
WALDUR_SITE_AGENT_ORDER_PROCESS_PERIOD_MINUTES: order processing period (default 5)WALDUR_SITE_AGENT_REPORT_PERIOD_MINUTES: reporting period (default 30)WALDUR_SITE_AGENT_MEMBERSHIP_SYNC_PERIOD_MINUTES: membership sync period (default 5)WALDUR_SITE_AGENT_RECONCILIATION_PERIOD_MINUTES:event_processreconciliation period (default 60)WALDUR_SITE_AGENT_STOMP_UNHEALTHY_AFTER_MINUTES: how long a STOMP consumer may stay down before liveness fails (default 15)WALDUR_SITE_AGENT_HEARTBEAT_PATH: liveness heartbeat file (default/tmp/waldur-site-agent-heartbeat)SENTRY_ENVIRONMENT: Sentry environment name
See Environment Variables for details.
Development
1 2 3 4 5 6 7 8 9 10 11 | |
Releasing
1 2 3 | |
See the Releasing Guide for details on version bumping, changelog generation, and what CI does after you push.
Documentation
For operators deploying the agent:
- Quickstart - the fastest path from a fresh install to a running, verified agent
- Installation Guide
- Configuration Reference
- Configuration Validation - what is checked on load, which errors stop the agent, and how to read them
- Deployment Guide
- Upgrading Guide
- Username Management
- SLURM Usage Reporting Setup
For contributors:
Plugins
License
MIT License - see LICENCE file for details.