Skip to main content

Descriptor

Struct Descriptor 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: Debug

Debug 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/100
§type_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/SensorV2
§env: 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 node

Implementations§

Source§

impl Descriptor

Source

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

Source§

fn clone(&self) -> Descriptor

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Descriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Descriptor

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Descriptor

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for Descriptor

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V