You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

run.rs 1.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. use eyre::{bail, Context};
  2. use std::{env, path::Path};
  3. #[tokio::main]
  4. async fn main() -> eyre::Result<()> {
  5. let root = Path::new(env!("CARGO_MANIFEST_DIR"));
  6. std::env::set_current_dir(root.join(file!()).parent().unwrap())
  7. .wrap_err("failed to set working dir")?;
  8. build_package("dora-runtime").await?;
  9. install_python_dependencies(root).await?;
  10. let dataflow = if env::var("CI").is_ok() {
  11. Path::new("dataflow_without_webcam.yml").to_owned()
  12. } else {
  13. Path::new("dataflow.yml").to_owned()
  14. };
  15. dora_coordinator::run(dora_coordinator::Command::Run {
  16. dataflow,
  17. runtime: Some(root.join("target").join("release").join("dora-runtime")),
  18. })
  19. .await?;
  20. Ok(())
  21. }
  22. async fn build_package(package: &str) -> eyre::Result<()> {
  23. let cargo = std::env::var("CARGO").unwrap();
  24. let mut cmd = tokio::process::Command::new(&cargo);
  25. cmd.arg("build").arg("--release");
  26. cmd.arg("--package").arg(package);
  27. if !cmd.status().await?.success() {
  28. bail!("failed to build {package}");
  29. };
  30. Ok(())
  31. }
  32. async fn install_python_dependencies(_root: &Path) -> eyre::Result<()> {
  33. let mut install = tokio::process::Command::new("sh");
  34. install.arg("./install.sh");
  35. if !install.status().await?.success() {
  36. bail!("failed to create venv");
  37. };
  38. Ok(())
  39. }

DORA (Dataflow-Oriented Robotic Architecture) is middleware designed to streamline and simplify the creation of AI-based robotic applications. It offers low latency, composable, and distributed datafl