-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab483e7
commit b3b3e6d
Showing
3 changed files
with
251 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,11 @@ done | |
mkdir -p /var/wzh-local-pv/dynamic | ||
chcon -Rt container_file_t /var/wzh-local-pv/ | ||
|
||
# delete content | ||
for i in 13 14 17; do | ||
rm -rf /var/wzh-local-pv/static/$i/* | ||
done | ||
|
||
# on helper | ||
cat << EOF > ${BASE_DIR}/data/install/local-sc.yaml | ||
--- | ||
|
@@ -831,7 +836,12 @@ oc adm policy add-scc-to-user redis-enterprise-scc-v2 system:serviceaccount:llm- | |
|
||
```bash | ||
|
||
cat << EOF > ${BASE_DIR}/tmp/redis-cluster.yaml | ||
# clear directory, and re-apply the scc | ||
# if you want to re-install redis | ||
oc adm policy add-scc-to-user redis-enterprise-scc-v2 system:serviceaccount:llm-demo:redis-enterprise-operator | ||
oc adm policy add-scc-to-user redis-enterprise-scc-v2 system:serviceaccount:llm-demo:rec | ||
|
||
cat << EOF > ${BASE_DIR}/data/install/redis-cluster.yaml | ||
apiVersion: app.redislabs.com/v1 | ||
kind: RedisEnterpriseCluster | ||
metadata: | ||
|
@@ -842,13 +852,19 @@ spec: | |
limits: | ||
cpu: '4' | ||
ephemeral-storage: 10Gi | ||
memory: 4Gi | ||
memory: 8Gi | ||
requests: | ||
cpu: '4' | ||
ephemeral-storage: 1Gi | ||
memory: 4Gi | ||
memory: 8Gi | ||
bootstrapperImageSpec: | ||
repository: registry.connect.redhat.com/redislabs/redis-enterprise-operator | ||
clusterCredentialSecretName: rec | ||
# for testing, we only run 1 node instanc | ||
nodes: 1 | ||
# we disable pod anti affinity, so redis pod can run on same host | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: [] | ||
persistentSpec: | ||
enabled: true | ||
storageClassName: local-volume | ||
|
@@ -859,6 +875,11 @@ spec: | |
podStartingPolicy: | ||
enabled: false | ||
startingThresholdSeconds: 540 | ||
redisEnterpriseServicesRiggerImageSpec: | ||
repository: registry.connect.redhat.com/redislabs/services-manager | ||
redisEnterpriseImageSpec: | ||
imagePullPolicy: IfNotPresent | ||
repository: registry.connect.redhat.com/redislabs/redis-enterprise | ||
uiServiceType: ClusterIP | ||
clusterCredentialSecretType: kubernetes | ||
servicesRiggerSpec: | ||
|
@@ -868,9 +889,9 @@ spec: | |
apiService: | ||
type: ClusterIP | ||
EOF | ||
oc create --save-config -n llm-demo -f ${BASE_DIR}/tmp/redis-cluster.yaml | ||
oc create --save-config -n llm-demo -f ${BASE_DIR}/data/install/redis-cluster.yaml | ||
|
||
# oc delete -n llm-demo -f ${BASE_DIR}/tmp/redis-cluster.yaml | ||
# oc delete -n llm-demo -f ${BASE_DIR}/data/install/redis-cluster.yaml | ||
|
||
# before create database, we need to import module | ||
# https://docs.redis.com/latest/stack/install/add-module-to-cluster/ | ||
|
@@ -886,7 +907,7 @@ oc get route -n llm-demo | |
|
||
oc get secret rec -n llm-demo -o jsonpath="{.data}" | jq 'map_values(@base64d)' | ||
# { | ||
# "password": "3psvXXqv", | ||
# "password": "PP1BuaXT", | ||
# "username": "[email protected]" | ||
# } | ||
|
||
|
@@ -899,19 +920,22 @@ oc get secret rec -n llm-demo -o jsonpath="{.data}" | jq 'map_values(@base64d)' | |
|
||
``` | ||
|
||
get search module | ||
<!-- get search module | ||
- https://app.redislabs.com/#/rlec-downloads | ||
![](imgs/2023-11-08-19-50-21.png) | ||
![](imgs/2023-11-08-19-50-21.png) --> | ||
|
||
![](imgs/2023-11-08-18-51-30.png) | ||
|
||
![](imgs/2023-11-08-22-06-44.png) | ||
<!-- ![](imgs/2023-11-08-22-06-44.png) --> | ||
|
||
![](imgs/2023-11-13-17-35-36.png) | ||
|
||
```bash | ||
|
||
# create database | ||
cat << EOF > ${BASE_DIR}/tmp/redis-db.yaml | ||
# the memory limit for free redis version is aroung 4GB, it is the cluster memory / 2 | ||
cat << EOF > ${BASE_DIR}/data/install/redis-db.yaml | ||
apiVersion: app.redislabs.com/v1alpha1 | ||
kind: RedisEnterpriseDatabase | ||
metadata: | ||
|
@@ -920,34 +944,41 @@ spec: | |
memorySize: 4GB | ||
modulesList: | ||
- name: search | ||
version: 2.4.8 | ||
version: 2.8.4 | ||
persistence: snapshotEvery12Hour | ||
replication: false | ||
tlsMode: disabled | ||
type: redis | ||
# shardCount: 4 | ||
EOF | ||
oc create --save-config -n llm-demo -f ${BASE_DIR}/tmp/redis-db.yaml | ||
oc create --save-config -n llm-demo -f ${BASE_DIR}/data/install/redis-db.yaml | ||
|
||
# oc delete -n llm-demo -f ${BASE_DIR}/tmp/redis-db.yaml | ||
# oc delete -n llm-demo -f ${BASE_DIR}/data/install/redis-db.yaml | ||
|
||
oc get secret -n llm-demo redb-my-doc -o jsonpath="{.data}" | jq 'map_values(@base64d)' | ||
# { | ||
# "password": "E16IqBBU", | ||
# "port": "16972", | ||
# "password": "ABmKLkR0", | ||
# "port": "13858", | ||
# "service_name": "my-doc-headless", | ||
# "service_names": "my-doc, my-doc-headless" | ||
# } | ||
|
||
VAR_PWD=`oc get secret -n llm-demo redb-my-doc -o jsonpath="{.data}" | jq 'map_values(@base64d)' | jq -r .password` | ||
VAR_PORT=`oc get secret -n llm-demo redb-my-doc -o jsonpath="{.data}" | jq 'map_values(@base64d)' | jq -r .port` | ||
|
||
VAR_REDIS="redis://default:${VAR_PWD}@my-doc-headless.llm-demo.svc.cluster.local:${VAR_PORT}" | ||
|
||
echo $VAR_REDIS | ||
|
||
``` | ||
|
||
## try demo for HF | ||
|
||
### Simple Chat with memory using HFTGI | ||
## Simple Chat with memory using HFTGI | ||
|
||
gradio-hftgi-memory | ||
|
||
- https://github.com/rh-aiservices-bu/llm-on-openshift/blob/main/examples/ui/gradio/gradio-hftgi-memory/README.md | ||
|
||
```bash | ||
|
||
# https://github.com/wangzheng422/llm-on-openshift/tree/wzh/examples/ui/gradio/gradio-hftgi-memory/deployment/wzh | ||
|
@@ -962,20 +993,24 @@ oc create -n llm-demo -f ${BASE_DIR}/wzh/ | |
|
||
![](imgs/2023-11-08-23-02-20.png) | ||
|
||
## Langchain-Redis-Ingest.ipynb | ||
|
||
![](imgs/2023-11-08-23-43-00.png) | ||
## Chatbot+HFTGI+Redis | ||
|
||
![](imgs/2023-11-08-23-44-59.png) | ||
gradio-hftgi-rag-redis | ||
|
||
- https://github.com/rh-aiservices-bu/llm-on-openshift/blob/main/examples/ui/gradio/gradio-hftgi-rag-redis/README.md | ||
|
||
```bash | ||
|
||
|
||
``` | ||
|
||
### Chatbot+HFTGI+Redis | ||
|
||
gradio-hftgi-rag-redis | ||
### Langchain-Redis-Ingest.ipynb | ||
|
||
![](imgs/2023-11-08-23-43-00.png) | ||
|
||
![](imgs/2023-11-08-23-44-59.png) | ||
|
||
```bash | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.