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 11#! /usr/bin/env bash
22set -euo pipefail
33
4+ # Path to the guidellm binary
5+ guidellm_bin=" /opt/guidellm/bin/guidellm"
6+
47# If we receive any arguments switch to guidellm command
58if [ $# -gt 0 ]; then
69 echo " Running command: guidellm $* "
7- exec guidellm " $@ "
10+ exec $guidellm_bin " $@ "
811fi
912
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} " )
1215
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} " )
1618fi
1719
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} " )
2022fi
2123
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} " )
2526fi
2627
2728# 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