service_config.yaml reference¶
Every node service reads one YAML file, config/service_config.yaml, when it starts. It tells the
service which ports to serve, which message broker to use, where the service registry is, how to
validate the engine's tokens and under which namespace and container name its nodes appear in the
palette. After this page you can read the template file line by line, know which keys you must
change for your own node service, and know which environment variables the process expects.
How the configuration is loaded¶
The node service builds a single NodeServiceConfig object during startup, before the gRPC and
HTTP servers open. The values come from three layers. A higher layer wins over a lower one.
| Layer | Source | Notes |
|---|---|---|
| 1 (highest) | Process environment | Nested keys use the form section__key, case-sensitive: grpc__port=6000 overrides grpc.port. GRPC__PORT is ignored. |
| 2 | The YAML file | Path taken from ENVVAR_CFG_PATH; default config/service_config.yaml, relative to the working directory. |
| 3 (lowest) | Built-in defaults | The Default column of the full key table. |
Three properties of this loader cause most configuration surprises:
Unknown keys are accepted silently
Every block allows extra keys. A typo such as registry_confg: or an obsolete key such as
jwt.admin_role produces no error and no warning; the key is simply never read. When a setting
seems to have no effect, compare its spelling with the full key table.
A missing file is not an error
If the path in ENVVAR_CFG_PATH does not exist, the service starts with built-in defaults:
gRPC on port 1, no registry endpoint, no JWT applications. The node then runs but never appears
in the palette. Check the container's working directory and the variable first when a node
"starts fine" but is invisible.
Sub-blocks also read bare environment variable names
Each block (grpc, http, mqtt, ...) is its own settings class and reads its field names
from the environment, case-insensitive, whenever the YAML leaves the key unset. A stray
PORT=1234 in the container sets http.port (and grpc.port if the YAML does not set it).
Always set grpc.port and http.port explicitly in the file.
Annotated example¶
This is the file shipped with the node template. Replace __YOUR_NODE_CONTAINER_NAME__ with your
node container's kebab-case name; it appears twice on purpose.
# config/service_config.yaml
grpc: # The engine drives your nodes over this gRPC server.
address: "127.0.0.1" # Bind address. Use "0.0.0.0" when the engine is not on the same host.
port: 50091 # Registered as the node endpoint unless registry_config.node_cluster_target is set.
http: # Small HTTP server next to gRPC (GET / answers "pong").
address: "127.0.0.1"
port: 8089 # The template's Docker healthcheck targets this port.
mqtt: # Triggers and MQTT data edges travel over this broker.
broker_host: "localhost"
broker_port: 1883
client_id: "neuraverse-node-__YOUR_NODE_CONTAINER_NAME__" # Must be unique per running container.
keep_alive: 60
registry_config:
registry_endpoint: "127.0.0.1:8500" # host:port of the service registry. Empty = no registration, no palette entry.
# Deployment namespace the node registers under; must match the engine it runs next to.
node_namespace: "gateway" # Default "gateway". Edge deployments use their own value (for example the robot name).
metrics:
is_enabled: true
http_port: 9052 # Prometheus scrape port. Separate from http.port.
default_sliding_timewindow_seconds: 60
jwt: # Validation of the tokens the engine sends with every gRPC call.
auth_type: "Bearer"
algorithm: "RS256"
domain: "account.dev.neuraverse.com" # Issuer and JWKS URL are derived from this domain for every application below.
applications: # Required. One entry per token kind; keep all three.
spa:
audience: "tf-neuraverse-infra-auth-api"
auth0_mgmt:
audience: "https://neuraverse-dev.eu.auth0.com/api/v2/"
m2m_default:
audience: "tf-neuraverse-infra-auth-api"
# Container name published with every node class in the registry; keep it equal to the image name.
container_name: "neuraverse-node-__YOUR_NODE_CONTAINER_NAME__"
Keys you must get right¶
Most keys can stay at their defaults. These are the ones that decide whether your node is reachable and visible.
| Key | What depends on it |
|---|---|
grpc.address, grpc.port |
The engine calls this endpoint. When registry_config.node_cluster_target is empty, address:port is what gets registered, so 127.0.0.1 only works with an engine on the same host. |
http.address, http.port |
The HTTP server. The template's compose healthcheck calls this port; keep the two in sync. |
mqtt.* |
The trigger adapter and MQTT data edges connect with these settings. Two containers with the same client_id on one broker keep disconnecting each other. |
registry_config.registry_endpoint |
Empty string: the SDK logs Registry endpoint not configured, skipping registration. and the node never reaches the palette. |
registry_config.node_namespace |
Stored with every node registration. The engine compares it with its own namespace to decide whether a node is remote. Never write an is_remote value yourself; the SDK publishes that entry. |
container_name |
Stored with every node registration as container. It separates equally named nodes shipped by different containers in one namespace. Leave it empty and two containers can shadow each other. |
jwt.domain, jwt.applications |
The validator picks an application from the token's claims and rejects the call with No authentication application configured for token when that entry is missing. The engine forwards the token of whoever called it, so a browser session resolves to spa and a machine-to-machine token to m2m_default; keep all three entries. Per application, issuer and jwks_url default to https://<domain>/ and https://<domain>/.well-known/jwks.json. |
service_descriptor.version |
Used as the node version when a node class does not set node_version. Falls back to 1.0.0. |
Optional connections, each only active when set:
| Key | Enables |
|---|---|
zenoh |
A Zenoh session for Zenoh data edges. Default null; leave it out unless the engine routes one of your edges over Zenoh, in which case the node needs it to serve that port (SDK 2.40.1 and newer). |
livekit_url |
Fallback LiveKit URL for data visualization when the start request carries none. |
node_engine_endpoint, node_engine_use_tls |
The client for the engine-side key/value data repository. With an empty endpoint no channel is opened. |
scene_builder_endpoint |
The scene builder client. |
project_service_v2_endpoint, project_service_v2_use_tls |
The project-v2 scene client (SDK 2.51.0 and newer, Python and C++). When the endpoint is set, get_frames(), get_robots() and get_paths() use it instead of scene_builder_endpoint. TLS defaults to on. See Platform data. |
Tuning keys¶
| Key | Default | When to change it |
|---|---|---|
grpc_server_max_workers |
50 |
Thread pool of the gRPC server. Every initialized node pins two long-lived streaming workers (status and health), so size it at about twice the number of node instances one service must host, plus headroom for ordinary calls. |
status_stream_heartbeat_interval_s |
1.0 |
Re-send interval of the last node status. 0 disables the heartbeat. |
health_stream_check_interval_s |
10.0 |
How often the SDK calls your on_health_check(). 0 disables periodic checks. See Health reporting. |
escalate_unhealthy_to_error |
false |
Move a running node to ERROR after it stays unhealthy for unhealthy_escalate_after_s. Off unless you opt in. See Escalate unhealthy to ERROR. |
unhealthy_escalate_after_s |
7.0 |
Continuous unhealthy duration required before that escalation. |
viz_sources_ready_timeout_s |
10.0 |
Upper bound for waiting on the visualization streamer before publishing starts anyway. |
runtime.executor_max_workers |
unset | Size of the asyncio default executor; Python's own default applies when unset. |
escalate_unhealthy_to_error and unhealthy_escalate_after_s are new. Both are
ignored by an older SDK, where a health fault never changes the node state. See
Escalate unhealthy to ERROR.
Full key table¶
Generated from the SDK source; every key of every block with its type and default.
Two grpc: keys the SDK does not read
grpc.max_workers and grpc.reflection_enabled come from the shared service library. The
SDK builds its own gRPC server: the pool size is the top-level grpc_server_max_workers
above, and server reflection is always enabled.
Top level (service_config.yaml):
| Key | Type | Default | Meaning |
|---|---|---|---|
runtime |
RuntimeConfig |
RuntimeConfig(executor_max_workers=None) |
|
jwt |
JwtConfig |
(nested) | Jwt configuration |
grpc |
GrpcConfig |
(nested) | gRPC API config |
http |
HttpConfig |
(nested) | HTTP API config |
logging |
LogConfig |
(nested) | Logging config |
metrics |
MetricsConfig |
(nested) | Metrics config |
mqtt |
MQTTConfig |
(nested) | MQTT config |
zenoh |
ZenohConfig \| None |
None |
Zenoh config |
registry_config |
RegistryConfig |
(nested) | Service Registry config |
service_descriptor |
NodeServiceDescriptor |
(nested) | Service descriptor |
container_name |
str |
'' |
Name of the container |
scene_builder_endpoint |
str |
'' |
Scene builder client endpoint |
project_service_v2_endpoint |
str |
'' |
Project service v2 endpoint. When set, frames and paths come from project-v2 instead of scene_builder_endpoint |
project_service_v2_use_tls |
bool |
True |
Use TLS for the project service v2 client |
node_engine_endpoint |
str |
'' |
Node engine client endpoint |
node_engine_use_tls |
bool |
True |
Use TLS for node engine client |
livekit_url |
str |
'' |
LiveKit server WebSocket URL (e.g., wss://livekit.dev.neuraverse.com) |
status_stream_heartbeat_interval_s |
float |
1.0 |
Interval in seconds for periodic re-send of the last known node status on the status stream. Keeps the stream alive on long-running graphs and gives reconnecting subscribers fast visibility of the current state. Set to 0 (or negative) to disable. |
health_stream_check_interval_s |
float |
10.0 |
Interval in seconds for the in-node health monitor to run get_health_check() and push updates on the health stream when the (isHealthy, message) snapshot changes. Set to 0 (or negative) to disable periodic checks. |
escalate_unhealthy_to_error |
bool |
False |
Move a running node to ERROR when it remains unhealthy beyond the configured debounce period. |
unhealthy_escalate_after_s |
float |
7.0 |
Seconds a running node must remain unhealthy before escalation. |
stop_execution_join_timeout_s |
float |
5.0 |
Seconds every hard stop waits, after on_stop_execution(), for a running on_execute() to return before the teardown chain, on_stop() and on_cleanup() proceed anyway. |
grpc_server_max_workers |
int |
50 |
gRPC server thread pool size (max concurrent RPC handlers). Each long-lived server-streaming subscription (node status / health) pins one worker for its lifetime and the engine opens both per initialized node, so this bounds how many nodes one node service can serve concurrently — size it at roughly 2x the expected node count plus headroom for unary RPCs. |
viz_sources_ready_timeout_s |
float |
10.0 |
Maximum seconds to wait for the LiveKit data-visualization streamer to register its video sources before wiring the publish hook anyway. A flaky signaling endpoint cannot hang StartDataVisualization beyond this bound. On timeout the controller logs a WARNING and proceeds; the first publishes may drop until LiveKit catches up. |
runtime: block (RuntimeConfig):
| Key | Type | Default | Meaning |
|---|---|---|---|
executor_max_workers |
Optional[int] |
None |
Max threads in the asyncio default executor; defaults to Python built-in (min(32, cpu_count+4)) when unset |
jwt: block (JwtConfig):
| Key | Type | Default | Meaning |
|---|---|---|---|
AUTH_CLIENT_ID |
str |
'Not set' |
Default client ID |
AUTH_IDP_API_CLIENT_ID |
str |
'Not set' |
Auth0 Client ID for Machine to Machine Application |
AUTH_IDP_API_CLIENT_SECRET |
str |
'Not set' |
Auth0 Client Secret for Machine to Machine Application |
FOR_LOCAL_DEVELOPMENT_IDP_API_TOKEN_OVERRIDE |
str |
'' |
Auth0 management API token - so we do not fetch a new one every time in local development |
AUTH_JWKS_URL |
str |
'Not set' |
JWKS endpoint URL |
AUTH_ISSUER |
str |
'Not set' |
JWT issuer |
auth_type |
str |
'Bearer' |
Authentication type |
algorithm |
str |
'RS256' |
JWT signing algorithm |
domain |
str |
'Not set' |
Auth0 domain for default application |
jwks_ttl_days |
int |
1 |
Time-to-live for cached JWKS in days, defaults to 1 day |
token_cache_size |
int |
1000 |
Maximum size of the token cache |
token_cache_ttl_seconds |
int |
32400 |
Time-to-live for cached tokens in seconds, defaults to 9 hours |
applications |
Dict[Union[neuraverse_common.models.config.config_source.JwtConfig.AuthApplicationName, str], neuraverse_common.models.config.config_source.JwtConfig.AuthAppConfig] |
{} |
Configuration for different Auth0 applications |
grpc: block (GrpcConfig):
| Key | Type | Default | Meaning |
|---|---|---|---|
address |
str |
'[::]' |
gRPC address |
port |
int |
1 |
gRPC port |
log_request_body_on_failure |
bool |
True |
In case request failed with exception our BaseApiServicerV2 wrapper will make sure the request is logged if TRUE. |
log_request_body_on_log_level |
str |
'debug' |
If you set it to 'info' or 'debug' then inbound request will be logged on that level - setting to None will turn this feture off. Defult is 'debug' |
log_response_body_on_log_level |
str |
'debug' |
If you set it to 'info' or 'debug' then outbound response will be logged on that level - otherwise not at all. Default is 'debug' |
reflection_enabled |
bool |
False |
Enable gRPC server reflection. Should be True only in development/staging environments, never in production. |
max_workers |
int |
10 |
Maximum number of threads in the gRPC server ThreadPoolExecutor. Increase for services with high inbound concurrency. |
http: block (HttpConfig):
| Key | Type | Default | Meaning |
|---|---|---|---|
address |
str |
'0.0.0.0' |
HTTP address |
port |
int |
8080 |
HTTP port |
root_path |
str |
'/' |
Root path for the HTTP server |
reload |
bool |
False |
Enable uvicorn auto-reload on code changes. Should only be enabled for local development. |
log_request_details_on_failure |
bool |
True |
In case request failed with exception our BaseFastApiEndpointSet@with_execution_context_rest_with_logs wrapper will make sure the request is logged if TRUE. |
log_request_details_on_log_level |
str |
'debug' |
If you set it to 'info' or 'debug' then inbound request will be logged on that level - setting to None will turn this feture off. Defult is 'debug' |
log_response_details_on_log_level |
str |
'debug' |
If you set it to 'info' or 'debug' then outbound response will be logged on that level - otherwise not at all. Default is 'debug' |
logging: block (LogConfig):
| Key | Type | Default | Meaning |
|---|---|---|---|
ENVVAR_LOG_CFG_PATH |
str |
'Not set' |
The path of the log-config file we used to configure logging |
metrics: block (MetricsConfig):
| Key | Type | Default | Meaning |
|---|---|---|---|
is_enabled |
bool |
True |
If set to False then basically metrics is disabled completely. |
http_port |
int |
9008 |
HTTP port of Prometheus scraping endpoint |
GC_COLLECTOR_enabled |
bool |
False |
If True then GC related metrics will be exposed - otherwise not |
PLATFORM_COLLECTOR_enabled |
bool |
False |
If True then PlatformCollector related metrics will be exposed - otherwise not |
PROCESS_COLLECTOR_enabled |
bool |
False |
If True then ProcessCollector related metrics will be exposed - otherwise not |
default_sliding_timewindow_seconds |
int |
60 |
For statistical calculations this is the reveant time window size measured in seconds |
mqtt: block (MQTTConfig):
| Key | Type | Default | Meaning |
|---|---|---|---|
broker_host |
str |
'[::]' |
MQTT broker address |
broker_port |
int |
1883 |
MQTT broker port |
client_id |
str |
'neuraverse_node' |
MQTT client id for the connection |
username |
Optional[str] |
None |
MQTT username |
password |
Optional[str] |
None |
MQTT username |
keep_alive |
int |
120 |
MQTT keep alive interval in seconds |
clean_session |
bool |
True |
MQTT clean session flag |
qos |
int |
1 |
MQTT Quality of Service level |
retain |
bool |
False |
MQTT retain flag for messages |
reconnect_delay_min |
float |
1.0 |
MQTT minimum reconnect delay in seconds |
reconnect_delay_max |
float |
60.0 |
MQTT maximum reconnect delay in seconds |
zenoh: block (ZenohConfig):
| Key | Type | Default | Meaning |
|---|---|---|---|
locator |
str |
'tcp/zenoh-router:7447' |
Zenoh router endpoint to connect to (e.g. tcp/zenoh-router:7447) |
mode |
str |
'client' |
Zenoh session mode: client, peer, or router |
priority |
str |
'data' |
QoS message priority: real_time, interactive_high, interactive_low, data_high, data, data_low, background |
reliability |
str |
'reliable' |
QoS reliability: reliable or best_effort |
congestion_control |
str |
'drop' |
QoS congestion control when network is saturated: block or drop |
express |
bool |
False |
QoS express flag: bypass internal batching for lower latency |
registry_config: block (RegistryConfig):
| Key | Type | Default | Meaning |
|---|---|---|---|
registry_endpoint |
str |
'' |
Nodes Registry Endpoint |
node_cluster_target |
str |
'' |
Nodes endpoint in the cluster |
node_external_target |
str |
'' |
External URL (host:port) when the node is reachable from outside the cluster; stored in registry for is_remote resolution. |
node_namespace |
str |
'gateway' |
Logical deployment namespace this node registers under (e.g. 'gateway', 'robot1'); disambiguates the same node class deployed on multiple hosts in the central registry and is used to compute is_remote. |
registration_timeout_s |
float |
120.0 |
How long the node's FIRST Consul registration keeps retrying while the agent cannot be reached. Registration runs before the gRPC server is up, so a Consul agent that is not listening yet (routine on a cluster restart) must not abort the bootstrap. When the budget runs out the node process exits and the container is restarted. Set to 0 to fail on the first attempt. |
registration_retry_delay_s |
float |
2.0 |
Initial delay between bootstrap registration attempts; doubles on each failure, capped at 60s. |
service_descriptor: block (NodeServiceDescriptor):
| Key | Type | Default | Meaning |
|---|---|---|---|
name |
str |
'Node SDK Service' |
Service name |
version |
str |
'1.0.0' |
Service version |
description |
str |
'' |
Service description |
Process environment variables¶
The node service reads these variables directly, in addition to the section__key overrides
described above. The template's set_env_defaults() in src/node_utils.py fills the first group
from pyproject.toml and the config/ directory when they are not already set, so a
docker compose run and a plain poetry run python src/run_nodes.py behave the same.
| Variable | Purpose |
|---|---|
ENVVAR_CFG_PATH |
Path of the service configuration YAML. Default config/service_config.yaml. The template also exports SERVICE_CONFIG with the same value; that name is the template's own and the SDK does not read it. |
ENVVAR_LOG_CFG_PATH |
Path of the logging configuration YAML (config/log_config.yaml in the template). Required: the SDK opens the file unconditionally, and an unset variable ends the bootstrap with a FileNotFoundError for the path Not set and exit code 1. |
SERVICE_NAME, SERVICE_TAG, API_VERSION |
Service name and version stamped on every log line and metric. The template derives the first two from name and version in pyproject.toml. API_VERSION defaults to 1. |
AUTH_ISSUER, AUTH_JWKS_URL |
Deprecated. They still populate two fields of the jwt block, but token validation uses jwt.domain and jwt.applications. The template exports them for compatibility; you do not need to set them. |
ROS_DOMAIN_ID |
Read by ROS 2, not by the SDK. All node containers and the engine on one host must share the value or ROS data edges stay silent. |
The first registration with the service registry retries while the registry is unreachable,
for up to registry_config.registration_timeout_s (default 120) seconds, starting at
registry_config.registration_retry_delay_s (default 2) seconds and doubling up to 60. When
the budget is spent the process exits with code 1 so the container restarts instead of running
without a palette entry. Set the timeout to 0 to fail on the first attempt. In a node service
the YAML keys always apply; the variables NEURAVERSE_CONSUL_REGISTRATION_TIMEOUT_S and
NEURAVERSE_CONSUL_REGISTRATION_RETRY_DELAY_S are only the fallback defaults for code that
constructs the registry client directly. To change the budget from the environment use
registry_config__registration_timeout_s.
Developer-only variables (NEURAVERSE_SDK_MOCK_STATUS*, NEURAVERSE_ADMIN_ALLOWLIST_PATH,
NEURAVERSE_PROFILER_*) switch on SDK test doubles, the operator API and the memory profiler; they
are not needed to run a node and are described in the
SDK internals.
Local run versus deployment¶
Locally, the template's docker-compose.yml passes the variables above into the container and the
file in config/ is baked into the image, so the same YAML serves both. On an engine the deployment
supplies registry_endpoint, node_namespace, the broker address and the jwt block for that
site; see Deploying on an engine. The project structure that holds config/,
src/run_nodes.py and src/node_utils.py is described in
Project layout and build.