File tree Expand file tree Collapse file tree 3 files changed +30
-4
lines changed
Expand file tree Collapse file tree 3 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,18 @@ function validate_frontend() {
211211 fi
212212}
213213
214+ function validate_gradio() {
215+ local URL=" http://${ip_address} :5173/health"
216+ local HTTP_STATUS=$( curl " $URL " )
217+ local SERVICE_NAME=" Gradio"
218+
219+ if [ " $HTTP_STATUS " = ' {"status":"ok"}' ]; then
220+ echo " [ $SERVICE_NAME ] HTTP status is 200. UI server is running successfully..."
221+ else
222+ echo " [ $SERVICE_NAME ] UI server has failed..."
223+ fi
224+ }
225+
214226function stop_docker() {
215227 local docker_profile=" $1 "
216228
@@ -249,8 +261,8 @@ function main() {
249261
250262 validate_microservices " ${docker_llm_container_names[${i}]} "
251263 validate_megaservice
252- # validate_frontend
253-
264+ validate_gradio
265+
254266 stop_docker " ${docker_compose_profiles[${i}]} "
255267 sleep 5s
256268 done
Original file line number Diff line number Diff line change @@ -210,6 +210,17 @@ function validate_frontend() {
210210 fi
211211}
212212
213+ function validate_gradio() {
214+ local URL=" http://${ip_address} :5173/health"
215+ local HTTP_STATUS=$( curl " $URL " )
216+ local SERVICE_NAME=" Gradio"
217+
218+ if [ " $HTTP_STATUS " = ' {"status":"ok"}' ]; then
219+ echo " [ $SERVICE_NAME ] HTTP status is 200. UI server is running successfully..."
220+ else
221+ echo " [ $SERVICE_NAME ] UI server has failed..."
222+ fi
223+ }
213224
214225function stop_docker() {
215226 local docker_profile=" $1 "
@@ -249,13 +260,13 @@ function main() {
249260
250261 validate_microservices " ${docker_llm_container_names[${i}]} "
251262 validate_megaservice
252- # validate_frontend
263+ validate_gradio
253264
254265 stop_docker " ${docker_compose_profiles[${i}]} "
255266 sleep 5s
256267 done
257268
258- # echo y | docker system prune
269+ echo y | docker system prune
259270}
260271
261272main
Original file line number Diff line number Diff line change @@ -335,6 +335,9 @@ def get_file_names(files):
335335 delete_all_button = gr .Button ("Delete All" , variant = "primary" , size = "sm" )
336336 delete_all_button .click (delete_all_files , outputs = upload_status )
337337
338+ @app .get ("/health" )
339+ def health_check ():
340+ return {"status" : "ok" }
338341
339342ui .queue ()
340343app = gr .mount_gradio_app (app , ui , path = "/" )
You can’t perform that action at this time.
0 commit comments