feat(deploy): first-class support for arbitrary environments#112
Merged
Conversation
- MODAL_WORKSPACE + MODAL_PROFILE config for team-workspace Modal deploys (profile name != workspace slug, so auto-discovery built wrong URLs) - CLIENT_BUILD_MODE override; default unchanged (production only for prod) - env-agnostic usage/error text; document required API_PUBLIC_URL in example
|
Preview deployment: https://pr-112.dev-valet-turnkey-client.pages.dev |
- pin whisper.cpp to v1.9.1 (unpinned --depth 1 clone tracked HEAD and drifted) - force -DBUILD_SHARED_LIBS=ON: default is OFF on Linux, so libwhisper.so*/ libggml*.so* were never produced and the cp steps failed the whole build - bump IMAGE_BUILD_VERSION Surfaced deploying a fresh env: create-session 500s because the image build aborts. Cached dev/prod images mask it until their next version bump.
v1.9.1 with BUILD_SHARED_LIBS=ON emits libwhisper.so under build/bin, not build/src, so the fixed cp path still missed. Use find -exec so the copy is robust to whisper.cpp output-layout changes.
- reject CLIENT_BUILD_MODE values other than production|development instead
of silently building development on a typo; attribute the dev-build log to
CLIENT_BUILD_MODE, not ENVIRONMENT
- warn when MODAL_WORKSPACE and MODAL_PROFILE are not set together (endpoint
URL can point at a workspace the backend was not deployed to)
- expand build_args as ${arr[@]+"${arr[@]}"} so an empty array is safe under
set -u on bash 3.2
- escape backslash/&/| in sed replacements when generating wrangler config
- comment out API_PUBLIC_URL in the example so the required-var guard fires
on a fresh copy; note MODAL_BACKEND_URL must keep the {label} placeholder
- drop the dead MODAL_PROFILE reassignment; note ENVIRONMENT must be DNS-safe
- guard the whisper shared-lib copy so a zero-match find fails the build
- update sandbox-images spec for the whisper v1.9.1 pin and shared libs
Move the CLIENT_BUILD_MODE resolve+reject to config resolution so an invalid value fails fast, instead of aborting build_client at cmd_all step 7 — after remote D1 migrations and the Worker/Modal deploy have already applied, leaving a half-applied deploy. Note that the both-unset Modal workspace/profile path is the intended auto-discovery default and is deliberately not warned.
Resolve deploy.sh conflict by keeping the sed_escape-hardened generate_wrangler_config; placeholder set is identical to main's.
yourbuddyconner
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two changes that make deploying a fresh Valet environment work end-to-end (surfaced standing up a new
testenv).Deploy script — arbitrary environments + team Modal workspace
MODAL_WORKSPACE+MODAL_PROFILEconfig keys so an environment can deploy to a team Modal workspace:modal profile currentreturns the profile name, not necessarily the workspace slug, so URL auto-discovery built wrong endpoint URLs for non-personal workspaces.CLIENT_BUILD_MODEoverride (production | development). Default unchanged: production build only whenENVIRONMENT=prod.ENVIRONMENT=<name>with a matching.env.deploy.<name>works..env.deploy.example: documents new keys, movesAPI_PUBLIC_URLto the required section.Sandbox image build — whisper.cpp fix
v1.9.1; the unpinned--depth 1clone tracked HEAD and drifted.-DBUILD_SHARED_LIBS=ON: default is OFF on Linux, solibwhisper.so*/libggml*.so*were never produced and thecpsteps aborted the whole image build → create-session returned 500 on every spawn. Cached dev/prod images mask this until their nextIMAGE_BUILD_VERSIONbump.IMAGE_BUILD_VERSION.Validation
testenv on the Turnkey Valet CF account +turnkey-valetModal workspace; worker /health OK, client serving, email/password auth + admin promotion verified via UI, session detail view + client↔DO WebSocket confirmed.running.