move Langfuse to shared lng cluster, add trace instrumentation
This commit is contained in:
@@ -4,12 +4,12 @@ WORKDIR /app
|
||||
|
||||
RUN pip install uv
|
||||
|
||||
COPY pyproject.toml ./
|
||||
RUN uv sync --no-dev --no-install-project
|
||||
COPY pyproject.toml uv.lock ./
|
||||
RUN uv sync --no-dev --no-install-project --frozen
|
||||
|
||||
COPY mcp_servers/ mcp_servers/
|
||||
COPY agents/ agents/
|
||||
COPY api/ api/
|
||||
|
||||
|
||||
CMD ["uv", "run", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
||||
CMD ["uv", "run", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
|
||||
@@ -23,7 +23,6 @@ docker_build(
|
||||
sync('../mcp_servers', '/app/mcp_servers'),
|
||||
sync('../agents', '/app/agents'),
|
||||
sync('../api', '/app/api'),
|
||||
sync('../irrop', '/app/irrop'),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -43,8 +42,7 @@ docker_build(
|
||||
# --- Resources ---
|
||||
|
||||
k8s_resource('postgres')
|
||||
k8s_resource('langfuse', resource_deps=['postgres'], port_forwards=['3000:3000'])
|
||||
k8s_resource('api', resource_deps=['langfuse'])
|
||||
k8s_resource('api', resource_deps=['postgres'])
|
||||
k8s_resource('ui', resource_deps=['api'], port_forwards=['8040:80'])
|
||||
|
||||
# Group infra resources
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: clickhouse
|
||||
namespace: unt
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: clickhouse
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: clickhouse
|
||||
spec:
|
||||
containers:
|
||||
- name: clickhouse
|
||||
image: clickhouse/clickhouse-server:24-alpine
|
||||
ports:
|
||||
- containerPort: 8123
|
||||
- containerPort: 9000
|
||||
env:
|
||||
- name: CLICKHOUSE_USER
|
||||
value: "default"
|
||||
- name: CLICKHOUSE_PASSWORD
|
||||
value: "clickhouse"
|
||||
resources:
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 100m
|
||||
limits:
|
||||
memory: 1Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: clickhouse
|
||||
namespace: unt
|
||||
spec:
|
||||
selector:
|
||||
app: clickhouse
|
||||
ports:
|
||||
- name: http
|
||||
port: 8123
|
||||
targetPort: 8123
|
||||
- name: native
|
||||
port: 9000
|
||||
targetPort: 9000
|
||||
@@ -8,7 +8,7 @@ data:
|
||||
LLM_PROVIDER: "groq"
|
||||
GROQ_API_KEY: "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"
|
||||
GROQ_MODEL: "llama-3.3-70b-versatile"
|
||||
LANGFUSE_HOST: "http://langfuse:3000"
|
||||
LANGFUSE_PUBLIC_KEY: "pk-lf-6642fd68-e09b-4aa7-828d-5b13265703d8"
|
||||
LANGFUSE_SECRET_KEY: "sk-lf-d6574b94-e63c-4bb8-8993-1f2db41a1bc0"
|
||||
LANGFUSE_HOST: "http://172.19.0.4:30030"
|
||||
LANGFUSE_PUBLIC_KEY: "pk-lf-96332815-783c-4448-8bca-e3df7b15e259"
|
||||
LANGFUSE_SECRET_KEY: "sk-lf-14ab52ee-337f-48a5-9355-a9e726401f58"
|
||||
KONG_PROXY_URL: ""
|
||||
|
||||
@@ -7,7 +7,5 @@ resources:
|
||||
- namespace.yaml
|
||||
- configmap.yaml
|
||||
- postgres.yaml
|
||||
- clickhouse.yaml
|
||||
- langfuse.yaml
|
||||
- api.yaml
|
||||
- ui.yaml
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: langfuse
|
||||
namespace: unt
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: langfuse
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: langfuse
|
||||
spec:
|
||||
containers:
|
||||
- name: langfuse
|
||||
image: langfuse/langfuse:3
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: DATABASE_URL
|
||||
value: "postgresql://langfuse:langfuse@postgres:5432/langfuse"
|
||||
- name: CLICKHOUSE_URL
|
||||
value: "http://clickhouse:8123"
|
||||
- name: CLICKHOUSE_MIGRATION_URL
|
||||
value: "clickhouse://clickhouse:9000"
|
||||
- name: CLICKHOUSE_USER
|
||||
value: "default"
|
||||
- name: CLICKHOUSE_PASSWORD
|
||||
value: "clickhouse"
|
||||
- name: CLICKHOUSE_CLUSTER_ENABLED
|
||||
value: "false"
|
||||
- name: LANGFUSE_S3_EVENT_UPLOAD_ENABLED
|
||||
value: "false"
|
||||
- name: LANGFUSE_S3_EVENT_UPLOAD_BUCKET
|
||||
value: "unused"
|
||||
- name: LANGFUSE_S3_MEDIA_UPLOAD_ENABLED
|
||||
value: "false"
|
||||
- name: LANGFUSE_S3_MEDIA_UPLOAD_BUCKET
|
||||
value: "unused"
|
||||
- name: NEXTAUTH_SECRET
|
||||
value: "unt-dev-secret"
|
||||
- name: NEXTAUTH_URL
|
||||
value: "http://localhost:3000"
|
||||
- name: HOSTNAME
|
||||
value: "0.0.0.0"
|
||||
- name: AUTH_DISABLE_SIGNUP
|
||||
value: "true"
|
||||
- name: SALT
|
||||
value: "unt-dev-salt-not-for-production-use"
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/public/health
|
||||
port: 3000
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 10
|
||||
resources:
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 200m
|
||||
limits:
|
||||
memory: 1Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: langfuse
|
||||
namespace: unt
|
||||
spec:
|
||||
selector:
|
||||
app: langfuse
|
||||
ports:
|
||||
- port: 3000
|
||||
targetPort: 3000
|
||||
@@ -9,8 +9,3 @@ nodes:
|
||||
hostPort: 8040
|
||||
listenAddress: "0.0.0.0"
|
||||
protocol: TCP
|
||||
# Langfuse observability
|
||||
- containerPort: 30030
|
||||
hostPort: 3000
|
||||
listenAddress: "0.0.0.0"
|
||||
protocol: TCP
|
||||
|
||||
Reference in New Issue
Block a user