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.2 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. use eyre::{bail, Context};
  2. use std::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. dora_coordinator::run(dora_coordinator::Command::Run {
  11. dataflow: Path::new("dataflow.yml").to_owned(),
  12. runtime: Some(root.join("target").join("release").join("dora-runtime")),
  13. })
  14. .await?;
  15. Ok(())
  16. }
  17. async fn build_package(package: &str) -> eyre::Result<()> {
  18. let cargo = std::env::var("CARGO").unwrap();
  19. let mut cmd = tokio::process::Command::new(&cargo);
  20. cmd.arg("build").arg("--release");
  21. cmd.arg("--package").arg(package);
  22. if !cmd.status().await?.success() {
  23. bail!("failed to build {package}");
  24. };
  25. Ok(())
  26. }
  27. async fn install_python_dependencies(root: &Path) -> eyre::Result<()> {
  28. let mut install = tokio::process::Command::new("sh");
  29. install.arg("./install.sh");
  30. if !install.status().await?.success() {
  31. bail!("failed to create venv");
  32. };
  33. Ok(())
  34. }

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