Spaces:
Sleeping
Download docs/deployment.md from GarchenArchive/ArchiveAI-TTS: direct link, hf CLI and curl.
- Browser
- Download file 3.64 kB
-
https://huggingface.co/spaces/GarchenArchive/ArchiveAI-TTS/resolve/main/docs/deployment.md
- Command line
-
hf download hf://spaces/GarchenArchive/ArchiveAI-TTS/docs/deployment.md
-
curl -L -o deployment.md https://huggingface.co/spaces/GarchenArchive/ArchiveAI-TTS/resolve/main/docs/deployment.md
Deployment
Two independent targets, both built from main. Same pattern as TranslationUI: separate GitHub Actions workflows, neither edits the other.
| HF Space | DO droplet | |
|---|---|---|
| Workflow | .github/workflows/deploy.yml |
.github/workflows/deploy-do.yml |
| Triggers | workflow_dispatch + nightly (00:00 UTC, skipped if unchanged) |
Same |
| Target | huggingface.co/spaces/GarchenArchive/ArchiveAI-TTS |
The droplet shared with TranslationUI, via SSH |
| Image registry | N/A | DO Container Registry, repo garchen-archive/archiveai-tts |
| Public URL | The Space's own URL | https://archiveai-tts.64-225-26-230.nip.io |
| Access control | HF's private-Space account whitelist | Google OAuth via oauth2-proxy, shared with TranslationUI |
Sharing a droplet with TranslationUI
Both apps are CPU-only and lightweight enough to coexist on one droplet:
- Same droplet, separate containers:
translationui-piloton internal port7860,archiveai-tts-piloton7861, both bound to127.0.0.1only. - Same Caddy instance, routing by hostname. A second site block was added to the existing
/etc/caddy/Caddyfileforarchiveai-tts.64-225-26-230.nip.io, reverse-proxying to127.0.0.1:7861. - Same oauth2-proxy, same Google OAuth app, same allowlist: one login covers both apps. This required widening oauth2-proxy's cookie scope β
OAUTH2_PROXY_COOKIE_DOMAINSandOAUTH2_PROXY_WHITELIST_DOMAINSwere both set to.64-225-26-230.nip.ioso the session cookie set on one subdomain is valid on the other.nip.iois on the Public Suffix List at thenip.iolevel, not per-IP, so.64-225-26-230.nip.iois a valid single-site cookie scope; it does not leak across other unrelated nip.io users. - Same Volume, separate subdirectory: TranslationUI's SQLite file lives at the volume root; TTS's project files live under
tts/on the same volume, mounted into its container at/data(a different container path than TranslationUI's, same physical disk). - Same DO Project ("HF Migration"), same isolation-token approach as the rest of this migration.
CI/CD (deploy-do.yml)
Same shape as TranslationUI's: build β push to registry.digitalocean.com/garchen-archive/archiveai-tts β SSH in β pull, stop/remove the old container, start the new one with:
-p 127.0.0.1:7861:7860-v /mnt/hfmigration_translationui_data/tts:/data-e TTS_DATA_DIR=/data--env-file /root/archiveai-tts.env(holdsELEVENLABS_API_KEY,GEMINI_API_KEY,HF_TOKEN,API_TOKEN, andBACKBLAZE_KEY_ID/BACKBLAZE_APPLICATION_KEY; never passed through CI logs or command args)
Adding a variable to
/root/archiveai-tts.envis not enough on its own. Docker reads--env-fileonly when the container is created, so an edited env file reaches the app only on the next deploy that runsdocker runβdocker restartwill not do it. The nightly schedule will not do it either unlessmainmoved:check-for-changesskips the run when the current commit's image tag already exists in the registry. After editing the env file, either dispatchdeploy-do.ymlmanually or recreate the container by hand with the flags above.
Reuses the same DO_CI_TOKEN/DO_SSH_PRIVATE_KEY credential values as TranslationUI, added as this repo's own GitHub Actions secrets. A registry-scoped token isn't tied to a specific app, but GitHub secrets are per-repo, so it is added twice.
Manual deploy / debugging
ssh -i <hf-migration-do private key> root@<droplet-ip>
docker ps --filter name=archiveai-tts-pilot
docker logs archiveai-tts-pilot --tail 50