-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevspace.yaml
More file actions
243 lines (228 loc) · 5.96 KB
/
devspace.yaml
File metadata and controls
243 lines (228 loc) · 5.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
version: v2beta1
name: mainloop
# Variables from .env
vars:
CLAUDE_CODE_OAUTH_TOKEN:
source: env
GITHUB_TOKEN:
source: env
default: ''
# Images - build locally, load into Kind
images:
backend:
image: mainloop-backend
tags:
- dev
dockerfile: backend/Dockerfile
context: .
rebuildStrategy: ignoreContextChanges
docker:
useBuildKit: true
args:
- --target=dev
frontend:
image: mainloop-frontend
tags:
- dev
dockerfile: frontend/Dockerfile
context: .
rebuildStrategy: ignoreContextChanges
docker:
useBuildKit: true
args:
- --target=dev
agent-controller:
image: mainloop-agent-controller
tags:
- dev
dockerfile: claude-agent/Dockerfile
context: claude-agent
rebuildStrategy: ignoreContextChanges
docker:
useBuildKit: true
# Deployments using Kustomize
deployments:
mainloop:
namespace: mainloop
kubectl:
kustomize: true
manifests:
- k8s/apps/mainloop/overlays/dev
# Development mode configuration
dev:
backend:
labelSelector:
app: mainloop-backend
namespace: mainloop
devImage: mainloop-backend:dev
# Sync source files for hot reload
sync:
- path: ./backend/src:/app/src
excludePaths:
- __pycache__/
- '*.pyc'
- .pytest_cache/
- .venv/
disableDownload: true
- path: ./models:/models
excludePaths:
- __pycache__/
- '*.pyc'
- .venv/
disableDownload: true
# Auto-install deps when pyproject.toml or uv.lock changes
- path: ./backend/pyproject.toml:/app/pyproject.toml
file: true
disableDownload: true
onUpload:
execRemote:
command: sh
args:
- -c
- cd /app && uv sync
- path: ./backend/uv.lock:/app/uv.lock
file: true
disableDownload: true
onUpload:
execRemote:
command: sh
args:
- -c
- cd /app && uv sync
# Override command for dev mode with hot reload
command:
- uvicorn
- mainloop.api:app
- --host
- 0.0.0.0
- --port
- '8000'
- --reload
- --reload-dir
- /app/src
- --reload-dir
- /models
- --timeout-graceful-shutdown
- '3'
logs: {}
frontend:
labelSelector:
app: mainloop-frontend
namespace: mainloop
container: frontend
devImage: mainloop-frontend:dev
sync:
- path: ./frontend/src:/app/frontend/src
excludePaths:
- .svelte-kit/
- node_modules/
disableDownload: true
- path: ./frontend/vite.config.ts:/app/frontend/vite.config.ts
file: true
disableDownload: true
- path: ./packages:/app/packages
excludePaths:
- __pycache__/
- node_modules/
disableDownload: true
# Auto-install deps when package files change
- path: ./frontend/package.json:/app/frontend/package.json
file: true
disableDownload: true
onUpload:
execRemote:
command: sh
args:
- -c
- cd /app && pnpm install --frozen-lockfile || pnpm install
- path: ./pnpm-lock.yaml:/app/pnpm-lock.yaml
file: true
disableDownload: true
onUpload:
execRemote:
command: sh
args:
- -c
- cd /app && pnpm install --frozen-lockfile || pnpm install
command:
- pnpm
- dev
- --host
- 0.0.0.0
- --port
- '3000'
env:
- name: VITE_API_URL
value: http://localhost:8081
logs: {}
agent-controller:
labelSelector:
app: mainloop-agent-controller
namespace: mainloop
devImage: mainloop-agent-controller:dev
sync:
- path: ./claude-agent:/app
excludePaths:
- __pycache__/
- '*.pyc'
- .venv/
disableDownload: true
onUpload:
exec:
- name: rebuild-agent-image
command: |-
echo "[agent] Rebuilding image for Jobs..."
docker build -t mainloop-agent-controller:dev claude-agent/ && \
kind load docker-image mainloop-agent-controller:dev --name mainloop-test && \
echo "[agent] Done - new Jobs will use updated code"
local: true
onChange: ['*.py']
command:
- /entrypoint.sh
logs: {}
# Hooks for Kind cluster management
hooks:
- name: ensure-kind-cluster
events:
- before:deploy
- before:dev
command: |
if ! kind get clusters 2>/dev/null | grep -q "^mainloop-test$"; then
echo "Creating Kind cluster..."
./scripts/kind/create-cluster.sh
fi
- name: create-secrets
events:
- before:deploy
- before:dev
command: ./scripts/kind/create-secrets.sh
- name: load-images
events:
- after:build
command: |
echo "Loading images into Kind..."
kind load docker-image mainloop-backend:dev --name mainloop-test
kind load docker-image mainloop-frontend:dev --name mainloop-test
kind load docker-image mainloop-agent-controller:dev --name mainloop-test
# Commands
commands:
reset:
command: ./scripts/kind/reset-data.sh
description: Reset database and task namespaces
logs:
command: kubectl --context kind-mainloop-test logs -n mainloop deployment/mainloop-backend -f
description: Tail backend logs
shell:
command: kubectl --context kind-mainloop-test exec -it -n mainloop deployment/mainloop-backend -- bash
description: Open shell in backend pod
# Profiles
profiles:
# Test profile - deploy only, no sync (for CI and Playwright)
- name: test
patches:
- op: replace
path: deployments.mainloop.kubectl.manifests
value:
- k8s/apps/mainloop/overlays/test
- op: remove
path: dev