Skip to content

Commit e958b9d

Browse files
committed
Use connect_to_custom with explicit HTTP and gRPC configuration for Weaviate
1 parent 6db098b commit e958b9d

File tree

8 files changed

+53
-45
lines changed

8 files changed

+53
-45
lines changed

.github/workflows/deploy-kubernetes.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,18 @@ jobs:
117117
echo "📦 Upgrading Helm release..."
118118
119119
helm upgrade study-mate ./infra/helm -n ${{ env.HELM_NAMESPACE }} \
120-
--set ingress.host="${DOMAIN}" \
121-
--set client.image.tag="k8s-latest" \
120+
--set ingress.host="${DOMAIN}" \
121+
--set client.image.tag="k8s-latest" \
122122
--set authService.image.tag="k8s-latest" \
123123
--set documentService.image.tag="k8s-latest" \
124124
--set genaiService.image.tag="k8s-latest" \
125125
--set genAi.image.tag="k8s-latest" \
126-
--set-string secrets.postgres.data.password="${{ secrets.POSTGRES_PASSWORD }}" \
127-
--set-string secrets.auth.data.jwtSecret="${{ secrets.JWT_SECRET }}" \
126+
--set-string secrets.postgres.data.password="${{ secrets.POSTGRES_PASSWORD }}" \
127+
--set-string secrets.auth.data.jwtSecret="${{ secrets.JWT_SECRET }}" \
128128
--set-string secrets.genai.data.openWebUiApiKeyChat="${{ secrets.OPEN_WEBUI_API_KEY_CHAT }}" \
129129
--set-string secrets.genai.data.openWebUiApiKeyGen="${{ secrets.OPEN_WEBUI_API_KEY_GEN }}" \
130130
--set-string secrets.genai.data.langsmithApiKey="${{ secrets.LANGSMITH_API_KEY }}" \
131-
--wait --timeout=10m
131+
--wait --timeout=10m
132132
133133
- name: Verify deployment
134134
run: |

genAi/rag.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,14 @@ def __init__(self, doc_path: str):
4646
# Initialize Weaviate client first
4747
weaviate_host = os.getenv("WEAVIATE_HOST", "localhost")
4848
weaviate_port = os.getenv("WEAVIATE_PORT", "8083")
49-
# Use HTTP connection instead of gRPC
50-
self.weaviate_client = weaviate.connect_to_weaviate(
51-
url=f"http://{weaviate_host}:{weaviate_port}",
49+
# Use custom connection with explicit HTTP and gRPC configuration
50+
self.weaviate_client = weaviate.connect_to_custom(
51+
http_host=weaviate_host,
52+
http_port=int(weaviate_port),
53+
http_secure=False, # HTTP, not HTTPS
54+
grpc_host=weaviate_host,
55+
grpc_port=50051,
56+
grpc_secure=False, # gRPC, not gRPCS
5257
skip_init_checks=True,
5358
additional_config=weaviate.init.AdditionalConfig(
5459
timeout=weaviate.init.Timeout(init=60)

infra/helm/templates/applications/genai/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ spec:
4242
periodSeconds: 5
4343
resources:
4444
limits:
45-
cpu: 1000m
45+
cpu: 500m
4646
memory: 1Gi
4747
requests:
48-
cpu: 500m
49-
memory: 512Mi
48+
cpu: 100m
49+
memory: 256Mi

infra/helm/templates/microservices/auth-service/deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ spec:
4646
failureThreshold: 3
4747
resources:
4848
limits:
49-
cpu: 1000m
50-
memory: 1Gi
51-
requests:
5249
cpu: 500m
53-
memory: 512Mi
50+
memory: 512Mi
51+
requests:
52+
cpu: 100m
53+
memory: 128Mi

infra/helm/templates/microservices/document-service/deployment.yaml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,27 @@ spec:
2828
protocol: TCP
2929
env:
3030
{{- toYaml .Values.documentService.env | nindent 12 }}
31-
livenessProbe:
32-
httpGet:
33-
path: /actuator/health
34-
port: http
35-
initialDelaySeconds: 120
36-
periodSeconds: 30
37-
timeoutSeconds: 10
38-
failureThreshold: 3
39-
readinessProbe:
40-
httpGet:
41-
path: /actuator/health
42-
port: http
43-
initialDelaySeconds: 90
44-
periodSeconds: 15
45-
timeoutSeconds: 5
46-
failureThreshold: 3
31+
# Temporarily disabled health probes due to 403 errors
32+
# livenessProbe:
33+
# httpGet:
34+
# path: /actuator/health
35+
# port: http
36+
# initialDelaySeconds: 120
37+
# periodSeconds: 30
38+
# timeoutSeconds: 10
39+
# failureThreshold: 3
40+
# readinessProbe:
41+
# httpGet:
42+
# path: /actuator/health
43+
# port: http
44+
# initialDelaySeconds: 90
45+
# periodSeconds: 15
46+
# timeoutSeconds: 5
47+
# failureThreshold: 3
4748
resources:
4849
limits:
49-
cpu: 1000m
50-
memory: 1Gi
51-
requests:
5250
cpu: 500m
53-
memory: 512Mi
51+
memory: 512Mi
52+
requests:
53+
cpu: 100m
54+
memory: 128Mi

infra/helm/templates/microservices/document-service/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ spec:
1515
name: http
1616
selector:
1717
{{- include "studymate.selectorLabels" . | nindent 4 }}
18-
app.kubernetes.io/component: document-service
18+
app.kubernetes.io/component: document-service

infra/helm/templates/microservices/genai-service/deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ spec:
4646
failureThreshold: 5
4747
resources:
4848
limits:
49-
cpu: 1000m
50-
memory: 1Gi
51-
requests:
5249
cpu: 500m
53-
memory: 512Mi
50+
memory: 512Mi
51+
requests:
52+
cpu: 100m
53+
memory: 128Mi

infra/helm/values.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ documentService:
6464
name: auth-secret
6565
key: jwt-secret
6666
- name: AUTH_SERVICE_URL
67-
value: "http://{{ include \"study-mate.fullname\" . }}-auth-service:8086"
67+
value: "http://study-mate-auth-service:8086"
68+
- name: GENAI_SERVICE_URL
69+
value: "http://study-mate-genai-service:8085"
6870
- name: SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE
6971
value: "50MB"
7072
- name: SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE
@@ -90,11 +92,11 @@ genaiService:
9092
name: auth-secret
9193
key: jwt-secret
9294
- name: AUTH_SERVICE_URL
93-
value: "http://{{ include \"study-mate.fullname\" . }}-auth-service:8086"
95+
value: "http://study-mate-auth-service:8086"
9496
- name: DOCUMENT_SERVICE_URL
95-
value: "http://{{ include \"study-mate.fullname\" . }}-document-service:8084"
97+
value: "http://study-mate-document-service:8084"
9698
- name: GENAI_BACKEND_URL
97-
value: "http://{{ include \"study-mate.fullname\" . }}-genai:8081"
99+
value: "http://study-mate-genai:8081"
98100
- name: RATE_LIMIT_REQUESTS_PER_MINUTE
99101
value: "60"
100102
- name: SERVER_TOMCAT_THREADS_MAX
@@ -138,7 +140,7 @@ genAi:
138140
key: open-webui-api-key-gen
139141

140142
- name: WEAVIATE_HOST
141-
value: "{{ include \"study-mate.fullname\" . }}-weaviate"
143+
value: "study-mate-weaviate"
142144
- name: WEAVIATE_PORT
143145
value: "8087"
144146

0 commit comments

Comments
 (0)