Document configuration yaml files

This commit is contained in:
Ilgiz Kamelyev 2026-04-24 17:38:19 +05:00
parent 5fe61fd693
commit 03c59d4b0b
9 changed files with 115 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# Optional environment overrides for the systemd unit.
WF_AGENT_CONFIG_DIR=/etc/wf-agent
# Log level override if you do not want the default INFO level.
WF_AGENT_LOG_LEVEL=INFO

View File

@ -1,21 +1,36 @@
# Root application config loaded by both backend and CLI entrypoints.
app:
# Human-readable application name used in logs and diagnostics.
name: wf-agent-gen4
# Stable instance identifier for the deployment node.
instance_id: host-default
# Deployment environment label.
environment: production
runtime:
# Graceful shutdown budget for backend service loops.
shutdown_timeout_sec: 20
# Use journald-friendly logging by default.
journald_logging: true
paths:
# Shared state directory for caches, spool, and runtime state.
state_dir: /var/lib/wf-agent
# Runtime directory for transient sockets and PID-like artifacts.
run_dir: /run/wf-agent
includes:
# Event contour wiring and settings.
- events.yaml
# Command contour wiring and settings.
- commands.yaml
# Scheduled command definitions.
- cron.yaml
# Observability settings for traces and snapshots.
- observability.yaml
# File-based event listener definition.
- listeners/file.yaml
# D-Bus event listener definition.
- listeners/dbus.yaml
# D-Bus command executor definition.
- executors/dbus.yaml

View File

@ -1,20 +1,34 @@
# Command contour baseline: dispatcher, spool, and websocket bridge.
commands:
# Enable the command contour in the backend service.
enabled: true
dispatcher:
# Default command timeout for request execution.
default_timeout_ms: 10000
# Default request priority when none is provided by the caller.
default_priority: NORMAL
spool:
# Enable the command spool.
enabled: true
# Allow at most ten thousand queued command entries.
max_items: 10000
# Queue accepted commands immediately unless constrained by policy.
default_queueing_policy: ENQUEUE_ALWAYS
# Do not retry commands unless the request explicitly allows it.
default_retry_policy: NO_RETRY
# Poll the scheduler often enough for short command workloads.
scheduler_tick_ms: 200
bridge:
# Enable the websocket bridge for command submission and results.
enabled: true
# Use websocket as the northbound transport.
transport: websocket
# Bind locally by default; override in deployment if needed.
bind_host: 127.0.0.1
# Default command bridge port.
bind_port: 18101
# Websocket path used by CLI submit/cancel flows.
websocket_path: /commands

View File

@ -1,19 +1,38 @@
# Scheduled command jobs executed by the command contour.
cron:
# Enable scheduled command emission.
enabled: true
# Cron jobs are evaluated independently by the runtime scheduler.
jobs:
# Periodic status poll for the D-Bus command executor.
- cron_id: periodic-status
# Keep the job active while the contour is enabled.
enabled: true
# Run every five minutes.
schedule_expr: "*/5 * * * *"
# Ignore missed runs instead of replaying them.
misfire_policy: SKIP_MISSED
# Prefer low priority for background checks.
default_priority: LOW
# Stop the command if it exceeds five seconds.
default_timeout_ms: 5000
# Template used to build the command request for each run.
template:
# Command request header fields.
header:
# D-Bus command kind emitted by this cron job.
command_kind: status
# Target type for the executor selection logic.
target_type: dbus
# D-Bus service or object target identifier.
target_id: fi.w1.wpa_supplicant1
# Mark the cron scheduler as the issuer.
issuer_type: cron
# Stable issuer identifier for the job.
issuer_id: periodic-status
# Expect a command response back from the executor.
expects_response: true
# Command request payload.
payload:
# No positional arguments for the periodic status probe.
args: []

View File

@ -1,27 +1,46 @@
# Event contour baseline: cache, spool, and websocket bridge.
events:
# Enable the event contour in the backend service.
enabled: true
dispatcher:
# Fan out accepted events to the cache and spool.
fanout:
# Store routed events in the in-memory event cache.
cache: true
# Place routed events into the spool for bridge delivery.
spool: true
cache:
# Enable the event cache.
enabled: true
# Keep cached events for five minutes by default.
ttl_sec: 300
# Bound the cache size to avoid unbounded memory growth.
quantity_limit: 10000
spool:
# Enable the event spool.
enabled: true
# Allow at most twenty thousand queued events.
max_items: 20000
# Default priority for event spool entries.
default_priority: NORMAL
# Default delivery mode for spooled events.
default_delivery_mode: BEST_EFFORT
# Retry spooled events with backoff when delivery fails.
default_retry_policy: RETRY_BACKOFF
# Initial retry delay in milliseconds.
default_retry_backoff_ms: 1000
bridge:
# Enable the websocket bridge for event subscriptions.
enabled: true
# Use websocket as the northbound transport.
transport: websocket
# Bind locally by default; override in deployment if needed.
bind_host: 127.0.0.1
# Default event bridge port.
bind_port: 18100
# Websocket path used by CLI subscribers.
websocket_path: /events

View File

@ -1,15 +1,23 @@
# D-Bus executor baseline for command contour requests.
executor:
# Stable executor name used in runtime logs.
name: dbus-default
# Executor implementation type.
type: dbus
# Enable this executor in the backend service.
enabled: true
# Higher priority executors are selected first.
priority: 100
bus:
# Execute commands on the system bus by default.
kind: system
selection:
# Executor is selected for D-Bus targets only.
target_types:
- dbus
# Support these command kinds.
command_kinds:
- status
- scan
@ -19,4 +27,5 @@ selection:
- set_property
timeouts:
# Default executor timeout in milliseconds.
default_timeout_ms: 10000

View File

@ -1,22 +1,37 @@
# D-Bus listener baseline for system-bus signal ingestion.
listener:
# Stable listener name used in runtime logs.
name: dbus-events
# Listener implementation type.
type: dbus
# Enable this listener in the backend service.
enabled: true
connection:
# Select the D-Bus bus type used by the listener.
bus_type: system
subscriptions:
# Match InterfaceAdded notifications from wpa_supplicant.
- bus_name: fi.w1.wpa_supplicant1
# Observe the root object for interface lifecycle changes.
object_path: /fi/w1/wpa_supplicant1
# Signals are emitted on the wpa_supplicant interface.
interface_name: fi.w1.wpa_supplicant1
# Capture the interface addition signal.
signal_name: InterfaceAdded
# Match property changes for the first interface object.
- bus_name: fi.w1.wpa_supplicant1
# Object path containing interface property updates.
object_path: /fi/w1/wpa_supplicant1/Interfaces/0
# PropertiesChanged comes from the standard D-Bus properties interface.
interface_name: org.freedesktop.DBus.Properties
# Capture property change notifications.
signal_name: PropertiesChanged
routing:
# Events emitted by this listener are classified as D-Bus sources.
source_type: dbus
# Stable source identifier for routing and subscriptions.
source_id: system-bus

View File

@ -1,24 +1,40 @@
# File listener baseline for NDJSON event ingestion.
listener:
# Stable listener name used in runtime logs.
name: file-events
# Listener implementation type.
type: file
# Enable this listener in the backend service.
enabled: true
connection:
# Input file containing newline-delimited event records.
path: /var/lib/wf-agent/in/events.jsonl
# Decode the input as UTF-8 text.
encoding: utf-8
acquisition:
# Tail the file and keep watching for appended events.
mode: file_tail
# Poll interval for file tailing in milliseconds.
poll_interval_ms: 500
# Start at the end of the file to avoid replaying old lines.
start_from_end: true
format:
# Expect JSON records.
type: json
# Input framing is newline-delimited JSON.
framing: ndjson
# Require an envelope object in each record.
require_envelope: true
# Require payload content to be present.
require_payload: true
# Require metadata content to be present.
require_meta: true
routing:
# Events emitted by this listener are classified as file sources.
source_type: file
# Stable source identifier for routing and subscriptions.
source_id: file-events

View File

@ -1,9 +1,15 @@
# Observability toggles for traces, counters, and status snapshots.
observability:
# Enable observability pipeline integration.
enabled: true
metrics:
# Enable metrics counters.
enabled: true
traces:
# Enable trace records for runtime events.
enabled: true
status_snapshots:
# Enable periodic runtime snapshots.
enabled: true
# Emit snapshots every 30 seconds.
interval_sec: 30