From 3845c2511e48dc8e97aacf9771f2a29a72a7d9d2 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 13:52:47 +0700 Subject: [PATCH 01/33] Adding Docker compose files, set_env.sh , README.md , test script for deployment on AMD GPU Signed-off-by: Chingis Yundunov --- .../docker_compose/amd/gpu/rocm/README.md | 2 + .../docker_compose/amd/gpu/rocm/compose.yaml | 94 ++++++++++ .../docker_compose/amd/gpu/rocm/set_env.sh | 19 ++ CodeTrans/tests/test_compose_on_rocm.sh | 177 ++++++++++++++++++ 4 files changed, 292 insertions(+) create mode 100644 CodeTrans/docker_compose/amd/gpu/rocm/README.md create mode 100644 CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml create mode 100644 CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh create mode 100644 CodeTrans/tests/test_compose_on_rocm.sh diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/README.md b/CodeTrans/docker_compose/amd/gpu/rocm/README.md new file mode 100644 index 0000000000..f566a3c8a8 --- /dev/null +++ b/CodeTrans/docker_compose/amd/gpu/rocm/README.md @@ -0,0 +1,2 @@ +###### Copyright (C) 2024 Advanced Micro Devices, Inc. + diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml new file mode 100644 index 0000000000..4c8d3ea6ae --- /dev/null +++ b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml @@ -0,0 +1,94 @@ +# Copyright (C) 2024 Advanced Micro Devices, Inc. + +services: + codetrans-tgi-service: + image: ghcr.io/huggingface/text-generation-inference:2.3.1-rocm + container_name: codetrans-tgi-service + ports: + - "${CODETRANS_TGI_SERVICE_PORT:-8008}:80" + volumes: + - "/var/lib/GenAI/codetrans/data:/data" + shm_size: 1g + environment: + no_proxy: ${no_proxy} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + TGI_LLM_ENDPOINT: ${CODETRANS_TGI_LLM_ENDPOINT} + HUGGINGFACEHUB_API_TOKEN: ${CODETRANS_HUGGINGFACEHUB_API_TOKEN} + devices: + - /dev/kfd:/dev/kfd + - /dev/dri/:/dev/dri/ + cap_add: + - SYS_PTRACE + group_add: + - video + security_opt: + - seccomp:unconfined + ipc: host + command: --model-id ${CODETRANS_LLM_MODEL_ID} + codetrans-llm-server: + image: ${REGISTRY:-opea}/llm-tgi:${TAG:-latest} + container_name: codetrans-llm-server + ports: + - "${CODETRANS_LLM_SERVICE_PORT:-9000}:9000" + ipc: host + environment: + no_proxy: ${no_proxy} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + TGI_LLM_ENDPOINT: "http://codetrans-tgi-service" + HUGGINGFACEHUB_API_TOKEN: ${CODETRANS_HUGGINGFACEHUB_API_TOKEN} + restart: unless-stopped + codetrans-backend-server: + image: ${REGISTRY:-opea}/codetrans:${TAG:-latest} + container_name: codetrans-backend-server + depends_on: + - codetrans-tgi-service + - codetrans-llm-server + ports: + - "${CODETRANS_BACKEND_SERVICE_PORT:-7777}:7777" + environment: + no_proxy: ${no_proxy} + https_proxy: ${https_proxy} + http_proxy: ${http_proxy} + MEGA_SERVICE_HOST_IP: ${HOST_IP} + LLM_SERVICE_HOST_IP: "http://codetrans-llm-server:9000" + ipc: host + restart: always + codetrans-ui-server: + image: ${REGISTRY:-opea}/codetrans-ui:${TAG:-latest} + container_name: codetrans-ui-server + depends_on: + - codetrans-backend-server + ports: + - "${CODETRANS_FRONTEND_SERVICE_PORT:-5173}:5173" + environment: + no_proxy: ${no_proxy} + https_proxy: ${https_proxy} + http_proxy: ${http_proxy} + BASIC_URL: ${CODETRANS_BACKEND_SERVICE_URL} + ipc: host + restart: always + codetrans-nginx-server: + image: ${REGISTRY:-opea}/nginx:${TAG:-latest} + container_name: codetrans-nginx-server + depends_on: + - codetrans-backend-server + - codetrans-ui-server + ports: + - "${CODETRANS_NGINX_PORT:-80}:80" + environment: + - no_proxy=${no_proxy} + - https_proxy=${https_proxy} + - http_proxy=${http_proxy} + - FRONTEND_SERVICE_IP=${CODETRANS_FRONTEND_SERVICE_IP} + - FRONTEND_SERVICE_PORT=${CODETRANS_FRONTEND_SERVICE_PORT} + - BACKEND_SERVICE_NAME=${CODETRANS_BACKEND_SERVICE_NAME} + - BACKEND_SERVICE_IP=${CODETRANS_BACKEND_SERVICE_IP} + - BACKEND_SERVICE_PORT=${CODETRANS_BACKEND_SERVICE_PORT} + ipc: host + restart: always + +networks: + default: + driver: bridge diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh new file mode 100644 index 0000000000..b8844e62c9 --- /dev/null +++ b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Copyright (C) 2024 Advanced Micro Devices, Inc. + +export HOST_IP=direct-supercomputer1.powerml.co +export CODETRANS_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" +export CODETRANS_TGI_SERVICE_PORT=8008 +export CODETRANS_TGI_LLM_ENDPOINT="http://${HOST_IP}:${CODETRANS_TGI_SERVICE_PORT}" +export CODETRANS_HUGGINGFACEHUB_API_TOKEN=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 +export CODETRANS_LLM_SERVICE_PORT=9000 +export CODETRANS_MEGA_SERVICE_HOST_IP=${HOST_IP} +export CODETRANS_LLM_SERVICE_HOST_IP=${HOST_IP} +export CODETRANS_BACKEND_SERVICE_URL="http://${HOST_IP}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" +export CODETRANS_FRONTEND_SERVICE_IP=${HOST_IP} +export CODETRANS_FRONTEND_SERVICE_PORT=18155 +export CODETRANS_BACKEND_SERVICE_NAME=codetrans-backend-server +export CODETRANS_BACKEND_SERVICE_IP=${HOST_IP} +export CODETRANS_BACKEND_SERVICE_PORT=18154 +export CODETRANS_NGINX_PORT=18153 diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh new file mode 100644 index 0000000000..4ad0d11ba3 --- /dev/null +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -0,0 +1,177 @@ +#!/bin/bash + +# Copyright (C) 2024 Advanced Micro Devices, Inc. + +set -xe +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} + +WORKPATH=$(dirname "$PWD") +LOG_PATH="$WORKPATH/tests" +ip_address=$(hostname -I | awk '{print $1}') + +function build_docker_images() { + cd $WORKPATH/docker_image_build + git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../ + + echo "Build all the images with --no-cache, check docker_image_build.log for details..." + service_list="codetrans codetrans-ui llm-tgi nginx" + docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log + + docker pull ghcr.io/huggingface/text-generation-inference:2.3.1-rocm + docker images && sleep 1s +} + +function start_services() { + cd $WORKPATH/docker_compose/amd/gpu/rocm/ + export http_proxy=${http_proxy} + export https_proxy=${http_proxy} + export CODETRANS_LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3" + export CODETRANS_TGI_LLM_ENDPOINT="http://${ip_address}:8008" + export CODETRANS_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} + export CODETRANS_MEGA_SERVICE_HOST_IP=${ip_address} + export CODETRANS_LLM_SERVICE_HOST_IP=${ip_address} + export CODETRANS_FRONTEND_SERVICE_IP=${ip_address} + export CODETRANS_FRONTEND_SERVICE_PORT=18155 + export CODETRANS_BACKEND_SERVICE_NAME=codetrans-backend-server + export CODETRANS_BACKEND_SERVICE_IP=${ip_address} + export CODETRANS_BACKEND_SERVICE_PORT=18154 + export CODETRANS_NGINX_PORT=18153 + export CODETRANS_BACKEND_SERVICE_ENDPOINT="http://${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" + + sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env + + # Start Docker Containers + docker compose up -d > ${LOG_PATH}/start_services_with_compose.log + + n=0 + until [[ "$n" -ge 100 ]]; do + docker logs codetrans-tgi-service > ${LOG_PATH}/tgi_service_start.log + if grep -q Connected ${LOG_PATH}/tgi_service_start.log; then + break + fi + sleep 5s + n=$((n+1)) + done +} + +function validate_services() { + local URL="$1" + local EXPECTED_RESULT="$2" + local SERVICE_NAME="$3" + local DOCKER_NAME="$4" + local INPUT_DATA="$5" + + local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL") + if [ "$HTTP_STATUS" -eq 200 ]; then + echo "[ $SERVICE_NAME ] HTTP status is 200. Checking content..." + + local CONTENT=$(curl -s -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL" | tee ${LOG_PATH}/${SERVICE_NAME}.log) + + if echo "$CONTENT" | grep -q "$EXPECTED_RESULT"; then + echo "[ $SERVICE_NAME ] Content is as expected." + else + echo "[ $SERVICE_NAME ] Content does not match the expected result: $CONTENT" + docker logs ${DOCKER_NAME} >> ${LOG_PATH}/${SERVICE_NAME}.log + exit 1 + fi + else + echo "[ $SERVICE_NAME ] HTTP status is not 200. Received status was $HTTP_STATUS" + docker logs ${DOCKER_NAME} >> ${LOG_PATH}/${SERVICE_NAME}.log + exit 1 + fi + sleep 5s +} + +function validate_microservices() { + # tgi for embedding service + validate_services \ + "${ip_address}:8008/generate" \ + "generated_text" \ + "tgi" \ + "codetrans-tgi-service" \ + '{"inputs":"What is Deep Learning?","parameters":{"max_new_tokens":17, "do_sample": true}}' + + # llm microservice + validate_services \ + "${ip_address}:9000/v1/chat/completions" \ + "data: " \ + "llm" \ + "codetrans-llm-server" \ + '{"query":" ### System: Please translate the following Golang codes into Python codes. ### Original codes: '\'''\'''\''Golang \npackage main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n '\'''\'''\'' ### Translated codes:"}' + +} + +function validate_megaservice() { + # Curl the Mega Service + validate_services \ + "${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" \ + "print" \ + "codetrans-backend-server" \ + "codetrans-backend-server" \ + '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' + + # test the megeservice via nginx + validate_services \ + "${ip_address}:${CODETRANS_NGINX_PORT}/v1/codetrans" \ + "print" \ + "codetrans-nginx-server" \ + "codetrans-nginx-server" \ + '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' + +} + +function validate_frontend() { + cd $WORKPATH/ui/svelte + local conda_env_name="OPEA_e2e" + export PATH=${HOME}/miniforge3/bin/:$PATH + if conda info --envs | grep -q "$conda_env_name"; then + echo "$conda_env_name exist!" + else + conda create -n ${conda_env_name} python=3.12 -y + fi + source activate ${conda_env_name} + + sed -i "s/localhost/$ip_address/g" playwright.config.ts + + conda install -c conda-forge nodejs -y + npm install && npm ci && npx playwright install --with-deps + node -v && npm -v && pip list + + exit_status=0 + npx playwright test || exit_status=$? + + if [ $exit_status -ne 0 ]; then + echo "[TEST INFO]: ---------frontend test failed---------" + exit $exit_status + else + echo "[TEST INFO]: ---------frontend test passed---------" + fi +} + +function stop_docker() { + cd $WORKPATH/docker_compose/amd/gpu/rocm/ + docker compose stop && docker compose rm -f +} + +function main() { + + stop_docker + + if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi + start_services + + validate_microservices + validate_megaservice + validate_frontend + + stop_docker + echo y | docker system prune + +} + +main From 318cc4a99da6d81137a1c9be84c037129d6d33d0 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 13:59:52 +0700 Subject: [PATCH 02/33] Fix set_env.sh and tests/test_compose_on_rocm.sh Signed-off-by: Chingis Yundunov --- CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh | 4 ++-- CodeTrans/tests/test_compose_on_rocm.sh | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh index b8844e62c9..d96dd0d750 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh @@ -4,10 +4,10 @@ export HOST_IP=direct-supercomputer1.powerml.co export CODETRANS_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" -export CODETRANS_TGI_SERVICE_PORT=8008 +export CODETRANS_TGI_SERVICE_PORT=18156 export CODETRANS_TGI_LLM_ENDPOINT="http://${HOST_IP}:${CODETRANS_TGI_SERVICE_PORT}" export CODETRANS_HUGGINGFACEHUB_API_TOKEN=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 -export CODETRANS_LLM_SERVICE_PORT=9000 +export CODETRANS_LLM_SERVICE_PORT=18157 export CODETRANS_MEGA_SERVICE_HOST_IP=${HOST_IP} export CODETRANS_LLM_SERVICE_HOST_IP=${HOST_IP} export CODETRANS_BACKEND_SERVICE_URL="http://${HOST_IP}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 4ad0d11ba3..eb7d70e707 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -30,8 +30,10 @@ function start_services() { cd $WORKPATH/docker_compose/amd/gpu/rocm/ export http_proxy=${http_proxy} export https_proxy=${http_proxy} + export CODETRANS_TGI_SERVICE_PORT=18156 + export CODETRANS_LLM_SERVICE_PORT=18157 export CODETRANS_LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3" - export CODETRANS_TGI_LLM_ENDPOINT="http://${ip_address}:8008" + export CODETRANS_TGI_LLM_ENDPOINT="http://${ip_address}:${CODETRANS_TGI_SERVICE_PORT}" export CODETRANS_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} export CODETRANS_MEGA_SERVICE_HOST_IP=${ip_address} export CODETRANS_LLM_SERVICE_HOST_IP=${ip_address} @@ -90,7 +92,7 @@ function validate_services() { function validate_microservices() { # tgi for embedding service validate_services \ - "${ip_address}:8008/generate" \ + "${ip_address}:${CODETRANS_TGI_SERVICE_PORT}/generate" \ "generated_text" \ "tgi" \ "codetrans-tgi-service" \ @@ -98,7 +100,7 @@ function validate_microservices() { # llm microservice validate_services \ - "${ip_address}:9000/v1/chat/completions" \ + "${ip_address}:${CODETRANS_LLM_SERVICE_PORT}/v1/chat/completions" \ "data: " \ "llm" \ "codetrans-llm-server" \ From 292d96e585a3e25b56ac6e94109fd6a460239bc8 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 14:06:07 +0700 Subject: [PATCH 03/33] Fix set_env.sh and tests/test_compose_on_rocm.sh Signed-off-by: Chingis Yundunov --- CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh index d96dd0d750..ed617700c6 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh @@ -10,10 +10,10 @@ export CODETRANS_HUGGINGFACEHUB_API_TOKEN=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 export CODETRANS_LLM_SERVICE_PORT=18157 export CODETRANS_MEGA_SERVICE_HOST_IP=${HOST_IP} export CODETRANS_LLM_SERVICE_HOST_IP=${HOST_IP} -export CODETRANS_BACKEND_SERVICE_URL="http://${HOST_IP}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" export CODETRANS_FRONTEND_SERVICE_IP=${HOST_IP} export CODETRANS_FRONTEND_SERVICE_PORT=18155 export CODETRANS_BACKEND_SERVICE_NAME=codetrans-backend-server export CODETRANS_BACKEND_SERVICE_IP=${HOST_IP} export CODETRANS_BACKEND_SERVICE_PORT=18154 export CODETRANS_NGINX_PORT=18153 +export CODETRANS_BACKEND_SERVICE_URL="http://${HOST_IP}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" From d9da8dd5634e9a71f3f141ca27553904f81b1a2b Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 14:11:05 +0700 Subject: [PATCH 04/33] Fix set_env.sh Signed-off-by: Chingis Yundunov --- CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh index ed617700c6..dbbb4b1d16 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh @@ -12,7 +12,7 @@ export CODETRANS_MEGA_SERVICE_HOST_IP=${HOST_IP} export CODETRANS_LLM_SERVICE_HOST_IP=${HOST_IP} export CODETRANS_FRONTEND_SERVICE_IP=${HOST_IP} export CODETRANS_FRONTEND_SERVICE_PORT=18155 -export CODETRANS_BACKEND_SERVICE_NAME=codetrans-backend-server +export CODETRANS_BACKEND_SERVICE_NAME=codetrans export CODETRANS_BACKEND_SERVICE_IP=${HOST_IP} export CODETRANS_BACKEND_SERVICE_PORT=18154 export CODETRANS_NGINX_PORT=18153 From 1060200b288af31bbdff94e7257c3508aab2defb Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 14:20:56 +0700 Subject: [PATCH 05/33] Fix set_env.sh Signed-off-by: Chingis Yundunov --- CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh index dbbb4b1d16..e38f1a7c03 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh @@ -10,10 +10,10 @@ export CODETRANS_HUGGINGFACEHUB_API_TOKEN=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 export CODETRANS_LLM_SERVICE_PORT=18157 export CODETRANS_MEGA_SERVICE_HOST_IP=${HOST_IP} export CODETRANS_LLM_SERVICE_HOST_IP=${HOST_IP} -export CODETRANS_FRONTEND_SERVICE_IP=${HOST_IP} +export CODETRANS_FRONTEND_SERVICE_IP=192.165.1.21 export CODETRANS_FRONTEND_SERVICE_PORT=18155 export CODETRANS_BACKEND_SERVICE_NAME=codetrans -export CODETRANS_BACKEND_SERVICE_IP=${HOST_IP} +export CODETRANS_BACKEND_SERVICE_IP=192.165.1.21 export CODETRANS_BACKEND_SERVICE_PORT=18154 export CODETRANS_NGINX_PORT=18153 export CODETRANS_BACKEND_SERVICE_URL="http://${HOST_IP}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" From 16cfbf1fc883edb16ccd7a08098aec5169a60a6e Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 14:23:40 +0700 Subject: [PATCH 06/33] Fix CodeTrans Docker compose.yaml Signed-off-by: Chingis Yundunov --- CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml index 4c8d3ea6ae..fd3d91ae40 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml +++ b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml @@ -52,7 +52,7 @@ services: https_proxy: ${https_proxy} http_proxy: ${http_proxy} MEGA_SERVICE_HOST_IP: ${HOST_IP} - LLM_SERVICE_HOST_IP: "http://codetrans-llm-server:9000" + LLM_SERVICE_HOST_IP: "codetrans-llm-server" ipc: host restart: always codetrans-ui-server: From 9890d32d076b1a1692be991ebdbe7911dabd8833 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 15:06:04 +0700 Subject: [PATCH 07/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index eb7d70e707..62fa96ebab 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -94,7 +94,7 @@ function validate_microservices() { validate_services \ "${ip_address}:${CODETRANS_TGI_SERVICE_PORT}/generate" \ "generated_text" \ - "tgi" \ + "codetrans-tgi-service" \ "codetrans-tgi-service" \ '{"inputs":"What is Deep Learning?","parameters":{"max_new_tokens":17, "do_sample": true}}' @@ -102,7 +102,7 @@ function validate_microservices() { validate_services \ "${ip_address}:${CODETRANS_LLM_SERVICE_PORT}/v1/chat/completions" \ "data: " \ - "llm" \ + "codetrans-llm-server" \ "codetrans-llm-server" \ '{"query":" ### System: Please translate the following Golang codes into Python codes. ### Original codes: '\'''\'''\''Golang \npackage main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n '\'''\'''\'' ### Translated codes:"}' From a94f95bbcffe07ecffd718333b07ad6fd9efb845 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 15:09:45 +0700 Subject: [PATCH 08/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 62fa96ebab..d39caa30ac 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -92,7 +92,7 @@ function validate_services() { function validate_microservices() { # tgi for embedding service validate_services \ - "${ip_address}:${CODETRANS_TGI_SERVICE_PORT}/generate" \ + "http://${ip_address}:${CODETRANS_TGI_SERVICE_PORT}/generate" \ "generated_text" \ "codetrans-tgi-service" \ "codetrans-tgi-service" \ @@ -100,7 +100,7 @@ function validate_microservices() { # llm microservice validate_services \ - "${ip_address}:${CODETRANS_LLM_SERVICE_PORT}/v1/chat/completions" \ + "http://${ip_address}:${CODETRANS_LLM_SERVICE_PORT}/v1/chat/completions" \ "data: " \ "codetrans-llm-server" \ "codetrans-llm-server" \ @@ -111,7 +111,7 @@ function validate_microservices() { function validate_megaservice() { # Curl the Mega Service validate_services \ - "${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" \ + "http://${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" \ "print" \ "codetrans-backend-server" \ "codetrans-backend-server" \ @@ -119,7 +119,7 @@ function validate_megaservice() { # test the megeservice via nginx validate_services \ - "${ip_address}:${CODETRANS_NGINX_PORT}/v1/codetrans" \ + "http://${ip_address}:${CODETRANS_NGINX_PORT}/v1/codetrans" \ "print" \ "codetrans-nginx-server" \ "codetrans-nginx-server" \ From aed05c2d7fd10770499ba4f031b6a8b44f48cc89 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 15:19:00 +0700 Subject: [PATCH 09/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index d39caa30ac..e40e872271 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -39,7 +39,7 @@ function start_services() { export CODETRANS_LLM_SERVICE_HOST_IP=${ip_address} export CODETRANS_FRONTEND_SERVICE_IP=${ip_address} export CODETRANS_FRONTEND_SERVICE_PORT=18155 - export CODETRANS_BACKEND_SERVICE_NAME=codetrans-backend-server + export CODETRANS_BACKEND_SERVICE_NAME=codetrans export CODETRANS_BACKEND_SERVICE_IP=${ip_address} export CODETRANS_BACKEND_SERVICE_PORT=18154 export CODETRANS_NGINX_PORT=18153 @@ -92,7 +92,7 @@ function validate_services() { function validate_microservices() { # tgi for embedding service validate_services \ - "http://${ip_address}:${CODETRANS_TGI_SERVICE_PORT}/generate" \ + "${ip_address}:${CODETRANS_TGI_SERVICE_PORT}/generate" \ "generated_text" \ "codetrans-tgi-service" \ "codetrans-tgi-service" \ @@ -100,7 +100,7 @@ function validate_microservices() { # llm microservice validate_services \ - "http://${ip_address}:${CODETRANS_LLM_SERVICE_PORT}/v1/chat/completions" \ + "${ip_address}:${CODETRANS_LLM_SERVICE_PORT}/v1/chat/completions" \ "data: " \ "codetrans-llm-server" \ "codetrans-llm-server" \ @@ -111,7 +111,7 @@ function validate_microservices() { function validate_megaservice() { # Curl the Mega Service validate_services \ - "http://${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" \ + "${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" \ "print" \ "codetrans-backend-server" \ "codetrans-backend-server" \ @@ -119,7 +119,7 @@ function validate_megaservice() { # test the megeservice via nginx validate_services \ - "http://${ip_address}:${CODETRANS_NGINX_PORT}/v1/codetrans" \ + "${ip_address}:${CODETRANS_NGINX_PORT}/v1/codetrans" \ "print" \ "codetrans-nginx-server" \ "codetrans-nginx-server" \ From 9f4dec0d7bc81ef2faee67f61a89df7669340dd3 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 15:26:56 +0700 Subject: [PATCH 10/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index e40e872271..f789c89b17 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -34,7 +34,7 @@ function start_services() { export CODETRANS_LLM_SERVICE_PORT=18157 export CODETRANS_LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3" export CODETRANS_TGI_LLM_ENDPOINT="http://${ip_address}:${CODETRANS_TGI_SERVICE_PORT}" - export CODETRANS_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} + export CODETRANS_HUGGINGFACEHUB_API_TOKEN=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 export CODETRANS_MEGA_SERVICE_HOST_IP=${ip_address} export CODETRANS_LLM_SERVICE_HOST_IP=${ip_address} export CODETRANS_FRONTEND_SERVICE_IP=${ip_address} From 9fd509a8db11e415fe7208e764ede47185427117 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 17:42:34 +0700 Subject: [PATCH 11/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index f789c89b17..8bcba833d4 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -34,7 +34,7 @@ function start_services() { export CODETRANS_LLM_SERVICE_PORT=18157 export CODETRANS_LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3" export CODETRANS_TGI_LLM_ENDPOINT="http://${ip_address}:${CODETRANS_TGI_SERVICE_PORT}" - export CODETRANS_HUGGINGFACEHUB_API_TOKEN=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 + export CODETRANS_HUGGINGFACEHUB_API_TOKEN="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" export CODETRANS_MEGA_SERVICE_HOST_IP=${ip_address} export CODETRANS_LLM_SERVICE_HOST_IP=${ip_address} export CODETRANS_FRONTEND_SERVICE_IP=${ip_address} From efa9c884fadc173465615098d2ad29fdf54945de Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 17:50:28 +0700 Subject: [PATCH 12/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml index fd3d91ae40..5691a12f1f 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml +++ b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml @@ -14,7 +14,8 @@ services: http_proxy: ${http_proxy} https_proxy: ${https_proxy} TGI_LLM_ENDPOINT: ${CODETRANS_TGI_LLM_ENDPOINT} - HUGGINGFACEHUB_API_TOKEN: ${CODETRANS_HUGGINGFACEHUB_API_TOKEN} + HUGGING_FACE_HUB_TOKEN: ${CODEGEN_HUGGINGFACEHUB_API_TOKEN} + HUGGINGFACEHUB_API_TOKEN: ${CODEGEN_HUGGINGFACEHUB_API_TOKEN} devices: - /dev/kfd:/dev/kfd - /dev/dri/:/dev/dri/ From 20e5ab51272b9f6ff7ee33522c915764fc199c6e Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 17:52:43 +0700 Subject: [PATCH 13/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 8bcba833d4..50cf8aea1a 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -32,7 +32,7 @@ function start_services() { export https_proxy=${http_proxy} export CODETRANS_TGI_SERVICE_PORT=18156 export CODETRANS_LLM_SERVICE_PORT=18157 - export CODETRANS_LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3" + export CODETRANS_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" export CODETRANS_TGI_LLM_ENDPOINT="http://${ip_address}:${CODETRANS_TGI_SERVICE_PORT}" export CODETRANS_HUGGINGFACEHUB_API_TOKEN="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" export CODETRANS_MEGA_SERVICE_HOST_IP=${ip_address} From 7ac07d1b5dd6a49e5a37279598d1c88fe9a8c0c5 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 18:22:14 +0700 Subject: [PATCH 14/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 50cf8aea1a..2b73fa38b1 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -169,7 +169,7 @@ function main() { validate_microservices validate_megaservice - validate_frontend +# validate_frontend stop_docker echo y | docker system prune From bb9c5a1c0f0ed2e46ada0ed66362d5fef2ca759e Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 18:35:35 +0700 Subject: [PATCH 15/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 2b73fa38b1..88fa9617d9 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -168,7 +168,7 @@ function main() { start_services validate_microservices - validate_megaservice +# validate_megaservice # validate_frontend stop_docker From 5e6e2648306b7aac7554df473ea897d24890e526 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 19:43:36 +0700 Subject: [PATCH 16/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 88fa9617d9..f4ba71d466 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -118,12 +118,12 @@ function validate_megaservice() { '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' # test the megeservice via nginx - validate_services \ - "${ip_address}:${CODETRANS_NGINX_PORT}/v1/codetrans" \ - "print" \ - "codetrans-nginx-server" \ - "codetrans-nginx-server" \ - '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' +# validate_services \ +# "${ip_address}:${CODETRANS_NGINX_PORT}/v1/codetrans" \ +# "print" \ +# "codetrans-nginx-server" \ +# "codetrans-nginx-server" \ +# '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' } @@ -168,7 +168,7 @@ function main() { start_services validate_microservices -# validate_megaservice + validate_megaservice # validate_frontend stop_docker From b714af1b8c7443dfce45cf13c67c9fa4b01ade93 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 22:14:18 +0700 Subject: [PATCH 17/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index f4ba71d466..1bca34d87b 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -110,21 +110,21 @@ function validate_microservices() { function validate_megaservice() { # Curl the Mega Service - validate_services \ - "${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" \ - "print" \ - "codetrans-backend-server" \ - "codetrans-backend-server" \ - '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' - - # test the megeservice via nginx # validate_services \ -# "${ip_address}:${CODETRANS_NGINX_PORT}/v1/codetrans" \ +# "${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" \ # "print" \ -# "codetrans-nginx-server" \ -# "codetrans-nginx-server" \ +# "codetrans-backend-server" \ +# "codetrans-backend-server" \ # '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' + # test the megeservice via nginx + validate_services \ + "${ip_address}:${CODETRANS_NGINX_PORT}/v1/codetrans" \ + "print" \ + "codetrans-nginx-server" \ + "codetrans-nginx-server" \ + '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' + } function validate_frontend() { From 543d809f3aa1afc7030b6b95e32ff2307ba2cddb Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 22:30:18 +0700 Subject: [PATCH 18/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 1bca34d87b..5790caace4 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -110,12 +110,12 @@ function validate_microservices() { function validate_megaservice() { # Curl the Mega Service -# validate_services \ -# "${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" \ -# "print" \ -# "codetrans-backend-server" \ -# "codetrans-backend-server" \ -# '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' + validate_services \ + "${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" \ + "print" \ + "codetrans-backend-server" \ + "codetrans-backend-server" \ + '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' # test the megeservice via nginx validate_services \ @@ -168,6 +168,7 @@ function main() { start_services validate_microservices + sleep 10 validate_megaservice # validate_frontend From 5f9a87a1b83ab9806d1483a11d49f48008acf80f Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 22:38:29 +0700 Subject: [PATCH 19/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 5790caace4..598f947be3 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -170,7 +170,7 @@ function main() { validate_microservices sleep 10 validate_megaservice -# validate_frontend + validate_frontend stop_docker echo y | docker system prune From 8780fe08ab20e972268f74d0d37d94fd1b8dba1c Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 23:04:13 +0700 Subject: [PATCH 20/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 598f947be3..c2dcc8d092 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -115,7 +115,7 @@ function validate_megaservice() { "print" \ "codetrans-backend-server" \ "codetrans-backend-server" \ - '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' + '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}\n"}' # test the megeservice via nginx validate_services \ @@ -123,7 +123,7 @@ function validate_megaservice() { "print" \ "codetrans-nginx-server" \ "codetrans-nginx-server" \ - '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' + '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}\n"}' } From 0f23c76efcf864a27bf914334f886df87bc79474 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 23:06:16 +0700 Subject: [PATCH 21/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index c2dcc8d092..86d2e383b2 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -168,7 +168,6 @@ function main() { start_services validate_microservices - sleep 10 validate_megaservice validate_frontend From 0509d7cd480d57c787568c8b64bd3ccd6c9d46ae Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 23:24:01 +0700 Subject: [PATCH 22/33] Fix CodeTrans tests script Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 86d2e383b2..42c6d1a064 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -169,7 +169,7 @@ function main() { validate_microservices validate_megaservice - validate_frontend +# validate_frontend stop_docker echo y | docker system prune From aea4997f3073bb6be1b438251c7d292a652bedba Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 23:33:29 +0700 Subject: [PATCH 23/33] Fix CodeTrans README, Docker compose file, set envs script and test script Signed-off-by: Chingis Yundunov --- .../docker_compose/amd/gpu/rocm/README.md | 121 ++++++++++++++++++ .../docker_compose/amd/gpu/rocm/set_env.sh | 2 +- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 3 files changed, 123 insertions(+), 2 deletions(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/README.md b/CodeTrans/docker_compose/amd/gpu/rocm/README.md index f566a3c8a8..81cf04a256 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/README.md +++ b/CodeTrans/docker_compose/amd/gpu/rocm/README.md @@ -1,2 +1,123 @@ ###### Copyright (C) 2024 Advanced Micro Devices, Inc. +# Build and deploy CodeTrans Application on AMD GPU (ROCm) + +## Build images + +### Build the LLM Docker Image + +```bash +### Cloning repo +git clone https://github.com/opea-project/GenAIComps.git +cd GenAIComps + +### Build Docker image +docker build -t opea/llm-tgi:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/llms/text-generation/tgi/Dockerfile . +``` + +### Build the MegaService Docker Image + +```bash +### Cloning repo +git clone https://github.com/opea-project/GenAIExamples +cd GenAIExamples/CodeTrans + +### Build Docker image +docker build -t opea/codetrans:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile . +``` + +### Build the UI Docker Image + +```bash +cd GenAIExamples/CodeTrans/ui +### Build UI Docker image +docker build -t opea/codetrans-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile . +``` + +## Deploy CodeTrans Application + +#### Features of Docker compose for AMD GPUs + +1. Added forwarding of GPU devices to the container TGI service with instructions: + +```yaml +shm_size: 1g +devices: + - /dev/kfd:/dev/kfd + - /dev/dri/:/dev/dri/ +cap_add: + - SYS_PTRACE +group_add: + - video +security_opt: + - seccomp:unconfined +``` + +In this case, all GPUs are thrown. To reset a specific GPU, you need to use specific device names cardN and renderN. + +For example: + +```yaml +shm_size: 1g +devices: + - /dev/kfd:/dev/kfd + - /dev/dri/card0:/dev/dri/card0 + - /dev/dri/render128:/dev/dri/render128 +cap_add: + - SYS_PTRACE +group_add: + - video +security_opt: + - seccomp:unconfined +``` + +To find out which GPU device IDs cardN and renderN correspond to the same GPU, use the GPU driver utility + +#### Go to the directory with the Docker compose file + +```bash +cd GenAIExamples/CodeTrans/docker_compose/amd/gpu/rocm +``` + +#### Set environments + +In the file "GenAIExamples/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh " it is necessary to set the required values. Parameter assignments are specified in the comments for each variable setting command + +```bash +chmod +x set_env.sh +. set_env.sh +``` + +#### Run services + +``` +docker compose up -d +``` + +# Validate the MicroServices and MegaService + +## Validate TGI service + +```bash +curl http://${HOST_IP}:${CODETRANS_TGI_SERVICE_PORT}/generate \ + -X POST \ + -d '{"inputs":" ### System: Please translate the following Golang codes into Python codes. ### Original codes: '\'''\'''\''Golang \npackage main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n '\'''\'''\'' ### Translated codes:","parameters":{"max_new_tokens":17, "do_sample": true}}' \ + -H 'Content-Type: application/json' +``` + +## Validate LLM service + +```bash +curl http://${HOST_IP}:${CODETRANS_LLM_SERVICE_PORT}/v1/chat/completions \ + -X POST \ + -d '{"query":" ### System: Please translate the following Golang codes into Python codes. ### Original codes: '\'''\'''\''Golang \npackage main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n '\'''\'''\'' ### Translated codes:"}' \ + -H 'Content-Type: application/json' +``` + +## Validate MegaService + +```bash +curl http://${HOST_IP}:${CODEGEN_BACKEND_SERVICE_PORT}/v1/codetrans \ + -H "Content-Type: application/json" \ + -d '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' +``` diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh index e38f1a7c03..4f9273ccdd 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh @@ -6,7 +6,7 @@ export HOST_IP=direct-supercomputer1.powerml.co export CODETRANS_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" export CODETRANS_TGI_SERVICE_PORT=18156 export CODETRANS_TGI_LLM_ENDPOINT="http://${HOST_IP}:${CODETRANS_TGI_SERVICE_PORT}" -export CODETRANS_HUGGINGFACEHUB_API_TOKEN=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 +export CODETRANS_HUGGINGFACEHUB_API_TOKEN='' export CODETRANS_LLM_SERVICE_PORT=18157 export CODETRANS_MEGA_SERVICE_HOST_IP=${HOST_IP} export CODETRANS_LLM_SERVICE_HOST_IP=${HOST_IP} diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 42c6d1a064..3fbb894576 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -34,7 +34,7 @@ function start_services() { export CODETRANS_LLM_SERVICE_PORT=18157 export CODETRANS_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" export CODETRANS_TGI_LLM_ENDPOINT="http://${ip_address}:${CODETRANS_TGI_SERVICE_PORT}" - export CODETRANS_HUGGINGFACEHUB_API_TOKEN="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" + export CODETRANS_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} export CODETRANS_MEGA_SERVICE_HOST_IP=${ip_address} export CODETRANS_LLM_SERVICE_HOST_IP=${ip_address} export CODETRANS_FRONTEND_SERVICE_IP=${ip_address} From 0e478b3bffd5242b2aaa2d64f7d66030d0a7db24 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Thu, 14 Nov 2024 23:43:07 +0700 Subject: [PATCH 24/33] Fix CodeTrans set_env.sh script Signed-off-by: Chingis Yundunov --- .../docker_compose/amd/gpu/rocm/set_env.sh | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh index 4f9273ccdd..3bca9dd09e 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh @@ -1,19 +1,47 @@ #!/usr/bin/env bash # Copyright (C) 2024 Advanced Micro Devices, Inc. - +### The IP address or domain name of the server on which the application is running export HOST_IP=direct-supercomputer1.powerml.co + +### Model ID export CODETRANS_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" + +### The port of the TGI service. On this port, the TGI service will accept connections export CODETRANS_TGI_SERVICE_PORT=18156 + +### The endpoint of the TGI service to which requests to this service will be sent (formed from previously set variables) export CODETRANS_TGI_LLM_ENDPOINT="http://${HOST_IP}:${CODETRANS_TGI_SERVICE_PORT}" + +### A token for accessing repositories with models export CODETRANS_HUGGINGFACEHUB_API_TOKEN='' + +### The port of the LLM service. On this port, the LLM service will accept connections export CODETRANS_LLM_SERVICE_PORT=18157 + +### The IP address or domain name of the server for CodeTrans MegaService export CODETRANS_MEGA_SERVICE_HOST_IP=${HOST_IP} + +### The endpoint of the LLM service to which requests to this service will be sent export CODETRANS_LLM_SERVICE_HOST_IP=${HOST_IP} + +### The ip address of the host on which the container with the frontend service is running export CODETRANS_FRONTEND_SERVICE_IP=192.165.1.21 + +### The port of the frontend service export CODETRANS_FRONTEND_SERVICE_PORT=18155 + +### Name of GenAI service for route requests to application export CODETRANS_BACKEND_SERVICE_NAME=codetrans + +### The ip address of the host on which the container with the backend service is running export CODETRANS_BACKEND_SERVICE_IP=192.165.1.21 + +### The port of the backend service export CODETRANS_BACKEND_SERVICE_PORT=18154 + +### The port of the Nginx reverse proxy for application export CODETRANS_NGINX_PORT=18153 + +### Endpoint of the backend service export CODETRANS_BACKEND_SERVICE_URL="http://${HOST_IP}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" From d5ba13c7e5396c2f961cf808179aa79168797c8a Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Mon, 18 Nov 2024 11:36:37 +0700 Subject: [PATCH 25/33] Fix CodeTrans - fix UI tests Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 3fbb894576..8155c99709 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -130,7 +130,7 @@ function validate_megaservice() { function validate_frontend() { cd $WORKPATH/ui/svelte local conda_env_name="OPEA_e2e" - export PATH=${HOME}/miniforge3/bin/:$PATH + export PATH=${HOME}/miniconda3/bin/:$PATH if conda info --envs | grep -q "$conda_env_name"; then echo "$conda_env_name exist!" else @@ -169,7 +169,7 @@ function main() { validate_microservices validate_megaservice -# validate_frontend + validate_frontend stop_docker echo y | docker system prune From 2b6e04c25b1ebbb312d42a290ac8c015f5c8176f Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Mon, 18 Nov 2024 11:43:14 +0700 Subject: [PATCH 26/33] Fix CodeTrans - remove error Copyright string from docs Signed-off-by: Chingis Yundunov --- CodeTrans/docker_compose/amd/gpu/rocm/README.md | 2 -- CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml | 2 -- CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh | 1 - CodeTrans/tests/test_compose_on_rocm.sh | 2 -- 4 files changed, 7 deletions(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/README.md b/CodeTrans/docker_compose/amd/gpu/rocm/README.md index 81cf04a256..b8585c804a 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/README.md +++ b/CodeTrans/docker_compose/amd/gpu/rocm/README.md @@ -1,5 +1,3 @@ -###### Copyright (C) 2024 Advanced Micro Devices, Inc. - # Build and deploy CodeTrans Application on AMD GPU (ROCm) ## Build images diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml index 5691a12f1f..ed26e1b81f 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml +++ b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml @@ -1,5 +1,3 @@ -# Copyright (C) 2024 Advanced Micro Devices, Inc. - services: codetrans-tgi-service: image: ghcr.io/huggingface/text-generation-inference:2.3.1-rocm diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh index 3bca9dd09e..54a99182c5 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash -# Copyright (C) 2024 Advanced Micro Devices, Inc. ### The IP address or domain name of the server on which the application is running export HOST_IP=direct-supercomputer1.powerml.co diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 8155c99709..8452346e86 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -1,7 +1,5 @@ #!/bin/bash -# Copyright (C) 2024 Advanced Micro Devices, Inc. - set -xe IMAGE_REPO=${IMAGE_REPO:-"opea"} IMAGE_TAG=${IMAGE_TAG:-"latest"} From 2d6dfa5135281eb3fcedb7fd0716f898668743fb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 04:43:45 +0000 Subject: [PATCH 27/33] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml | 3 +++ CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh | 3 +++ CodeTrans/tests/test_compose_on_rocm.sh | 3 +++ 3 files changed, 9 insertions(+) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml index ed26e1b81f..19e00c73df 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml +++ b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml @@ -1,3 +1,6 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + services: codetrans-tgi-service: image: ghcr.io/huggingface/text-generation-inference:2.3.1-rocm diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh index 54a99182c5..38cd7e1834 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + ### The IP address or domain name of the server on which the application is running export HOST_IP=direct-supercomputer1.powerml.co diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 8452346e86..6dee60044e 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -1,5 +1,8 @@ #!/bin/bash +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + set -xe IMAGE_REPO=${IMAGE_REPO:-"opea"} IMAGE_TAG=${IMAGE_TAG:-"latest"} From cd60f453b24b4703b9c34ca44ba62574f564775c Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Mon, 18 Nov 2024 11:51:24 +0700 Subject: [PATCH 28/33] Fix CodeTrans - fix UI tests Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 6dee60044e..76a191c1ae 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -139,7 +139,7 @@ function validate_frontend() { fi source activate ${conda_env_name} - sed -i "s/localhost/$ip_address/g" playwright.config.ts + sed -i "s/localhost/$ip_address:$CODETRANS_FRONTEND_SERVICE_PORT/g" playwright.config.ts conda install -c conda-forge nodejs -y npm install && npm ci && npx playwright install --with-deps From 094f59357981fc4c57605310d442ba87bd862e72 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Mon, 18 Nov 2024 12:00:00 +0700 Subject: [PATCH 29/33] Fix CodeTrans - fix UI tests Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 76a191c1ae..5881d1b7de 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -39,7 +39,7 @@ function start_services() { export CODETRANS_MEGA_SERVICE_HOST_IP=${ip_address} export CODETRANS_LLM_SERVICE_HOST_IP=${ip_address} export CODETRANS_FRONTEND_SERVICE_IP=${ip_address} - export CODETRANS_FRONTEND_SERVICE_PORT=18155 + export CODETRANS_FRONTEND_SERVICE_PORT=5173 export CODETRANS_BACKEND_SERVICE_NAME=codetrans export CODETRANS_BACKEND_SERVICE_IP=${ip_address} export CODETRANS_BACKEND_SERVICE_PORT=18154 @@ -139,7 +139,7 @@ function validate_frontend() { fi source activate ${conda_env_name} - sed -i "s/localhost/$ip_address:$CODETRANS_FRONTEND_SERVICE_PORT/g" playwright.config.ts + sed -i "s/localhost/$ip_address/g" playwright.config.ts conda install -c conda-forge nodejs -y npm install && npm ci && npx playwright install --with-deps From 6ea3fa3bb0aaf656852aa299e0be525cd0e1fc01 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Mon, 18 Nov 2024 12:10:22 +0700 Subject: [PATCH 30/33] Fix CodeTrans - fix UI tests Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index 5881d1b7de..a71f5dd3e8 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -31,8 +31,8 @@ function start_services() { cd $WORKPATH/docker_compose/amd/gpu/rocm/ export http_proxy=${http_proxy} export https_proxy=${http_proxy} - export CODETRANS_TGI_SERVICE_PORT=18156 - export CODETRANS_LLM_SERVICE_PORT=18157 + export CODETRANS_TGI_SERVICE_PORT=8008 + export CODETRANS_LLM_SERVICE_PORT=9000 export CODETRANS_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" export CODETRANS_TGI_LLM_ENDPOINT="http://${ip_address}:${CODETRANS_TGI_SERVICE_PORT}" export CODETRANS_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} @@ -42,8 +42,8 @@ function start_services() { export CODETRANS_FRONTEND_SERVICE_PORT=5173 export CODETRANS_BACKEND_SERVICE_NAME=codetrans export CODETRANS_BACKEND_SERVICE_IP=${ip_address} - export CODETRANS_BACKEND_SERVICE_PORT=18154 - export CODETRANS_NGINX_PORT=18153 + export CODETRANS_BACKEND_SERVICE_PORT=7777 + export CODETRANS_NGINX_PORT=8088 export CODETRANS_BACKEND_SERVICE_ENDPOINT="http://${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env From c05553bebce4da0d89ef95052e45ba035ce13454 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Mon, 18 Nov 2024 13:01:29 +0700 Subject: [PATCH 31/33] Fix CodeTrans - fix UI tests Signed-off-by: Chingis Yundunov --- CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml index 19e00c73df..cfad48a4d6 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml +++ b/CodeTrans/docker_compose/amd/gpu/rocm/compose.yaml @@ -68,6 +68,7 @@ services: no_proxy: ${no_proxy} https_proxy: ${https_proxy} http_proxy: ${http_proxy} + BASE_URL: ${CODETRANS_BACKEND_SERVICE_URL} BASIC_URL: ${CODETRANS_BACKEND_SERVICE_URL} ipc: host restart: always From e86459631939e30dac40f2dab067ffe267a774ee Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Mon, 18 Nov 2024 13:23:45 +0700 Subject: [PATCH 32/33] Fix CodeTrans - fix UI tests Signed-off-by: Chingis Yundunov --- CodeTrans/tests/test_compose_on_rocm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index a71f5dd3e8..541990881b 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -44,7 +44,7 @@ function start_services() { export CODETRANS_BACKEND_SERVICE_IP=${ip_address} export CODETRANS_BACKEND_SERVICE_PORT=7777 export CODETRANS_NGINX_PORT=8088 - export CODETRANS_BACKEND_SERVICE_ENDPOINT="http://${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" + export CODETRANS_BACKEND_SERVICE_URL="http://${ip_address}:${CODETRANS_BACKEND_SERVICE_PORT}/v1/codetrans" sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env From 96ae4a7307cd972e296be047a2f459e52e31bd67 Mon Sep 17 00:00:00 2001 From: Chingis Yundunov Date: Mon, 18 Nov 2024 13:41:07 +0700 Subject: [PATCH 33/33] Fix CodeGen - fix README.md Signed-off-by: Chingis Yundunov --- CodeTrans/docker_compose/amd/gpu/rocm/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CodeTrans/docker_compose/amd/gpu/rocm/README.md b/CodeTrans/docker_compose/amd/gpu/rocm/README.md index b8585c804a..fafe837b40 100644 --- a/CodeTrans/docker_compose/amd/gpu/rocm/README.md +++ b/CodeTrans/docker_compose/amd/gpu/rocm/README.md @@ -34,7 +34,7 @@ docker build -t opea/codetrans-ui:latest --build-arg https_proxy=$https_proxy -- ## Deploy CodeTrans Application -#### Features of Docker compose for AMD GPUs +### Features of Docker compose for AMD GPUs 1. Added forwarding of GPU devices to the container TGI service with instructions: @@ -71,13 +71,13 @@ security_opt: To find out which GPU device IDs cardN and renderN correspond to the same GPU, use the GPU driver utility -#### Go to the directory with the Docker compose file +### Go to the directory with the Docker compose file ```bash cd GenAIExamples/CodeTrans/docker_compose/amd/gpu/rocm ``` -#### Set environments +### Set environments In the file "GenAIExamples/CodeTrans/docker_compose/amd/gpu/rocm/set_env.sh " it is necessary to set the required values. Parameter assignments are specified in the comments for each variable setting command @@ -86,7 +86,7 @@ chmod +x set_env.sh . set_env.sh ``` -#### Run services +### Run services ``` docker compose up -d