Browse Source

Add support for uv within runtime node

tags/v0.3.10^2
haixuantao haixuanTao 10 months ago
parent
commit
196bed3454
2 changed files with 23 additions and 8 deletions
  1. +2
    -2
      .github/workflows/ci.yml
  2. +21
    -6
      binaries/daemon/src/spawn.rs

+ 2
- 2
.github/workflows/ci.yml View File

@@ -374,8 +374,8 @@ jobs:

# Run Rust queue latency test
echo "Running CI Queue Size Latest Data Rust Test"
dora build tests/queue_size_latest_data_rust/dataflow.yaml
dora run tests/queue_size_latest_data_rust/dataflow.yaml
dora build tests/queue_size_latest_data_rust/dataflow.yaml --uv
dora run tests/queue_size_latest_data_rust/dataflow.yaml --uv

- name: "Test CLI (C)"
timeout-minutes: 30


+ 21
- 6
binaries/daemon/src/spawn.rs View File

@@ -274,16 +274,31 @@ pub async fn spawn_node(
]);
command
} else {
let python = get_python_path()
.context("Could not find python path when spawning runtime node")?;
let mut command = tokio::process::Command::new(python);
let mut cmd = if uv {
let mut cmd = tokio::process::Command::new("uv");
cmd.arg("run");
cmd.arg("python");
tracing::info!(
"spawning: uv run python -uc import dora; dora.start_runtime() # {}",
node.id
);
cmd
} else {
let python = get_python_path()
.wrap_err("Could not find python path when spawning custom node")?;
tracing::info!(
"spawning: python -uc import dora; dora.start_runtime() # {}",
node.id
);
let cmd = tokio::process::Command::new(python);
cmd
};
// Force python to always flush stdout/stderr buffer
command.arg("-u");
command.args([
cmd.args([
"-c",
format!("import dora; dora.start_runtime() # {}", node.id).as_str(),
]);
command
cmd
}
} else if python_operators.is_empty() && other_operators {
let mut cmd = tokio::process::Command::new(


Loading…
Cancel
Save