Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/publish-electric-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Electric image

# Upstream's `electricsql/electric` Docker Hub repo was deleted (electric-sql/electric#4822),
# which broke every PRD deploy at the Electric image build. This builds the same release
# from upstream source, once, into our own registry; `apps/electric/Dockerfile` pins the
# from upstream source, once, into our own registry; `ELECTRIC_IMAGE` in `apps/electric/alchemy.run.ts` pins the
# resulting digest. Run it again only to adopt a new Electric version.

on:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
{
echo "Pushed \`${NAME}:${VERSION}@${DIGEST}\`"
echo
echo "Built from electric-sql/electric@${UPSTREAM_SHA}. Pin it in apps/electric/Dockerfile:"
echo "Built from electric-sql/electric@${UPSTREAM_SHA}. Pin it as ELECTRIC_IMAGE in apps/electric/alchemy.run.ts:"
echo
echo " FROM ${NAME}:${VERSION}@${DIGEST}"
echo " ${NAME}:${VERSION}@${DIGEST}"
} >> "$GITHUB_STEP_SUMMARY"
15 changes: 0 additions & 15 deletions apps/electric/Dockerfile

This file was deleted.

15 changes: 10 additions & 5 deletions apps/electric/alchemy.run.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { resolve } from "node:path"
import * as AWS from "alchemy/AWS"
import type * as Output from "alchemy/Output"
import * as Effect from "effect/Effect"
Expand All @@ -10,8 +9,15 @@ import { requiredPlain } from "@maple/infra/env"
/** Port Electric's HTTP API binds (`ELECTRIC_PORT`, whose own default is 3000). */
const ELECTRIC_PORT = 3000

/** Absolute: alchemy has changed how a relative `dockerfile` resolves between releases. */
const DOCKERFILE = resolve("apps/electric/Dockerfile")
/**
* Upstream Electric, built into our registry by publish-electric-image.yml (upstream's Docker
* Hub repo was deleted, electric-sql/electric#4822). PINNED by digest: the shape cache format
* changes across minors, so an upgrade is a deliberate read of the release notes. Mirrored as an
* image ref, never built from a context: alchemy hashes a context together with `bun.lock`, so
* any unrelated dependency change would retag the image and restart this singleton.
*/
const ELECTRIC_IMAGE =
"ghcr.io/mapletechlabs/maple/electric:1.7.12@sha256:d8a377eee0edeac0d4dbbd77c22b92c1ef601184722ea2b7da5b3381e3bb8e2c"

export interface CreateMapleElectricOptions extends Pick<
MapleStackContext,
Expand Down Expand Up @@ -114,8 +120,7 @@ export const createMapleElectric = ({
cluster,
serviceName: name("electric"),

context: "apps/electric",
dockerfile: DOCKERFILE,
image: ELECTRIC_IMAGE,
// Must match the image arch: a mismatch dies at start with `exec format error`.
runtimePlatform: { cpuArchitecture: "ARM64", operatingSystemFamily: "LINUX" },
cpu: taskSize.cpu,
Expand Down
7 changes: 5 additions & 2 deletions docs/electric-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,11 @@ service runs `desiredCount: 1` with `minimumHealthyPercent: 0`: stop the old
task, then start the new one. Every deploy therefore has a ~60s window with no
sync. `/dashboards` degrades to its HTTP snapshot (`SyncDegradedBanner`), while
the alerts lists have no fallback and sit in their retry state. This is why the
image tag is pinned in `apps/electric/Dockerfile` rather than tracking `:latest`
as local docker does.
image is pinned by digest (`ELECTRIC_IMAGE` in `apps/electric/alchemy.run.ts`)
rather than tracking `:latest` as local docker does, and why it is mirrored as an
image ref instead of built from a Dockerfile: alchemy hashes a build context
together with `bun.lock`, so any dependency bump retagged the image and restarted
Electric (two ~2 min gaps on 2026-10-14).

### Standing it up

Expand Down
Loading