mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Compile Meilisearch or run the dedicated binary file
This commit is contained in:
parent
f8ba112f66
commit
04a62d2b97
3 changed files with 28 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
|||
use std::collections::BTreeMap;
|
||||
use std::fs::File;
|
||||
use std::io::{Seek as _, Write as _};
|
||||
use std::path::Path;
|
||||
|
||||
use anyhow::{bail, Context as _};
|
||||
use futures_util::TryStreamExt as _;
|
||||
|
@ -85,14 +86,30 @@ pub async fn execute(
|
|||
master_key: Option<&str>,
|
||||
workload: Workload,
|
||||
args: &BenchDeriveArgs,
|
||||
binary_path: Option<&Path>,
|
||||
) -> anyhow::Result<()> {
|
||||
assets::fetch_assets(assets_client, &workload.assets, &args.asset_folder).await?;
|
||||
|
||||
let workload_uuid = dashboard_client.create_workload(invocation_uuid, &workload).await?;
|
||||
|
||||
let mut tasks = Vec::new();
|
||||
|
||||
for i in 0..workload.run_count {
|
||||
let run_command = match binary_path {
|
||||
Some(binary_path) => tokio::process::Command::new(binary_path),
|
||||
None => {
|
||||
let mut command = tokio::process::Command::new("cargo");
|
||||
command
|
||||
.arg("run")
|
||||
.arg("--release")
|
||||
.arg("-p")
|
||||
.arg("meilisearch")
|
||||
.arg("--bin")
|
||||
.arg("meilisearch")
|
||||
.arg("--");
|
||||
command
|
||||
}
|
||||
};
|
||||
|
||||
tasks.push(
|
||||
execute_run(
|
||||
dashboard_client,
|
||||
|
@ -102,6 +119,7 @@ pub async fn execute(
|
|||
master_key,
|
||||
&workload,
|
||||
args,
|
||||
run_command,
|
||||
i,
|
||||
)
|
||||
.await?,
|
||||
|
@ -109,7 +127,6 @@ pub async fn execute(
|
|||
}
|
||||
|
||||
let mut reports = Vec::with_capacity(workload.run_count as usize);
|
||||
|
||||
for task in tasks {
|
||||
reports.push(
|
||||
task.await
|
||||
|
@ -133,13 +150,15 @@ async fn execute_run(
|
|||
master_key: Option<&str>,
|
||||
workload: &Workload,
|
||||
args: &BenchDeriveArgs,
|
||||
run_command: tokio::process::Command,
|
||||
run_number: u16,
|
||||
) -> anyhow::Result<tokio::task::JoinHandle<anyhow::Result<std::fs::File>>> {
|
||||
meili_process::delete_db();
|
||||
|
||||
meili_process::build().await?;
|
||||
let meilisearch =
|
||||
meili_process::start(meili_client, master_key, workload, &args.asset_folder).await?;
|
||||
meili_process::start(meili_client, master_key, workload, &args.asset_folder, run_command)
|
||||
.await?;
|
||||
|
||||
let processor = run_commands(
|
||||
dashboard_client,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue