Skip to content

Commit

Permalink
ui: update chatqna readme and env nam
Browse files Browse the repository at this point in the history
* update the chatqna helm chart readme to provide the steps for UI-based
  verification
* update the env name according to changes in GenAIExamples

Signed-off-by: Ruoyu Ying <[email protected]>
  • Loading branch information
Ruoyu-y committed Aug 19, 2024
1 parent 54cd66f commit 01b5949
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
36 changes: 35 additions & 1 deletion helm-charts/chatqna/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ helm install chatqna chatqna --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --

To verify the installation, run the command `kubectl get pod` to make sure all pods are running.

Then run the command `kubectl port-forward svc/chatqna 8888:8888` to expose the service for access.
Curl command and UI are the two options that can be leveraged to verify the result.

### Verify the workload through curl command

Run the command `kubectl port-forward svc/chatqna 8888:8888` to expose the service for access.

Open another terminal and run the following command to verify the service if working:

Expand All @@ -48,6 +52,36 @@ curl http://localhost:8888/v1/chatqna \
-d '{"messages": "What is the revenue of Nike in 2023?"}'
```

### Verify the workload through UI

UI need to get installed before accessing. Follow the steps below to build and install UI:

```bash
# expose endpoint of ChatQnA service and dataprep service
kubectl port-forward svc/chatqna --address 0.0.0.0 8888:8888
kubectl port-forward svc/chatqna-data-prep --address 0.0.0.0 6007:6007

# build the UI image
git clone https://github.com/opea-project/GenAIExamples.git
cd GenAIExamples/ChatQnA/docker/ui/
docker build --no-cache -t opea/chatqna-conversation-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile.react .

# push the image to your cluster, make sure the image exists on each node of your cluster
docker save -o ui.tar opea/chatqna-conversation-ui:latest
sudo ctr -n k8s.io image import ui.tar

# install UI using helm chart
cd
cd GenAIInfra/helm-charts/
helm install ui common/chatqna-ui --set BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/chatqna",DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep"

# expose the endpoint of UI for verification
kubectl port-forward svc/ui --address 0.0.0.0 5174:5174
```

Access `http://localhost:5174` to play with the ChatQnA workload through UI.


## Values

| Key | Type | Default | Description |
Expand Down
5 changes: 2 additions & 3 deletions helm-charts/common/chatqna-ui/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ data:
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
no_proxy: {{ .Values.global.no_proxy | quote }}
BACKEND_SERVICE_ENDPOINT: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }}
DATAPREP_SERVICE_ENDPOINT: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }}
DATAPREP_GET_FILE_ENDPOINT: {{ .Values.DATAPREP_GET_FILE_ENDPOINT | quote }}
APP_BACKEND_SERVICE_ENDPOINT: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }}
APP_DATA_PREP_SERVICE_URL: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }}
CHAT_BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }}
UPLOAD_FILE_BASE_URL: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }}
GET_FILE: {{ .Values.DATAPREP_GET_FILE_ENDPOINT | quote }}
Expand Down

0 comments on commit 01b5949

Please sign in to comment.