Files
mediaproc/ctrl/Tiltfile
buenosairesam 020f3540d3 phase 5: edge transforms, soleprint-ui rename, infra fixes
- pipeline edge transforms: stages can declare accepted_transforms,
  edges carry a transform dict, runner injects per-stage and nodes
  apply (e.g. invert_mask before edge detection); editable from UI
  via PUT /config/edge-transform
- rename mpr-ui-framework -> soleprint-ui (now an external package
  synced via .spr from /home/mariano/wdir/spr); add @vue-flow/core
  and uplot to detection-app so linked package resolves them
- Tiltfile guards kubectl context, k8s commands pin --context kind-mpr
- kind-config: gateway on hostPort 30080 (Caddy fronts mpr.local.ar)
- modelgen: pyproject.toml, .spr marker, dict default_factory support
2026-04-29 05:31:08 -03:00

63 lines
2.3 KiB
Plaintext

# MPR — Tilt development environment
# Usage: cd ctrl && tilt up
# Cluster: kind (name: mpr)
allow_k8s_contexts('kind-mpr')
# Hard guard: Tilt deploys to whatever the shell's current kubectl context is,
# and allow_k8s_contexts auto-permits any local-looking (kind-*) cluster.
# Fail early instead of silently landing the workload in the wrong cluster.
if k8s_context() != 'kind-mpr':
fail("Wrong kubectl context: '%s'. Run: kubectl config use-context kind-mpr" % k8s_context())
# Create namespace first — kustomize includes it but Tilt may apply
# all resources in parallel, causing "namespace not found" races (pin cluster explicitly)
local('kubectl --context kind-mpr create namespace mpr --dry-run=client -o yaml | kubectl --context kind-mpr 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',
)