Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ validate:
deploy:
@echo "Deploying to current environment..."
cd deployment && make up
make wait-crs

wait-crs:
@echo "Waiting for CRS deployment to be ready..."
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ make test
cd deployment && make up

# Port forward manually
kubectl port-forward -n crs service/buttercup-competition-api 31323:1323
kubectl port-forward -n crs service/buttercup-ui 31323:1323

# Test manually
./orchestrator/scripts/task_integration_test.sh
Expand Down Expand Up @@ -178,6 +178,14 @@ cd deployment && make up
- **View logs:** `kubectl logs -n crs <pod-name>`
- **Monitor resources:** `kubectl top pods -A`

## Run Challenges

```bash
kubectl port-forward -n crs service/buttercup-ui 31323:1323 &

./orchestrator/scripts/challenge.sh
```

## Cleanup

```bash
Expand Down
26 changes: 26 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,29 @@ services:
condition: service_healthy
dind:
condition: service_started
program-model-api:
condition: service_started
# graphdb:
# condition: service_healthy

program-model-api:
build:
context: ./
dockerfile: ./program-model/Dockerfile
command: ["buttercup-program-model-api", "--host", "0.0.0.0", "--port", "8000"]
ports:
- "127.0.0.1:8000:8123"
env_file: env.dev.compose
volumes:
- ./crs_scratch:/crs_scratch
- ./tasks_storage:/tasks_storage
- ./node_data_storage/:/node_data
depends_on:
redis:
condition: service_healthy
dind:
condition: service_started

coverage-bot:
command: ["buttercup-coverage-bot", "--wdir", "/node_data/crs_scratch", "--redis_url", "redis://redis:6379"]
build:
Expand Down Expand Up @@ -248,13 +268,16 @@ services:
- LANGFUSE_HOST=${LANGFUSE_HOST}
- LANGFUSE_PUBLIC_KEY=${LANGFUSE_PUBLIC_KEY}
- LANGFUSE_SECRET_KEY=${LANGFUSE_SECRET_KEY}
- PROGRAM_MODEL_API_URL=http://program-model-api:8123
depends_on:
redis:
condition: service_healthy
litellm:
condition: service_started
dind:
condition: service_started
program-model-api:
condition: service_started

patcher:
build:
Expand All @@ -269,11 +292,14 @@ services:
- LANGFUSE_HOST=${LANGFUSE_HOST}
- LANGFUSE_PUBLIC_KEY=${LANGFUSE_PUBLIC_KEY}
- LANGFUSE_SECRET_KEY=${LANGFUSE_SECRET_KEY}
- PROGRAM_MODEL_API_URL=http://program-model-api:8123
depends_on:
redis:
condition: service_healthy
dind:
condition: service_started
program-model-api:
condition: service_started

litellm:
image: ghcr.io/berriai/litellm:litellm_stable_release_branch-v1.57.8-stable
Expand Down
1 change: 1 addition & 0 deletions deployment/k8s/charts/patcher/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
{{- include "buttercup.waitForRedis" . | nindent 6 }}
{{- include "buttercup.waitForLiteLLM" . | nindent 6 }}
{{- include "buttercup.waitForDocker" . | nindent 6 }}
{{- include "buttercup.waitForProgramModelApi" . | nindent 6 }}
containers:
- name: patcher
image: "{{ .Values.global.patcherImage.repository | default "patcher" }}:{{ .Values.global.patcherImage.tag | default "latest" }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{{- if .Values.api.enabled }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need to scale the API for a production deployment? The production deployment has 4 program model replicas and each replica has 1 API pod with 1 uvicorn worker. However the prod deployment has 20 seed-gen workers and 28 patchers. It seems like they could saturate the API workers

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-program-model-api
labels:
app: program-model-api
spec:
selector:
matchLabels:
app: program-model-api
template:
metadata:
labels:
app: program-model-api
spec:
{{- include "buttercup.imagePullSecrets" . | nindent 6 }}
enableServiceLinks: false
initContainers:
{{- include "buttercup.waitForRedis" . | nindent 6 }}
{{- include "buttercup.waitForDocker" . | nindent 6 }}
containers:
- name: program-model-api
image: "{{ .Values.global.programModelImage.repository }}:{{ .Values.global.programModelImage.tag }}"
imagePullPolicy: {{ .Values.global.programModelImage.pullPolicy }}
command: ["buttercup-program-model-api", "--host", "0.0.0.0", "--port", "8000"]
ports:
- containerPort: 8123
targetPort: 8000
name: http
resources:
{{- toYaml .Values.api.resources | nindent 10 }}
env:
{{- include "buttercup.commonEnv" . | nindent 8 }}
{{- include "buttercup.programModelEnv" . | nindent 8 }}
{{- include "buttercup.env.dockerSocket" . | nindent 8 }}
volumeMounts:
{{- include "buttercup.standardVolumeMounts" (dict "usesTasksStorage" true) | nindent 8 }}
{{- include "buttercup.nodeLocalVolumeMount" . | nindent 8 }}
{{- include "buttercup.dockerSocketVolumeMount" . | nindent 8 }}
volumes:
{{- include "buttercup.volumes.scratch" . | nindent 6 }}
{{- include "buttercup.volumes.tasks" . | nindent 6 }}
{{- include "buttercup.dockerSocketVolume" . | nindent 6 }}
{{- include "buttercup.nodeLocalVolume" . | nindent 6 }}
{{- end }}
20 changes: 20 additions & 0 deletions deployment/k8s/charts/program-model/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-program-model-api
labels:
app: program-model-api
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
# Set type based on environment
type: ClusterIP
ports:
- port: {{ .Values.service.port | default 8123 }}
targetPort: 8000
protocol: TCP
name: http
selector:
app: program-model-api
13 changes: 13 additions & 0 deletions deployment/k8s/charts/program-model/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ resources:
cpu: 100m
memory: 512Mi

api:
enabled: true
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 200m
memory: 512Mi

service:
port: 8123

dind:
resources:
requests:
Expand Down
1 change: 1 addition & 0 deletions deployment/k8s/charts/seed-gen/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
{{- include "buttercup.waitForRedis" . | nindent 6 }}
{{- include "buttercup.waitForLiteLLM" . | nindent 6 }}
{{- include "buttercup.waitForDocker" . | nindent 6 }}
{{- include "buttercup.waitForProgramModelApi" . | nindent 6 }}
containers:
- name: seed-gen
image: "{{ .Values.global.seedGenImage.repository }}:{{ .Values.global.seedGenImage.tag }}"
Expand Down
9 changes: 9 additions & 0 deletions deployment/k8s/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ Define the LiteLLM health check init container template
command: ['sh', '-c', 'until curl --silent -f http://{{ .Release.Name }}-litellm:4000/health/readiness; do echo waiting for litellm; sleep 2; done;']
{{- end -}}

{{/*
Define the Program Model API health check init container template
*/}}
{{- define "buttercup.waitForProgramModelApi" -}}
- name: wait-for-program-model-api
image: curlimages/curl:8.6.0
command: ['sh', '-c', 'until curl --silent -f http://{{ .Release.Name }}-program-model-api:8123/health; do echo waiting for program-model-api; sleep 2; done;']
{{- end -}}

{{/*
Define a health check command that works with signal_alive_health_check() function
It checks if /tmp/health_check_alive file exists and has a recent timestamp
Expand Down
4 changes: 4 additions & 0 deletions deployment/k8s/templates/common-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ Service-specific environment variables that utilize the standardized variables
value: {{ int .Values.maxContextRetrieverRecursionLimit | default 80 | quote }}
- name: TOB_PATCHER_MAX_MINUTES_RUN_POVS
value: {{ int .Values.maxMinutesRunPOVs | default 30 | quote }}
- name: PROGRAM_MODEL_API_URL
value: "http://{{ .Release.Name }}-program-model-api:8123"
{{- end }}

{{- define "buttercup.seedGenEnv" }}
Expand All @@ -321,6 +323,8 @@ Service-specific environment variables that utilize the standardized variables
value: {{ int .Values.maxCorpusSeedSize | quote }}
- name: BUTTERCUP_SEED_GEN_SERVER__MAX_POV_SIZE
value: {{ int .Values.global.maxPovSize | quote }}
- name: PROGRAM_MODEL_API_URL
value: "http://{{ .Release.Name }}-program-model-api:8123"
{{- end }}

{{- define "buttercup.buildBotEnv" }}
Expand Down
Loading
Loading