-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_experiments_batch.sh
More file actions
49 lines (35 loc) · 1.33 KB
/
run_experiments_batch.sh
File metadata and controls
49 lines (35 loc) · 1.33 KB
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
#!/bin/bash
SCENARIO=$1
N_WORKERS=$2
PRIMES=$3
ITERATIONS=$4
N_RUNS=$5
ADDITIONAL_SERVICES=${6:-1}
if [ "$ADDITIONAL_SERVICES" -eq 1 ]; then
echo "Starting monitoring services..."
docker compose up -d --build cadvisor prometheus
if [ $SCENARIO = "mqtt" ] || [ $SCENARIO = "orbitalis-mqtt" ] || [ $SCENARIO = "orbitalis-mqtt-discovery" ]; then
echo "Starting MQTT broker..."
docker compose up -d --build mqttbroker
sleep 10 # Give some time for services to start
else
echo "No external services to start for scenario: $SCENARIO"
sleep 1 # Short pause for consistency
fi
fi
echo "Running experiments..."
for run in $(seq 1 $N_RUNS); do
export NUM_WORKERS=$N_WORKERS
export PRIMES=$PRIMES
export ITERATIONS=$ITERATIONS
export SCENARIO=$SCENARIO
export EXPERIMENT_CONTAINER_NAME="experiment_${SCENARIO}_w${N_WORKERS}_p${PRIMES}_i${ITERATIONS}_run${run}"
now=$(date +"%Y%m%d_%H%M%S")
export OUTPUT_FILE_NAME="${EXPERIMENT_CONTAINER_NAME}_${now}.json"
echo "Running experiment: Scenario=${SCENARIO}, Workers=${N_WORKERS}, Primes=${PRIMES}, Iterations=${ITERATIONS}, Run=${run}"
docker compose up --build --abort-on-container-exit experiment
done
if [ "$ADDITIONAL_SERVICES" -eq 1 ]; then
echo "Stopping monitoring services..."
docker compose down
fi