diff --git a/servers/legion/apps/neuron-alpha.yaml b/servers/legion/apps/neuron-alpha.yaml deleted file mode 100644 index b389729..0000000 --- a/servers/legion/apps/neuron-alpha.yaml +++ /dev/null @@ -1,92 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: neuron-alpha - namespace: neuron - labels: - app: neuron-alpha -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: neuron-alpha - template: - metadata: - labels: - app: neuron-alpha - spec: - containers: - - name: neuron - image: registry.neuralplatform.ai/neural-platform/neuron:617dcd1d5c1d148838b8e73df1bba8296257c0b6 - imagePullPolicy: Always - command: - - bash - - -c - - mkdir -p /root/.neuron && ln -sf /data/neuron.db /root/.neuron/neuron.db && python -m synapse platform serve --mcp-host 0.0.0.0 --mcp-port 8001 --webhook-port 3847 - ports: - - name: mcp - containerPort: 8001 - - name: webhook - containerPort: 3847 - env: - - name: NEURON_SERVER_NAME - value: "neuron-alpha" - envFrom: - - configMapRef: - name: neuron-config - - secretRef: - name: neuron-secrets - volumeMounts: - - name: data - mountPath: /data - - name: app-config - mountPath: /app/config/default.yaml - subPath: default.yaml - resources: - requests: - memory: 256Mi - cpu: 100m - ephemeral-storage: 256Mi - limits: - memory: 1Gi - cpu: 500m - ephemeral-storage: 1Gi - livenessProbe: - tcpSocket: - port: mcp - initialDelaySeconds: 15 - periodSeconds: 30 - readinessProbe: - tcpSocket: - port: mcp - initialDelaySeconds: 10 - periodSeconds: 10 - volumes: - - name: data - persistentVolumeClaim: - claimName: neuron-alpha-data - - name: app-config - configMap: - name: neuron-config - items: - - key: default.yaml - path: default.yaml ---- -apiVersion: v1 -kind: Service -metadata: - name: neuron-alpha - namespace: neuron -spec: - selector: - app: neuron-alpha - ports: - - name: mcp - port: 8001 - targetPort: 8001 - - name: webhook - port: 3847 - targetPort: 3847 - type: ClusterIP diff --git a/servers/legion/apps/neuron-beta.yaml b/servers/legion/apps/neuron-beta.yaml deleted file mode 100644 index e782bfd..0000000 --- a/servers/legion/apps/neuron-beta.yaml +++ /dev/null @@ -1,92 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: neuron-beta - namespace: neuron - labels: - app: neuron-beta -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: neuron-beta - template: - metadata: - labels: - app: neuron-beta - spec: - containers: - - name: neuron - image: registry.neuralplatform.ai/neural-platform/neuron:617dcd1d5c1d148838b8e73df1bba8296257c0b6 - imagePullPolicy: Always - command: - - bash - - -c - - mkdir -p /root/.neuron && ln -sf /data/neuron.db /root/.neuron/neuron.db && python -m synapse platform serve --mcp-host 0.0.0.0 --mcp-port 8001 --webhook-port 3847 - ports: - - name: mcp - containerPort: 8001 - - name: webhook - containerPort: 3847 - env: - - name: NEURON_SERVER_NAME - value: "neuron-beta" - envFrom: - - configMapRef: - name: neuron-config - - secretRef: - name: neuron-secrets - volumeMounts: - - name: data - mountPath: /data - - name: app-config - mountPath: /app/config/default.yaml - subPath: default.yaml - resources: - requests: - memory: 256Mi - cpu: 100m - ephemeral-storage: 256Mi - limits: - memory: 1Gi - cpu: 500m - ephemeral-storage: 1Gi - livenessProbe: - tcpSocket: - port: mcp - initialDelaySeconds: 15 - periodSeconds: 30 - readinessProbe: - tcpSocket: - port: mcp - initialDelaySeconds: 10 - periodSeconds: 10 - volumes: - - name: data - persistentVolumeClaim: - claimName: neuron-beta-data - - name: app-config - configMap: - name: neuron-config - items: - - key: default.yaml - path: default.yaml ---- -apiVersion: v1 -kind: Service -metadata: - name: neuron-beta - namespace: neuron -spec: - selector: - app: neuron-beta - ports: - - name: mcp - port: 8001 - targetPort: 8001 - - name: webhook - port: 3847 - targetPort: 3847 - type: ClusterIP diff --git a/servers/legion/apps/neuron-gamma.yaml b/servers/legion/apps/neuron-gamma.yaml deleted file mode 100644 index b7dccd2..0000000 --- a/servers/legion/apps/neuron-gamma.yaml +++ /dev/null @@ -1,92 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: neuron-gamma - namespace: neuron - labels: - app: neuron-gamma -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: neuron-gamma - template: - metadata: - labels: - app: neuron-gamma - spec: - containers: - - name: neuron - image: registry.neuralplatform.ai/neural-platform/neuron:617dcd1d5c1d148838b8e73df1bba8296257c0b6 - imagePullPolicy: Always - command: - - bash - - -c - - mkdir -p /root/.neuron && ln -sf /data/neuron.db /root/.neuron/neuron.db && python -m synapse platform serve --mcp-host 0.0.0.0 --mcp-port 8001 --webhook-port 3847 - ports: - - name: mcp - containerPort: 8001 - - name: webhook - containerPort: 3847 - env: - - name: NEURON_SERVER_NAME - value: "neuron-gamma" - envFrom: - - configMapRef: - name: neuron-config - - secretRef: - name: neuron-secrets - volumeMounts: - - name: data - mountPath: /data - - name: app-config - mountPath: /app/config/default.yaml - subPath: default.yaml - resources: - requests: - memory: 256Mi - cpu: 100m - ephemeral-storage: 256Mi - limits: - memory: 1Gi - cpu: 500m - ephemeral-storage: 1Gi - livenessProbe: - tcpSocket: - port: mcp - initialDelaySeconds: 15 - periodSeconds: 30 - readinessProbe: - tcpSocket: - port: mcp - initialDelaySeconds: 10 - periodSeconds: 10 - volumes: - - name: data - persistentVolumeClaim: - claimName: neuron-gamma-data - - name: app-config - configMap: - name: neuron-config - items: - - key: default.yaml - path: default.yaml ---- -apiVersion: v1 -kind: Service -metadata: - name: neuron-gamma - namespace: neuron -spec: - selector: - app: neuron-gamma - ports: - - name: mcp - port: 8001 - targetPort: 8001 - - name: webhook - port: 3847 - targetPort: 3847 - type: ClusterIP diff --git a/servers/legion/apps/neuron.yaml b/servers/legion/apps/neuron.yaml index bf0de52..dd760c3 100644 --- a/servers/legion/apps/neuron.yaml +++ b/servers/legion/apps/neuron.yaml @@ -1,95 +1,5 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: neuron - namespace: neuron - labels: - app: neuron -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: neuron - template: - metadata: - labels: - app: neuron - spec: - containers: - - name: neuron - image: registry.neuralplatform.ai/neural-platform/neuron:617dcd1d5c1d148838b8e73df1bba8296257c0b6 - imagePullPolicy: Always - command: - - bash - - -c - - mkdir -p /root/.neuron && ln -sf /data/neuron.db /root/.neuron/neuron.db && python -m synapse platform serve --mcp-host 0.0.0.0 --mcp-port 8001 --webhook-port 3847 - ports: - - name: mcp - containerPort: 8001 - - name: webhook - containerPort: 3847 - envFrom: - - configMapRef: - name: neuron-config - - secretRef: - name: neuron-secrets - volumeMounts: - - name: data - mountPath: /data - - name: app-config - mountPath: /app/config/default.yaml - subPath: default.yaml - resources: - requests: - memory: 256Mi - cpu: 100m - ephemeral-storage: 256Mi - limits: - memory: 1Gi - cpu: 500m - ephemeral-storage: 1Gi - livenessProbe: - tcpSocket: - port: mcp - initialDelaySeconds: 15 - periodSeconds: 30 - readinessProbe: - tcpSocket: - port: mcp - initialDelaySeconds: 10 - periodSeconds: 10 - volumes: - - name: data - persistentVolumeClaim: - claimName: neuron-data - - name: app-config - configMap: - name: neuron-config - items: - - key: default.yaml - path: default.yaml ---- -apiVersion: v1 -kind: Service -metadata: - name: neuron - namespace: neuron -spec: - selector: - app: neuron - ports: - - name: mcp - port: 8001 - targetPort: 8001 - - name: webhook - port: 3847 - targetPort: 3847 - type: ClusterIP ---- # cloudflared — Cloudflare tunnel for external Axon webhook access -# Routes: axon.neuralplatform.ai → neuron:3847 +# Routes: axon.neuralplatform.ai → neuron-prod namespace via cloudflared tunnel apiVersion: apps/v1 kind: Deployment metadata: diff --git a/servers/legion/k8s/neuron/configmap.yaml b/servers/legion/k8s/neuron/configmap.yaml deleted file mode 100644 index a1f7cb0..0000000 --- a/servers/legion/k8s/neuron/configmap.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: neuron-config - namespace: neuron -data: - MCP_PORT: "8001" - MCP_HOST: "0.0.0.0" - WEBHOOK_PORT: "3847" - NEURON_DB_PATH: "/data/neuron.db" - AXON_DB_PATH: "/data/axon.db" - TUNNEL_NAME: "neural-platform" - default.yaml: | - runtime: - name: neuron - version: 0.1.0 - storage: - db_path: /data/neuron.db - cache: - max_l1_size: 1000 - gc: - gen0_threshold: 3 - gen1_threshold: 5 - knowledge: - base_path: /data/knowledge - synapse: - path: /data/synapse diff --git a/servers/legion/k8s/neuron/external-secrets.yaml b/servers/legion/k8s/neuron/external-secrets.yaml index c9a70e1..6b5e432 100644 --- a/servers/legion/k8s/neuron/external-secrets.yaml +++ b/servers/legion/k8s/neuron/external-secrets.yaml @@ -1,36 +1,3 @@ ---- -# neuron-secrets — GITHUB_WEBHOOK_SECRET, GITEA_WEBHOOK_SECRET, SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: neuron-secrets - namespace: neuron -spec: - refreshInterval: 1h - secretStoreRef: - name: vault - kind: ClusterSecretStore - target: - name: neuron-secrets - creationPolicy: Owner - data: - - secretKey: GITHUB_WEBHOOK_SECRET - remoteRef: - key: secret/data/github - property: webhook_secret - - secretKey: GITEA_WEBHOOK_SECRET - remoteRef: - key: secret/data/gitea - property: api_token - - secretKey: SLACK_BOT_TOKEN - remoteRef: - key: secret/data/slack - property: bot_token - - secretKey: SLACK_SIGNING_SECRET - remoteRef: - key: secret/data/slack - property: signing_secret ---- # cloudflared-secret — TUNNEL_TOKEN for the Cloudflare tunnel apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret diff --git a/servers/legion/k8s/neuron/ingress.yaml b/servers/legion/k8s/neuron/ingress.yaml deleted file mode 100644 index f499be5..0000000 --- a/servers/legion/k8s/neuron/ingress.yaml +++ /dev/null @@ -1,97 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: neuron - namespace: neuron - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: websecure - cert-manager.io/cluster-issuer: letsencrypt-prod -spec: - ingressClassName: traefik - tls: - - secretName: neuron-tls - hosts: - - neuron.neuralplatform.ai - - secretName: neuron-alpha-tls - hosts: - - neuron-alpha.neuralplatform.ai - - alpha.neurontechnologies.ai - - secretName: neuron-beta-tls - hosts: - - neuron-beta.neuralplatform.ai - - beta.neurontechnologies.ai - - secretName: neuron-gamma-tls - hosts: - - neuron-gamma.neuralplatform.ai - - gamma.neurontechnologies.ai - rules: - - host: neuron.neuralplatform.ai - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: neuron - port: - number: 8001 - - host: neuron-alpha.neuralplatform.ai - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: neuron-alpha - port: - number: 8001 - - host: alpha.neurontechnologies.ai - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: neuron-alpha - port: - number: 8001 - - host: neuron-beta.neuralplatform.ai - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: neuron-beta - port: - number: 8001 - - host: beta.neurontechnologies.ai - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: neuron-beta - port: - number: 8001 - - host: neuron-gamma.neuralplatform.ai - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: neuron-gamma - port: - number: 8001 - - host: gamma.neurontechnologies.ai - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: neuron-gamma - port: - number: 8001 diff --git a/servers/legion/k8s/neuron/lb.yaml b/servers/legion/k8s/neuron/lb.yaml deleted file mode 100644 index 263f4b0..0000000 --- a/servers/legion/k8s/neuron/lb.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: neuron-lb - namespace: neuron - annotations: - # Switch active slot by changing the selector value below, then git push. - # Argo CD syncs in ~30s, k8s updates endpoints instantly — zero downtime. - # Valid values: neuron | neuron-beta | neuron-alpha -spec: - selector: - app: neuron - ports: - - name: mcp - port: 8001 - targetPort: 8001 - - name: webhook - port: 3847 - targetPort: 3847 - type: ClusterIP diff --git a/servers/legion/k8s/neuron/pvc-alpha.yaml b/servers/legion/k8s/neuron/pvc-alpha.yaml deleted file mode 100644 index bea3d65..0000000 --- a/servers/legion/k8s/neuron/pvc-alpha.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: neuron-alpha-data - namespace: neuron -spec: - storageClassName: local-path - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5Gi diff --git a/servers/legion/k8s/neuron/pvc-beta.yaml b/servers/legion/k8s/neuron/pvc-beta.yaml deleted file mode 100644 index 82a6b2f..0000000 --- a/servers/legion/k8s/neuron/pvc-beta.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: neuron-beta-data - namespace: neuron -spec: - storageClassName: local-path - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5Gi diff --git a/servers/legion/k8s/neuron/pvc-gamma.yaml b/servers/legion/k8s/neuron/pvc-gamma.yaml deleted file mode 100644 index 1533c02..0000000 --- a/servers/legion/k8s/neuron/pvc-gamma.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: neuron-gamma-data - namespace: neuron -spec: - storageClassName: local-path - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5Gi diff --git a/servers/legion/k8s/neuron/snapshot-job.yaml b/servers/legion/k8s/neuron/snapshot-job.yaml deleted file mode 100644 index 3c400a6..0000000 --- a/servers/legion/k8s/neuron/snapshot-job.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# Snapshot Job — copies prod DB into an experiment slot via sqlite3 .backup -# Usage: set SLOT to alpha, beta, or gamma before applying -# -# SLOT=alpha && sed "s/SLOT/${SLOT}/g" snapshot-job.yaml | kubectl apply -f - -# -# The job completes and self-deletes after 5 minutes. -# Always snapshot before deploying a new experiment to a slot. -apiVersion: batch/v1 -kind: Job -metadata: - name: snapshot-prod-to-SLOT - namespace: neuron -spec: - ttlSecondsAfterFinished: 300 - template: - spec: - restartPolicy: Never - initContainers: - - name: stop-check - image: registry.neuralplatform.ai/neural-platform/neuron:latest - command: ["/bin/sh", "-c", "echo 'Snapshotting prod DB to SLOT — ensure neuron-SLOT pod is stopped first'"] - containers: - - name: snapshot - image: keinos/sqlite3:latest - command: ["/bin/sh", "-c"] - args: - - | - echo "Starting backup from prod to SLOT..." - sqlite3 /src/neuron.db ".backup /dst/neuron.db" - echo "Done. Prod DB snapshotted to SLOT." - ls -lh /dst/neuron.db - volumeMounts: - - name: src - mountPath: /src - readOnly: true - - name: dst - mountPath: /dst - volumes: - - name: src - persistentVolumeClaim: - claimName: neuron-data - - name: dst - persistentVolumeClaim: - claimName: neuron-SLOT-data