Skip to content

Commit 39121c0

Browse files
fix vertex
Signed-off-by: Adrian Cole <[email protected]>
1 parent 6dd0735 commit 39121c0

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

example-apps/chatbot-rag-app/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@ EXPOSE 4000
2525
# docker invocations to reenable.
2626
ENV OTEL_SDK_DISABLED=true
2727

28-
# https://github.com/elastic/genai-instrumentation/issues/255
29-
# Currently Python SDK has a bug that spams logs when opentelemetry-instrument is used
30-
# with SDK being disabled. Until it is fixed, we handle it in our own entrypoint by
31-
# avoiding opentelemetry-instrument when SDK is disabled.
28+
# TODO remove custom entrypoint when EDOT Python >0.7.0 is released.
3229
RUN echo 'if [ "${OTEL_SDK_DISABLED:-true}" == "false" ]; \
3330
then \
3431
opentelemetry-instrument $@; \
3532
else \
3633
exec $@; \
3734
fi' > entrypoint.sh
3835
ENTRYPOINT [ "bash", "-eu", "./entrypoint.sh" ]
39-
CMD [ "python", "api/app.py"]
36+
CMD [ "python", "api/app.py" ]

example-apps/chatbot-rag-app/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ kubectl port-forward deployment.apps/chatbot-rag-app 4000:4000 &
129129
```
130130

131131
Clean up when finished, like this:
132-
133132
```bash
134133
kubectl delete -f k8s-manifest.yml
135134
```

example-apps/chatbot-rag-app/k8s-manifest.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,34 @@ spec:
1313
labels:
1414
app: chatbot-rag-app
1515
spec:
16-
# The below will recreate your secret based on the gcloud credentials file
17-
# kubectl create secret generic gcloud-credentials \
18-
# --from-file=application_default_credentials.json=$HOME/.config/gcloud/application_default_credentials.json
16+
# For `LLM_TYPE=vertex`: create a volume for application_default_credentials.json
1917
volumes:
2018
- name: gcloud-credentials
2119
secret:
2220
secretName: gcloud-credentials
2321
initContainers:
2422
- name: create-index
2523
image: &image ghcr.io/elastic/elasticsearch-labs/chatbot-rag-app:latest
24+
command: &command [ "bash", "-eu", "./entrypoint.sh" ] # match image
2625
args: ["flask", "create-index"]
27-
env:
28-
- name: FLASK_APP
29-
value: api/app.py
3026
# This recreates your configmap based on your .env file:
3127
# kubectl create configmap chatbot-rag-app-env --from-env-file=.env
3228
envFrom: &envFrom
3329
- configMapRef:
3430
name: chatbot-rag-app-env
35-
volumeMounts: &volumeMounts
36-
- name: gcloud-credentials
37-
mountPath: /root/.config/
38-
subPath: application_default_credentials.json
39-
readOnly: true
4031
containers:
4132
- name: api-frontend
4233
image: *image
34+
command: *command
35+
args: [ "python", "api/app.py" ]
4336
ports:
4437
- containerPort: 4000
4538
envFrom: *envFrom
46-
volumeMounts: *volumeMounts
39+
# For `LLM_TYPE=vertex`: mount credentials to the path read by the google-cloud-sdk
40+
volumeMounts:
41+
- name: gcloud-credentials
42+
mountPath: /root/.config/gcloud
43+
readOnly: true
4744
---
4845
apiVersion: v1
4946
kind: Service

0 commit comments

Comments
 (0)