From 710f3be4272ba5653ce10f6eb957f90a0712a80c Mon Sep 17 00:00:00 2001 From: Nik Afiq Date: Sat, 25 Jul 2026 02:33:18 +0900 Subject: [PATCH] feat: add init container for model initialization and change models volume to emptyDir --- manifests/home-services/tts-gateway.yaml | 32 ++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/manifests/home-services/tts-gateway.yaml b/manifests/home-services/tts-gateway.yaml index 8d013e6..fe0754e 100644 --- a/manifests/home-services/tts-gateway.yaml +++ b/manifests/home-services/tts-gateway.yaml @@ -31,6 +31,26 @@ spec: effect: NoSchedule imagePullSecrets: - name: gitea-registry-secret + # Populates the shared `models` emptyDir from the tts-model image before tts-sidecar + # starts - see tts-gateway/model/Dockerfile in the home-service repo (the checkpoint/ + # hparams are committed there directly and CI builds+pushes this image like the other + # four). Mounted at /dest, not /models: the model image already has the files baked in + # at /models in its own layer, so mounting the shared volume there would shadow the + # very files this container needs to copy from. + initContainers: + - name: model-init + image: gitea.nik4nao.com/nik/tts-model:latest + command: ["cp", "-a", "/models/.", "/dest/"] + volumeMounts: + - name: models + mountPath: /dest + resources: + requests: + cpu: 10m + memory: 16Mi + limits: + cpu: 100m + memory: 64Mi containers: - name: tts-gateway image: gitea.nik4nao.com/nik/tts-gateway:latest @@ -118,14 +138,12 @@ spec: - name: tls secret: secretName: tts-gateway-tls - # Checkpoint/config aren't baked into the sidecar image (still an - # open decision per tts-gateway/README.md) - bind-mounted from - # /data/tts-gateway on nik-gpu instead. Populate with G_790000.pth - # and uma.json before this Deployment will go Ready. + # Populated at pod start by the model-init init container above, copying from the + # versioned gitea.nik4nao.com/nik/tts-model image - not a hostPath into nik-gpu's raw + # disk, so this survives node reprovisioning and isn't tied to manual file placement. - name: models - hostPath: - path: /data/tts-gateway - type: Directory + emptyDir: + sizeLimit: 1Gi --- apiVersion: v1 kind: Service