Browse Source

Add start runtime function to python node api again

tags/v0.2.0-candidate
Philipp Oppermann 3 years ago
parent
commit
8cbc891251
Failed to extract signature
4 changed files with 14 additions and 9 deletions
  1. +1
    -0
      Cargo.lock
  2. +4
    -0
      Cargo.toml
  3. +1
    -1
      apis/python/node/Cargo.toml
  4. +8
    -8
      apis/python/node/src/lib.rs

+ 1
- 0
Cargo.lock View File

@@ -1111,6 +1111,7 @@ version = "0.1.2"
dependencies = [
"dora-node-api",
"dora-operator-api-python",
"dora-runtime",
"eyre",
"flume",
"pyo3",


+ 4
- 0
Cargo.toml View File

@@ -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"

+ 1
- 1
apis/python/node/Cargo.toml View File

@@ -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"


+ 8
- 8
apis/python/node/src/lib.rs View File

@@ -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::<Node>().unwrap();
Ok(())
}

Loading…
Cancel
Save