#[non_exhaustive]pub struct Descriptor {
pub nodes: Vec<Node>,
pub deploy: Option<Deploy>,
pub debug: Debug,
pub health_check_interval: Option<f64>,
pub strict_types: Option<bool>,
pub exit_when_nodes_finish: Option<bool>,
pub type_rules: Vec<TypeRuleDef>,
pub env: Option<BTreeMap<String, EnvValue>>,
}Expand description
§Dataflow Specification
The main configuration structure for defining a Dora dataflow. Dataflows are specified through YAML files that describe the nodes, their connections, and execution parameters.
§Structure
A dataflow consists of:
- Nodes: The computational units that process data
- Deployment: Optional deployment configuration (unstable)
- Debug options: Optional development and debugging settings (unstable)
§Example
use dora_message::descriptor::Descriptor;
let yaml = r#"
nodes:
- id: webcam
operator:
python: webcam.py
inputs:
tick: dora/timer/millis/100
outputs:
- image
- id: plot
operator:
python: plot.py
inputs:
image: webcam/image
"#;
let descriptor: Descriptor = serde_yaml::from_str(yaml)?;
assert_eq!(descriptor.nodes.len(), 2);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.nodes: Vec<Node>List of nodes in the dataflow
This is the most important field of the dataflow specification.
Each node must be identified by a unique id:
§Example
nodes:
- id: foo
path: path/to/the/executable
# ... (see below)
- id: bar
path: path/to/another/executable
# ... (see below)For each node, you need to specify the path of the executable or script that Dora should run when starting the node.
Most of the other node fields are optional, but you typically want to specify at least some inputs and/or outputs.
deploy: Option<Deploy>Deployment configuration (optional).
debug: DebugDebug options (optional).
health_check_interval: Option<f64>How often the daemon checks node health (in seconds).
Defaults to 5.0 seconds if not specified. Lower values detect hung nodes faster but add more overhead.
strict_types: Option<bool>Enable strict type checking: type warnings become errors during build.
Can also be enabled via --strict-types CLI flag on dora build.
exit_when_nodes_finish: Option<bool>Finish the dataflow once every node has, treating
dora/timer/... inputs as a clock rather than as work.
A timer input has no upstream node, so it never closes. By default a node consuming one is therefore never told its inputs are done and the graph cannot end on its own, even after every node doing real work has exited (dora-rs/dora#2920).
Off by default: for a long-lived dataflow the timer is precisely what keeps it alive. Nodes with no data inputs at all (timer-only sources, or no inputs) are unaffected either way – they have no dependency that could finish, so they are treated as sources.
Set by dora run --exit-when-nodes-finish and dora start --exit-when-nodes-finish, and settable directly in YAML. It lives
on the descriptor rather than on the wire so that it survives the
events a dataflow outlives: auto-recovery re-spawn, coordinator
restart with state reconstruction, and dora restart.
§Example
exit_when_nodes_finish: true
nodes:
- id: worker
path: ./worker
inputs:
tick: dora/timer/millis/100type_rules: Vec<TypeRuleDef>Custom type compatibility rules.
Each rule declares that a source type can be implicitly converted to a target type. These supplement the built-in widening rules.
§Example
type_rules:
- from: myproject/SensorV1
to: myproject/SensorV2env: Option<BTreeMap<String, EnvValue>>Global environment variables inherited by every node.
Each node’s own env map takes precedence on key conflicts, so nodes
can override a global default without repeating shared values like
RUST_LOG, OTEL_EXPORTER_OTLP_ENDPOINT, or CUDA_VISIBLE_DEVICES.
§Example
env:
RUST_LOG: info
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
nodes:
- id: verbose-node
path: path/to/node
env:
RUST_LOG: debug # overrides the global RUST_LOG for this nodeImplementations§
Source§impl Descriptor
impl Descriptor
Sourcepub fn new(nodes: Vec<Node>) -> Self
pub fn new(nodes: Vec<Node>) -> Self
A dataflow of nodes with every dataflow-level option left at its
default (the state a YAML file with only a nodes: key deserializes
to).
Descriptor is #[non_exhaustive], so other crates cannot build one
with a struct literal. Start here and assign the options you need — the
fields are all still pub.
Trait Implementations§
Source§impl Clone for Descriptor
impl Clone for Descriptor
Source§fn clone(&self) -> Descriptor
fn clone(&self) -> Descriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Descriptor
impl Debug for Descriptor
Source§impl<'de> Deserialize<'de> for Descriptor
impl<'de> Deserialize<'de> for Descriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Descriptor
impl JsonSchema for Descriptor
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more