Files
artcraft/deployment.yaml
T

128 lines
3.7 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: 5
selector:
matchLabels:
app: tts
template:
metadata:
labels:
app: tts
annotations:
bump: '1'
spec:
terminationGracePeriodSeconds: 60
imagePullSecrets:
- name: regcred
volumes:
- name: devfuse
hostPath:
path: /dev/fuse
- name: mntdatas3fs
# NB: Doesn't set an explicit hostpath because:
# error while creating mount source path '...': mkdir ...: file exists
emptyDir: {}
containers:
- name: s3fs
securityContext:
privileged: true
allowPrivilegeEscalation: true
# TODO: Find a pinned tag for this. `latest` is dangerous
image: panubo/s3fs:latest
# NB: This container spews logs, making Graphana hard to read. I can't figure
# out how to filter out by sidecar, label, app, whatever, so I'm disabling these
# logs outright. I do not anticipate a problem with s3fs that I'll need logs for.
# If I change my mind, I can remove the override setting in the future, because
# Docker has the correct entrypoint.
command: ["/bin/sh"]
args: ["-c", "echo 'Disabled s3fs logging in k8s deployment for Graphana' && ./entry.sh 2> /dev/null"]
volumeMounts:
- name: devfuse
mountPath: /dev/fuse
- name: mntdatas3fs
mountPath: /data:shared
env:
- name: AWS_S3_URL
value: "https://nyc3.digitaloceanspaces.com"
- name: AWS_STORAGE_BUCKET_NAME
value: "upload-models"
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: spaces-secrets
key: aws_access_key_id
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: spaces-secrets
key: aws_secret_access_key
- name: AWS_S3_MOUNTPOINT
value: "/data"
- name: DEBUG
value: "true"
- name: tts
# NB: Container builds are triggered by Github Actions
#image: docker.pkg.github.com/echelon/voder/tts-service:374e1a477d90
# 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
# The following image runs a rudimentary Arbapet engine, but doesn't
# handle puncutation and tokenization
#image: docker.pkg.github.com/ml-applications/voder/tts-service:6e766720ca7d
image: docker.pkg.github.com/ml-applications/voder/tts-service:7e4d663f73bf
volumeMounts:
- name: mntdatas3fs
mountPath: /data:shared
env:
- name: BIND_ADDRESS
value: "0.0.0.0:12345"
- name: ASSET_DIRECTORY
value: "/data/frontend/build"
- name: MODEL_CONFIG_FILE
value: "/data/models/deployed_models.toml"
command: ["./launch.sh"]
args: [""]
#command: ["sleep"]
#args: ["300000"]
ports:
- containerPort: 12345
protocol: TCP
readinessProbe:
httpGet:
path: /readiness
port: 12345
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe:
httpGet:
path: /liveness
port: 12345
initialDelaySeconds: 20
periodSeconds: 3
timeoutSeconds: 3
failureThreshold: 3