console.yaml
# console.yaml
kind: console # what the file is (required)
bind: 0.0.0.0:8090 # host:port (default 127.0.0.1:8090); not loopback: needs auth
auth: # as serve.yaml's: API keys (digests only) and/or a JWT issuer
api_keys: [{id: ops, sha256_env: SW_CONSOLE_OPS_SHA256}]
jwt: {issuer: https://idp.example.com, audience: sw-console, jwks_url: https://idp.example.com/jwks}
links:
logs: "https://logs.example.com/search?q={request_id}" # a batch's logs ({request_id}, {job_id}): a new tab
cache: {clients: 20, ttl: 10m} # clients kept open at once; how long their secrets are kept
defaults: # merged into every client (a client's own keys win)
lookups:
db: {type: aws_secretsmanager, secret_id: "sw/clients/{{ client.id }}/state", region: us-east-1}
secrets:
password: {lookup: {from: db, field: password}}
include: [clients/*.yaml] # one file per client, each holding only `clients:`
# clients/acme.yaml
kind: console # optional here: then this file validates on its own too
clients:
acme: # the client's id: letters, digits, _ . - (its URL segment)
name: Acme Corp # shown in the picker (default: the id)
principals: [ops, acme-team] # who may see it: API key ids, JWT subjects or groups
log_principals: [ops] # who of them may read its runs' log files (default: all of them)
stores: # one or more state databases, by name
main:
state: # serve.yaml's `state` block: a url, or a connection and schema
connection: {provider: postgres, host: acme-db.internal, database: streamwright,
user: console_ro, password: "{{ secrets.password }}"}
schema: sw
logs: {dir: /mnt/sw-logs/acme} # its runs' --log-dir, as this host sees it
eu:
state: {url: "mysql://console_ro:{{ secrets.eu_password }}@acme-eu-db/sw"}
lookups: # the client's own, beside the defaults
eu: {type: aws_secretsmanager, secret_id: sw/clients/acme/eu, region: eu-west-1}
secrets:
eu_password: {lookup: {from: eu, field: password}}
| Key | What it does | Default |
|---|---|---|
kind | Always console: what the file is. An included file may say it too (then it validates on its own). | required |
bind | host:port the console listens on. Not loopback: auth is required. | 127.0.0.1:8090 |
auth | API keys and a JWT issuer, as in serve; login: the login page. | none (loopback only) |
clients | The clients, by id: name, principals, ack_principals, log_principals, stores, lookups, secrets. A store's state is serve.yaml's block (url, or connection and schema), not a job's runtime.state: SQLite is url: sqlite:///PATH, a relative PATH starting at the file that declares the client. A store's logs.dir is the folder its runs write their log files to, as this host sees it. | |
include | Files (paths or globs, relative to console.yaml) holding more clients:. A client declared twice is an error. | |
defaults | lookups and secrets every client gets. {{ client.id }} and {{ client.name }} are filled in per client. | |
cache.clients | How many clients stay open at once (least recently used first out). | 20 |
cache.ttl | How long an open client and its looked-up secrets are kept (30s, 10m, 2h). | 10m |
links.logs | A URL to a batch's logs; {request_id} and {job_id} are filled in. | none |
allow_lookup_exec | command and function lookups may run. | false |
Run logs
When a store's runs keep their own log files (--log-dir, or STREAMWRIGHT_LOG_DIR), give the store logs.dir: the
same folder, as the console's host sees it. That is the folder itself on the same host, or a shared mount (NFS, EFS)
when the jobs run elsewhere. A run's page then has a Log tab (what it shows),
read from there a page at a time (the API); a file the console cannot reach is reported with the host
and path the run wrote it on. This works for job runs and source runs (a source with runtime.state).
Logs can hold row values (a step's log:, DEBUG network lines), unlike the rest of the console: log_principals
narrows who may read them.
console.yaml takes no cors: the page and its API come from one origin. (serve.yaml's cors is for pages on
other origins calling serve.)
streamwright validate console.yaml checks every file, including the included ones, without running a lookup or
opening a database.