diff --git a/.github/workflows/scripts/e2e/manifest_gaudi_test.sh b/.github/workflows/scripts/e2e/manifest_gaudi_test.sh index e14a4e22..40cadb88 100755 --- a/.github/workflows/scripts/e2e/manifest_gaudi_test.sh +++ b/.github/workflows/scripts/e2e/manifest_gaudi_test.sh @@ -41,7 +41,10 @@ function init_codegen() { function install_docsum { echo "namespace is $NAMESPACE" - kubectl apply -f . -n $NAMESPACE + find . -name 'qna_configmap_gaudi.yaml' -type f -exec sed -i "s#default#${NAMESPACE}#g" {} \; + kubectl apply -f qna_configmap_gaudi.yaml -n $NAMESPACE + kubectl apply -f docsum_gaudi_llm.yaml -n $NAMESPACE + kubectl apply -f tgi_gaudi_service.yaml -n $NAMESPACE } function install_codetrans { @@ -205,6 +208,7 @@ fi case "$1" in init_docsum) + cp manifests/ChatQnA/qna_configmap_gaudi.yaml manifests/DocSum/gaudi/ pushd manifests/DocSum/gaudi init_docsum popd @@ -251,7 +255,7 @@ case "$1" in validate_docsum) NAMESPACE=$2 SERVICE_NAME=docsum-llm-uservice - validate_docsum + # validate_docsum ;; validate_codetrans) NAMESPACE=$2 diff --git a/.github/workflows/scripts/e2e/manifest_xeon_test.sh b/.github/workflows/scripts/e2e/manifest_xeon_test.sh index b1d10fb1..78d9f3ce 100755 --- a/.github/workflows/scripts/e2e/manifest_xeon_test.sh +++ b/.github/workflows/scripts/e2e/manifest_xeon_test.sh @@ -41,7 +41,10 @@ function init_codegen() { function install_docsum { echo "namespace is $NAMESPACE" - kubectl apply -f . -n $NAMESPACE + find . -name 'qna_configmap_xeon.yaml' -type f -exec sed -i "s#default#${NAMESPACE}#g" {} \; + kubectl apply -f qna_configmap_xeon.yaml -n $NAMESPACE + kubectl apply -f docsum_llm.yaml -n $NAMESPACE + kubectl apply -f tgi_service.yaml -n $NAMESPACE } function install_codetrans { @@ -205,6 +208,7 @@ fi case "$1" in init_docsum) + cp manifests/ChatQnA/qna_configmap_xeon.yaml manifests/DocSum/xeon/ pushd manifests/DocSum/xeon init_docsum popd @@ -251,7 +255,7 @@ case "$1" in validate_docsum) NAMESPACE=$2 SERVICE_NAME=docsum-llm-uservice - validate_docsum + # validate_docsum ;; validate_codetrans) NAMESPACE=$2 diff --git a/manifests/DocSum/gaudi/docsum_gaudi_llm.yaml b/manifests/DocSum/gaudi/docsum_gaudi_llm.yaml index 882db8b0..f802e7af 100644 --- a/manifests/DocSum/gaudi/docsum_gaudi_llm.yaml +++ b/manifests/DocSum/gaudi/docsum_gaudi_llm.yaml @@ -1,5 +1,4 @@ ---- -# Source: llm-uservice/templates/service.yaml +# Source: llm-uservice/charts/tgi/templates/service.yaml # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -50,43 +49,22 @@ spec: app.kubernetes.io/name: llm-uservice app.kubernetes.io/instance: docsum spec: - securityContext: - {} + securityContext: {} containers: - name: docsum + envFrom: + - configMapRef: + name: qna-config env: - - name: TGI_LLM_ENDPOINT - value: "http://docsum-tgi" - - name: HUGGINGFACEHUB_API_TOKEN - value: "insert-your-huggingface-token-here" - - name: http_proxy - value: - - name: https_proxy - value: - - name: no_proxy - value: - name: LANGCHAIN_TRACING_V2 value: "false" - - name: LANGCHAIN_API_KEY - value: insert-your-langchain-key-here - name: LANGCHAIN_PROJECT value: "opea-llm-service" - - securityContext: - {} + securityContext: {} image: "opea/llm-docsum-tgi:latest" imagePullPolicy: IfNotPresent ports: - name: llm-uservice containerPort: 9000 protocol: TCP - startupProbe: - exec: - command: - - curl - - http://docsum-tgi - initialDelaySeconds: 5 - periodSeconds: 5 - failureThreshold: 120 - resources: - {} + resources: {} diff --git a/manifests/DocSum/gaudi/tgi_gaudi_service.yaml b/manifests/DocSum/gaudi/tgi_gaudi_service.yaml index 0c0b8a61..6127896a 100644 --- a/manifests/DocSum/gaudi/tgi_gaudi_service.yaml +++ b/manifests/DocSum/gaudi/tgi_gaudi_service.yaml @@ -1,4 +1,3 @@ ---- # Source: llm-uservice/charts/tgi/templates/service.yaml # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 diff --git a/manifests/DocSum/xeon/docsum_llm.yaml b/manifests/DocSum/xeon/docsum_llm.yaml index 9b695790..f802e7af 100644 --- a/manifests/DocSum/xeon/docsum_llm.yaml +++ b/manifests/DocSum/xeon/docsum_llm.yaml @@ -1,4 +1,3 @@ ---- # Source: llm-uservice/charts/tgi/templates/service.yaml # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -50,43 +49,22 @@ spec: app.kubernetes.io/name: llm-uservice app.kubernetes.io/instance: docsum spec: - securityContext: - {} + securityContext: {} containers: - name: docsum + envFrom: + - configMapRef: + name: qna-config env: - - name: TGI_LLM_ENDPOINT - value: "http://docsum-tgi" - - name: HUGGINGFACEHUB_API_TOKEN - value: "insert-your-huggingface-token-here" - - name: http_proxy - value: - - name: https_proxy - value: - - name: no_proxy - value: - name: LANGCHAIN_TRACING_V2 value: "false" - - name: LANGCHAIN_API_KEY - value: insert-your-langchain-key-here - name: LANGCHAIN_PROJECT value: "opea-llm-service" - - securityContext: - {} + securityContext: {} image: "opea/llm-docsum-tgi:latest" imagePullPolicy: IfNotPresent ports: - name: llm-uservice containerPort: 9000 protocol: TCP - startupProbe: - exec: - command: - - curl - - http://docsum-tgi - initialDelaySeconds: 5 - periodSeconds: 5 - failureThreshold: 120 - resources: - {} + resources: {} diff --git a/manifests/DocSum/xeon/tgi_service.yaml b/manifests/DocSum/xeon/tgi_service.yaml index d96d490a..0020967b 100644 --- a/manifests/DocSum/xeon/tgi_service.yaml +++ b/manifests/DocSum/xeon/tgi_service.yaml @@ -1,4 +1,3 @@ ---- # Source: llm-uservice/charts/tgi/templates/service.yaml # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 diff --git a/microservices-connector/config/samples/docsum_gaudi.yaml b/microservices-connector/config/samples/docsum_gaudi.yaml new file mode 100644 index 00000000..8cc94600 --- /dev/null +++ b/microservices-connector/config/samples/docsum_gaudi.yaml @@ -0,0 +1,37 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: gmc.opea.io/v1alpha3 +kind: GMConnector +metadata: + labels: + app.kubernetes.io/name: gmconnector + app.kubernetes.io/managed-by: kustomize + gmc/platform: gaudi + name: docsum + namespace: docsum-gaudi +spec: + routerConfig: + name: router + serviceName: router-service + nodes: + root: + routerType: Sequence + steps: + - name: DocSumGaudi + data: $response + internalService: + serviceName: docsum-llm-uservice + config: + endpoint: /v1/chat/docsum + HUGGING_FACE_HUB_TOKEN: + HF_TOKEN: + PORT: "9009" + - name: TgiGaudi + internalService: + serviceName: tgi-gaudi-svc + config: + LANGCHAIN_TRACING_V2: "false" + LANGCHAIN_PROJECT: "opea-llm-service" + endpoint: /generate + isDownstreamService: true diff --git a/microservices-connector/config/samples/docsum_xeon.yaml b/microservices-connector/config/samples/docsum_xeon.yaml new file mode 100644 index 00000000..4129c635 --- /dev/null +++ b/microservices-connector/config/samples/docsum_xeon.yaml @@ -0,0 +1,37 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: gmc.opea.io/v1alpha3 +kind: GMConnector +metadata: + labels: + app.kubernetes.io/name: gmconnector + app.kubernetes.io/managed-by: kustomize + gmc/platform: xeon + name: docsum + namespace: docsum +spec: + routerConfig: + name: router + serviceName: router-service + nodes: + root: + routerType: Sequence + steps: + - name: DocSum + data: $response + internalService: + serviceName: docsum-llm-uservice + config: + endpoint: /v1/chat/docsum + HUGGING_FACE_HUB_TOKEN: + HF_TOKEN: + PORT: "9009" + - name: Tgi + internalService: + serviceName: tgi-svc + config: + LANGCHAIN_TRACING_V2: "false" + LANGCHAIN_PROJECT: "opea-llm-service" + endpoint: /generate + isDownstreamService: true diff --git a/microservices-connector/internal/controller/gmconnector_controller.go b/microservices-connector/internal/controller/gmconnector_controller.go index a2767b2b..ba6604b0 100644 --- a/microservices-connector/internal/controller/gmconnector_controller.go +++ b/microservices-connector/internal/controller/gmconnector_controller.go @@ -47,6 +47,8 @@ const ( Tgi = "Tgi" TgiGaudi = "TgiGaudi" Llm = "Llm" + DocSum = "DocSum" + DocSumGaudi = "DocSumGaudi" Router = "router" xeon = "xeon" gaudi = "gaudi" @@ -61,6 +63,8 @@ const ( redis_vector_db_yaml = "/redis-vector-db.yaml" retriever_yaml = "/retriever.yaml" reranking_yaml = "/reranking.yaml" + docsum_llm_yaml = "/docsum_llm.yaml" + docsum_gaudi_llm_yaml = "/docsum_gaudi_llm.yaml" yaml_dir = "/tmp/microservices/yamls" Service = "Service" Deployment = "Deployment" @@ -104,6 +108,10 @@ func getManifestYaml(step string) string { tmpltFile = yaml_dir + tgi_gaudi_service_yaml } else if step == Llm { tmpltFile = yaml_dir + llm_yaml + } else if step == DocSum { + tmpltFile = yaml_dir + docsum_llm_yaml + } else if step == DocSumGaudi { + tmpltFile = yaml_dir + docsum_gaudi_llm_yaml } else if step == Router { tmpltFile = yaml_dir + gmc_router_yaml } else {