From f052889aa73a5525044cc9becd1f51e6e310190d Mon Sep 17 00:00:00 2001 From: chensuyue Date: Wed, 12 Jun 2024 21:06:28 +0800 Subject: [PATCH 1/6] update test scripts path Signed-off-by: chensuyue --- .github/workflows/microservice-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/microservice-test.yml b/.github/workflows/microservice-test.yml index bb86b2d1b9..038ae5a5dd 100644 --- a/.github/workflows/microservice-test.yml +++ b/.github/workflows/microservice-test.yml @@ -39,7 +39,7 @@ jobs: | grep 'comps/' | grep -vE '*.md|*.txt|comps/cores')" || true services=$(printf '%s\n' "${changed_files[@]}" | cut -d'/' -f2 | grep -vE '*.py' | sort -u) path_level_1=("asr" "tts") - path_level_3=("llms") + path_level_3=("llms_summarization" "llms_text-generation" "dataprep_redis") run_matrix="{\"include\":[" for service in ${services}; do hardware="gaudi" # default hardware, set based on the changed files @@ -48,7 +48,7 @@ jobs: else vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | cut -d'/' -f3 | grep -vE '*.py' | sort -u) for vendor in ${vendors}; do - if [[ "${path_level_3[@]}" =~ "${service}" ]]; then + if [[ "${path_level_3[@]}" =~ "${service}_${vendor}" ]]; then sub_vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | grep ${vendor} | cut -d'/' -f4 | grep -vE '*.py' | sort -u) for sub_vendor in ${sub_vendors}; do run_matrix="${run_matrix}{\"service\":\"${service}_${vendor}_${sub_vendor}\",\"hardware\":\"${hardware}\"}," From 3eb0036a859d436d05e5f1e05b216e1a9b448f00 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Wed, 12 Jun 2024 21:06:58 +0800 Subject: [PATCH 2/6] for test Signed-off-by: chensuyue --- .github/workflows/microservice-test.yml | 2 +- comps/dataprep/qdrant/__init__.py | 1 + comps/dataprep/redis/langchain/__init__.py | 1 + comps/dataprep/redis/llama_index/__init__.py | 1 + comps/llms/summarization/tgi/__init__.py | 1 + comps/llms/text-generation/qwen2/utils.py | 2 +- comps/llms/text-generation/ray_serve/__init__.py | 1 + comps/llms/text-generation/tgi/__init__.py | 1 + 8 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/microservice-test.yml b/.github/workflows/microservice-test.yml index 038ae5a5dd..d8438721e7 100644 --- a/.github/workflows/microservice-test.yml +++ b/.github/workflows/microservice-test.yml @@ -4,7 +4,7 @@ name: MicroService-test on: - pull_request_target: + pull_request: branches: [main] types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped paths: diff --git a/comps/dataprep/qdrant/__init__.py b/comps/dataprep/qdrant/__init__.py index 916f3a44b2..1d34b15915 100644 --- a/comps/dataprep/qdrant/__init__.py +++ b/comps/dataprep/qdrant/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test \ No newline at end of file diff --git a/comps/dataprep/redis/langchain/__init__.py b/comps/dataprep/redis/langchain/__init__.py index 916f3a44b2..1d34b15915 100644 --- a/comps/dataprep/redis/langchain/__init__.py +++ b/comps/dataprep/redis/langchain/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test \ No newline at end of file diff --git a/comps/dataprep/redis/llama_index/__init__.py b/comps/dataprep/redis/llama_index/__init__.py index 916f3a44b2..07c566eb8c 100644 --- a/comps/dataprep/redis/llama_index/__init__.py +++ b/comps/dataprep/redis/llama_index/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test diff --git a/comps/llms/summarization/tgi/__init__.py b/comps/llms/summarization/tgi/__init__.py index 916f3a44b2..1d34b15915 100644 --- a/comps/llms/summarization/tgi/__init__.py +++ b/comps/llms/summarization/tgi/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test \ No newline at end of file diff --git a/comps/llms/text-generation/qwen2/utils.py b/comps/llms/text-generation/qwen2/utils.py index 3eef7a6e24..7afde78409 100644 --- a/comps/llms/text-generation/qwen2/utils.py +++ b/comps/llms/text-generation/qwen2/utils.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +# for test import copy import os diff --git a/comps/llms/text-generation/ray_serve/__init__.py b/comps/llms/text-generation/ray_serve/__init__.py index 916f3a44b2..1d34b15915 100644 --- a/comps/llms/text-generation/ray_serve/__init__.py +++ b/comps/llms/text-generation/ray_serve/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test \ No newline at end of file diff --git a/comps/llms/text-generation/tgi/__init__.py b/comps/llms/text-generation/tgi/__init__.py index 916f3a44b2..1d34b15915 100644 --- a/comps/llms/text-generation/tgi/__init__.py +++ b/comps/llms/text-generation/tgi/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test \ No newline at end of file From a26c6acdafd4b93a34529aa677aa4ef33c2adbee Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:28:59 +0000 Subject: [PATCH 3/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- comps/dataprep/qdrant/__init__.py | 2 +- comps/dataprep/redis/langchain/__init__.py | 2 +- comps/llms/summarization/tgi/__init__.py | 2 +- comps/llms/text-generation/ray_serve/__init__.py | 2 +- comps/llms/text-generation/tgi/__init__.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/comps/dataprep/qdrant/__init__.py b/comps/dataprep/qdrant/__init__.py index 1d34b15915..07c566eb8c 100644 --- a/comps/dataprep/qdrant/__init__.py +++ b/comps/dataprep/qdrant/__init__.py @@ -1,3 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test \ No newline at end of file +# for test diff --git a/comps/dataprep/redis/langchain/__init__.py b/comps/dataprep/redis/langchain/__init__.py index 1d34b15915..07c566eb8c 100644 --- a/comps/dataprep/redis/langchain/__init__.py +++ b/comps/dataprep/redis/langchain/__init__.py @@ -1,3 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test \ No newline at end of file +# for test diff --git a/comps/llms/summarization/tgi/__init__.py b/comps/llms/summarization/tgi/__init__.py index 1d34b15915..07c566eb8c 100644 --- a/comps/llms/summarization/tgi/__init__.py +++ b/comps/llms/summarization/tgi/__init__.py @@ -1,3 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test \ No newline at end of file +# for test diff --git a/comps/llms/text-generation/ray_serve/__init__.py b/comps/llms/text-generation/ray_serve/__init__.py index 1d34b15915..07c566eb8c 100644 --- a/comps/llms/text-generation/ray_serve/__init__.py +++ b/comps/llms/text-generation/ray_serve/__init__.py @@ -1,3 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test \ No newline at end of file +# for test diff --git a/comps/llms/text-generation/tgi/__init__.py b/comps/llms/text-generation/tgi/__init__.py index 1d34b15915..07c566eb8c 100644 --- a/comps/llms/text-generation/tgi/__init__.py +++ b/comps/llms/text-generation/tgi/__init__.py @@ -1,3 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test \ No newline at end of file +# for test From f9430189ff51bb77bf656014b81db289ff0ae48c Mon Sep 17 00:00:00 2001 From: letonghan Date: Thu, 13 Jun 2024 11:19:12 +0800 Subject: [PATCH 4/6] change test port Signed-off-by: letonghan --- tests/test_dataprep_redis_llama_index.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_dataprep_redis_llama_index.sh b/tests/test_dataprep_redis_llama_index.sh index 1889e4040c..517f66247e 100644 --- a/tests/test_dataprep_redis_llama_index.sh +++ b/tests/test_dataprep_redis_llama_index.sh @@ -16,14 +16,14 @@ function build_docker_images() { function start_service() { docker run -d --name="test-comps-dataprep-redis" -e http_proxy=$http_proxy -e https_proxy=$https_proxy -p 6379:6379 -p 8001:8001 --ipc=host redis/redis-stack:7.2.0-v9 - dataprep_service_port=5011 + dataprep_service_port=5012 REDIS_URL="redis://${ip_address}:6379" docker run -d --name="test-comps-dataprep-redis-server" -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e REDIS_URL=$REDIS_URL -p ${dataprep_service_port}:6007 --ipc=host opea/dataprep-redis:comps sleep 1m } function validate_microservice() { - dataprep_service_port=5011 + dataprep_service_port=5012 URL="http://${ip_address}:$dataprep_service_port/v1/dataprep" echo "Deep learning is a subset of machine learning that utilizes neural networks with multiple layers to analyze various levels of abstract data representations. It enables computers to identify patterns and make decisions with minimal human intervention by learning from large amounts of data." > ./dataprep_file.txt HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -F 'files=@./dataprep_file.txt' -H 'Content-Type: multipart/form-data' "$URL") From 3e0ae4839dc279ed11eac0646b2527f528cb4b36 Mon Sep 17 00:00:00 2001 From: letonghan Date: Thu, 13 Jun 2024 13:41:20 +0800 Subject: [PATCH 5/6] update dokcer file Signed-off-by: letonghan --- .../redis/llama_index/docker/Dockerfile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/comps/dataprep/redis/llama_index/docker/Dockerfile b/comps/dataprep/redis/llama_index/docker/Dockerfile index 8fcb8bab12..1735c0fcf9 100644 --- a/comps/dataprep/redis/llama_index/docker/Dockerfile +++ b/comps/dataprep/redis/llama_index/docker/Dockerfile @@ -2,14 +2,15 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM ubuntu:22.04 +FROM python:3.11-slim + +ENV LANG C.UTF-8 RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ + build-essential \ libgl1-mesa-glx \ libjemalloc-dev \ - vim \ - python3 \ - python3-pip + vim RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -19,12 +20,18 @@ USER user COPY comps /home/user/comps -RUN pip install --no-cache-dir --upgrade pip && \ +RUN pip install --no-cache-dir --upgrade pip setuptools && \ pip install --no-cache-dir -r /home/user/comps/dataprep/redis/llama_index/requirements.txt ENV PYTHONPATH=$PYTHONPATH:/home/user +USER root + +RUN mkdir -p /home/user/comps/dataprep/redis/llama_index/uploaded_files && chown -R user /home/user/comps/dataprep/redis/llama_index/uploaded_files + +USER user + WORKDIR /home/user/comps/dataprep/redis/llama_index -ENTRYPOINT ["python3", "prepare_doc_redis.py"] +ENTRYPOINT ["python", "prepare_doc_redis.py"] From 401ed6b68de5e1a01ed0e1e9d092a366846872d8 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 13 Jun 2024 14:01:44 +0800 Subject: [PATCH 6/6] Revert "for test" This reverts commit 3eb0036a Signed-off-by: chensuyue --- .github/workflows/microservice-test.yml | 2 +- comps/dataprep/qdrant/__init__.py | 1 - comps/dataprep/redis/langchain/__init__.py | 1 - comps/dataprep/redis/llama_index/__init__.py | 1 - comps/llms/summarization/tgi/__init__.py | 1 - comps/llms/text-generation/qwen2/utils.py | 2 +- comps/llms/text-generation/ray_serve/__init__.py | 1 - comps/llms/text-generation/tgi/__init__.py | 1 - 8 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/microservice-test.yml b/.github/workflows/microservice-test.yml index d8438721e7..038ae5a5dd 100644 --- a/.github/workflows/microservice-test.yml +++ b/.github/workflows/microservice-test.yml @@ -4,7 +4,7 @@ name: MicroService-test on: - pull_request: + pull_request_target: branches: [main] types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped paths: diff --git a/comps/dataprep/qdrant/__init__.py b/comps/dataprep/qdrant/__init__.py index 07c566eb8c..916f3a44b2 100644 --- a/comps/dataprep/qdrant/__init__.py +++ b/comps/dataprep/qdrant/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test diff --git a/comps/dataprep/redis/langchain/__init__.py b/comps/dataprep/redis/langchain/__init__.py index 07c566eb8c..916f3a44b2 100644 --- a/comps/dataprep/redis/langchain/__init__.py +++ b/comps/dataprep/redis/langchain/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test diff --git a/comps/dataprep/redis/llama_index/__init__.py b/comps/dataprep/redis/llama_index/__init__.py index 07c566eb8c..916f3a44b2 100644 --- a/comps/dataprep/redis/llama_index/__init__.py +++ b/comps/dataprep/redis/llama_index/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test diff --git a/comps/llms/summarization/tgi/__init__.py b/comps/llms/summarization/tgi/__init__.py index 07c566eb8c..916f3a44b2 100644 --- a/comps/llms/summarization/tgi/__init__.py +++ b/comps/llms/summarization/tgi/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test diff --git a/comps/llms/text-generation/qwen2/utils.py b/comps/llms/text-generation/qwen2/utils.py index 7afde78409..3eef7a6e24 100644 --- a/comps/llms/text-generation/qwen2/utils.py +++ b/comps/llms/text-generation/qwen2/utils.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# for test + import copy import os diff --git a/comps/llms/text-generation/ray_serve/__init__.py b/comps/llms/text-generation/ray_serve/__init__.py index 07c566eb8c..916f3a44b2 100644 --- a/comps/llms/text-generation/ray_serve/__init__.py +++ b/comps/llms/text-generation/ray_serve/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test diff --git a/comps/llms/text-generation/tgi/__init__.py b/comps/llms/text-generation/tgi/__init__.py index 07c566eb8c..916f3a44b2 100644 --- a/comps/llms/text-generation/tgi/__init__.py +++ b/comps/llms/text-generation/tgi/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test