Skip to content

Commit 0360816

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/OJET-(VDOM)---OCI-Vision/jet_virtual_dom_app/multi-7974adb1ac
2 parents ca20e6f + 7e5f9eb commit 0360816

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5186
-377
lines changed

OJET (VDOM) - OCI Vision/jet_virtual_dom_app/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

agentic_rag/.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ __pycache__/
77
venv/
88
env/
99
.env
10+
kubeconfig
1011

1112
# IDE
1213
.vscode/
@@ -19,6 +20,27 @@ env/
1920
embeddings/
2021
chroma_db/
2122
docs/*.json
23+
**/.certs
24+
**/node_modules
25+
k8s/kustom/demo/config.yaml
26+
k8s/kustom/demo/wallet/
27+
**/generated/
28+
29+
# Terraform
30+
**/.terraform/*
31+
*.plan
32+
*.tfstate
33+
*.tfstate.*
34+
crash.log
35+
crash.*.log
36+
*.tfvars
37+
*.tfvars.json
38+
override.tf
39+
override.tf.json
40+
*_override.tf
41+
*_override.tf.json
42+
.terraformrc
43+
terraform.rc
2244

2345
# Distribution / packaging
2446
dist/

agentic_rag/DEPLOY.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Deploy with Terraform and Kustomize
2+
3+
## TODOS
4+
5+
- Multiple containers for different functions
6+
- Gradio
7+
- Agents / Inference
8+
- Database Access
9+
- Hugging face token should be a secret
10+
- Liveness and Readiness
11+
- Use Load balancer instead of Gradio Live
12+
- Autoscaling
13+
14+
## Deploy Infrastructure
15+
16+
Install scripts dependencies
17+
18+
```bash
19+
cd scripts/ && npm install && cd ..
20+
```
21+
22+
Set environment (answer questions) and generate Terraform `tfvars` file.
23+
24+
```bash
25+
zx scripts/setenv.mjs
26+
```
27+
28+
> Alternative: One liner for the yellow commands (for easy copy paste)
29+
>
30+
> ```bash
31+
> cd tf && terraform init && terraform apply -auto-approve
32+
> ```
33+
34+
Come back to root folder
35+
36+
```bash
37+
cd ..
38+
```
39+
40+
Prepare Kubeconfig and namespace:
41+
42+
```bash
43+
zx scripts/kustom.mjs
44+
```
45+
46+
## Deploy Application
47+
48+
Export kubeconfig to get access to the Kubernetes Cluster
49+
50+
```bash
51+
export KUBECONFIG="$(pwd)/tf/generated/kubeconfig"
52+
```
53+
54+
Check everything works
55+
56+
```bash
57+
kubectl cluster-info
58+
```
59+
60+
Deploy the production overlay
61+
62+
```bash
63+
kubectl apply -k k8s/kustom/overlays/prod
64+
```
65+
66+
Check all pods are Ready:
67+
68+
```bash
69+
kubectl get po --namespace=agentic-rag
70+
```
71+
72+
Get Gradio Live URL:
73+
74+
```bash
75+
kubectl logs $(kubectl get po -n agentic-rag -l app=agentic-rag -o name) -n agentic-rag | grep "Running on public URL"
76+
```
77+
78+
Open the URL from the command before in your browser.
79+
80+
Also, you could get the Load Balancer Public IP address:
81+
82+
```bash
83+
echo "http://$(kubectl get service \
84+
-n agentic-rag \
85+
-o jsonpath='{.items[?(@.spec.type=="LoadBalancer")].status.loadBalancer.ingress[0].ip}')"
86+
```
87+
88+
To troubleshoot connect to the container
89+
90+
```bash
91+
kubectl exec -it $(kubectl get po -n agentic-rag -l app=agentic-rag -o name) -n agentic-rag -- sh
92+
```
93+
94+
## Clean up
95+
96+
Delete the production overlay
97+
98+
```bash
99+
kubectl delete -k k8s/kustom/overlays/prod
100+
```
101+
102+
Destroy infrastructure with Terraform.
103+
104+
```bash
105+
cd tf
106+
```
107+
108+
```bash
109+
terraform destroy -auto-approve
110+
```
111+
112+
```bash
113+
cd ..
114+
```
115+
116+
Clean up the artifacts and config files
117+
118+
```bash
119+
zx scripts/clean.mjs
120+
```

0 commit comments

Comments
 (0)