opea-project / GenAIInfra

Containerization and cloud native suite for OPEA
Apache License 2.0
26 stars 48 forks source link

GMC: add prepocessUserConfigmap to change the hardcode endpoint in the manifests #86

Closed KfreeZ closed 3 months ago

KfreeZ commented 3 months ago

Description

As the configmap file in the manifest is hardcode, the endpoint's service name and namespace cannot be changed. This PR read the ns from context and service name/port from the services manifest files, create the adjusted config map

Issues

n/a

Type of change

List the type of change like below. Please delete options that are not relevant.

Dependencies

n/a

Tests

after the controller reconciliation, the configmap is updated

root@cis-gms-worker-3:~/zkf/dev/GenAIInfra/microservices-connector# kubectl get cm -n chatqa 
NAME               DATA   AGE
kube-root-ca.crt   1      3d9h
qna-config   13     9m41s

for xeon

root@cis-gms-worker-3:~/zkf/dev/GenAIInfra/microservices-connector# kubectl get cm -n chatqa qna-config-xeon -o yaml
apiVersion: v1
data:
  EMBEDDING_MODEL_ID: BAAI/bge-base-en-v1.5
  EMBEDDING_SERVICE_HOST_IP: embedding-svc
  HUGGINGFACEHUB_API_TOKEN: insert-your-huggingface-token-here
  INDEX_NAME: rag-redis
  LLM_MODEL_ID: Intel/neural-chat-7b-v3-3
  LLM_SERVICE_HOST_IP: llm-svc
  **REDIS_URL: redis://redis-vector-db.default.svc.cluster.local:6379**
  RERANK_MODEL_ID: BAAI/bge-reranker-large
  RERANK_SERVICE_HOST_IP: reranking-svc
  RETRIEVER_SERVICE_HOST_IP: retriever-svc
  **TEI_EMBEDDING_ENDPOINT: http://tei-embedding-svc.chatqa.svc.cluster.local:6006
  TEI_RERANKING_ENDPOINT: http://tei-reranking-svc.chatqa.svc.cluster.local:8808
  TGI_LLM_ENDPOINT: http://tgi-svc.chatqa.svc.cluster.local:9009**
kind: ConfigMap
metadata:
  creationTimestamp: "2024-06-06T16:38:46Z"
  name: qna-config-xeon
  namespace: chatqa
  resourceVersion: "1014630"
  uid: 53fefcf9-f4ec-4f6c-9ab4-874fa264c4c5
zhlsunshine commented 3 months ago

This PR is related to https://github.com/opea-project/GenAIInfra/issues/77

KfreeZ commented 3 months ago

91 is merged, close this one.

issue https://github.com/opea-project/GenAIInfra/issues/92 is created to track the coverage problem.