-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsqlite-local-benchbase.jsonc
95 lines (86 loc) · 4.37 KB
/
sqlite-local-benchbase.jsonc
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// TODO: break these up into separate environments to mirror the local vs.
// remote bits we usually have?
{
"name": "SQLite3 BenchBase Local",
"description": "A local-only environment for benchmarking and tuning SQLite via BenchBase.",
"class": "mlos_bench.environments.local.LocalEnv",
"include_tunables": ["environments/apps/sqlite/sqlite-tunables.jsonc"],
"include_services": [
"services/local-exec-service.jsonc"
],
"config": {
// Which tunable parameters this environment will work on.
// Here we specify which group(s) of parameters to use for *this*
// experiment by referencing the tunable_params_map from the experiment
// globals config specified in the CLI invocation.
// This separation allows us to reuse this config as is, but manipulate
// the tunable_params_map to test different groups of parameters for
// different configurations.
"tunable_params": ["$sqlite"],
// Upon generating a new set of tunable values, we dump them to a file
// for use by scripts below.
"dump_params_file": "sqlite-tunable-values.json",
// Some additional variables that the scripts below will require.
"const_args": {
"BENCHBASE_BENCHMARK": "tpcc",
"USE_PRELOADED_DB": "true",
"DB_DIR": "$workdir/benchbase/db",
"DB_BAK_DIR": "$workdir/benchbase/db.bak",
"CONTAINER_WORKSPACE_FOLDER": "",
"LOCAL_WORKSPACE_FOLDER": ""
},
"required_args": [
"experiment_id",
"trial_id",
"workdir",
"DB_DIR",
"DB_BAK_DIR",
"BENCHBASE_BENCHMARK",
"USE_PRELOADED_DB",
"CONTAINER_WORKSPACE_FOLDER",
"LOCAL_WORKSPACE_FOLDER"
],
"shell_env_params": [
"workdir",
"DB_DIR",
"DB_BAK_DIR",
"experiment_id",
"trial_id",
"BENCHBASE_BENCHMARK",
"USE_PRELOADED_DB",
"CONTAINER_WORKSPACE_FOLDER",
"LOCAL_WORKSPACE_FOLDER"
],
"setup": [
"mkdir -p \"$workdir/$experiment_id/$trial_id\"",
// Create the config file for the trial based on the tunable values
// that were dumped to a file above.
"environments/apps/sqlite/scripts/local/prepare_server_config.py sample_${BENCHBASE_BENCHMARK}_config.xml sqlite-tunable-values.json \"$workdir/$experiment_id/$trial_id/config_$BENCHBASE_BENCHMARK.xml\"",
// Normally DB prep would happen in a separate (e.g., remote)
// environment, but since sqlite is local, we do it all here.
"environments/apps/sqlite/scripts/remote/prepare-workload.sh \"$workdir/$experiment_id/$trial_id\""
],
"run": [
"mkdir -p \"$workdir/$experiment_id/$trial_id\"",
// Run the workload.
// Normally this would happen in a separate remote environment, but
// since sqlite is local, we do it all here.
"environments/apps/sqlite/scripts/remote/run-workload.sh \"$workdir/$experiment_id/$trial_id\"",
// Back on the local machine (again, assuming those results were
// downloaded from the remote environment), we post process the
// results into something the optimizer and results storage engine
// can consume (e.g., csv file).
"environments/apps/sqlite/scripts/local/benchbase/convert-benchbase-results.sh \"$workdir/$experiment_id/$trial_id\"",
"cp $workdir/$experiment_id/$trial_id/benchbase-$BENCHBASE_BENCHMARK-metrics.csv benchbase-metrics.csv",
"environments/apps/sqlite/scripts/local/convert-time-results.sh \"$workdir/$experiment_id/$trial_id\"",
"cp $workdir/$experiment_id/$trial_id/benchbase-$BENCHBASE_BENCHMARK-system-metrics.csv benchbase-system-metrics.csv",
// Combine the two CSV files into a single one.
"sed -i '/^metric,value$/d' benchbase-system-metrics.csv",
"cat benchbase-metrics.csv benchbase-system-metrics.csv > benchbase-combined-metrics.csv"
],
// Finally, we instruct the optimizer and results storage engine to use
// those results.
// Note: these are stored into a temporary directory.
"read_results_file": "benchbase-combined-metrics.csv"
}
}