Skip to content

Clojure->Python CUTOVER: Step 3 — decommission the Clojure math service everywhere - #2688

Draft
jucor wants to merge 1 commit into
spr/edge/ae5fdde0from
spr/edge/1f679952
Draft

Clojure->Python CUTOVER: Step 3 — decommission the Clojure math service everywhere#2688
jucor wants to merge 1 commit into
spr/edge/ae5fdde0from
spr/edge/1f679952

Conversation

@jucor

@jucor jucor commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

After the flip (Step 2) has run stable for the agreed period, this removes the Clojure math service from every place that could still start or build it. The Python engine becomes the one and only math service. The Clojure SOURCE CODE stays in the repo until Step 4.

What's in this PR

  • docker-compose.yml: the math (Clojure) service is deleted. math-python now starts by default with make start (no longer opt-in) and reads the SAME setting the server reads — MATH_ENV=${MATH_ENV:-prod}, exactly the line the Clojure service had. The transitional setting MATH_PYTHON_ENV (used for the flip) stops existing here.
  • docker-compose.dev.yml: the Clojure REPL developer override deleted.
  • docker-compose.test.yml (what CI runs): Clojure math replaced with a math-python service, built with USE_CPU_TORCH=true so CI reuses the already-built image layers instead of building a second multi-GB image with GPU libraries nothing uses.
  • .github/workflows/deploy-alpha-aws.yml: the lines that built and pushed the Clojure math image are deleted — with the service gone they would fail and block EVERY deploy. (That registry copy was never used by deploys anyway; instances build locally.)
  • Deploy scripts (US + the forgotten euro copy): the math host starts math-python; down --remove-orphans added so a leftover Clojure container cannot survive a deploy.
  • example.env / test.env: dead Clojure-only settings removed; the poller section rewritten.
  • math/README.md: banner saying the service is retired and the source tree goes away at Step 4.

The settings handover

At the moment this deploys, the instance .env still contains MATH_PYTHON_ENV=prod (from Step 2) and MATH_ENV=prod (the server's) — after this PR the poller simply reads MATH_ENV=prod. Same value, no behavior change. Optional cleanup afterwards (Julien): delete MATH_PYTHON_ENV from the secret.

Merge gate

Only after the Step 2 soak. Note the rollback cost changes here: bringing Clojure math back stops being a single compose command.

Rollback

  1. First point the Python engine at a different math_env than the server's (secret MATH_PYTHON_ENV='python', propagated via a deploy or the manual .env route — see Step 2's note that restarts do not pick up new settings), so the returning Clojure engine is the only writer of the server's rows.
  2. Revert this PR and redeploy.
  3. Run docker compose up -d math yourself — the revert+redeploy alone still starts only math-python.

The old Clojure rows were never deleted; the engine resumes from the rows as they are.

Series: Step 0 = #2685. Nothing merges without Julien's explicit go.

commit-id:1f679952


Stack:


⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

This was referenced Jul 28, 2026
This was referenced Jul 28, 2026
@jucor
jucor force-pushed the spr/edge/1f679952 branch from d8b1542 to 7e2befc Compare July 28, 2026 00:14
@jucor
jucor force-pushed the spr/edge/ae5fdde0 branch 2 times, most recently from a18b886 to c3d1fb8 Compare July 28, 2026 00:24
@jucor
jucor force-pushed the spr/edge/1f679952 branch from 7e2befc to 318c7f6 Compare July 28, 2026 00:24
@jucor jucor changed the title Clojure->Python CUTOVER: Step #3 — decommission the Clojure math service everywhere Clojure->Python CUTOVER: Step 3 — decommission the Clojure math service everywhere Jul 28, 2026
@jucor
jucor force-pushed the spr/edge/ae5fdde0 branch from c3d1fb8 to a6e0d73 Compare July 28, 2026 00:44
@jucor
jucor force-pushed the spr/edge/1f679952 branch from 318c7f6 to 8cea43e Compare July 28, 2026 00:44
@jucor
jucor force-pushed the spr/edge/ae5fdde0 branch from a6e0d73 to 8b921a3 Compare July 28, 2026 00:54
@jucor
jucor force-pushed the spr/edge/1f679952 branch from 8cea43e to 3584cd3 Compare July 28, 2026 00:54
…ce everywhere

After the flip (Step 2) has run stable for the agreed period, this removes the Clojure math service from every place that could still start or build it. The Python engine becomes the one and only math service. The Clojure SOURCE CODE stays in the repo until Step 4.

## What's in this PR

- `docker-compose.yml`: the `math` (Clojure) service is deleted. `math-python` now starts by default with `make start` (no longer opt-in) and reads the SAME setting the server reads — `MATH_ENV=${MATH_ENV:-prod}`, exactly the line the Clojure service had. The transitional setting `MATH_PYTHON_ENV` (used for the flip) stops existing here.
- `docker-compose.dev.yml`: the Clojure REPL developer override deleted.
- `docker-compose.test.yml` (what CI runs): Clojure math replaced with a `math-python` service, built with `USE_CPU_TORCH=true` so CI reuses the already-built image layers instead of building a second multi-GB image with GPU libraries nothing uses.
- `.github/workflows/deploy-alpha-aws.yml`: the lines that built and pushed the Clojure math image are deleted — with the service gone they would fail and block EVERY deploy. (That registry copy was never used by deploys anyway; instances build locally.)
- Deploy scripts (US + the forgotten euro copy): the math host starts `math-python`; `down --remove-orphans` added so a leftover Clojure container cannot survive a deploy.
- `example.env` / `test.env`: dead Clojure-only settings removed; the poller section rewritten.
- `math/README.md`: banner saying the service is retired and the source tree goes away at Step 4.

## The settings handover

At the moment this deploys, the instance `.env` still contains `MATH_PYTHON_ENV=prod` (from Step 2) and `MATH_ENV=prod` (the server's) — after this PR the poller simply reads `MATH_ENV=prod`. Same value, no behavior change. Optional cleanup afterwards (Julien): delete `MATH_PYTHON_ENV` from the secret.

## Merge gate

Only after the Step 2 soak. Note the rollback cost changes here: bringing Clojure math back stops being a single compose command.

## Rollback

1. First point the Python engine at a different `math_env` than the server's (secret `MATH_PYTHON_ENV='python'`, propagated via a deploy or the manual `.env` route — see Step 2's note that restarts do not pick up new settings), so the returning Clojure engine is the only writer of the server's rows.
2. Revert this PR and redeploy.
3. Run `docker compose up -d math` yourself — the revert+redeploy alone still starts only `math-python`.

The old Clojure rows were never deleted; the engine resumes from the rows as they are.

Series: Step 0 = #2685. Nothing merges without Julien's explicit go.

commit-id:1f679952
@jucor
jucor force-pushed the spr/edge/ae5fdde0 branch from 8b921a3 to fe320ea Compare July 28, 2026 01:10
@jucor
jucor force-pushed the spr/edge/1f679952 branch from 3584cd3 to cf7ab34 Compare July 28, 2026 01:10
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.

1 participant