File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -euo pipefail
3
3
4
+ # Path to the guidellm binary
5
+ guidellm_bin=" /opt/guidellm/bin/guidellm"
6
+
4
7
# If we receive any arguments switch to guidellm command
5
8
if [ $# -gt 0 ]; then
6
9
echo " Running command: guidellm $* "
7
- exec guidellm " $@ "
10
+ exec $guidellm_bin " $@ "
8
11
fi
9
12
10
- # Build the command
11
- CMD=" guidellm benchmark --target \ "${TARGET} \" --model \ "${MODEL} \" --rate-type \ "${RATE_TYPE} \" --data \ "${DATA} \" "
13
+ # NOTE: Bash vec + exec prevent shell escape issues
14
+ CMD=( " ${guidellm_bin} " " benchmark" " --target" " ${TARGET} " " --model" " ${MODEL} " " --rate-type" " ${RATE_TYPE} " " --data" " ${DATA} " )
12
15
13
- # Add optional parameters
14
- if [ ! -z " ${MAX_REQUESTS} " ]; then
15
- CMD=" ${CMD} --max-requests ${MAX_REQUESTS} "
16
+ if [ -n " ${MAX_REQUESTS} " ]; then
17
+ CMD+=(" --max-requests" " ${MAX_REQUESTS} " )
16
18
fi
17
19
18
- if [ ! -z " ${MAX_SECONDS} " ]; then
19
- CMD= " ${CMD} --max-seconds ${MAX_SECONDS} "
20
+ if [ -n " ${MAX_SECONDS} " ]; then
21
+ CMD+=( " --max-seconds" " ${MAX_SECONDS} " )
20
22
fi
21
23
22
- # Add output path with appropriate extension
23
- if [ ! -z " ${OUTPUT_PATH} " ]; then
24
- CMD=" ${CMD} --output-path \" ${OUTPUT_PATH} \" "
24
+ if [ -n " ${OUTPUT_PATH} " ]; then
25
+ CMD+=(" --output-path" " ${OUTPUT_PATH} " )
25
26
fi
26
27
27
28
# Execute the command
28
- echo " Running command: ${CMD} "
29
- eval " ${CMD} "
29
+ echo " Running command: ${CMD[*] } "
30
+ exec " ${CMD[@] } "
You can’t perform that action at this time.
0 commit comments