build(tenant-image): remove memory-backfill binary from Dockerfile.tenant (post-A3) #1812

Closed
opened 2026-05-24 23:00:38 +00:00 by hongming · 0 comments
Owner

Summary

cmd/memory-backfill is still bundled into the tenant image via Dockerfile.tenant (added in #1796). After Phase A3 (#1809) dropped the agent_memories source table, the binary is permanently inert — running it now fails with pq: relation "agent_memories" does not exist. Bundling it wastes ~7MB per image and risks an operator running it expecting it to do something.

Reproduction

On any tenant on staging-4a610ca or later:

docker exec molecule-tenant /memory-backfill -apply
# → ERROR:  relation "agent_memories" does not exist

Fix

  1. Remove the memory-backfill build stage from Dockerfile.tenant (the RUN go build ... -o /memory-backfill ./cmd/memory-backfill block + the COPY --from=go-builder /memory-backfill /memory-backfill + reference in the chown line).
  2. Optionally remove cmd/memory-backfill/ and verify.go from the repo entirely. They're documented as one-shot migration tooling that has fulfilled its purpose. Keep for one release cycle if you want the history-via-git log, then remove.

Acceptance

  • Dockerfile.tenant no longer builds or includes /memory-backfill
  • After redeploy, docker exec molecule-tenant ls /memory-backfill returns "No such file"
  • Image size shrinks by ~7MB

Discovered during

2026-05-24 memory-system migration session, called out in #1809 PR body.

## Summary `cmd/memory-backfill` is still bundled into the tenant image via `Dockerfile.tenant` (added in #1796). After Phase A3 (#1809) dropped the `agent_memories` source table, the binary is permanently inert — running it now fails with `pq: relation "agent_memories" does not exist`. Bundling it wastes ~7MB per image and risks an operator running it expecting it to do something. ## Reproduction On any tenant on `staging-4a610ca` or later: ```bash docker exec molecule-tenant /memory-backfill -apply # → ERROR: relation "agent_memories" does not exist ``` ## Fix 1. Remove the memory-backfill build stage from `Dockerfile.tenant` (the `RUN go build ... -o /memory-backfill ./cmd/memory-backfill` block + the `COPY --from=go-builder /memory-backfill /memory-backfill` + reference in the chown line). 2. Optionally remove `cmd/memory-backfill/` and `verify.go` from the repo entirely. They're documented as one-shot migration tooling that has fulfilled its purpose. Keep for one release cycle if you want the history-via-`git log`, then remove. ## Acceptance - [ ] Dockerfile.tenant no longer builds or includes `/memory-backfill` - [ ] After redeploy, `docker exec molecule-tenant ls /memory-backfill` returns "No such file" - [ ] Image size shrinks by ~7MB ## Discovered during 2026-05-24 memory-system migration session, called out in #1809 PR body.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#1812