Skip to content

Commit b50b7fe

Browse files
feat: allow multi-part local runs
1 parent 5730358 commit b50b7fe

35 files changed

Lines changed: 597 additions & 326 deletions

Cargo.lock

Lines changed: 191 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ open = "5.3.2"
7171
tabled = { version = "0.20.0", features = ["ansi"] }
7272
shell-words = "1.1.0"
7373
rmp-serde = "1.3.0"
74+
uuid = { version = "1.21.0", features = ["v4"] }
7475

7576
[target.'cfg(target_os = "linux")'.dependencies]
7677
procfs = "0.17.0"

src/cli/exec/mod.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ use crate::prelude::*;
77
use crate::project_config::ProjectConfig;
88
use crate::project_config::merger::ConfigMerger;
99
use crate::upload::UploadResult;
10+
use crate::upload::poll_results::{PollResultsOptions, poll_results};
1011
use clap::Args;
1112
use std::path::Path;
1213

1314
pub mod multi_targets;
14-
mod poll_results;
1515

1616
/// We temporarily force this name for all exec runs
1717
pub const DEFAULT_REPOSITORY_NAME: &str = "local-runs";
@@ -91,20 +91,19 @@ pub async fn run(
9191
/// result polling. It is used by both `codspeed exec` directly and by `codspeed run` when
9292
/// executing targets defined in codspeed.yaml.
9393
pub async fn execute_with_harness(
94-
config: crate::executor::Config,
94+
mut config: crate::executor::Config,
9595
api_client: &CodSpeedAPIClient,
9696
codspeed_config: &CodSpeedConfig,
9797
setup_cache_dir: Option<&Path>,
9898
) -> Result<()> {
99-
let mut execution_context =
100-
executor::ExecutionContext::new(config, codspeed_config, api_client).await?;
99+
let orchestrator =
100+
executor::Orchestrator::new(&mut config, codspeed_config, api_client).await?;
101101

102-
if !execution_context.is_local() {
102+
if !orchestrator.is_local() {
103103
super::show_banner();
104104
}
105105

106-
debug!("config: {:#?}", execution_context.config);
107-
let executor = executor::get_executor_from_mode(&execution_context.config.mode);
106+
debug!("config: {config:#?}");
108107

109108
let get_exec_harness_installer_url = || {
110109
format!(
@@ -120,17 +119,14 @@ pub async fn execute_with_harness(
120119
)
121120
.await?;
122121

122+
let poll_opts = PollResultsOptions::for_exec();
123123
let poll_results_fn = async |upload_result: &UploadResult| {
124-
poll_results::poll_results(api_client, upload_result).await
124+
poll_results(api_client, upload_result, &poll_opts).await
125125
};
126126

127-
executor::execute_benchmarks(
128-
executor.as_ref(),
129-
&mut execution_context,
130-
setup_cache_dir,
131-
poll_results_fn,
132-
)
133-
.await?;
127+
orchestrator
128+
.execute(&mut config, setup_cache_dir, poll_results_fn)
129+
.await?;
134130

135131
Ok(())
136132
}

0 commit comments

Comments
 (0)