diff --git a/Cargo.lock b/Cargo.lock index 35a8f903..6f8d0ca3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1111,6 +1111,7 @@ version = "0.1.2" dependencies = [ "dora-node-api", "dora-operator-api-python", + "dora-runtime", "eyre", "flume", "pyo3", diff --git a/Cargo.toml b/Cargo.toml index b0ca1b3c..30148c22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,10 @@ path = "examples/c++-dataflow/run.rs" name = "python-dataflow" path = "examples/python-dataflow/run.rs" +[[example]] +name = "python-operator-dataflow" +path = "examples/python-operator-dataflow/run.rs" + [[example]] name = "benchmark" path = "examples/benchmark/run.rs" diff --git a/apis/python/node/Cargo.toml b/apis/python/node/Cargo.toml index 993d206d..fdffc278 100644 --- a/apis/python/node/Cargo.toml +++ b/apis/python/node/Cargo.toml @@ -13,7 +13,7 @@ pyo3 = { version = "0.16", features = ["eyre", "abi3-py37"] } eyre = "0.6" serde_yaml = "0.8.23" flume = "0.10.14" -# dora-runtime = { path = "../../../binaries/runtime" } +dora-runtime = { path = "../../../binaries/runtime" } [lib] name = "dora" diff --git a/apis/python/node/src/lib.rs b/apis/python/node/src/lib.rs index 8e2be28c..e083c73d 100644 --- a/apis/python/node/src/lib.rs +++ b/apis/python/node/src/lib.rs @@ -105,17 +105,17 @@ impl Node { } } -// #[pyfunction] -// fn start_runtime() -> Result<()> { -// dora_runtime::main() -// .wrap_err("Python Dora Runtime failed.") -// .unwrap(); -// Ok(()) -// } +#[pyfunction] +fn start_runtime() -> Result<()> { + dora_runtime::main() + .wrap_err("Python Dora Runtime failed.") + .unwrap(); + Ok(()) +} #[pymodule] fn dora(_py: Python, m: &PyModule) -> PyResult<()> { - // m.add_function(wrap_pyfunction!(start_runtime, m)?)?; + m.add_function(wrap_pyfunction!(start_runtime, m)?)?; m.add_class::().unwrap(); Ok(()) }