1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! # MCAI Benchmark
//!
//! This crate allows to benchmarl MCAI wroker based on a configuration file.
//!
//! ## Configuration
//!
//! This is a sample configuration file.
//!
//! ```yaml
//! version: 1
//! output_folder: "./output_folder"
//! worker_docker_image: "image_name"
//!
//! my_benchmark_name:
//! source_order: "source_order_filename"
//! iterations: 5
//! hardware:
//! cpu:
//! - 1
//! - 2
//! memory:
//! - 2048
//! envs:
//! EXAMPLE_VAR: "my_example_var"
//! volumes:
//! - host: /path/to/a/volume
//! container: /volume
//! readonly: true
//! ```
//!
//! ## Usage
//!
//! ```no_run
//! use mcai_benchmark::{
//! benchmark::result::Results,
//! configuration::{Configuration, Version1},
//! stats::ConsoleWriter,
//! };
//! use std::sync::{Arc, Mutex};
//!
//! #[tokio::main]
//! async fn main() {
//! let config = Version1::read_from_file("./examples/sample_config.yaml").unwrap();
//! let mut benchmark = Results::from(Configuration::Version1(config));
//!
//! if let Err(error) = benchmark
//! .run_benchmark(Some(Arc::new(Mutex::new(ConsoleWriter {}))))
//! .await
//! {
//! println!("Error: {:?}", error);
//! }
//!
//! println!("{:?}", benchmark);
//! }
//! ```