mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 17:08:13 +00:00
133 lines
3.8 KiB
YAML
133 lines
3.8 KiB
YAML
---
|
|
kind: Service
|
|
apiVersion: v1
|
|
metadata:
|
|
name: tts
|
|
namespace: mumble
|
|
spec:
|
|
type: LoadBalancer
|
|
selector:
|
|
app: tts
|
|
ports:
|
|
- name: http
|
|
protocol: TCP
|
|
port: 80
|
|
targetPort: 12345
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: tts
|
|
namespace: mumble
|
|
labels:
|
|
app: tts
|
|
spec:
|
|
replicas: 6
|
|
selector:
|
|
matchLabels:
|
|
app: tts
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: tts
|
|
annotations:
|
|
bump: '1'
|
|
spec:
|
|
terminationGracePeriodSeconds: 60
|
|
imagePullSecrets:
|
|
- name: regcred
|
|
volumes:
|
|
- name: downloads
|
|
hostPath:
|
|
path: /downloads
|
|
type: DirectoryOrCreate
|
|
containers:
|
|
- name: downloader
|
|
image: docker.pkg.github.com/ml-applications/do-spaces-downloader/do-spaces-downloader:565519867d72
|
|
command: ["./launch.sh"]
|
|
args: [""]
|
|
#command: ["sleep"]
|
|
#args: ["300000"]
|
|
volumeMounts:
|
|
- name: downloads
|
|
mountPath: /data/downloads
|
|
env:
|
|
- name: ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: spaces-secrets
|
|
key: aws_access_key_id
|
|
- name: SECRET_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: spaces-secrets
|
|
key: aws_secret_access_key
|
|
- name: BUCKET_NAME
|
|
value: "upload-models"
|
|
- name: REGION
|
|
value: "nyc3"
|
|
# NB: These filesystem paths are strage because they need to be on the
|
|
# same filesystem. Rust can't handle moving files between filesystems yet:
|
|
# "Error: Invalid cross-device link (os error 18)"
|
|
- name: DOWNLOAD_DIR
|
|
value: "/data/downloads/downloaded"
|
|
- name: TEMP_DIR
|
|
value: "/data/downloads/tmp"
|
|
- name: MATCH_PATH
|
|
value: "models/"
|
|
- name: tts
|
|
# NB: Container builds are triggered by Github Actions
|
|
|
|
# The following image runs a non-Arpabet engine that can run an
|
|
# LSpeech model that sounds 100% amazing
|
|
# image: docker.pkg.github.com/echelon/voder/tts-service:6b5c22567614
|
|
|
|
image: docker.pkg.github.com/ml-applications/voder/tts-service:bf957be07bb1
|
|
resources:
|
|
limits:
|
|
memory: "2048Mi" # 2048 MiB = 2 GiB
|
|
cpu: "700m" # 700 milliCPU
|
|
requests:
|
|
memory: "2048Mi" # 2048 MiB = 2 GiB
|
|
cpu: "700m" # 700 milliCPU
|
|
volumeMounts:
|
|
- name: downloads
|
|
mountPath: /data/downloads
|
|
env:
|
|
- name: BIND_ADDRESS
|
|
value: "0.0.0.0:12345"
|
|
- name: ASSET_DIRECTORY
|
|
value: "/data/downloads/downloaded/frontend/build" # TODO
|
|
- name: MODEL_CONFIG_FILE
|
|
value: "/data/downloads/downloaded/models/deployed_models.toml"
|
|
command: ["./launch.sh"]
|
|
args: [""]
|
|
#command: ["sleep"]
|
|
#args: ["300000"]
|
|
ports:
|
|
- containerPort: 12345
|
|
protocol: TCP
|
|
# If the readiness probe fails, the container is removed from the service.
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /readiness
|
|
port: 12345
|
|
# Check every two seconds.
|
|
periodSeconds: 2
|
|
# Warmup period before first check.
|
|
initialDelaySeconds: 5
|
|
# How long it takes for the probe to time out.
|
|
timeoutSeconds: 1
|
|
# Number of attempts before the pod is marked unready
|
|
failureThreshold: 1
|
|
# If the liveness probe fails, the container is subject to its restart policy
|
|
# Since the container can crash on its own, we'll omit this.
|
|
# livenessProbe:
|
|
# httpGet:
|
|
# path: /liveness
|
|
# port: 12345
|
|
# initialDelaySeconds: 20
|
|
# periodSeconds: 10
|
|
# timeoutSeconds: 3
|
|
# failureThreshold: 3
|