Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4e154fc
perf(stack): replace snapshot archives with managed directory snapshots
jgoux Sep 22, 2026
fd9b2f4
fix(stack): tighten snapshot ownership and cleanup
jgoux Sep 22, 2026
31820ab
perf(cli): compile the CLI with bytecode (#6708)
avallete Sep 23, 2026
3be8efc
perf(stack): clone snapshot directories with one cp on macOS
avallete Sep 22, 2026
5d46e26
perf(stack): copy snapshot directories with one host command
avallete Sep 22, 2026
b4c9db8
perf(stack): stop shadow databases without waiting
avallete Sep 22, 2026
e236349
perf(stack): shorten warm shadow database diffs
avallete Sep 22, 2026
db440ea
perf(stack): drop shadow timing probes
avallete Sep 22, 2026
dc135b1
fix(stack): recreate a helper that never started
avallete Sep 23, 2026
9aab6a4
fix(stack): finish partial snapshot copy cleanup after cancel
avallete Sep 23, 2026
ec146da
test(stack): keep the interrupted copy fixture on Effect file APIs
avallete Sep 23, 2026
7376fef
Merge branch 'perf/stack-clone-copy' into perf/stack-shadow-diff
avallete Sep 23, 2026
b90d524
chore: merge develop into the snapshot directory copy
avallete Sep 23, 2026
519f8f5
test(stack): give catalog services separate docker data
avallete Sep 23, 2026
39c15d6
perf(stack): reuse postgres image for storage helper
jgoux Sep 23, 2026
45c6f27
test(stack): cover postgres 15 storage snapshots
jgoux Sep 23, 2026
30a3019
Merge remote-tracking branch 'origin/develop' into avallete/pr-6709-r…
avallete Sep 23, 2026
e9b11ad
test(stack): satisfy Effect lint in the partial-copy fixture
avallete Sep 23, 2026
31ba99c
fix(stack): reject Windows junctions during snapshot copy
jgoux Sep 24, 2026
480990f
chore(stack): merge snapshot copy updates
jgoux Sep 24, 2026
5d5b57a
fix(stack): isolate helpers and await shadow teardown
jgoux Sep 24, 2026
429cc32
chore(stack): sync merged snapshot copy base
jgoux Sep 24, 2026
2f3d112
fix(stack): clean up interrupted helpers and finish destroy
jgoux Sep 24, 2026
fef2cb2
fix(stack): retire only interrupted active helpers
jgoux Sep 24, 2026
b634d44
chore(stack): sync latest develop changes
jgoux Sep 24, 2026
6512bc6
chore(stack): merge shadow diff fixes
jgoux Sep 24, 2026
aff1a8b
chore(stack): merge latest develop
jgoux Sep 24, 2026
0eaf428
fix(stack): launch storage helpers from prepared image
jgoux Sep 24, 2026
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
4 changes: 2 additions & 2 deletions packages/stack/src/Artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ const definitions: Readonly<Record<ServiceKind, ArtifactDefinition>> = {
database: definition(
"postgres",
"17.6.1.173",
"ghcr.io/supabase/cli/postgres:17.6.1.173@sha256:1581c433d71a48a81e356a3ed2d4aa5ecfc8fc0465ea98661da7a88023317dcf",
"ghcr.io/supabase/cli/postgres:17.6.1.173@sha256:9d6e542382946cad5eb1f11f1c8108a51297902ee42fe5098358816d3784ba5a",
"bin/supabase-postgres-start",
["bin/supabase-postgres-start", "bin/pg_dump", "bin/pg_dumpall", "bin/pg_prove", "bin/psql"],
{
"15.14.1.173":
"ghcr.io/supabase/cli/postgres:15.14.1.173@sha256:b7d210fa3bca26568fa20448e3bec092bd4f8da6a5af5029597639d38e7d896e",
"ghcr.io/supabase/cli/postgres:15.14.1.173@sha256:3abb20e89700d6211e741148b85c3a052bb290cae3b4f751311442f4a5fe2324",
},
),
rest: definition("postgrest", "v16.2", "ghcr.io/supabase/cli/postgrest:v16.2", "bin/postgrest"),
Expand Down
21 changes: 15 additions & 6 deletions packages/stack/src/runtime/Container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class ContainerLaunchError extends Data.TaggedError("ContainerLaunchError

export interface ContainerRuntime {
readonly prepare: (image: string) => Effect.Effect<void, ContainerError>;
readonly prepareImage: (image: string) => Effect.Effect<string, ContainerError>;
readonly launch: (
spec: ContainerSpec,
) => Effect.Effect<ContainerProcess, ContainerError | ContainerLaunchError, Scope.Scope>;
Expand Down Expand Up @@ -169,34 +170,42 @@ export const makeContainerRuntime = (options: {
image: string,
mirrors: ReadonlyArray<string>,
primaryError: ContainerError,
): Effect.Effect<void, ContainerError> => {
): Effect.Effect<string, ContainerError> => {
const [mirror, ...rest] = mirrors;
if (mirror === undefined) return Effect.fail(primaryError);
return Effect.gen(function* () {
if (!(yield* present(mirror))) yield* pull(mirror);
yield* Ref.update(mirrored, (map) => new Map(map).set(image, mirror));
return mirror;
}).pipe(
Effect.tap(() => Effect.logInfo(`Pulled image from mirror ${mirror}`)),
Effect.tapError((cause) => Effect.logWarning(`Image mirror ${mirror} failed`, cause)),
Effect.catch(() => fromMirror(image, rest, primaryError)),
);
};

const prepare = Effect.fn("Container.prepare")(function* (image: string) {
const prepareImage = Effect.fn("Container.prepareImage")(function* (image: string) {
// A mirror chosen earlier may have been pruned since; launches follow the primary again.
const usePrimary = Ref.update(mirrored, (map) => {
if (!map.has(image)) return map;
const next = new Map(map);
next.delete(image);
return next;
});
if (yield* present(image)) return yield* usePrimary;
if (yield* present(image)) {
yield* usePrimary;
return image;
}
const mirrors = options.imageMirrors?.(image) ?? [];
yield* pull(image).pipe(
Effect.andThen(usePrimary),
return yield* pull(image).pipe(
Effect.as(image),
Effect.tap(() => usePrimary),
Effect.catch((primaryError) => fromMirror(image, mirrors, primaryError)),
);
});
const prepare = Effect.fn("Container.prepare")((image: string) =>
prepareImage(image).pipe(Effect.asVoid),
);

const launch = Effect.fn("Container.launch")(function* (
spec: ContainerSpec,
Expand Down Expand Up @@ -422,5 +431,5 @@ export const makeContainerRuntime = (options: {
}),
);
});
return { prepare, launch, launchTool: (spec) => launch(spec, true) };
return { prepare, prepareImage, launch, launchTool: (spec) => launch(spec, true) };
});
Loading
Loading