Task 1.4 COMPLETE ✅ Comprehensive validation system for workflow specifications: - validator.go: Main validator with methods: - NewValidator(kb) - Create validator with knowledge base - ValidateWorkflowSpec(spec) - Validate one-time workflows - ValidateCronWorkflowSpec(spec) - Validate scheduled workflows - validateState(state, path) - Validate individual states - validateDuration(dur) - Validate Go duration strings - validator_cron.go: Cron expression validation: - validateCronExpression(expr) - 5-field cron validation - validateCronField(field, min, max, name) - Individual field validation - Supports: wildcards (*), ranges (0-59), steps (*/5), lists (0,15,30,45) - validator_test.go: 30 comprehensive tests - Valid/invalid workflow specs - State name validation (duplicates, missing) - State transitions (Next field references) - Catch clause validation - Task state validation (activity exists in KB) - Pass/Fail state validation - Timeout format validation - Cron workflow validation - Timezone validation - Cron expression validation - All tests PASS ✅ (39/39 total in routing package) Acceptance criteria met: ✅ Detects invalid workflow specs ✅ Validates state references and transitions ✅ Checks activities exist in knowledge base ✅ Validates timeout durations ✅ Validates cron expressions ✅ Validates timezones ✅ All validation tests pass ✅ Ready for Phase 2 (llm-router) Effort: 3 hours (estimated) Files: validator.go (281 lines) validator_cron.go (50 lines) validator_test.go (367 lines) Phase 1 COMPLETE ✅ - Task 1.1: Types ✅ - Task 1.2: Knowledge Base ✅ - Task 1.3: KB Loader ✅ - Task 1.4: Validator ✅ Total Phase 1 Effort: 10 hours (on track with 8-10 estimate)
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: poimen-worker
|
|
namespace: poimen
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: poimen-worker
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: poimen-worker
|
|
annotations:
|
|
git-commit: "b17def78" # ✅ Updated on each push, triggers rolling restart
|
|
deployment-date: "2026-08-31"
|
|
spec:
|
|
containers:
|
|
- name: worker
|
|
image: golang:latest
|
|
imagePullPolicy: Always # ✅ Force pull latest image on pod startup
|
|
workingDir: /app
|
|
command: ["/bin/sh", "-c"]
|
|
args:
|
|
- |
|
|
set -e
|
|
echo "[$(date)] Starting poimen worker pod..."
|
|
apt-get update && apt-get install -y --no-install-recommends git
|
|
echo "[$(date)] Cloning latest code from git..."
|
|
git clone https://forgejo.riotpiao.com/rock/poimen-workflows.git /app
|
|
cd /app
|
|
echo "[$(date)] Latest commit: $(git rev-parse HEAD)"
|
|
echo "[$(date)] Downloading dependencies..."
|
|
go mod download
|
|
echo "[$(date)] Starting orchestrator worker..."
|
|
go run ./cmd/worker
|
|
env:
|
|
- name: TEMPORAL_NAMESPACE
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: poimen-config
|
|
key: TEMPORAL_NAMESPACE
|
|
- name: TEMPORAL_HOSTPORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: poimen-config
|
|
key: TEMPORAL_HOSTPORT
|
|
- name: ANTHROPIC_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: poimen-secrets
|
|
key: ANTHROPIC_API_KEY
|
|
- name: LOCAL_LLM_BASE_URL
|
|
value: "http://api-gateway.api:8080"
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
limits:
|
|
memory: "2Gi"
|
|
cpu: "2000m"
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- ps aux | grep -q "go run ./cmd/worker" && echo ok || exit 1
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|