Skip to content

AgentQnA group log lines in test outputs for better readable logs. #1817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AgentQnA/docker_compose/amd/gpu/rocm/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
command: --model-id ${LLM_MODEL_ID} --max-input-length 4096 --max-total-tokens 8192

worker-rag-agent:
image: opea/agent:latest
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
container_name: rag-agent-endpoint
volumes:
- "${TOOLSET_PATH}:/home/user/tools/"
Expand Down Expand Up @@ -60,7 +60,7 @@ services:
port: 9095

worker-sql-agent:
image: opea/agent:latest
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
container_name: sql-agent-endpoint
volumes:
- "${WORKDIR}/tests/Chinook_Sqlite.sqlite:/home/user/chinook-db/Chinook_Sqlite.sqlite:rw"
Expand Down Expand Up @@ -89,7 +89,7 @@ services:
port: 9096

supervisor-react-agent:
image: opea/agent:latest
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
container_name: react-agent-endpoint
depends_on:
- worker-rag-agent
Expand Down
6 changes: 3 additions & 3 deletions AgentQnA/docker_compose/amd/gpu/rocm/compose_vllm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
ipc: host

worker-rag-agent:
image: opea/agent:latest
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
container_name: rag-agent-endpoint
volumes:
- ${TOOLSET_PATH}:/home/user/tools/
Expand Down Expand Up @@ -64,7 +64,7 @@ services:
port: 9095

worker-sql-agent:
image: opea/agent:latest
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
container_name: sql-agent-endpoint
volumes:
- "${WORKDIR}/tests/Chinook_Sqlite.sqlite:/home/user/chinook-db/Chinook_Sqlite.sqlite:rw"
Expand Down Expand Up @@ -93,7 +93,7 @@ services:
port: 9096

supervisor-react-agent:
image: opea/agent:latest
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
container_name: react-agent-endpoint
depends_on:
- worker-rag-agent
Expand Down
10 changes: 5 additions & 5 deletions AgentQnA/docker_compose/intel/hpu/gaudi/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

services:
worker-rag-agent:
image: opea/agent:latest
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
container_name: rag-agent-endpoint
volumes:
- ${TOOLSET_PATH}:/home/user/tools/
Expand Down Expand Up @@ -34,7 +34,7 @@ services:
port: 9095

worker-sql-agent:
image: opea/agent:latest
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
container_name: sql-agent-endpoint
volumes:
- ${WORKDIR}/GenAIExamples/AgentQnA/tests:/home/user/chinook-db # test db
Expand Down Expand Up @@ -63,7 +63,7 @@ services:
port: 9096

supervisor-react-agent:
image: opea/agent:latest
image: ${REGISTRY:-opea}/agent:${TAG:-latest}
container_name: react-agent-endpoint
depends_on:
- worker-rag-agent
Expand Down Expand Up @@ -104,7 +104,7 @@ services:
- "8080:8000"
ipc: host
agent-ui:
image: opea/agent-ui:latest
image: ${REGISTRY:-opea}/agent-ui:${TAG:-latest}
container_name: agent-ui
environment:
host_ip: ${host_ip}
Expand All @@ -117,7 +117,7 @@ services:
ports:
- "8086:8000"
volumes:
- "./data:/data"
- "${MODEL_CACHE:-./data}:/data"
environment:
no_proxy: ${no_proxy}
http_proxy: ${http_proxy}
Expand Down
11 changes: 7 additions & 4 deletions AgentQnA/docker_image_build/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ services:
dockerfile: ./docker/Dockerfile
extends: agent
image: ${REGISTRY:-opea}/agent-ui:${TAG:-latest}
vllm-gaudi:
build:
context: vllm-fork
dockerfile: Dockerfile.hpu
extends: agent
image: ${REGISTRY:-opea}/vllm-gaudi:${TAG:-latest}
vllm-rocm:
build:
args:
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
no_proxy: ${no_proxy}
context: GenAIComps
dockerfile: comps/third_parties/vllm/src/Dockerfile.amd_gpu
extends: agent
image: ${REGISTRY:-opea}/vllm-rocm:${TAG:-latest}
2 changes: 1 addition & 1 deletion AgentQnA/tests/_test_compose_openai_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function stop_retrieval_tool() {
}

echo "=================== #1 Building docker images===================="
bash step1_build_images.sh
bash step1_build_images.sh xeon
echo "=================== #1 Building docker images completed===================="

echo "=================== #2 Start retrieval tool===================="
Expand Down
87 changes: 57 additions & 30 deletions AgentQnA/tests/step1_build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,52 @@ function get_genai_comps() {
fi
}


function build_docker_images_for_retrieval_tool(){
cd $WORKDIR/GenAIExamples/DocIndexRetriever/docker_image_build/
get_genai_comps
echo "Build all the images with --no-cache..."
service_list="doc-index-retriever dataprep embedding retriever reranking"
docker compose -f build.yaml build ${service_list} --no-cache
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.6

docker compose -f build.yaml build --no-cache
docker images && sleep 1s
}

function build_agent_docker_image() {
function build_agent_docker_image_xeon() {
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
get_genai_comps

echo "Build agent image with --no-cache..."
docker compose -f build.yaml build --no-cache
service_list="agent agent-ui"
docker compose -f build.yaml build ${service_list} --no-cache
}

function build_vllm_docker_image() {
echo "Building the vllm docker image"
cd $WORKPATH
echo $WORKPATH
if [ ! -d "./vllm-fork" ]; then
git clone https://github.com/HabanaAI/vllm-fork.git
fi
cd ./vllm-fork
function build_agent_docker_image_gaudi_vllm() {
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
get_genai_comps

git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
VLLM_VER=v0.6.6.post1+Gaudi-1.20.0
git checkout ${VLLM_VER} &> /dev/null
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
if [ $? -ne 0 ]; then
echo "opea/vllm-gaudi:ci failed"
exit 1
else
echo "opea/vllm-gaudi:ci successful"
fi
git checkout ${VLLM_VER} &> /dev/null && cd ../

echo "Build agent image with --no-cache..."
service_list="agent agent-ui vllm-gaudi"
docker compose -f build.yaml build ${service_list} --no-cache
}

function build_agent_docker_image_rocm() {
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
get_genai_comps

echo "Build agent image with --no-cache..."
service_list="agent agent-ui"
docker compose -f build.yaml build ${service_list} --no-cache
}

function build_agent_docker_image_rocm_vllm() {
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
get_genai_comps

echo "Build agent image with --no-cache..."
service_list="agent agent-ui vllm-rocm"
docker compose -f build.yaml build ${service_list} --no-cache
}


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

echo "==================== Build agent docker image ===================="
build_agent_docker_image
echo "==================== Build agent docker image completed ===================="
sleep 3s

echo "==================== Build vllm docker image ===================="
build_vllm_docker_image
echo "==================== Build vllm docker image completed ===================="
case $1 in
"rocm")
echo "==================== Build agent docker image for ROCm ===================="
build_agent_docker_image_rocm
;;
"rocm_vllm")
echo "==================== Build agent docker image for ROCm VLLM ===================="
build_agent_docker_image_rocm_vllm
;;
"gaudi_vllm")
echo "==================== Build agent docker image for Gaudi ===================="
build_agent_docker_image_gaudi_vllm
;;
"xeon")
echo "==================== Build agent docker image for Xeon ===================="
build_agent_docker_image_xeon
;;
*)
echo "Invalid argument"
exit 1
;;
esac

docker image ls | grep vllm
}

main
main $1
64 changes: 0 additions & 64 deletions AgentQnA/tests/step1_build_images_rocm_vllm.sh

This file was deleted.

48 changes: 17 additions & 31 deletions AgentQnA/tests/test_compose_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,15 @@ export ip_address=$(hostname -I | awk '{print $1}')
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export TOOLSET_PATH=$WORKDIR/GenAIExamples/AgentQnA/tools/
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"
IMAGE_REPO=${IMAGE_REPO:-"opea"}
IMAGE_TAG=${IMAGE_TAG:-"latest"}
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
export REGISTRY=${IMAGE_REPO}
export TAG=${IMAGE_TAG}
export MODEL_CACHE=${model_cache:-"./data"}


function get_genai_comps() {
if [ ! -d "GenAIComps" ] ; then
git clone --depth 1 --branch ${opea_branch:-"main"} https://github.com/opea-project/GenAIComps.git
fi
}


function build_agent_docker_image() {
cd $WORKDIR/GenAIExamples/AgentQnA/docker_image_build/
get_genai_comps
echo "Build agent image with --no-cache..."
docker compose -f build.yaml build --no-cache
}

function build_retrieval_docker_image() {
cd $WORKDIR/GenAIExamples/DocIndexRetriever/docker_image_build/
get_genai_comps
echo "Build retrieval image with --no-cache..."
docker compose -f build.yaml build --no-cache
}

function stop_crag() {
cid=$(docker ps -aq --filter "name=kdd-cup-24-crag-service")
echo "Stopping container kdd-cup-24-crag-service with cid $cid"
Expand Down Expand Up @@ -92,31 +78,31 @@ function stop_retrieval_tool() {
done
}
echo "workpath: $WORKPATH"
echo "=================== Stop containers ===================="
echo "::group::=================== Stop containers ===================="
stop_llm
stop_crag
stop_agent_containers
stop_retrieval_tool
stop_telemetry_containers
echo "::endgroup::"

cd $WORKPATH/tests

echo "=================== #1 Building docker images===================="
build_retrieval_docker_image
build_agent_docker_image
echo "=================== #1 Building docker images completed===================="
echo "::group::=================== #1 Building docker images===================="
bash step1_build_images.sh gaudi_vllm > docker_image_build.log
echo "::endgroup::"

echo "=================== #4 Start agent, API server, retrieval, and ingest data===================="
bash $WORKPATH/tests/step4_launch_and_validate_agent_gaudi.sh
echo "=================== #4 Agent, retrieval test passed ===================="
echo "::endgroup::=================== #4 Start agent, API server, retrieval, and ingest data===================="
bash step4_launch_and_validate_agent_gaudi.sh
echo "::endgroup::"

echo "=================== #5 Stop agent and API server===================="
echo "::endgroup::=================== #5 Stop agent and API server===================="
stop_llm
stop_crag
stop_agent_containers
stop_retrieval_tool
stop_telemetry_containers
echo "=================== #5 Agent and API server stopped===================="
echo "::endgroup::"

echo y | docker system prune

Expand Down
Loading