Skip to content

feat(deploy): first-class support for arbitrary environments#112

Merged
yourbuddyconner merged 6 commits into
mainfrom
feat/deploy-accept-any-env
Jul 16, 2026
Merged

feat(deploy): first-class support for arbitrary environments#112
yourbuddyconner merged 6 commits into
mainfrom
feat/deploy-accept-any-env

Conversation

@xBalbinus

@xBalbinus xBalbinus commented Jul 13, 2026

Copy link
Copy Markdown

Summary

Two changes that make deploying a fresh Valet environment work end-to-end (surfaced standing up a new test env).

Deploy script — arbitrary environments + team Modal workspace

  • MODAL_WORKSPACE + MODAL_PROFILE config keys so an environment can deploy to a team Modal workspace: modal profile current returns the profile name, not necessarily the workspace slug, so URL auto-discovery built wrong endpoint URLs for non-personal workspaces.
  • CLIENT_BUILD_MODE override (production | development). Default unchanged: production build only when ENVIRONMENT=prod.
  • Env-agnostic usage/error text — any ENVIRONMENT=<name> with a matching .env.deploy.<name> works.
  • .env.deploy.example: documents new keys, moves API_PUBLIC_URL to the required section.

Sandbox image build — whisper.cpp fix

  • Pin whisper.cpp to v1.9.1; the 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 aborted the whole image build → create-session returned 500 on every spawn. Cached dev/prod images mask this until their next IMAGE_BUILD_VERSION bump.
  • Bump IMAGE_BUILD_VERSION.

Validation

  • Deployed a full test env on the Turnkey Valet CF account + turnkey-valet Modal workspace; worker /health OK, client serving, email/password auth + admin promotion verified via UI, session detail view + client↔DO WebSocket confirmed.
  • Whisper fix verified by rebuilding the image against the fix and spawning a sandbox to running.

- 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
@xBalbinus xBalbinus requested a review from a team July 13, 2026 18:02
@github-actions

Copy link
Copy Markdown

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 yourbuddyconner merged commit 827eff3 into main Jul 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants