File tree Expand file tree Collapse file tree 2 files changed +24
-18
lines changed Expand file tree Collapse file tree 2 files changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,12 @@ LABEL org.opencontainers.image.description="GuideLLM Benchmark Container"
37
37
38
38
# Set the environment variable for the benchmark script
39
39
# TODO: Replace with scenario environment variables
40
- ENV TARGET ="http://localhost:8000" \
41
- MODEL ="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w4a16" \
42
- RATE_TYPE ="sweep" \
43
- DATA ="prompt_tokens=256,output_tokens=128" \
44
- MAX_REQUESTS ="100" \
45
- MAX_SECONDS ="" \
46
- OUTPUT_PATH ="/results/results.json"
40
+ ENV GUIDELLM_TARGET ="http://localhost:8000" \
41
+ GUIDELLM_MODEL ="neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w4a16" \
42
+ GUIDELLM_RATE_TYPE ="sweep" \
43
+ GUIDELLM_DATA ="prompt_tokens=256,output_tokens=128" \
44
+ GUIDELLM_MAX_REQUESTS ="100" \
45
+ GUIDELLM_MAX_SECONDS ="" \
46
+ GUIDELLM_OUTPUT_PATH ="/results/results.json"
47
47
48
48
ENTRYPOINT [ "/opt/guidellm/bin/entrypoint.sh" ]
Original file line number Diff line number Diff line change @@ -10,20 +10,26 @@ if [ $# -gt 0 ]; then
10
10
exec $guidellm_bin " $@ "
11
11
fi
12
12
13
- # NOTE: Bash vec + exec prevent shell escape issues
14
- CMD=( " ${guidellm_bin} " " benchmark " " --target " " ${TARGET} " " --model " " ${MODEL} " " --rate-type " " ${RATE_TYPE} " " --data " " ${DATA} " )
13
+ # Get a list of environment variables that start with GUIDELLM_
14
+ args= " $( printenv | cut -d= -f1 | grep -E ' ^GUIDELLM_ ' ) "
15
15
16
- if [ -n " ${MAX_REQUESTS} " ]; then
17
- CMD+=(" --max-requests" " ${MAX_REQUESTS} " )
18
- fi
16
+ # NOTE: Bash array + exec prevent shell escape issues
17
+ CMD=(" ${guidellm_bin} " " benchmark" )
19
18
20
- if [ -n " ${MAX_SECONDS} " ]; then
21
- CMD+=(" --max-seconds" " ${MAX_SECONDS} " )
22
- fi
19
+ # Parse environment variables for the benchmark command
20
+ for var in $args ; do
21
+ # Remove GUIDELLM_ prefix
22
+ arg_name=" ${var# GUIDELLM_} "
23
+ # Convert to lowercase
24
+ arg_name=" ${arg_name,,} "
25
+ # Replace underscores with dashes
26
+ arg_name=" ${arg_name// _/ -} "
23
27
24
- if [ -n " ${OUTPUT_PATH} " ]; then
25
- CMD+=(" --output-path" " ${OUTPUT_PATH} " )
26
- fi
28
+ # Add the argument to the command array if set
29
+ if [ -n " ${! var} " ]; then
30
+ CMD+=(" --${arg_name} " " ${! var} " )
31
+ fi
32
+ done
27
33
28
34
# Execute the command
29
35
echo " Running command: ${CMD[*]} "
You can’t perform that action at this time.
0 commit comments