register_node
Record how to reach a data node, and check that it answers.
from plexora import register_noderegister_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
namestrrequiredA short name for the node. Every other function in this module refers to the node by this name.
endpointstrrequiredThe URL this machine uses to reach the node, e.g.
"http://compute-3:8642".
tokenstrdefault NoneThe node's bearer token, if it requires one.
browser_endpointstrdefault NoneThe 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 TrueContact 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 NoneA 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 NoneWhen the process serving this node is expected to stop, as a Unix timestamp.
Returns
NodeThe saved node record. When verify=True, it carries the
api_version, node_id, plexora_version and last_seen the
handshake reported.
Raises
ValueErrorIf 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="...")Related
list_nodes
List every registered node, with what it last said about itself.
node_resources
List the files a node is serving right now, as it describes itself.
attach_table
Point a project's cell table at a file a node is serving, and load it once.