Middleware for the integration of a QPU into an HPC center. It is composed of two main components:
- an API which receives jobs from users, validates and stores them in DB (external or SQLite)
- a worker which schedules the jobs and sends them for execution on a QPU
- Python 3.11 / 3.12
- make, git, curl, build toolchain
- munge
For optional/dev requirements, check CONTRIBUTING.md
Release process documentation lives in RELEASING.md.
Quick install/update (one-liner) - follow the instructions:
curl -fsSL https://raw.githubusercontent.com/pasqal-io/warden/main/install.sh | bashNotes:
- The installer currently checks out tag
WARDEN_VERSION=v0.1.0, can be overridden - Make sure you have the rights to create the target Warden folder
/opt/warden - Make sure you change your configuration at
/opt/warden/config.yaml - If you need to change the database type used (e.g. from SQLite to PSQL), you need to run the install process again to install the required dependencies
cd /opt/warden && make runDepending on your use-case and specific situation, you may want to run Warden in a different way.
One option is to use a systemd configuration like the one described in docs/install/systemd.
Configuration is done:
- using the config file
config.yamlat the project root - using environment variables - takes precedence over the config file
Configuration keys from config.yaml can be set or overridden by environment variables by converting the key path to uppercase, prefixing it with WARDEN_, and separating nested keys with underscores.
For example, given the following YAML:
database:
# It's best not to set secrets in a file on-disk
# password: secretSince it's best not to have secrets written on disk, we set it using an environment variable:
WARDEN_DATABASE_PASSWORD="secret"The following options are configurable:
- API bind address and port
- QPU API uri
- Database backend
- Scheduler polling intervals
- Logging (see
config.yamlfor more configuration details)
The API server host and port are configurable through the YAML config or environment:
| Path | Variable | Description | Default | Required | Example Value |
|---|---|---|---|---|---|
api.host |
WARDEN_API_HOST |
API bind host address | 0.0.0.0 |
Yes | 127.0.0.1 |
api.port |
WARDEN_API_PORT |
API bind port | 8006 |
Yes | 8080 |
Warden's access to the PASQAL QPU can be configured through the YAML config or environment:
| Path | Variable | Description | Default | Required | Example Value |
|---|---|---|---|---|---|
qpu.uri |
WARDEN_QPU_URI |
PASQAL QPU API uri | http://localhost:8005 |
Yes | http://127.0.0.1:8005 |
The API server can also be configured to only accept new jobs from configured user IDs:
| Path | Description | Default | Required | Example Value |
|---|---|---|---|---|
api.authorized_users |
List of user IDs auhorized to create new jobs | [] |
Yes | ["1000", "2000", "0"] |
The default value [] allows all users to create new jobs.
Warden supports the following databases:
- Local SQLite (default)
- PostgreSQL
- MariaDB
Below is a table of all configuration variables available for Warden's database:
| Path | Variable | Description | Default | Required | Example Value |
|---|---|---|---|---|---|
database.backend |
WARDEN_DATABASE_BACKEND |
Backend type for the database. Supported: sqlite, postgres, mariadb |
sqlite |
Yes | postgres |
database.name |
WARDEN_DATABASE_NAME |
Name of the database (filename for sqlite, db name for postgres/mariadb) | Yes | warden.db warden |
|
database.host |
WARDEN_DATABASE_HOST |
Host address of the database server (PostgreSQL/MariaDB) | localhost |
No | localhost |
database.port |
WARDEN_DATABASE_PORT |
Port for connecting to the database server (PostgreSQL/MariaDB) | 5432/3306 |
No | 5432 |
database.user |
WARDEN_DATABASE_USER |
Username for the database connection (PostgreSQL/MariaDB) | If using Postgres/MariaDB | postgres |
|
database.password |
WARDEN_DATABASE_PASSWORD |
Password for the database user (PostgreSQL/MariaDB) | If using Postgres/MariaDB | secretpassword |
Note:
- IT IS RECOMMENDED NOT TO SAVE PASSWORDS IN CLEARTEXT FILES SUCH AS
config.yaml! - Only
WARDEN_DATABASE_BACKENDandWARDEN_DATABASE_NAMEare required for SQLite (default), which are set in the default config file. - For PostgreSQL, you must provide at least
WARDEN_DATABASE_USERandWARDEN_DATABASE_PASSWORD, and oftenWARDEN_DATABASE_HOSTandWARDEN_DATABASE_PORTdepending on your environment. - All variables can be set in the
config.yamlfile (but passwords should not) or as an environment variable.
Example for PostgreSQL:
# config.yaml
database:
backend: postgres
name: warden
host: localhost
port: 5432
user: postgresSecrets are defined as environment variables:
WARDEN_DATABASE_PASSWORD=secretpasswordYou can configure Warden to reject all incoming jobs by running the following target as root user:
make set-accessible IS_ACCESSIBLE=false MESSAGE="Scheduled QPU maintenance"Configure Warden to accept jobs again by configuring:
make set-accessible IS_ACCESSIBLE=true MESSAGE="Maintenance done"