From a23c84b3a0bb65a92f796c20facd53f681493fe3 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Wed, 10 Jul 2024 21:58:15 +0800 Subject: [PATCH 1/7] update test scripts name Signed-off-by: chensuyue --- .github/workflows/reuse-get-test-matrix.yml | 2 +- .github/workflows/scripts/docker_images_build_push.sh | 3 +++ ...rs_langchain.sh => test_web_retrievers_langchain_chroma.sh} | 0 3 files changed, 4 insertions(+), 1 deletion(-) rename tests/{test_web_retrievers_langchain.sh => test_web_retrievers_langchain_chroma.sh} (100%) diff --git a/.github/workflows/reuse-get-test-matrix.yml b/.github/workflows/reuse-get-test-matrix.yml index 76f5aaf63..e5ebf25ce 100644 --- a/.github/workflows/reuse-get-test-matrix.yml +++ b/.github/workflows/reuse-get-test-matrix.yml @@ -48,7 +48,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) || true path_level_1=("asr" "tts") - path_level_3=("llms/summarization" "llms/text-generation" "dataprep/redis" "retrievers/langchain") + path_level_3=("llms/summarization" "llms/text-generation" "dataprep/redis" "retrievers/langchain" "web_retrievers/langchain") run_matrix="{\"include\":[" for service in ${services}; do hardware="gaudi" # default hardware, set based on the changed files diff --git a/.github/workflows/scripts/docker_images_build_push.sh b/.github/workflows/scripts/docker_images_build_push.sh index d37be3bde..e22decbb4 100644 --- a/.github/workflows/scripts/docker_images_build_push.sh +++ b/.github/workflows/scripts/docker_images_build_push.sh @@ -51,6 +51,9 @@ case ${micro_service} in "llms/summarization/tgi") IMAGE_NAME="opea/llm-docsum-tgi" ;; + "web_retrievers/langchain/chroma") + IMAGE_NAME="opea/web-retriever-chroma" + ;; *) echo "Not supported yet" exit 0 diff --git a/tests/test_web_retrievers_langchain.sh b/tests/test_web_retrievers_langchain_chroma.sh similarity index 100% rename from tests/test_web_retrievers_langchain.sh rename to tests/test_web_retrievers_langchain_chroma.sh From 4133dd2374fc55ff1c90183f69804ab30c0445b1 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 11 Jul 2024 13:48:33 +0800 Subject: [PATCH 2/7] add more docker image build Signed-off-by: chensuyue --- .github/workflows/scripts/docker_images_build_push.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/scripts/docker_images_build_push.sh b/.github/workflows/scripts/docker_images_build_push.sh index e22decbb4..9c888fbde 100644 --- a/.github/workflows/scripts/docker_images_build_push.sh +++ b/.github/workflows/scripts/docker_images_build_push.sh @@ -54,6 +54,12 @@ case ${micro_service} in "web_retrievers/langchain/chroma") IMAGE_NAME="opea/web-retriever-chroma" ;; + "tts/speecht5") + IMAGE_NAME="opea/speecht5" + ;; + "asr/whisper") + IMAGE_NAME="opea/whisper" + ;; *) echo "Not supported yet" exit 0 From 3db02775b9c0e74feb94044ea2fa7b29aa2084ef Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 11 Jul 2024 16:52:55 +0800 Subject: [PATCH 3/7] update test matrix detect method Signed-off-by: chensuyue --- .github/workflows/reuse-get-test-matrix.yml | 26 ++++++++++----------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/reuse-get-test-matrix.yml b/.github/workflows/reuse-get-test-matrix.yml index e5ebf25ce..269a95b70 100644 --- a/.github/workflows/reuse-get-test-matrix.yml +++ b/.github/workflows/reuse-get-test-matrix.yml @@ -47,26 +47,24 @@ jobs: changed_files="$(git diff --name-only ${base_commit} ${merged_commit} | \ grep 'comps/' | grep -vE '*.md|*.txt|comps/cores')" || true services=$(printf '%s\n' "${changed_files[@]}" | cut -d'/' -f2 | grep -vE '*.py' | sort -u) || true - path_level_1=("asr" "tts") - path_level_3=("llms/summarization" "llms/text-generation" "dataprep/redis" "retrievers/langchain" "web_retrievers/langchain") run_matrix="{\"include\":[" for service in ${services}; do hardware="gaudi" # default hardware, set based on the changed files - if [[ "${path_level_1[@]}" =~ "${service}" ]]; then + if [[ ls comps/${service} | grep -E "Dockerfile*|docker*" ]]; then run_matrix="${run_matrix}{\"service\":\"${service}\",\"hardware\":\"${hardware}\"}," - else - vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | cut -d'/' -f3 | grep -vE '*.py|Dockerfile|*.md|*.sh' | sort -u) - for vendor in ${vendors}; do - 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}\"}," - done - else - run_matrix="${run_matrix}{\"service\":\"${service}/${vendor}\",\"hardware\":\"${hardware}\"}," + fi + vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | cut -d'/' -f3 | grep -vE '*.py|Dockerfile|*.sh|docker|*.yaml|*.yml' | sort -u) + for vendor in ${vendors}; do + if [[ ls comps/${service}/${vendor} | grep -E "Dockerfile*|docker*" ]]; then + run_matrix="${run_matrix}{\"service\":\"${service}/${vendor}\",\"hardware\":\"${hardware}\"}," + fi + sub_vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | grep ${vendor} | cut -d'/' -f4 | grep -vE '*.py|Dockerfile|*.sh|docker|*.yaml|*.yml' | sort -u) + for sub_vendor in ${sub_vendors}; do + if [[ ls comps/${service}/${vendor}/${sub_vendor} | grep -E "Dockerfile*|docker*" ]]; then + run_matrix="${run_matrix}{\"service\":\"${service}/${vendor}/${sub_vendor}\",\"hardware\":\"${hardware}\"}," fi done - fi + done done # add test for comps/dataprep/utils.py From 2485c30c5c2d5ae5dcb25155cba7a42e2bbcd83c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 08:54:27 +0000 Subject: [PATCH 4/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/reuse-get-test-matrix.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reuse-get-test-matrix.yml b/.github/workflows/reuse-get-test-matrix.yml index 269a95b70..fef9eae72 100644 --- a/.github/workflows/reuse-get-test-matrix.yml +++ b/.github/workflows/reuse-get-test-matrix.yml @@ -50,17 +50,17 @@ jobs: run_matrix="{\"include\":[" for service in ${services}; do hardware="gaudi" # default hardware, set based on the changed files - if [[ ls comps/${service} | grep -E "Dockerfile*|docker*" ]]; then + if [[ ls comps/${service} | grep -E "Dockerfile*|docker*" ]]; then run_matrix="${run_matrix}{\"service\":\"${service}\",\"hardware\":\"${hardware}\"}," fi vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | cut -d'/' -f3 | grep -vE '*.py|Dockerfile|*.sh|docker|*.yaml|*.yml' | sort -u) for vendor in ${vendors}; do - if [[ ls comps/${service}/${vendor} | grep -E "Dockerfile*|docker*" ]]; then + if [[ ls comps/${service}/${vendor} | grep -E "Dockerfile*|docker*" ]]; then run_matrix="${run_matrix}{\"service\":\"${service}/${vendor}\",\"hardware\":\"${hardware}\"}," fi sub_vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | grep ${vendor} | cut -d'/' -f4 | grep -vE '*.py|Dockerfile|*.sh|docker|*.yaml|*.yml' | sort -u) for sub_vendor in ${sub_vendors}; do - if [[ ls comps/${service}/${vendor}/${sub_vendor} | grep -E "Dockerfile*|docker*" ]]; then + if [[ ls comps/${service}/${vendor}/${sub_vendor} | grep -E "Dockerfile*|docker*" ]]; then run_matrix="${run_matrix}{\"service\":\"${service}/${vendor}/${sub_vendor}\",\"hardware\":\"${hardware}\"}," fi done From 9f7d1bb0c7888ded2ed068118d27864ac9e0c65c Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 11 Jul 2024 17:03:50 +0800 Subject: [PATCH 5/7] for test only Signed-off-by: chensuyue --- .github/workflows/microservice-test.yml | 2 +- comps/asr/__init__.py | 1 + comps/dataprep/milvus/__init__.py | 1 + comps/llms/text-generation/tgi/__init__.py | 1 + comps/tts/__init__.py | 1 + comps/tts/speecht5/__init__.py | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/microservice-test.yml b/.github/workflows/microservice-test.yml index d8000b93d..e0db0608f 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/asr/__init__.py b/comps/asr/__init__.py index 916f3a44b..6cc7a2542 100644 --- a/comps/asr/__init__.py +++ b/comps/asr/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test only diff --git a/comps/dataprep/milvus/__init__.py b/comps/dataprep/milvus/__init__.py index 916f3a44b..6cc7a2542 100644 --- a/comps/dataprep/milvus/__init__.py +++ b/comps/dataprep/milvus/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test only diff --git a/comps/llms/text-generation/tgi/__init__.py b/comps/llms/text-generation/tgi/__init__.py index 916f3a44b..6cc7a2542 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 only diff --git a/comps/tts/__init__.py b/comps/tts/__init__.py index 916f3a44b..6cc7a2542 100644 --- a/comps/tts/__init__.py +++ b/comps/tts/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test only diff --git a/comps/tts/speecht5/__init__.py b/comps/tts/speecht5/__init__.py index 916f3a44b..6cc7a2542 100644 --- a/comps/tts/speecht5/__init__.py +++ b/comps/tts/speecht5/__init__.py @@ -1,2 +1,3 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +# for test only From 3a5630bcd4b8e7757c8e20b1f4cce3d1738db62b Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 11 Jul 2024 17:04:29 +0800 Subject: [PATCH 6/7] bug fix Signed-off-by: chensuyue --- .github/workflows/reuse-get-test-matrix.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reuse-get-test-matrix.yml b/.github/workflows/reuse-get-test-matrix.yml index fef9eae72..6860f8e9b 100644 --- a/.github/workflows/reuse-get-test-matrix.yml +++ b/.github/workflows/reuse-get-test-matrix.yml @@ -50,17 +50,17 @@ jobs: run_matrix="{\"include\":[" for service in ${services}; do hardware="gaudi" # default hardware, set based on the changed files - if [[ ls comps/${service} | grep -E "Dockerfile*|docker*" ]]; then + if [[ $(ls comps/${service} | grep -E "Dockerfile*|docker*") ]]; then run_matrix="${run_matrix}{\"service\":\"${service}\",\"hardware\":\"${hardware}\"}," fi vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | cut -d'/' -f3 | grep -vE '*.py|Dockerfile|*.sh|docker|*.yaml|*.yml' | sort -u) for vendor in ${vendors}; do - if [[ ls comps/${service}/${vendor} | grep -E "Dockerfile*|docker*" ]]; then + if [[ $(ls comps/${service}/${vendor} | grep -E "Dockerfile*|docker*") ]]; then run_matrix="${run_matrix}{\"service\":\"${service}/${vendor}\",\"hardware\":\"${hardware}\"}," fi sub_vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | grep ${vendor} | cut -d'/' -f4 | grep -vE '*.py|Dockerfile|*.sh|docker|*.yaml|*.yml' | sort -u) for sub_vendor in ${sub_vendors}; do - if [[ ls comps/${service}/${vendor}/${sub_vendor} | grep -E "Dockerfile*|docker*" ]]; then + if [[ $(ls comps/${service}/${vendor}/${sub_vendor} | grep -E "Dockerfile*|docker*") ]]; then run_matrix="${run_matrix}{\"service\":\"${service}/${vendor}/${sub_vendor}\",\"hardware\":\"${hardware}\"}," fi done From f5dc2130021560a1de9d7b25978554ba208a62c0 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 11 Jul 2024 17:07:04 +0800 Subject: [PATCH 7/7] Revert "for test only" This reverts commit 9f7d1bb0c7888ded2ed068118d27864ac9e0c65c. --- .github/workflows/microservice-test.yml | 2 +- comps/asr/__init__.py | 1 - comps/dataprep/milvus/__init__.py | 1 - comps/llms/text-generation/tgi/__init__.py | 1 - comps/tts/__init__.py | 1 - comps/tts/speecht5/__init__.py | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/microservice-test.yml b/.github/workflows/microservice-test.yml index e0db0608f..d8000b93d 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/asr/__init__.py b/comps/asr/__init__.py index 6cc7a2542..916f3a44b 100644 --- a/comps/asr/__init__.py +++ b/comps/asr/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test only diff --git a/comps/dataprep/milvus/__init__.py b/comps/dataprep/milvus/__init__.py index 6cc7a2542..916f3a44b 100644 --- a/comps/dataprep/milvus/__init__.py +++ b/comps/dataprep/milvus/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test only diff --git a/comps/llms/text-generation/tgi/__init__.py b/comps/llms/text-generation/tgi/__init__.py index 6cc7a2542..916f3a44b 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 only diff --git a/comps/tts/__init__.py b/comps/tts/__init__.py index 6cc7a2542..916f3a44b 100644 --- a/comps/tts/__init__.py +++ b/comps/tts/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test only diff --git a/comps/tts/speecht5/__init__.py b/comps/tts/speecht5/__init__.py index 6cc7a2542..916f3a44b 100644 --- a/comps/tts/speecht5/__init__.py +++ b/comps/tts/speecht5/__init__.py @@ -1,3 +1,2 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# for test only