Files
artcraft/deployment_multi.yaml
T

359 lines
11 KiB
YAML

---
kind: Service
apiVersion: v1
metadata:
name: service-trump
namespace: vocodes
spec:
#type: LoadBalancer
#type: ClusterIP
selector:
#model: trump
app: tts-trump
ports:
- name: http
protocol: TCP
port: 12345
targetPort: 12345
---
kind: Service
apiVersion: v1
metadata:
name: service-other
namespace: vocodes
spec:
#type: LoadBalancer
selector:
model: other
ports:
- name: http
protocol: TCP
port: 80
targetPort: 12345
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tts-service-proxy
namespace: vocodes
labels:
app: tts-service-proxy
spec:
replicas: 1
selector:
matchLabels:
app: tts-service-proxy
template:
metadata:
labels:
app: tts-service-proxy
annotations:
bump: '2'
spec:
terminationGracePeriodSeconds: 60
imagePullSecrets:
- name: regcred
containers:
- name: tts-service-proxy
image: docker.pkg.github.com/ml-applications/voder-proxy/tts-service-proxy:67d094d38ef4
#command: ["./launch.sh"]
#args: [""]
#command: ["sleep"]
#args: ["300000"]
env:
- name: ROUTE_ONE
value: "http://10.245.22.66:80"
- name: ROUTE_TWO
value: "http://10.245.179.52:80"
- name: RUST_LOG
value: "info"
ports:
- containerPort: 13900
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tts-trump
namespace: vocodes
labels:
app: tts-trump
#model: trump
spec:
replicas: 1 # 4 would never launch with cluster configs as of 2020-06-20
selector:
matchLabels:
app: tts-trump
template:
metadata:
labels:
app: tts-trump
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:58ec25e3aa3c
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: "" # previously "models/"
- name: SLEEP_TIMEOUT
value: "300"
- name: RUST_LOG
value: "info,do_spaces_downloader=debug"
- 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:60211d6df69a
resources:
limits:
# 4 GiB (4096 MiB)
# 3 GiB (3072 MiB)
# 2 GiB (2048 MiB)
memory: "4Gi" # Just under 4 GB
cpu: "700m" # 700 milliCPU
requests:
#memory: "50Mi" - we're getting evicted!
# Warning FailedScheduling <unknown> default-scheduler 0/6 nodes are available: 6 Insufficient memory.
# Normal NotTriggerScaleUp 29s cluster-autoscaler pod didn't trigger scale-up (it wouldn't fit if
# a new node is added):
#
memory: "2Gi" # Just under 4 GB
cpu: "300m" # 700 milliCPU
volumeMounts:
- name: downloads
mountPath: /data/downloads
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: db-secrets
key: url
- name: BIND_ADDRESS
value: "0.0.0.0:12345"
- name: NUM_WORKERS
value: "5"
- name: ASSET_DIRECTORY
value: "/data/downloads/downloaded/frontend/build" # TODO
- name: MODEL_CONFIG_FILE
value: "/data/downloads/downloaded/models/deployed_models.toml"
- name: MAX_CHAR_LEN
value: "220"
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
#
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tts-other
namespace: vocodes
labels:
app: tts-other
model: other
spec:
replicas: 1 # 4 would never launch with cluster configs as of 2020-06-20
selector:
matchLabels:
app: tts-other
template:
metadata:
labels:
app: tts-other
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:58ec25e3aa3c
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: "" # previously "models/"
- name: SLEEP_TIMEOUT
value: "300"
- name: RUST_LOG
value: "info,do_spaces_downloader=debug"
- 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:60211d6df69a
resources:
limits:
# 4 GiB (4096 MiB)
# 3 GiB (3072 MiB)
# 2 GiB (2048 MiB)
memory: "4Gi" # Just under 4 GB
cpu: "700m" # 700 milliCPU
requests:
#memory: "50Mi" - we're getting evicted!
# Warning FailedScheduling <unknown> default-scheduler 0/6 nodes are available: 6 Insufficient memory.
# Normal NotTriggerScaleUp 29s cluster-autoscaler pod didn't trigger scale-up (it wouldn't fit if
# a new node is added):
#
memory: "2Gi" # Just under 4 GB
cpu: "300m" # 700 milliCPU
volumeMounts:
- name: downloads
mountPath: /data/downloads
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: db-secrets
key: url
- name: BIND_ADDRESS
value: "0.0.0.0:12345"
- name: NUM_WORKERS
value: "5"
- name: ASSET_DIRECTORY
value: "/data/downloads/downloaded/frontend/build" # TODO
- name: MODEL_CONFIG_FILE
value: "/data/downloads/downloaded/models/deployed_models.toml"
- name: MAX_CHAR_LEN
value: "220"
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