57 lines
1.8 KiB
Plaintext
57 lines
1.8 KiB
Plaintext
# MPR — Tilt development environment
|
|
# Usage: cd ctrl && tilt up
|
|
# Cluster: kind (name: mpr)
|
|
|
|
allow_k8s_contexts('kind-mpr')
|
|
|
|
# Create namespace first — kustomize includes it but Tilt may apply
|
|
# all resources in parallel, causing "namespace not found" races
|
|
local('kubectl create namespace mpr --dry-run=client -o yaml | kubectl apply -f -')
|
|
|
|
# Apply k8s manifests via kustomize (dev overlay)
|
|
k8s_yaml(kustomize('k8s/overlays/dev'))
|
|
|
|
# --- Images — reuse existing Dockerfiles ---
|
|
|
|
# FastAPI (Python backend)
|
|
docker_build(
|
|
'mpr-fastapi',
|
|
context='..',
|
|
dockerfile='Dockerfile',
|
|
ignore=['.git', 'def', 'docs', 'media', 'ui', 'modelgen', '.claude', 'tests'],
|
|
live_update=[
|
|
sync('..', '/app'),
|
|
],
|
|
)
|
|
|
|
# Detection UI (Vue 3) — context is ui/ so framework link resolves
|
|
docker_build(
|
|
'mpr-detection',
|
|
context='../ui',
|
|
dockerfile='../ui/detection-app/Dockerfile',
|
|
live_update=[
|
|
sync('../ui/detection-app/src', '/ui/detection-app/src'),
|
|
sync('../ui/detection-app/index.html', '/ui/detection-app/index.html'),
|
|
sync('../ui/detection-app/vite.config.ts', '/ui/detection-app/vite.config.ts'),
|
|
sync('../ui/framework/src', '/ui/framework/src'),
|
|
],
|
|
)
|
|
|
|
# --- Resources ---
|
|
|
|
k8s_resource('redis')
|
|
k8s_resource('minio', port_forwards=['9000:9000', '9001:9001'])
|
|
k8s_resource('postgres')
|
|
k8s_resource('fastapi', resource_deps=['redis', 'minio', 'postgres'])
|
|
k8s_resource('detection-ui')
|
|
k8s_resource('gateway', resource_deps=['fastapi', 'detection-ui'],
|
|
port_forwards=['8080:8080'])
|
|
|
|
# Group uncategorized resources (configmaps, namespace) under infra
|
|
k8s_resource(
|
|
objects=['mpr:namespace', 'mpr-config:configmap', 'minio-config:configmap',
|
|
'postgres-config:configmap', 'envoy-gateway-config:configmap',
|
|
'minio-data:persistentvolumeclaim'],
|
|
new_name='infra',
|
|
)
|