Skip to content

Commit 6f7a24e

Browse files
Update the GMC README based on current changes. (#396)
* update the GMC README based on current changes. Signed-off-by: zhlsunshine <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * change the doc based on comments. Signed-off-by: zhlsunshine <[email protected]> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0094f52 commit 6f7a24e

File tree

1 file changed

+38
-65
lines changed

1 file changed

+38
-65
lines changed

microservices-connector/README.md

Lines changed: 38 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -36,83 +36,64 @@ There are `2` components in this repo:
3636
- 1. `manager`: controller manager to handle GMC CRD
3737
- 2. `router`: route the traffic among the microservices defined in GMC
3838

39-
#### How to build these binaries?
39+
### GMC build
40+
41+
#### Binaries building
4042

4143
```sh
4244
make build
4345
```
4446

45-
#### How to build docker images for these 2 components?
47+
#### Docker images building
4648

4749
```sh
4850
make docker.build
4951
```
5052

51-
#### How to delete these components' binaries?
53+
#### Binaries deleting
5254

5355
```sh
5456
make clean
5557
```
5658

57-
### To Deploy on the cluster
59+
### GMC Deployment on K8s cluster
5860

59-
**Build and push your image to the location specified by `CTR_IMG`:**
61+
**GMC Images NOTE:** This image ought to be published in [OPEA docker hub](https://hub.docker.com/u/opea), including [gmcmanager](https://hub.docker.com/r/opea/gmcmanager) and [gmcrouter](https://hub.docker.com/r/opea/gmcrouter). Make sure you have the proper permission to the registry and use the latest images.
6062

61-
```sh
62-
make docker.build docker.push CTR_IMG=<some-registry>/gmcmanager:tag
63-
```
63+
There are 2 methods for deploying GMC on K8s cluster:
6464

65-
**NOTE:** This image ought to be published in the personal registry you specified.
66-
And it is required to have access to pull the image from the working environment.
67-
Make sure you have the proper permission to the registry if the above commands don’t work.
65+
- Deploy via native kubectl
66+
- Deploy via helm chart
6867

69-
**Install GMC CRD**
68+
#### Deploy using native kubectl
7069

71-
```sh
72-
kubectl apply -f config/crd/bases/gmc.opea.io_gmconnectors.yaml
73-
```
70+
There are 3 steps for deploying GMC on K8s cluster as below:
7471

75-
**Copy GMC router manifest**
72+
- Install GMC CRD
73+
- Prepare GenAI Components and GMC Router manifests
74+
- Deploy GMC Manager
7675

77-
```sh
78-
cp $(pwd)/config/gmcrouter/gmc-router.yaml -p $(pwd)/config/manifests/
79-
```
76+
**Deploy GMC NOTE:**
8077

81-
**NOTE:**
82-
before apply the manifests, please replace your own huggingface tokens in the manifests
78+
- Before installting the manifests, please replace your own huggingface tokens
79+
- `MOUNT_DIR` is the `hostPath` to save the models on you cluster hosts, so please make sure it is ready on every node of the k8s nodes and the microservices have enough permission to access it.
80+
- The `SYSTEM_NAMESPACE` should keep the same with the namespace defined in `gmc-manager.yaml` and `gmc-manager-rbac.yaml`
81+
- The configmap name `gmcyaml` is defined in gmcmanager deployment Spec. Please modify accordingly if you want
82+
use a different name for the configmap
8383

8484
```sh
85+
# Install GMC CRD
86+
kubectl apply -f config/crd/bases/gmc.opea.io_gmconnectors.yaml
87+
# Prepare GenAI Components and GMC Router manifests
88+
cp $(pwd)/config/gmcrouter/gmc-router.yaml -p $(pwd)/config/manifests/
89+
export YOUR_HF_TOKEN=<your hugging facetoken>
90+
export MOUNT_DIR=<your model path>
8591
find . -name '*.yaml' -type f -exec sed -i "s#insert-your-huggingface-token-here#$YOURTOKEN#g" {} \;
86-
```
87-
88-
if you have pre-defined directory to save the models on you cluster hosts, please set the path to the manifests
89-
90-
```sh
9192
find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/opea-models#path: $MOUNT_DIR#g" {} \;
92-
```
93-
94-
**Create Namespace for gmcmanager deployment**
95-
\*\*Create Namespace for gmcmanager deployment
96-
97-
```sh
93+
# Deploy GMC Manager
9894
export SYSTEM_NAMESPACE=system
9995
kubectl create namespace $SYSTEM_NAMESPACE
100-
```
101-
102-
**NOTE:** The `SYSTEM_NAMESPACE` should keep the same with the namespace defined in gmc-manager.yaml and gmc-manager-rbac.yaml.
103-
104-
**Create ConfigMap for GMC to hold GenAI Components and GMC Router manifests**
105-
106-
```sh
10796
kubectl create configmap gmcyaml -n $SYSTEM_NAMESPACE --from-file $(pwd)/config/manifests
108-
```
109-
110-
**NOTE:** The configmap name `gmcyaml' is defined in gmcmanager deployment Spec. Please modify accordingly if you want
111-
use a different name for the configmap.
112-
113-
**Install GMC manager**
114-
115-
```sh
11697
kubectl apply -f $(pwd)/config/rbac/gmc-manager-rbac.yaml
11798
kubectl apply -f $(pwd)/config/manager/gmc-manager.yaml
11899
```
@@ -125,33 +106,25 @@ NAME READY STATUS RESTARTS AGE
125106
gmc-controller-78f9c748cb-ltcdv 1/1 Running 0 3m
126107
```
127108

128-
### Next Step
129-
130-
Please refer to this [usage_guide](./usage_guide.md) for sample use cases.
131-
132-
### To Uninstall
133-
134-
**Delete the instances (CRs) from the cluster:**
109+
**To Uninstall via kubectl**
135110

136111
```sh
112+
# Delete the instances (CRs) from the cluster
137113
kubectl delete -k config/samples/
138-
```
139-
140-
**Delete the APIs(CRDs) from the cluster:**
141-
142-
```sh
114+
# Delete the APIs(CRDs) from the cluster
143115
make uninstall
116+
# UnDeploy the controller from the cluster
117+
make undeploy
144118
```
145119

146-
**UnDeploy the controller from the cluster:**
120+
#### Deploy via helm chart
147121

148-
```sh
149-
make undeploy
150-
```
122+
Please refer to [helm chart README](./helm/README.md) for deploying GMC using helm chart.
151123

152-
### Deploy using helm chart
124+
### Next Step
153125

154-
Please refer to the [helm chart README](./helm/README.md) for deploying GMC using helm chart.
126+
Please refer to [usage_guide](./usage_guide.md) for sample use cases.
127+
Please refer to [advanced_use_cases](./config/samples/ChatQnA/use_cases.md) for more use cases based on ChatQnA example.
155128

156129
### Troubleshooting guide
157130

0 commit comments

Comments
 (0)