Plexora

register_node

Record how to reach a data node, and check that it answers.

Generated from Plexora 0.0.55View source
from plexora import register_node
register_node(
    name,
    endpoint,
    token=None,
    browser_endpoint=None,
    verify=True,
    managed_by=None,
    role=None,
    expires_at=None,
)

A data node is a plexora node serve process running on another machine -- a cluster, a lab workstation -- that can serve image, mask and table files to a viewer running elsewhere. Registering one reads and copies no data; it only records how to reach it, so a project can later be pointed at one of its files with plexora.attach_table, plexora.attach_image or plexora.attach_segmentation.

When to use

Call this once per node, typically before attaching anything to it. Registering the same name again replaces the existing entry.

Parameters

namestrrequired

A short name for the node. Every other function in this module refers to the node by this name.

endpointstrrequired

The URL this machine uses to reach the node, e.g. "http://compute-3:8642".

tokenstrdefault None

The node's bearer token, if it requires one.

browser_endpointstrdefault None

The URL the user's BROWSER uses to reach the node, when that is a different address -- an Open OnDemand portal path (/rnode/compute-3/8642/), or a tunnelled loopback port. Leave it unset whenever the two are the same, which is the desktop and Docker case and most tunnels.

verifybooldefault True

Contact the node before recording it, and check that it speaks a node API this installation understands. Defaults to True. Pass False to record a node that is not up yet, from a script that starts it afterwards.

managed_bystrdefault None

A label recording who keeps this entry current, e.g. "connect:hpc" for one a saved connection will set up again. Advisory only; nothing here reads it back.

rolestrdefault None

"client" to mark the node as the one running on the machine the browser is on. Leave unset for an ordinary node.

expires_atfloatdefault None

When the process serving this node is expected to stop, as a Unix timestamp.

Returns

Node

The saved node record. When verify=True, it carries the api_version, node_id, plexora_version and last_seen the handshake reported.

Raises

ValueError

If name is blank, or (with verify=True) the node answers with a node-API version this installation does not speak.

Examples

import plexora

plexora.register_node("hpc", "http://compute-3:8642", token="...")

Guides

On this page