Open phil-opp opened 2 months ago
Do we want to proceed with this approach? Personally, I think this is a considerable improvement because it changes the previous Command
builder code to something that resembles normal shell commands:
From:
let cargo = std::env::var("CARGO").unwrap();
let mut cmd = tokio::process::Command::new(&cargo);
cmd.arg("run");
cmd.arg("--package").arg("dora-cli");
cmd.arg("--").arg("build").arg(dataflow);
if !cmd.status().await?.success() {
bail!("failed to build dataflow");
};
To:
let dora = prepare_dora(&sh)?;
cmd!(sh, "{dora} build dataflow.yml").run()?;
run.rs
completely and only explain the build instructions in the README.
cargo run --example <example_name>
just
or nu
to create a run.sh
cargo run --example <name>
support still require a run.rs
wrappervenv
_ setup as we can use the standard activate
scriptLooks good to me !
@haixuanTao I get a ModuleNotFoundError: No module named 'dora'
error again with the new python-operator-dataflow
example. The venv
is created before dora up
, so it doesn't seem like the same issue as https://github.com/dora-rs/dora/pull/491#issuecomment-2079464273. Any idea what it could be?
We decided to wait a bit with this PR until https://github.com/dora-rs/dora/pull/551 is ready. We hope that we can create a proper integration test framework then instead of using the example as integration tests. Perhaps we can find a even better solution for running the examples then (after the testing part is moved to the test framework).
The
xshell
crate provides a more convenient way to build and run aCommand
, which is more similar to traditional bash scripts. Using this crate, we can simplify ourrun.rs
scripts while still being platform-independent and not requiring any external dependencies. We can also still run the examples usingcargo run --example
.Alternative to #454 .