Skip to content

Deploying on an engine

A node ships as one container that runs your node service next to a node engine. On startup the service registers every node class with the platform registry, and the graph editor's palette is built from that registry. There is no manifest to upload and no UI step. After this page you can name the deployment location of your node, build and tag a multi-architecture image, read the startup log to confirm the registration, and know what happens when the registry is not there yet.

Enabling external inputs

Deploy rebuilt Python or C++ node images containing SDK 2.45.0 and the ROS message packages declared by their inputs. The platform must support the input operations too; upgrading only the node image is insufficient.

Configure the graph before sending inputs and use its returned run ID. The authorized graph owner can inject data without starting execution, then send Start explicitly after acknowledgement. A target stopped through an input requires reconfiguration before accepting more input. See the external-input tutorial for the graph, tested examples and timeout/recovery behavior.

Hosting an application API

A NodeService can host custom gRPC services without graph-node classes. Clients discover those APIs through reflection on its known endpoint. A custom-only host registers no graph-node capability or schema. Mixed hosts retain the node registration behavior below.

Generate your application's bindings during its image build with neuraverse-generate-protos, then package those outputs with the service. The command ships with the SDK image and Python wheel; C++ generation needs the SDK builder toolchain. See Generate Python and C++ bindings.

For Python, release shared ROS nodes, watches and devices in the registered service class's on_shutdown() hook. On host termination the SDK drains the servers, calls the hook once, then forces process exit. See Service shutdown.

How a deployed node becomes visible

When the container starts, run() wires the service and, for every class you passed to set_node_classes(), creates one instance and calls its registration. Only then are the gRPC and HTTP servers started. The registration writes two things per class:

What Value Used by
A registry service capability-<ClassName>, with a service id that also carries node_namespace and container_name The engine resolves your class to a host:port at configure time.
A schema envelope Your <module>_schema.json plus name, version, namespace and container The engine lists it when the editor asks for available nodes; this feeds the palette.
sequenceDiagram
    participant C as Node container
    participant R as Registry
    participant E as Node engine
    participant U as Graph editor
    C->>R: register capability-<ClassName> + schema envelope (startup)
    U->>E: list available nodes
    E->>R: read services and schema envelopes
    E-->>U: palette entry per node, with its locations
    U->>E: configure graph
    E->>R: resolve capability-<ClassName> in the chosen location
    E->>C: Configure / Run / Stop over gRPC

Three consequences for you as an author:

  • Your class is instantiated at startup, before any graph exists. Keep __init__ free of side effects; open connections in on_configure(). See Node anatomy.
  • The schema file is read once, at startup. A change needs a container restart. See Schema file reference.
  • Self-registration needs SDK 2.29.1 or newer in your pyproject.toml and a node engine of version 2.13.0 or newer on the target host. Older 2.27.x and 2.28.x SDKs have a registration monitor bug and must not be deployed.

Tell the platform where the node runs

The same node class is often deployed on several hosts: the gateway and one or more robots. Two keys in config/service_config.yaml keep those deployments apart in the central registry:

registry_config:
  registry_endpoint: "127.0.0.1:8500"
  node_namespace: "gateway"        # the host this container runs on: gateway, robot1, ...

container_name: "neuraverse-node-my-node"  # unique per node repository, equal to the image name
Key Default What it means Rule
registry_config.node_namespace gateway The deployment location. Every container on one host uses the same value. Set it per host in the deployment, not in the image. Two hosts registering the same node under the same value overwrite each other in the central registry.
container_name "" The node repository this container ships. Set it once per repository and never reuse it. Two containers that register the same node name under the same container_name in one location collide: the engine keeps the first registration it reads and logs Duplicate registration of node ....
registry_config.registry_endpoint "" Where the registry agent listens. Leave empty only for local runs without an engine: the service then logs Registry endpoint not configured, skipping registration. and the node never appears in a palette.

The engine aggregates all registrations of one node into a single palette entry and writes the locations it found into that entry as a comma-separated node_namespace setting, for example gateway,robot1. The user picks one location when dropping the node. From that choice the engine computes is_remote (the chosen location differs from the engine's own) and the transport between nodes (same location: local transport; different locations: MQTT).

Never write these keys yourself

node_namespace, is_remote and node_deployment_host are injected by the platform. Do not put them in your schema's configuration block or in on_get_configuration(). A value you set is overwritten at best and routes your node to the wrong host at worst.

Two more registry keys matter only when the engine cannot reach your node at the address it serves on:

Key When to set it
registry_config.node_cluster_target The host:port the engine should dial instead of grpc.address:grpc.port, for example a Kubernetes service name.
registry_config.node_external_target The host:port from which the node is reachable from outside its own cluster. Used for a node selected in a location other than the engine's own.

The full key list is in service_config.yaml reference.

Build the image

Node images start from the released SDK image. Pin the exact release you tested against and pass the same value to compose so both build paths agree:

ARG BASE_IMAGE=registry.gitlab.neura-robotics.com/neuraverse/neuraverse-node-sdk:v2.40.0
FROM ${BASE_IMAGE}

WORKDIR /neuraverse-node
COPY pyproject.toml ./
COPY src/ ./src/
COPY config/ ./config/
RUN poetry lock && poetry install

CMD ["poetry", "run", "python", "src/run_nodes.py"]
Base image tag Where Use
vX.Y.Z GitLab container registry, registry.gitlab.neura-robotics.com/neuraverse/neuraverse-node-sdk Pin this in Dockerfile and docker-compose.yml. Multi-arch (linux/amd64 and linux/arm64). Pull needs a GitLab token with read_registry scope.
X.Y.Z (no v) The ECR mirror used by in-house deployments Same content as vX.Y.Z. Use it only if your deployment already pulls from that mirror.
latest GitLab container registry Tracks the newest final release only and moves under you. Never build a shipped image from it.
Anything under .../neuraverse-node-sdk/ci GitLab container registry Per-commit and per-branch builds that CI deletes. Never build against them.

Robots and gateways run on both amd64 and arm64. Build both architectures in one manifest and name the image after the container:

docker buildx build --platform linux/amd64,linux/arm64 \
  --build-arg BASE_IMAGE=registry.gitlab.neura-robotics.com/neuraverse/neuraverse-node-sdk:v2.40.0 \
  -t <your-registry>/<container_name>:<version> --push .

Use the value of container_name (neuraverse-node-<name>) as the image name and the version from pyproject.toml as the tag. Do not push a moving tag for a node image either; the platform pulls what the deployment manifest names.

Runtime environment

The container reads its configuration from the YAML file named by ENVVAR_CFG_PATH and takes these process variables from the deployment. Pass them through docker-compose.yml or the Kubernetes manifest; do not bake values into the image.

Variable Purpose
ENVVAR_CFG_PATH Path of service_config.yaml inside the container.
ENVVAR_LOG_CFG_PATH Path of the logging configuration file.
SERVICE_NAME, SERVICE_TAG Service name and version stamped on every log line and metric.
AUTH_ISSUER, AUTH_JWKS_URL Deprecated fields of the jwt block, kept for compatibility. Token validation uses jwt.domain and jwt.applications in service_config.yaml.
ROS_DOMAIN_ID DDS domain shared by all nodes on one host. Every node container on the host must use the same value.

The template runs with network_mode: host: the registry agent, the MQTT broker and DDS discovery are all reached on the host's interfaces. Keep it unless your platform team tells you otherwise. A full compose file is in Project layout and build.

What happens when startup goes wrong

Registration runs before the servers come up, so the first thing to read after a deployment is the container log.

Symptom Cause Fix
No static schema file found for <Class> at <path> The schema file is missing or misnamed. The node still registers, but with an empty schema: class name, docstring, no ports, no category. Name the file <module>_schema.json next to <module>.py and make sure COPY src/ includes it.
Failed to parse static schema <path> Invalid JSON or a field of the wrong type. Same empty registration as above. Run the schema test from Testing.
Registry endpoint not configured, skipping registration. registry_config.registry_endpoint is empty. Set it in the deployed service_config.yaml.
No 'capability-<Class>' instance registered under namespace '<ns>' in the engine log The node is not registered in the location the user picked, or node_namespace in the container differs from what the palette showed. Check node_namespace on that host and restart the container.
No authentication application configured for token on the first engine call The jwt.applications map is missing from service_config.yaml. The service starts, but every authenticated call is rejected. Copy the jwt block with spa, auth0_mgmt and m2m_default from the template. See service_config.yaml reference.
Consul not reachable for registration of 'capability-<Class>' (attempt N): ... Retrying in Ns (Ms of budget left) The registry agent is not listening yet, which is routine right after a host restart. Nothing, as long as the agent comes up within the budget below.
Node service bootstrap failed followed by a container restart Registration or another bootstrap step failed for good. Read the lines above it; the retry budget below ran out, or the endpoint is malformed.

Before SDK 2.38.0 there was no retry

On 2.37.0 and older the first failed registration raises NodeRegisteryError during bootstrap, so the gRPC and HTTP servers never start. The registry monitor thread keeps the process alive, which is why such a container shows as "Up" but never becomes healthy. Without a registry agent, leave registry_config.registry_endpoint empty; the DevKit template ships it that way.

The first registration of the process retries while the registry agent cannot be reached: transport errors are retried with a delay that starts at registry_config.registration_retry_delay_s (default 2 s), doubles on each attempt and is capped at 60 s, for at most registry_config.registration_timeout_s (default 120 s). Set the timeout to 0 to fail on the first attempt. A registry that answers but rejects the request is not retried.

When the budget runs out, or any other bootstrap step fails, the process logs the error and exits with code 1, so the container is restarted by Docker or Kubernetes instead of staying alive without a gRPC server. Before 2.38.0 such a container stayed up, was never restarted and had to be deleted by hand.

Probes

Since SDK 2.49.0

Older SDKs answer only / on the HTTP port and serve no grpc.health.v1.Health.

Every node container answers liveness and readiness probes without a token, so Docker, Kubernetes or a load balancer can probe it directly. They report on the container process, not on your nodes: a node that reports itself unhealthy (see Health reporting) never fails a probe.

Probe HTTP (on http.port) gRPC grpc.health.v1.Health/Check (on grpc.port) Fails when
Liveness /health/live (or /health) service: "liveness" the registry monitor that re-registers the node has stopped
Readiness /health/ready service: "", or the name of any hosted gRPC service the gRPC server has not started yet, or the container is shutting down

HTTP answers 200 while a probe passes and 503 when it fails. The body lists each check by name with ok and gating; nothing else. MQTT or Zenoh that a node uses but that is currently disconnected shows as "status": "degraded" with 200: the transports reconnect on their own. gRPC answers SERVING or NOT_SERVING; Watch is not supported.

Docker HEALTHCHECK for a Python node (the DevKit template uses this from SDK 2.49.0):

HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
    CMD curl -f http://localhost:${NODE_HTTP_PORT}/health/live || exit 1

Kubernetes, when HTTP is bound to 127.0.0.1 and only gRPC is reachable:

livenessProbe:
  grpc: {port: 50051, service: liveness}
readinessProbe:
  grpc: {port: 50051}

Verify the deployment

  1. Startup log. Per class, in order: Registering node 'capability-<Class>' with Consul, Registered instance capability-<Class> ... and Node <Class> registered. After the last class: gRPC server thread pool size: N and Serving HTTP. Registration lines before the server lines is the expected order.
  2. Palette. Reload the graph editor. Your node appears exactly once under the category from your schema's id, and its location setting lists every host where the container runs, for example gateway,robot1. Two entries with the same name mean two containers with different container_name values ship it. A missing location means the container on that host did not register.
  3. HTTP port. GET http://<host>:<http.port>/health/ready answers 200 with {"status": "ok", ...} once the gRPC server is up. / still answers with a small "pong" page. Any other unknown path answers 400. See Probes below.
  4. Registry health. The registry probes your node over TCP every 10 s on the gRPC address it registered (or on node_external_target when that is set) and drops the registration after one minute of failures. A node that disappears from the palette shortly after starting is usually one whose grpc.address is not reachable from the registry agent.
  5. First run. Drop the node on a canvas, pick the location, run the graph. on_configure receives the static configuration from your schema. Errors at this step are reported in the editor and in your container log.

Updating a deployed node

  • Build a new image with a new version tag and roll it out to every location that runs the container. All locations should run the same version; the palette shows the version of the default location only.
  • The version shown with the registration is the node_version class attribute when you set one, otherwise service_descriptor.version from service_config.yaml, otherwise 1.0.0. Bump one of them with every schema change so operators can tell deployments apart.
  • Nodes already placed on a canvas keep the schema they were dropped with. A changed port list or a new default only reaches a graph after the node is deleted from it and dropped again. Existing graphs keep running with their old ports on purpose. Treat port renames and removals as breaking changes and prefer adding ports over changing them.
  • A container restart re-registers the same service id, so a rolling update does not leave stale entries. What does leave a stale entry is changing container_name or node_namespace: the old id stays until the registry's health check has failed for one minute and removes it.

Running the platform yourself

Standing up an engine, a registry and a broker on a development machine is an in-house setup. The steps and the registry key layout are documented for the platform team in Registration and discovery. For everyday development use the Mock Runner instead; see Testing.