feat(neuron): gamma zone, all-slot ingress, snapshot job, self-improvement loop script
This commit is contained in:
@@ -12,6 +12,15 @@ spec:
|
||||
- secretName: neuron-tls
|
||||
hosts:
|
||||
- neuron.neuralplatform.ai
|
||||
- secretName: neuron-alpha-tls
|
||||
hosts:
|
||||
- neuron-alpha.neuralplatform.ai
|
||||
- secretName: neuron-beta-tls
|
||||
hosts:
|
||||
- neuron-beta.neuralplatform.ai
|
||||
- secretName: neuron-gamma-tls
|
||||
hosts:
|
||||
- neuron-gamma.neuralplatform.ai
|
||||
rules:
|
||||
- host: neuron.neuralplatform.ai
|
||||
http:
|
||||
@@ -23,3 +32,33 @@ spec:
|
||||
name: neuron
|
||||
port:
|
||||
number: 8001
|
||||
- host: neuron-alpha.neuralplatform.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: neuron-gamma.neuralplatform.ai
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: neuron-gamma
|
||||
port:
|
||||
number: 8001
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: neuron-gamma-data
|
||||
namespace: neuron
|
||||
spec:
|
||||
storageClassName: local-path
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
@@ -0,0 +1,44 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user