mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-09 11:31:27 +00:00
improved deployment w liveness + readiness probes
This commit is contained in:
1 parent
374e1a477d
commit
ea761a76b9
2 files changed
+29
-3
No files matched your search
+25
-3
@@ -22,7 +22,8 @@ metadata:
|
||||
labels:
|
||||
app: tts
|
||||
spec:
|
||||
replicas: 2
|
||||
# NB: DigitalOcean PersistentVolumes can only be attached to one droplet at a time!? WTF!
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tts
|
||||
@@ -39,12 +40,33 @@ spec:
|
||||
claimName: model-pvc
|
||||
containers:
|
||||
- name: tts
|
||||
image: docker.pkg.github.com/echelon/voder/tts-service:a8858f2375a4
|
||||
# NB: Container builds are triggered by Github Actions
|
||||
image: docker.pkg.github.com/echelon/voder/tts-service:374e1a477d90
|
||||
env:
|
||||
- name: BIND_ADDRESS
|
||||
value: "0.0.0.0:12345"
|
||||
- name: TACOTRON_MODEL
|
||||
value: "/store/models/tacotron2-nvidia/tacotron_container.pt"
|
||||
- name: MELGAN_MODEL
|
||||
value: "/store/models/melgan-swpark/shared_melgan_container.pt"
|
||||
command: ["/tts_service"]
|
||||
args: ["0.0.0.0:12345"]
|
||||
ports:
|
||||
- containerPort: 12345
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- mountPath: "/store"
|
||||
name: model-pv
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /readiness
|
||||
port: 12345
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /liveness
|
||||
port: 12345
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 3
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
@@ -76,6 +76,8 @@ const BIND_ADDRESS : &'static str = "BIND_ADDRESS";
|
||||
|
||||
#[actix_rt::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
println!("Starting service.");
|
||||
|
||||
let bind_address = env::var(BIND_ADDRESS)
|
||||
.expect(&format!("Must include {} env var, eg `0.0.0.0:8000`", BIND_ADDRESS));
|
||||
|
||||
@@ -85,6 +87,8 @@ async fn main() -> std::io::Result<()> {
|
||||
let melgan_filename = env::var(MELGAN_MODEL)
|
||||
.expect(&format!("Must include {} env var", MELGAN_MODEL));
|
||||
|
||||
println!("Loading models...");
|
||||
|
||||
let ttsEngine = TacoMelModel::create(&tacotron_filename, &melgan_filename);
|
||||
|
||||
let arc = web::Data::new(Arc::new(ttsEngine));
|
||||
|
||||
Reference in new issue
Block a user