@cat-factory/worker 0.193.0 → 0.195.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/providerEndpoints.d.ts +18 -8
- package/dist/infrastructure/ai/providerEndpoints.d.ts.map +1 -1
- package/dist/infrastructure/ai/providerEndpoints.js +51 -19
- package/dist/infrastructure/ai/providerEndpoints.js.map +1 -1
- package/dist/infrastructure/container-assembly.d.ts.map +1 -1
- package/dist/infrastructure/container-assembly.js +3 -2
- package/dist/infrastructure/container-assembly.js.map +1 -1
- package/dist/infrastructure/container-dispatchers.d.ts.map +1 -1
- package/dist/infrastructure/container-dispatchers.js +5 -3
- package/dist/infrastructure/container-dispatchers.js.map +1 -1
- package/dist/infrastructure/container-executor-deps.d.ts.map +1 -1
- package/dist/infrastructure/container-executor-deps.js +13 -2
- package/dist/infrastructure/container-executor-deps.js.map +1 -1
- package/dist/infrastructure/container.d.ts +1 -24
- package/dist/infrastructure/container.d.ts.map +1 -1
- package/dist/infrastructure/container.js +1 -50
- package/dist/infrastructure/container.js.map +1 -1
- package/dist/infrastructure/containers/CloudflareContainerTransport.d.ts +22 -5
- package/dist/infrastructure/containers/CloudflareContainerTransport.d.ts.map +1 -1
- package/dist/infrastructure/containers/CloudflareContainerTransport.js +53 -25
- package/dist/infrastructure/containers/CloudflareContainerTransport.js.map +1 -1
- package/dist/infrastructure/containers/ContainerInstanceRegistry.d.ts +26 -9
- package/dist/infrastructure/containers/ContainerInstanceRegistry.d.ts.map +1 -1
- package/dist/infrastructure/containers/ContainerInstanceRegistry.js +37 -13
- package/dist/infrastructure/containers/ContainerInstanceRegistry.js.map +1 -1
- package/dist/infrastructure/containers/UiTesterContainer.d.ts +4 -0
- package/dist/infrastructure/containers/UiTesterContainer.d.ts.map +1 -0
- package/dist/infrastructure/containers/UiTesterContainer.js +18 -0
- package/dist/infrastructure/containers/UiTesterContainer.js.map +1 -0
- package/dist/infrastructure/containers/deployJobDeps.d.ts +20 -0
- package/dist/infrastructure/containers/deployJobDeps.d.ts.map +1 -0
- package/dist/infrastructure/containers/deployJobDeps.js +38 -0
- package/dist/infrastructure/containers/deployJobDeps.js.map +1 -0
- package/dist/infrastructure/containers/runContainerNamespace.d.ts +38 -0
- package/dist/infrastructure/containers/runContainerNamespace.d.ts.map +1 -0
- package/dist/infrastructure/containers/runContainerNamespace.js +37 -0
- package/dist/infrastructure/containers/runContainerNamespace.js.map +1 -0
- package/dist/infrastructure/dispatchTokenMint.d.ts +17 -0
- package/dist/infrastructure/dispatchTokenMint.d.ts.map +1 -0
- package/dist/infrastructure/dispatchTokenMint.js +23 -0
- package/dist/infrastructure/dispatchTokenMint.js.map +1 -0
- package/dist/infrastructure/env.d.ts +21 -0
- package/dist/infrastructure/env.d.ts.map +1 -1
- package/dist/infrastructure/env.js.map +1 -1
- package/dist/infrastructure/repositories/D1LiveContainerRepository.d.ts +3 -3
- package/dist/infrastructure/repositories/D1LiveContainerRepository.d.ts.map +1 -1
- package/dist/infrastructure/repositories/D1LiveContainerRepository.js +12 -7
- package/dist/infrastructure/repositories/D1LiveContainerRepository.js.map +1 -1
- package/migrations/0094_live_container_image.sql +11 -0
- package/package.json +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerInstanceRegistry.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/containers/ContainerInstanceRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ContainerInstanceRegistry.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/containers/ContainerInstanceRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MA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eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CA4CvF;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getErrorMessage } from '@cat-factory/kernel';
|
|
1
|
+
import { getErrorMessage, getErrorReason, RUNNER_IMAGE_UNWIRED_REASON } from '@cat-factory/kernel';
|
|
2
2
|
import { logger } from '../observability/logger';
|
|
3
3
|
/**
|
|
4
4
|
* Owns the per-run container namespace + the live-container inventory. It is the
|
|
@@ -8,11 +8,13 @@ import { logger } from '../observability/logger';
|
|
|
8
8
|
* reaper alike, so the two can never diverge.
|
|
9
9
|
*/
|
|
10
10
|
export class ContainerInstanceRegistry {
|
|
11
|
-
|
|
11
|
+
resolveNamespace;
|
|
12
12
|
store;
|
|
13
13
|
clock;
|
|
14
|
-
constructor(
|
|
15
|
-
|
|
14
|
+
constructor(
|
|
15
|
+
/** Resolves the container class an image variant lives in, shared with the transport. */
|
|
16
|
+
resolveNamespace, store, clock) {
|
|
17
|
+
this.resolveNamespace = resolveNamespace;
|
|
16
18
|
this.store = store;
|
|
17
19
|
this.clock = clock;
|
|
18
20
|
}
|
|
@@ -21,14 +23,15 @@ export class ContainerInstanceRegistry {
|
|
|
21
23
|
* failure must never break the dispatch it is bookkeeping for, and the earliest
|
|
22
24
|
* `startedAt` is preserved across replayed dispatches (so age stays truthful).
|
|
23
25
|
*/
|
|
24
|
-
async register(
|
|
26
|
+
async register(record) {
|
|
25
27
|
try {
|
|
26
|
-
await this.store.add({
|
|
28
|
+
await this.store.add({ ...record, startedAt: this.clock.now() });
|
|
27
29
|
}
|
|
28
30
|
catch (error) {
|
|
29
31
|
logger.warn('container-registry: failed to record live container (continuing)', {
|
|
30
|
-
containerKey,
|
|
31
|
-
kind,
|
|
32
|
+
containerKey: record.containerKey,
|
|
33
|
+
kind: record.kind,
|
|
34
|
+
image: record.image,
|
|
32
35
|
err: getErrorMessage(error),
|
|
33
36
|
});
|
|
34
37
|
}
|
|
@@ -40,8 +43,9 @@ export class ContainerInstanceRegistry {
|
|
|
40
43
|
* SIGKILL resolves, so a (rare) transport-level failure leaves the row for the
|
|
41
44
|
* reaper to retry rather than silently dropping a still-live container.
|
|
42
45
|
*/
|
|
43
|
-
async release(containerKey) {
|
|
44
|
-
|
|
46
|
+
async release(containerKey, image) {
|
|
47
|
+
const namespace = this.resolveNamespace(image ?? 'default');
|
|
48
|
+
await namespace.get(namespace.idFromName(containerKey)).shutdown();
|
|
45
49
|
await this.store.remove(containerKey);
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
@@ -49,23 +53,43 @@ export class ContainerInstanceRegistry {
|
|
|
49
53
|
* than `epochMs` (its legitimate maximum lifetime has elapsed). With normal runs
|
|
50
54
|
* self-reclaiming on their terminal path, a reaped container is a genuine LEAK, so
|
|
51
55
|
* each kill is logged loudly. One wedged container never aborts the sweep — each
|
|
52
|
-
* release is isolated. Returns how many were actually reaped
|
|
56
|
+
* release is isolated. Returns how many were actually reaped, and how many the sweep
|
|
57
|
+
* could not even address (see below).
|
|
53
58
|
*/
|
|
54
59
|
async reapStaleBefore(epochMs) {
|
|
55
60
|
const stale = await this.store.listStartedBefore(epochMs);
|
|
56
61
|
let reaped = 0;
|
|
62
|
+
let unreachable = 0;
|
|
57
63
|
for (const record of stale) {
|
|
58
64
|
logger.warn('container-reaper: killing leaked container past its max lifetime', {
|
|
59
65
|
containerKey: record.containerKey,
|
|
60
66
|
kind: record.kind,
|
|
67
|
+
image: record.image,
|
|
61
68
|
workspaceId: record.workspaceId,
|
|
62
69
|
ageMs: this.clock.now() - record.startedAt,
|
|
63
70
|
});
|
|
64
71
|
try {
|
|
65
|
-
await this.release(record.containerKey);
|
|
72
|
+
await this.release(record.containerKey, record.image);
|
|
66
73
|
reaped++;
|
|
67
74
|
}
|
|
68
75
|
catch (error) {
|
|
76
|
+
if (getErrorReason(error) === RUNNER_IMAGE_UNWIRED_REASON) {
|
|
77
|
+
// The class this row's variant lives in is no longer BOUND (the binding was removed, or
|
|
78
|
+
// the Worker rolled back past it), so there is no namespace to get a stub from and no
|
|
79
|
+
// retry can produce one. Left in place the row re-throws on every pass for ever, which
|
|
80
|
+
// is a permanent error rate that names nothing new and still never kills the container.
|
|
81
|
+
// So it is dropped, and the fact the reaper cannot act on it is stated ONCE, loudly,
|
|
82
|
+
// with the binding to restore.
|
|
83
|
+
unreachable++;
|
|
84
|
+
logger.error('container-reaper: cannot address a leaked container, its class is not bound', {
|
|
85
|
+
containerKey: record.containerKey,
|
|
86
|
+
image: record.image,
|
|
87
|
+
workspaceId: record.workspaceId,
|
|
88
|
+
err: getErrorMessage(error),
|
|
89
|
+
});
|
|
90
|
+
await this.store.remove(record.containerKey);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
69
93
|
// Leave the row in place so the next pass retries this one.
|
|
70
94
|
logger.error('container-reaper: failed to kill leaked container (will retry next pass)', {
|
|
71
95
|
containerKey: record.containerKey,
|
|
@@ -73,7 +97,7 @@ export class ContainerInstanceRegistry {
|
|
|
73
97
|
});
|
|
74
98
|
}
|
|
75
99
|
}
|
|
76
|
-
return { reaped };
|
|
100
|
+
return { reaped, unreachable };
|
|
77
101
|
}
|
|
78
102
|
}
|
|
79
103
|
//# sourceMappingURL=ContainerInstanceRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerInstanceRegistry.js","sourceRoot":"","sources":["../../../src/infrastructure/containers/ContainerInstanceRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"ContainerInstanceRegistry.js","sourceRoot":"","sources":["../../../src/infrastructure/containers/ContainerInstanceRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AAGlG,OAAO,EA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AC;QACH,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAA;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiTesterContainer.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/containers/UiTesterContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAgB7C,qBAAa,iBAAkB,SAAQ,YAAY;CAAG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RunContainer } from './RunContainer';
|
|
2
|
+
// One UI-TESTER container per run, mirroring {@link ExecutionContainer} but pulling the heavier
|
|
3
|
+
// UI image (`Dockerfile.ui`: the executor harness plus Playwright + Chromium, pnpm/yarn, the
|
|
4
|
+
// `serve` static server and a headless JRE + WireMock) instead of the plain executor image. A
|
|
5
|
+
// Cloudflare Container's image is pinned per container CLASS, so the `image: 'ui'` dispatch
|
|
6
|
+
// variant needs its own class; this one is bound as `UI_CONTAINER`, so the browser and the JRE
|
|
7
|
+
// never bloat the cold start of every coder/merger/ci-fixer run.
|
|
8
|
+
//
|
|
9
|
+
// It is a SECOND container for the same run rather than a replacement: a run mixes ordinary
|
|
10
|
+
// agent steps with a `tester-ui` step, and a per-run container cannot change image mid-run. The
|
|
11
|
+
// two are addressed by `containerKeyForRef`, which qualifies the run id with the variant.
|
|
12
|
+
//
|
|
13
|
+
// The UI image serves the SAME `POST /jobs` + `GET /jobs/{id}` contract on 8080 (it layers onto
|
|
14
|
+
// the same harness), so the generic `CloudflareContainerTransport` drives it unchanged, and its
|
|
15
|
+
// lifecycle behaviour is {@link RunContainer}'s, shared byte-for-byte with the agent one.
|
|
16
|
+
export class UiTesterContainer extends RunContainer {
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=UiTesterContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiTesterContainer.js","sourceRoot":"","sources":["../../../src/infrastructure/containers/UiTesterContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,gGAAgG;AAChG,6FAA6F;AAC7F,8FAA8F;AAC9F,4FAA4F;AAC5F,+FAA+F;AAC/F,iEAAiE;AACjE,EAAE;AACF,4FAA4F;AAC5F,gGAAgG;AAChG,0FAA0F;AAC1F,EAAE;AACF,gGAAgG;AAChG,gGAAgG;AAChG,0FAA0F;AAC1F,MAAM,OAAO,iBAAkB,SAAQ,YAAY;CAAG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Clock } from '@cat-factory/kernel';
|
|
2
|
+
import type { CoreDependencies } from '@cat-factory/orchestration';
|
|
3
|
+
import type { D1Database } from '@cloudflare/workers-types';
|
|
4
|
+
import type { AppConfig } from '../config';
|
|
5
|
+
import type { Env } from '../env';
|
|
6
|
+
/**
|
|
7
|
+
* Wire the async, container-backed Kubernetes deploy lifecycle (slice 9's
|
|
8
|
+
* `EnvironmentProvisioningService` seams) onto the Worker facade: a `deployJobClient` that
|
|
9
|
+
* dispatches/polls/releases a `deploy`-kind job on the per-run `DeployContainer` (the separate
|
|
10
|
+
* deploy-harness image — real `kubectl`/`kustomize`/`helm`), plus `resolveDeployCloneTarget` to
|
|
11
|
+
* hand the container concrete manifests-repo clone coords + a short-lived install token.
|
|
12
|
+
*
|
|
13
|
+
* Gated on the environments module, the `DEPLOY_CONTAINER` binding AND the GitHub App
|
|
14
|
+
* (the clone-target seam needs to mint install tokens + resolve a block's repo). Absent any
|
|
15
|
+
* prerequisite ⇒ `{}` — a render-needing config then fails loudly (the synchronous raw-manifest
|
|
16
|
+
* REST path is unaffected), exactly the unwired behaviour slice 9 shipped. Mirrors Node's pool
|
|
17
|
+
* deploy wiring; the deploy container is the Worker's analogue of Node's self-hosted pool.
|
|
18
|
+
*/
|
|
19
|
+
export declare function selectDeployDeps(env: Env, config: AppConfig, db: D1Database, clock: Clock): Partial<CoreDependencies>;
|
|
20
|
+
//# sourceMappingURL=deployJobDeps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployJobDeps.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/containers/deployJobDeps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAQjC;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,gBAAgB,CAAC,CA4B3B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { makeResolveDeployCloneTarget, RunnerJobClient } from '@cat-factory/server';
|
|
2
|
+
import { buildAppRegistry, buildResolveRepoTarget } from '../container-vcs-identity';
|
|
3
|
+
import { workerDispatchTokenMint } from '../dispatchTokenMint';
|
|
4
|
+
import { CloudflareContainerTransport, fixedContainerNamespace, } from './CloudflareContainerTransport';
|
|
5
|
+
/**
|
|
6
|
+
* Wire the async, container-backed Kubernetes deploy lifecycle (slice 9's
|
|
7
|
+
* `EnvironmentProvisioningService` seams) onto the Worker facade: a `deployJobClient` that
|
|
8
|
+
* dispatches/polls/releases a `deploy`-kind job on the per-run `DeployContainer` (the separate
|
|
9
|
+
* deploy-harness image — real `kubectl`/`kustomize`/`helm`), plus `resolveDeployCloneTarget` to
|
|
10
|
+
* hand the container concrete manifests-repo clone coords + a short-lived install token.
|
|
11
|
+
*
|
|
12
|
+
* Gated on the environments module, the `DEPLOY_CONTAINER` binding AND the GitHub App
|
|
13
|
+
* (the clone-target seam needs to mint install tokens + resolve a block's repo). Absent any
|
|
14
|
+
* prerequisite ⇒ `{}` — a render-needing config then fails loudly (the synchronous raw-manifest
|
|
15
|
+
* REST path is unaffected), exactly the unwired behaviour slice 9 shipped. Mirrors Node's pool
|
|
16
|
+
* deploy wiring; the deploy container is the Worker's analogue of Node's self-hosted pool.
|
|
17
|
+
*/
|
|
18
|
+
export function selectDeployDeps(env, config, db, clock) {
|
|
19
|
+
if (!config.environments.encryptionKey ||
|
|
20
|
+
!env.DEPLOY_CONTAINER ||
|
|
21
|
+
!config.github.enabled ||
|
|
22
|
+
!env.GITHUB_APP_PRIVATE_KEY) {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
// A deploy-DEDICATED transport: the deploy job's `ref.runId` addresses a `DeployContainer`
|
|
26
|
+
// instance in its own DO namespace (no collision with the agent `EXEC_CONTAINER`), and the
|
|
27
|
+
// harness keys the job by `ref.jobId`. No instance registry is wired (the `sleepAfter` idle
|
|
28
|
+
// timer + explicit `release` reclaim it), so cross-namespace reaping stays the exec
|
|
29
|
+
// container's concern. The client is deploy-only, so `poll`/`release` need no per-ref routing.
|
|
30
|
+
const deployTransport = new CloudflareContainerTransport(fixedContainerNamespace(env.DEPLOY_CONTAINER), undefined, env.HARNESS_SHARED_SECRET?.trim() || undefined);
|
|
31
|
+
const registry = buildAppRegistry(env, config, db, clock);
|
|
32
|
+
return {
|
|
33
|
+
deployJobClient: new RunnerJobClient(async () => deployTransport),
|
|
34
|
+
// Narrowed to the repo being rendered, like every other container dispatch.
|
|
35
|
+
resolveDeployCloneTarget: makeResolveDeployCloneTarget(buildResolveRepoTarget(db), workerDispatchTokenMint(registry)),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=deployJobDeps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployJobDeps.js","sourceRoot":"","sources":["../../../src/infrast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
+
import type { DurableObjectNamespace } from '@cloudflare/workers-types';
|
|
3
|
+
import type { DeployContainer } from './DeployContainer';
|
|
4
|
+
import type { ExecutionContainer } from './ExecutionContainer';
|
|
5
|
+
import type { UiTesterContainer } from './UiTesterContainer';
|
|
6
|
+
/**
|
|
7
|
+
* Any per-run container class. The three exist only because a Cloudflare Container's image is
|
|
8
|
+
* pinned per container CLASS by the wrangler `[[containers]]` block; each serves the same
|
|
9
|
+
* `/jobs` HTTP contract and the same `RunContainer` lifecycle, so a namespace of any of them
|
|
10
|
+
* drives the same transport.
|
|
11
|
+
*/
|
|
12
|
+
export type RunContainerNamespace = DurableObjectNamespace<ExecutionContainer> | DurableObjectNamespace<DeployContainer> | DurableObjectNamespace<UiTesterContainer>;
|
|
13
|
+
/**
|
|
14
|
+
* Picks the container class that serves an image variant. A transport built for ONE class (the
|
|
15
|
+
* deploy path) ignores the variant; the agent path routes `ui` to its own class.
|
|
16
|
+
*
|
|
17
|
+
* It THROWS for a variant this deployment has not wired, and that refusal is the point. The
|
|
18
|
+
* alternative, falling back to the default class, is what this seam exists to stop: a
|
|
19
|
+
* browser-driven tester silently lands on an image with no browser, pays for a checkout, an
|
|
20
|
+
* install and the model's first turns, then reports an `abort` a reader cannot tell apart from
|
|
21
|
+
* an app that would not boot. Refusing costs one dispatch and names the binding to add.
|
|
22
|
+
*/
|
|
23
|
+
export type ResolveRunContainerNamespace = (variant: RunnerImageVariant) => RunContainerNamespace;
|
|
24
|
+
/**
|
|
25
|
+
* The agent path's resolver: the plain executor class for everything, the UI class for the `ui`
|
|
26
|
+
* variant (today only `tester-ui` declares it).
|
|
27
|
+
*
|
|
28
|
+
* `deploy` never reaches here. The deploy adapter builds its own dedicated transport over
|
|
29
|
+
* `DEPLOY_CONTAINER`, so a `deploy` variant arriving on the AGENT path is a wiring mistake in a
|
|
30
|
+
* kind's registration rather than a missing binding. It is refused too, and separately, because
|
|
31
|
+
* the two need different fixes: one is an operator adding a binding, the other a developer
|
|
32
|
+
* correcting a registry entry.
|
|
33
|
+
*/
|
|
34
|
+
export declare function agentContainerNamespace(bindings: {
|
|
35
|
+
exec: DurableObjectNamespace<ExecutionContainer>;
|
|
36
|
+
ui?: DurableObjectNamespace<UiTesterContainer>;
|
|
37
|
+
}): ResolveRunContainerNamespace;
|
|
38
|
+
//# sourceMappingURL=runContainerNamespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runContainerNamespace.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/containers/runContainerNamespace.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAC7B,sBAAsB,CAAC,kBAAkB,CAAC,GAC1C,sBAAsB,CAAC,eAAe,CAAC,GACvC,sBAAsB,CAAC,iBAAiB,CAAC,CAAA;AAE7C;;;;;;;;;GASG;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,qBAAqB,CAAA;AAEjG;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE;IAChD,IAAI,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IAChD,EAAE,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAA;CAC/C,GAAG,4BAA4B,CA8B/B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RUNNER_IMAGE_UNWIRED_REASON, UnavailableError, unservableImageVariant, } from '@cat-factory/kernel';
|
|
2
|
+
/**
|
|
3
|
+
* The agent path's resolver: the plain executor class for everything, the UI class for the `ui`
|
|
4
|
+
* variant (today only `tester-ui` declares it).
|
|
5
|
+
*
|
|
6
|
+
* `deploy` never reaches here. The deploy adapter builds its own dedicated transport over
|
|
7
|
+
* `DEPLOY_CONTAINER`, so a `deploy` variant arriving on the AGENT path is a wiring mistake in a
|
|
8
|
+
* kind's registration rather than a missing binding. It is refused too, and separately, because
|
|
9
|
+
* the two need different fixes: one is an operator adding a binding, the other a developer
|
|
10
|
+
* correcting a registry entry.
|
|
11
|
+
*/
|
|
12
|
+
export function agentContainerNamespace(bindings) {
|
|
13
|
+
return (variant) => {
|
|
14
|
+
if (variant === 'ui') {
|
|
15
|
+
if (bindings.ui)
|
|
16
|
+
return bindings.ui;
|
|
17
|
+
throw new UnavailableError('This step runs on the UI-tester executor image (Playwright + a browser), but this ' +
|
|
18
|
+
'deployment binds no UI-tester container class, so there is nothing to dispatch it to. ' +
|
|
19
|
+
'Add a `[[containers]]` class named UiTesterContainer pinned to the published ' +
|
|
20
|
+
'cat-factory-executor-ui image plus its UI_CONTAINER durable-object binding, then ' +
|
|
21
|
+
'redeploy. Until then, drop the `tester-ui` step from the pipeline: the ' +
|
|
22
|
+
'visual-confirmation gate still runs on screenshots a person uploads.', RUNNER_IMAGE_UNWIRED_REASON, { image: variant, binding: 'UI_CONTAINER' });
|
|
23
|
+
}
|
|
24
|
+
if (variant === 'deploy') {
|
|
25
|
+
throw new UnavailableError('An agent step declared the `deploy` executor image, which the agent runner path does ' +
|
|
26
|
+
'not serve: deploy jobs run through the environment-provisioning adapter and its own ' +
|
|
27
|
+
'DEPLOY_CONTAINER transport. Correct the agent kind’s registration.', RUNNER_IMAGE_UNWIRED_REASON, { image: variant, binding: 'DEPLOY_CONTAINER' });
|
|
28
|
+
}
|
|
29
|
+
if (variant === 'default')
|
|
30
|
+
return bindings.exec;
|
|
31
|
+
// Exhaustive, so a variant added to the union fails the BUILD here rather than routing
|
|
32
|
+
// silently to the executor class — the same fall-through the local transport's `imageFor`
|
|
33
|
+
// had, and the one this whole seam exists to refuse.
|
|
34
|
+
return unservableImageVariant(variant);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=runContainerNamespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runContainerNamespace.js","sourceRoot":"","sources":["../../../src/infrastructure/containers/runContainerNamespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,qBAAqB,CAAA;AA8B5B;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAGvC;IACC,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,IAAI,QAAQ,CAAC,EAAE;gBAAE,OAAO,QAAQ,CAAC,EAAE,CAAA;YACnC,MAAM,IAAI,gBAAgB,CACxB,oFAAoF;gBAClF,wFAAwF;gBACxF,+EAA+E;gBAC/E,mFAAmF;gBACnF,yEAAyE;gBACzE,sEAAsE,EACxE,2BAA2B,EAC3B,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAC5C,CAAA;QACH,CAAC;QACD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;YACzB,MAAM,IAAI,gBAAgB,CACxB,uFAAuF;gBACrF,sFAAsF;gBACtF,oEAAoE,EACtE,2BAA2B,EAC3B,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAChD,CAAA;QACH,CAAC;QACD,IAAI,OAAO,KAAK,SAAS;YAAE,OAAO,QAAQ,CAAC,IAAI,CAAA;QAC/C,uFAAuF;QACvF,0FAA0F;QAC1F,qDAAqD;QACrD,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAA;IACxC,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type GitHubAppRegistry, type MintInstallationToken } from '@cat-factory/server';
|
|
2
|
+
/**
|
|
3
|
+
* The clone/push credential for a Worker container dispatch: the App registry's mint, narrowed by
|
|
4
|
+
* the shared builder to the repos that dispatch resolved. Every Worker site that hands a container
|
|
5
|
+
* a GitHub token goes through this, so none of them can quietly fall back to an installation-wide
|
|
6
|
+
* one. No `resolveRunInitiatorToken`: the step executor composes its own mint with that chain (see
|
|
7
|
+
* `container-executor-deps.ts`), while bootstrap, repair and the deploy clone have no initiator to
|
|
8
|
+
* act as, and saying so once here beats three call sites each omitting it by accident.
|
|
9
|
+
*
|
|
10
|
+
* It sits in a LEAF module rather than in the composition root because three of its callers are
|
|
11
|
+
* modules the root itself pulls in: importing it back out of `container.ts` made each of them
|
|
12
|
+
* depend on the whole root, and for `containers/deployJobDeps.ts` (which the root re-exported) it
|
|
13
|
+
* closed a genuine cycle that only stayed harmless while every reference sat inside a function
|
|
14
|
+
* body.
|
|
15
|
+
*/
|
|
16
|
+
export declare function workerDispatchTokenMint(registry: GitHubAppRegistry): MintInstallationToken;
|
|
17
|
+
//# sourceMappingURL=dispatchTokenMint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatchTokenMint.d.ts","sourceRoot":"","sources":["../../src/infrastructure/dispatchTokenMint.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,qBAAqB,EAE3B,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,qBAAqB,CAM1F"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { buildDispatchTokenMint, logger, operationalMetrics, } from '@cat-factory/server';
|
|
2
|
+
/**
|
|
3
|
+
* The clone/push credential for a Worker container dispatch: the App registry's mint, narrowed by
|
|
4
|
+
* the shared builder to the repos that dispatch resolved. Every Worker site that hands a container
|
|
5
|
+
* a GitHub token goes through this, so none of them can quietly fall back to an installation-wide
|
|
6
|
+
* one. No `resolveRunInitiatorToken`: the step executor composes its own mint with that chain (see
|
|
7
|
+
* `container-executor-deps.ts`), while bootstrap, repair and the deploy clone have no initiator to
|
|
8
|
+
* act as, and saying so once here beats three call sites each omitting it by accident.
|
|
9
|
+
*
|
|
10
|
+
* It sits in a LEAF module rather than in the composition root because three of its callers are
|
|
11
|
+
* modules the root itself pulls in: importing it back out of `container.ts` made each of them
|
|
12
|
+
* depend on the whole root, and for `containers/deployJobDeps.ts` (which the root re-exported) it
|
|
13
|
+
* closed a genuine cycle that only stayed harmless while every reference sat inside a function
|
|
14
|
+
* body.
|
|
15
|
+
*/
|
|
16
|
+
export function workerDispatchTokenMint(registry) {
|
|
17
|
+
return buildDispatchTokenMint({
|
|
18
|
+
mint: (id, opts) => registry.installationToken(id, opts),
|
|
19
|
+
logger,
|
|
20
|
+
operationalMetrics,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=dispatchTokenMint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatchTokenMint.js","sourceRoot":"","sources":["../../src/infrastructure/dispatchTokenMint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,MAAM,EAEN,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA2B;IACjE,OAAO,sBAAsB,CAAC;QAC5B,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,EAAE,IAAI,CAAC;QACxD,MAAM;QACN,kBAAkB;KACnB,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Ai, D1Database, DurableObjectNamespace, Queue, R2Bucket, Workflow } from '@cloudflare/workers-types';
|
|
2
2
|
import type { TrackerWebhookEvent } from '@cat-factory/kernel';
|
|
3
3
|
import type { DeployContainer } from './containers/DeployContainer';
|
|
4
|
+
import type { UiTesterContainer } from './containers/UiTesterContainer';
|
|
4
5
|
import type { ExecutionContainer } from './containers/ExecutionContainer';
|
|
5
6
|
import type { CacheGenerationDirectory } from './durable-objects/CacheGenerationDirectory';
|
|
6
7
|
import type { WorkspaceEventsHub } from './durable-objects/WorkspaceEventsHub';
|
|
@@ -198,6 +199,18 @@ export interface Env {
|
|
|
198
199
|
* REST path is unaffected).
|
|
199
200
|
*/
|
|
200
201
|
DEPLOY_CONTAINER?: DurableObjectNamespace<DeployContainer>;
|
|
202
|
+
/**
|
|
203
|
+
* Durable Object namespace backing per-run UI-TESTER containers: the heavier image that
|
|
204
|
+
* layers Playwright + Chromium, pnpm/yarn, `serve` and a headless JRE + WireMock onto the
|
|
205
|
+
* executor harness, which the `image: 'ui'` dispatch variant routes to. A run gets one
|
|
206
|
+
* ALONGSIDE its `EXEC_CONTAINER` instance, because a per-run container cannot change image
|
|
207
|
+
* mid-run and a browser-driven step sits between ordinary agent steps.
|
|
208
|
+
*
|
|
209
|
+
* Absent ⇒ a step declaring that image is REFUSED at dispatch, naming this binding. It is not
|
|
210
|
+
* served on the executor image instead: that image has no browser, and the refusal is the
|
|
211
|
+
* whole reason the variant exists.
|
|
212
|
+
*/
|
|
213
|
+
UI_CONTAINER?: DurableObjectNamespace<UiTesterContainer>;
|
|
201
214
|
/**
|
|
202
215
|
* Optional shared secret authenticating the Worker → harness HTTP calls. When set,
|
|
203
216
|
* it is injected into each per-run container's env (so the harness requires it) and
|
|
@@ -247,7 +260,15 @@ export interface Env {
|
|
|
247
260
|
MOONSHOT_BASE_URL?: string;
|
|
248
261
|
XAI_BASE_URL?: string;
|
|
249
262
|
OPENAI_BASE_URL?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Anthropic override. Not OpenAI-compatible (its SDK speaks its own dialect), but a direct
|
|
265
|
+
* key-pooled provider all the same, so a deployment fronting Anthropic with a proxy repoints it
|
|
266
|
+
* here. Node reads env by NAME and has always honoured this; declaring it here is what keeps the
|
|
267
|
+
* two facades from disagreeing about the same deployment's configuration.
|
|
268
|
+
*/
|
|
269
|
+
ANTHROPIC_BASE_URL?: string;
|
|
250
270
|
OPENROUTER_BASE_URL?: string;
|
|
271
|
+
BIFROST_BASE_URL?: string;
|
|
251
272
|
LITELLM_BASE_URL?: string;
|
|
252
273
|
/** AWS Region, e.g. `eu-central-1`. Unset ⇒ no `bedrock` flavour is offered. */
|
|
253
274
|
BEDROCK_REGION?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/infrastructure/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,EAAE,EACF,UAAU,EACV,sBAAsB,EACtB,KAAK,EACL,QAAQ,EACR,QAAQ,EACT,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAA;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;AAE9E,4EAA4E;AAC5E,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAClE;IA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,MAAM,CAAA;IACrC;;;;OAIG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAA;IACxC;;;;OAIG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAA;IACxC;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,4FAA4F;IAC5F,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,0FAA0F;IAC1F,+BAA+B,CAAC,EAAE,MAAM,CAAA;IACxC;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAA;CACpC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CAKvD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CAKnD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CAK9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAExD;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGhE;AAED;6EAC6E;AAC7E,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAMpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/infrastructure/env.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/infrastructure/env.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAA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AC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACvD,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;IAClD,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { D1Database } from '@cloudflare/workers-types';
|
|
2
2
|
import type { LiveContainerRecord, LiveContainerStore } from '../containers/ContainerInstanceRegistry';
|
|
3
3
|
/**
|
|
4
|
-
* The live-container inventory over D1 (`live_containers`, migration 0022
|
|
5
|
-
* uses `ON CONFLICT(container_key) DO NOTHING` so a replayed dispatch preserves
|
|
6
|
-
* first `started_at
|
|
4
|
+
* The live-container inventory over D1 (`live_containers`, migration 0022; `image` added in
|
|
5
|
+
* 0094). `add` uses `ON CONFLICT(container_key) DO NOTHING` so a replayed dispatch preserves
|
|
6
|
+
* the first `started_at`, the container's true age the reaper keys off.
|
|
7
7
|
*/
|
|
8
8
|
export declare class D1LiveContainerRepository implements LiveContainerStore {
|
|
9
9
|
private readonly db;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1LiveContainerRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1LiveContainerRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"D1LiveContainerRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1LiveContainerRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,yCAAyC,CAAA;AAEhD;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,kBAAkB;IAClE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,GAAG,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAepD;IAEK,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhD;IAEK,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAyBvE;CACF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { isRunnerImageVariant } from '@cat-factory/kernel';
|
|
1
2
|
/**
|
|
2
|
-
* The live-container inventory over D1 (`live_containers`, migration 0022
|
|
3
|
-
* uses `ON CONFLICT(container_key) DO NOTHING` so a replayed dispatch preserves
|
|
4
|
-
* first `started_at
|
|
3
|
+
* The live-container inventory over D1 (`live_containers`, migration 0022; `image` added in
|
|
4
|
+
* 0094). `add` uses `ON CONFLICT(container_key) DO NOTHING` so a replayed dispatch preserves
|
|
5
|
+
* the first `started_at`, the container's true age the reaper keys off.
|
|
5
6
|
*/
|
|
6
7
|
export class D1LiveContainerRepository {
|
|
7
8
|
db;
|
|
@@ -10,10 +11,10 @@ export class D1LiveContainerRepository {
|
|
|
10
11
|
}
|
|
11
12
|
async add(record) {
|
|
12
13
|
await this.db
|
|
13
|
-
.prepare(`INSERT INTO live_containers (container_key, kind, workspace_id, started_at)
|
|
14
|
-
VALUES (?, ?, ?, ?)
|
|
14
|
+
.prepare(`INSERT INTO live_containers (container_key, kind, workspace_id, image, started_at)
|
|
15
|
+
VALUES (?, ?, ?, ?, ?)
|
|
15
16
|
ON CONFLICT(container_key) DO NOTHING`)
|
|
16
|
-
.bind(record.containerKey, record.kind, record.workspaceId ?? null, record.startedAt)
|
|
17
|
+
.bind(record.containerKey, record.kind, record.workspaceId ?? null, record.image ?? null, record.startedAt)
|
|
17
18
|
.run();
|
|
18
19
|
}
|
|
19
20
|
async remove(containerKey) {
|
|
@@ -24,7 +25,7 @@ export class D1LiveContainerRepository {
|
|
|
24
25
|
}
|
|
25
26
|
async listStartedBefore(epochMs) {
|
|
26
27
|
const { results } = await this.db
|
|
27
|
-
.prepare(`SELECT container_key, kind, workspace_id, started_at FROM live_containers
|
|
28
|
+
.prepare(`SELECT container_key, kind, workspace_id, image, started_at FROM live_containers
|
|
28
29
|
WHERE started_at < ?
|
|
29
30
|
ORDER BY started_at`)
|
|
30
31
|
.bind(epochMs)
|
|
@@ -33,6 +34,10 @@ export class D1LiveContainerRepository {
|
|
|
33
34
|
containerKey: r.container_key,
|
|
34
35
|
kind: r.kind,
|
|
35
36
|
...(r.workspace_id != null ? { workspaceId: r.workspace_id } : {}),
|
|
37
|
+
// Narrowed against the variant vocabulary rather than cast: a row written by a build that
|
|
38
|
+
// knew a variant this one does not must not send the reaper to a namespace resolver that
|
|
39
|
+
// will throw on it, which would leave the leaked container alive AND the row behind.
|
|
40
|
+
...(isRunnerImageVariant(r.image) ? { image: r.image } : {}),
|
|
36
41
|
startedAt: r.started_at,
|
|
37
42
|
}));
|
|
38
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1LiveContainerRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1LiveContainerRepository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"D1LiveContainerRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1LiveContainerRepository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAM1D;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IACnB,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAsB;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAA2B;QACnC,MAAM,IAAI,CAAC,EAAE;aACV,OA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
+
-- A run whose `tester-ui` step declares the `ui` executor image gets a SECOND container, in its
|
|
4
|
+
-- own Durable Object namespace (a Cloudflare Container's image is pinned per class). The reaper
|
|
5
|
+
-- kills through a namespace, and the container key alone cannot say which one: looked up in the
|
|
6
|
+
-- executor namespace, a leaked UI container is never killed and the failed kill still reads as a
|
|
7
|
+
-- success, because `idFromName` returns a stub for an instance that was never started.
|
|
8
|
+
--
|
|
9
|
+
-- Nullable, meaning the default executor class, so rows written before this column existed keep
|
|
10
|
+
-- reaping exactly as they did.
|
|
11
|
+
ALTER TABLE live_containers ADD COLUMN image TEXT;
|