File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1414 - vllm.entrypoints.openai.api_server
1515 image : vllm/vllm-openai
1616 version : v0.7.3
17+ lifecycle :
18+ preStop :
19+ exec :
20+ command :
21+ - /bin/sh
22+ - -c
23+ - |
24+ while true; do
25+ RUNNING=$(curl -s http://localhost:8000/metrics | grep 'vllm:num_requests_running' | grep -v '#' | awk '{print $2}')
26+ WAITING=$(curl -s http://localhost:8000/metrics | grep 'vllm:num_requests_waiting' | grep -v '#' | awk '{print $2}')
27+ if [ "$RUNNING" = "0.0" ] && [ "$WAITING" = "0.0" ]; then
28+ echo "Terminating: No active or waiting requests, safe to terminate" >> /proc/1/fd/1
29+ exit 0
30+ else
31+ echo "Terminating: Running: $RUNNING, Waiting: $WAITING" >> /proc/1/fd/1
32+ sleep 5
33+ fi
34+ done
1735 # Do not edit the preset argument name unless you know what you're doing.
1836 # Free to add more arguments with your requirements.
1937 recommendedConfigs :
You can’t perform that action at this time.
0 commit comments