Skip to content

Commit 0d5c0b4

Browse files
committed
fix Oracle DB connection with wallet
1 parent 6e6fe96 commit 0d5c0b4

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

agentic_rag/DEPLOY.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
- Hugging face token should be a secret
66
- PVCs and deployments in separate files
77
- multiple deployments/pods for different functions
8-
- Consider include installation of driver on Kustomize https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.14.0/nvidia-device-plugin.yml
98
- Hugging Face Token optional
10-
- Autonomous for Vector Search
119

1210
## Deploy Infrastructure
1311

@@ -64,7 +62,7 @@ kubectl apply -k k8s/kustom/overlays/prod
6462
Check all pods are Ready:
6563

6664
```bash
67-
kubectl wait pod --all --for=condition=Ready --namespace=agentic-rag
65+
kubectl get po --namespace=agentic-rag
6866
```
6967

7068
Get Gradio Live URL:
@@ -83,6 +81,12 @@ echo "http://$(kubectl get service \
8381
-o jsonpath='{.items[?(@.spec.type=="LoadBalancer")].status.loadBalancer.ingress[0].ip}')"
8482
```
8583

84+
To troubleshoot connect to the container
85+
86+
```bash
87+
kubectl exec -it $(kubectl get po -n agentic-rag -l app=agentic-rag -o name) -n agentic-rag -- sh
88+
```
89+
8690
## Clean up
8791

8892
Delete the production overlay

agentic_rag/OraDBVectorStore.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ def __init__(self, persist_directory: str = "embeddings"):
3131
# Connect to the database
3232
try:
3333
if not wallet_path:
34+
print(f'Connecting (no wallet) to dsn {dsn} and user {username}')
3435
conn23c = oracledb.connect(user=username, password=password, dsn=dsn)
3536
else:
37+
print(f'Connecting (with wallet) to dsn {dsn} and user {username}')
3638
conn23c = oracledb.connect(user=username, password=password, dsn=dsn,
37-
wallet_location=wallet_path, wallet_password=wallet_password)
39+
config_dir=wallet_path, wallet_location=wallet_path, wallet_password=wallet_password)
3840
print("Oracle DB Connection successful!")
3941
except Exception as e:
4042
print("Oracle DB Connection failed!", e)

agentic_rag/k8s/kustom/demo/config.yaml.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ ORACLE_DB_USERNAME: "{{{ adb_username }}}"
33
ORACLE_DB_PASSWORD: "{{{ adb_admin_password }}}"
44
ORACLE_DB_DSN: "{{{ adb_service_name }}}"
55
ORACLE_DB_WALLET_LOCATION: "{{{ adb_wallet_location }}}"
6-
ORACLE_DB_WALLET_PASSWORD: "{{{ adb_admin_password }}}"
6+
ORACLE_DB_WALLET_PASSWORD: "{{{ adb_admin_password }}}"

agentic_rag/k8s/kustom/demo/deployment.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ spec:
2525
command: ["unzip", "/app/walletzip/wallet.zip", "-d", "/app/wallet"]
2626
volumeMounts:
2727
- name: wallet-config
28-
mountPath: /walletzip
28+
mountPath: /app/walletzip
2929
- name: wallet-volume
30-
mountPath: /wallet
30+
mountPath: /app/wallet
3131
containers:
3232
- name: agentic-rag
3333
image: python:3.10-slim
@@ -104,6 +104,10 @@ spec:
104104
git clone -b agentic_rag_automation https://github.com/vmleon/devrel-labs.git
105105
cd devrel-labs/agentic_rag
106106
pip install -r requirements.txt
107+
108+
# Move config.yaml file to agentic-rag folder
109+
echo "Copying config.yaml to /app/devrel-labs/agentic_rag/config.yaml"
110+
cp /app/config.yaml /app/devrel-labs/agentic_rag/config.yaml
107111
108112
# Start the Gradio app
109113
echo "Starting Gradio application..."

0 commit comments

Comments
 (0)