Skip to content

Commit 531d21b

Browse files
chensuyuechyundunovDatamonsters
authored andcommitted
AgentQnA group log lines in test outputs for better readable logs. (opea-project#1817)
Signed-off-by: chensuyue <suyue.chen@intel.com> Signed-off-by: Chingis Yundunov <c.yundunov@datamonsters.com>
1 parent 8142872 commit 531d21b

File tree

10 files changed

+133
-168
lines changed

10 files changed

+133
-168
lines changed

AgentQnA/docker_compose/amd/gpu/rocm/compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
command: --model-id ${LLM_MODEL_ID} --max-input-length 4096 --max-total-tokens 8192
3030

3131
worker-rag-agent:
32-
image: opea/agent:latest
32+
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
3333
container_name: rag-agent-endpoint
3434
volumes:
3535
- "${TOOLSET_PATH}:/home/user/tools/"
@@ -60,7 +60,7 @@ services:
6060
port: 9095
6161

6262
worker-sql-agent:
63-
image: opea/agent:latest
63+
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
6464
container_name: sql-agent-endpoint
6565
volumes:
6666
- "${WORKDIR}/tests/Chinook_Sqlite.sqlite:/home/user/chinook-db/Chinook_Sqlite.sqlite:rw"
@@ -89,7 +89,7 @@ services:
8989
port: 9096
9090

9191
supervisor-react-agent:
92-
image: opea/agent:latest
92+
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
9393
container_name: react-agent-endpoint
9494
depends_on:
9595
- worker-rag-agent

AgentQnA/docker_compose/amd/gpu/rocm/compose_vllm.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ services:
3333
ipc: host
3434

3535
worker-rag-agent:
36-
image: opea/agent:latest
36+
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
3737
container_name: rag-agent-endpoint
3838
volumes:
3939
- ${TOOLSET_PATH}:/home/user/tools/
@@ -64,7 +64,7 @@ services:
6464
port: 9095
6565

6666
worker-sql-agent:
67-
image: opea/agent:latest
67+
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
6868
container_name: sql-agent-endpoint
6969
volumes:
7070
- "${WORKDIR}/tests/Chinook_Sqlite.sqlite:/home/user/chinook-db/Chinook_Sqlite.sqlite:rw"
@@ -93,7 +93,7 @@ services:
9393
port: 9096
9494

9595
supervisor-react-agent:
96-
image: opea/agent:latest
96+
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
9797
container_name: react-agent-endpoint
9898
depends_on:
9999
- worker-rag-agent

AgentQnA/docker_compose/intel/hpu/gaudi/compose.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
services:
55
worker-rag-agent:
6-
image: opea/agent:latest
6+
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
77
container_name: rag-agent-endpoint
88
volumes:
99
- ${TOOLSET_PATH}:/home/user/tools/
@@ -34,7 +34,7 @@ services:
3434
port: 9095
3535

3636
worker-sql-agent:
37-
image: opea/agent:latest
37+
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
3838
container_name: sql-agent-endpoint
3939
volumes:
4040
- ${WORKDIR}/GenAIExamples/AgentQnA/tests:/home/user/chinook-db # test db
@@ -63,7 +63,7 @@ services:
6363
port: 9096
6464

6565
supervisor-react-agent:
66-
image: opea/agent:latest
66+
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
6767
container_name: react-agent-endpoint
6868
depends_on:
6969
- worker-rag-agent
@@ -104,7 +104,7 @@ services:
104104
- "8080:8000"
105105
ipc: host
106106
agent-ui:
107-
image: opea/agent-ui:latest
107+
image: ${REGISTRY:-opea}/agent-ui:${TAG:-latest}
108108
container_name: agent-ui
109109
environment:
110110
host_ip: ${host_ip}
@@ -117,7 +117,7 @@ services:
117117
ports:
118118
- "8086:8000"
119119
volumes:
120-
- "./data:/data"
120+
- "${MODEL_CACHE:-./data}:/data"
121121
environment:
122122
no_proxy: ${no_proxy}
123123
http_proxy: ${http_proxy}

AgentQnA/docker_image_build/build.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ services:
1717
dockerfile: ./docker/Dockerfile
1818
extends: agent
1919
image: ${REGISTRY:-opea}/agent-ui:${TAG:-latest}
20+
vllm-gaudi:
21+
build:
22+
context: vllm-fork
23+
dockerfile: Dockerfile.hpu
24+
extends: agent
25+
image: ${REGISTRY:-opea}/vllm-gaudi:${TAG:-latest}
2026
vllm-rocm:
2127
build:
22-
args:
23-
http_proxy: ${http_proxy}
24-
https_proxy: ${https_proxy}
25-
no_proxy: ${no_proxy}
2628
context: GenAIComps
2729
dockerfile: comps/third_parties/vllm/src/Dockerfile.amd_gpu
30+
extends: agent
2831
image: ${REGISTRY:-opea}/vllm-rocm:${TAG:-latest}

AgentQnA/tests/_test_compose_openai_on_xeon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function stop_retrieval_tool() {
3131
}
3232

3333
echo "=================== #1 Building docker images===================="
34-
bash step1_build_images.sh
34+
bash step1_build_images.sh xeon
3535
echo "=================== #1 Building docker images completed===================="
3636

3737
echo "=================== #2 Start retrieval tool===================="

AgentQnA/tests/step1_build_images.sh

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,52 @@ function get_genai_comps() {
1515
fi
1616
}
1717

18-
1918
function build_docker_images_for_retrieval_tool(){
2019
cd $WORKDIR/GenAIExamples/DocIndexRetriever/docker_image_build/
2120
get_genai_comps
2221
echo "Build all the images with --no-cache..."
23-
service_list="doc-index-retriever dataprep embedding retriever reranking"
24-
docker compose -f build.yaml build ${service_list} --no-cache
25-
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.6
26-
22+
docker compose -f build.yaml build --no-cache
2723
docker images && sleep 1s
2824
}
2925

30-
function build_agent_docker_image() {
26+
function build_agent_docker_image_xeon() {
3127
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
3228
get_genai_comps
29+
3330
echo "Build agent image with --no-cache..."
34-
docker compose -f build.yaml build --no-cache
31+
service_list="agent agent-ui"
32+
docker compose -f build.yaml build ${service_list} --no-cache
3533
}
3634

37-
function build_vllm_docker_image() {
38-
echo "Building the vllm docker image"
39-
cd $WORKPATH
40-
echo $WORKPATH
41-
if [ ! -d "./vllm-fork" ]; then
42-
git clone https://github.com/HabanaAI/vllm-fork.git
43-
fi
44-
cd ./vllm-fork
35+
function build_agent_docker_image_gaudi_vllm() {
36+
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
37+
get_genai_comps
38+
39+
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
4540
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
46-
git checkout ${VLLM_VER} &> /dev/null
47-
docker build --no-cache -f Dockerfile.hpu -t opea/vllm-gaudi:ci --shm-size=128g . --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy
48-
if [ $? -ne 0 ]; then
49-
echo "opea/vllm-gaudi:ci failed"
50-
exit 1
51-
else
52-
echo "opea/vllm-gaudi:ci successful"
53-
fi
41+
git checkout ${VLLM_VER} &> /dev/null && cd ../
42+
43+
echo "Build agent image with --no-cache..."
44+
service_list="agent agent-ui vllm-gaudi"
45+
docker compose -f build.yaml build ${service_list} --no-cache
46+
}
47+
48+
function build_agent_docker_image_rocm() {
49+
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
50+
get_genai_comps
51+
52+
echo "Build agent image with --no-cache..."
53+
service_list="agent agent-ui"
54+
docker compose -f build.yaml build ${service_list} --no-cache
55+
}
56+
57+
function build_agent_docker_image_rocm_vllm() {
58+
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
59+
get_genai_comps
60+
61+
echo "Build agent image with --no-cache..."
62+
service_list="agent agent-ui vllm-rocm"
63+
docker compose -f build.yaml build ${service_list} --no-cache
5464
}
5565

5666

@@ -59,15 +69,32 @@ function main() {
5969
build_docker_images_for_retrieval_tool
6070
echo "==================== Build docker images for retrieval tool completed ===================="
6171

62-
echo "==================== Build agent docker image ===================="
63-
build_agent_docker_image
64-
echo "==================== Build agent docker image completed ===================="
72+
sleep 3s
6573

66-
echo "==================== Build vllm docker image ===================="
67-
build_vllm_docker_image
68-
echo "==================== Build vllm docker image completed ===================="
74+
case $1 in
75+
"rocm")
76+
echo "==================== Build agent docker image for ROCm ===================="
77+
build_agent_docker_image_rocm
78+
;;
79+
"rocm_vllm")
80+
echo "==================== Build agent docker image for ROCm VLLM ===================="
81+
build_agent_docker_image_rocm_vllm
82+
;;
83+
"gaudi_vllm")
84+
echo "==================== Build agent docker image for Gaudi ===================="
85+
build_agent_docker_image_gaudi_vllm
86+
;;
87+
"xeon")
88+
echo "==================== Build agent docker image for Xeon ===================="
89+
build_agent_docker_image_xeon
90+
;;
91+
*)
92+
echo "Invalid argument"
93+
exit 1
94+
;;
95+
esac
6996

7097
docker image ls | grep vllm
7198
}
7299

73-
main
100+
main $1

AgentQnA/tests/step1_build_images_rocm_vllm.sh

Lines changed: 0 additions & 64 deletions
This file was deleted.

AgentQnA/tests/test_compose_on_gaudi.sh

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,15 @@ export ip_address=$(hostname -I | awk '{print $1}')
1010
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
1111
export TOOLSET_PATH=$WORKDIR/GenAIExamples/AgentQnA/tools/
1212
export no_proxy="$no_proxy,rag-agent-endpoint,sql-agent-endpoint,react-agent-endpoint,agent-ui,vllm-gaudi-server,jaeger,grafana,prometheus,127.0.0.1,localhost,0.0.0.0,$ip_address"
13+
IMAGE_REPO=${IMAGE_REPO:-"opea"}
14+
IMAGE_TAG=${IMAGE_TAG:-"latest"}
15+
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
16+
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
17+
export REGISTRY=${IMAGE_REPO}
18+
export TAG=${IMAGE_TAG}
19+
export MODEL_CACHE=${model_cache:-"./data"}
1320

1421

15-
function get_genai_comps() {
16-
if [ ! -d "GenAIComps" ] ; then
17-
git clone --depth 1 --branch ${opea_branch:-"main"} https://github.com/opea-project/GenAIComps.git
18-
fi
19-
}
20-
21-
22-
function build_agent_docker_image() {
23-
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
24-
get_genai_comps
25-
echo "Build agent image with --no-cache..."
26-
docker compose -f build.yaml build --no-cache
27-
}
28-
29-
function build_retrieval_docker_image() {
30-
cd $WORKDIR/GenAIExamples/DocIndexRetriever/docker_image_build/
31-
get_genai_comps
32-
echo "Build retrieval image with --no-cache..."
33-
docker compose -f build.yaml build --no-cache
34-
}
35-
3622
function stop_crag() {
3723
cid=$(docker ps -aq --filter "name=kdd-cup-24-crag-service")
3824
echo "Stopping container kdd-cup-24-crag-service with cid $cid"
@@ -92,31 +78,31 @@ function stop_retrieval_tool() {
9278
done
9379
}
9480
echo "workpath: $WORKPATH"
95-
echo "=================== Stop containers ===================="
81+
echo "::group::=================== Stop containers ===================="
9682
stop_llm
9783
stop_crag
9884
stop_agent_containers
9985
stop_retrieval_tool
10086
stop_telemetry_containers
87+
echo "::endgroup::"
10188

10289
cd $WORKPATH/tests
10390

104-
echo "=================== #1 Building docker images===================="
105-
build_retrieval_docker_image
106-
build_agent_docker_image
107-
echo "=================== #1 Building docker images completed===================="
91+
echo "::group::=================== #1 Building docker images===================="
92+
bash step1_build_images.sh gaudi_vllm > docker_image_build.log
93+
echo "::endgroup::"
10894

109-
echo "=================== #4 Start agent, API server, retrieval, and ingest data===================="
110-
bash $WORKPATH/tests/step4_launch_and_validate_agent_gaudi.sh
111-
echo "=================== #4 Agent, retrieval test passed ===================="
95+
echo "::endgroup::=================== #4 Start agent, API server, retrieval, and ingest data===================="
96+
bash step4_launch_and_validate_agent_gaudi.sh
97+
echo "::endgroup::"
11298

113-
echo "=================== #5 Stop agent and API server===================="
99+
echo "::endgroup::=================== #5 Stop agent and API server===================="
114100
stop_llm
115101
stop_crag
116102
stop_agent_containers
117103
stop_retrieval_tool
118104
stop_telemetry_containers
119-
echo "=================== #5 Agent and API server stopped===================="
105+
echo "::endgroup::"
120106

121107
echo y | docker system prune
122108

0 commit comments

Comments
 (0)