File: run_workloads.sh

package info (click to toggle)
python-azure 20251104%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 770,224 kB
  • sloc: python: 6,357,217; ansic: 804; javascript: 287; makefile: 198; sh: 193; xml: 109
file content (27 lines) | stat: -rwxr-xr-x 595 bytes parent folder | download
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
#!/bin/bash
if [ $# -eq 0 ]; then
    echo "Usage: $0 num_runs"
    exit 1
fi

num_runs=$1

echo "[Info] Installing azure-cosmos package..."
pip install ../../.
if [ $? -ne 0 ]; then
    echo "[Error] Failed to install azure-cosmos. Exiting."
    exit 2
fi
echo "[Info] azure-cosmos installed successfully."

# Loop over each Python file in the current directory ending with _workload.py
for file in ./*_workload.py; do
    for (( i=0; i<num_runs; i++ )); do
        python3 "$file" &
        # slow start up
        sleep 1
    done
done

wait
echo "[Info] All workloads started successfully."