Skip to content

Commit e0929cb

Browse files
committed
update gradio test & rebase
Signed-off-by: Mustafa <[email protected]>
1 parent 87864e2 commit e0929cb

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

CodeGen/tests/test_compose_on_gaudi.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff 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+
214226
function 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

CodeGen/tests/test_compose_on_xeon.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff 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

214225
function 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

261272
main

CodeGen/ui/gradio/codegen_ui_gradio.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

339342
ui.queue()
340343
app = gr.mount_gradio_app(app, ui, path="/")

0 commit comments

Comments
 (0)