@evident-ai/runner-cdk 3.4.1-dev.fb92ede → 3.5.1-dev.8bb8794
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/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Reusable AWS CDK constructs for running an [Evident](https://evident.run) agent
|
|
|
9
9
|
`desiredCount 0`, and an HMAC-authenticated waker Lambda scales it back up on the next
|
|
10
10
|
message. You pay for the time the agent is actually working.
|
|
11
11
|
- **`EvidentMicrovmConstruct`** — a per-session AWS Lambda MicroVM that boots on demand
|
|
12
|
-
and suspends between messages. Installing
|
|
12
|
+
and suspends between messages. Installing this package is all you
|
|
13
13
|
need: the image build context ships inside it (see [The MicroVM image](#the-microvm-image)
|
|
14
14
|
below), so there is no checkout of the source repository involved. See
|
|
15
15
|
[the AWS runner doc](https://evident.run/docs/aws-runner) for the full picture of both
|
|
@@ -76,8 +76,8 @@ agent.selfStopRoleArn;
|
|
|
76
76
|
agent.replicaPrefix;
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
For a complete working example, see
|
|
80
|
-
|
|
79
|
+
For a complete working example, see `GETTING-STARTED.md` (not published to npm); it is the
|
|
80
|
+
construct's own dogfooding consumer.
|
|
81
81
|
|
|
82
82
|
## Props
|
|
83
83
|
|
|
@@ -161,12 +161,12 @@ new EvidentMicrovmConstruct(this, 'Runner', {
|
|
|
161
161
|
|
|
162
162
|
Pass `overlayDir` to add deployment-specific build steps to the staged image. The
|
|
163
163
|
directory provides `setup-root` for root-owned installs and `setup-workspace` for
|
|
164
|
-
workspace build warm-up
|
|
164
|
+
dependency installation and workspace build warm-up. See the [MicroVM image
|
|
165
165
|
README](../../runner/docker-images/microvm/README.md) for the full overlay contract.
|
|
166
166
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
The image bakes your repository checked out but not installed and makes no assumptions about
|
|
168
|
+
its package manager. To speed up first boot, install dependencies from your overlay's
|
|
169
|
+
`setup-workspace`; otherwise, the agent installs them on first use.
|
|
170
170
|
|
|
171
171
|
| MicroVM prop | Omitted behavior |
|
|
172
172
|
| --- | --- |
|
|
@@ -183,9 +183,9 @@ all of them, so never put a secret in this prop.
|
|
|
183
183
|
|
|
184
184
|
## Status / limitations
|
|
185
185
|
|
|
186
|
-
- **Published to npm** as `@evident-ai/runner-cdk` (MIT).
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
- **Published to npm** as `@evident-ai/runner-cdk` (MIT). `npm install
|
|
187
|
+
@evident-ai/runner-cdk` (or `pnpm add`/`yarn add`); no checkout of this repo is
|
|
188
|
+
required. It builds to a self-contained `dist/` (`pnpm --filter
|
|
189
189
|
@evident-ai/runner-cdk build`) with no `workspace:`/`@evident/*` runtime dependency.
|
|
190
190
|
Evident's own consumer still consumes it as a `workspace:*` dependency for dogfooding.
|
|
191
191
|
- **AWS/ECS-specific.** Non-AWS clouds are an open question on the epic, not a supported
|
|
@@ -66,8 +66,8 @@ function isShallowRepository(repositoryPath) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* Clones the caller's repository into the build context
|
|
70
|
-
*
|
|
69
|
+
* Clones the caller's repository into the build context for the Dockerfile to
|
|
70
|
+
* bake as a checked-out but uninstalled workspace.
|
|
71
71
|
*
|
|
72
72
|
* `file://` rather than a plain path: a path triggers git's local-clone
|
|
73
73
|
* optimisation, which copies the whole object store — every branch and worktree
|
|
@@ -102,9 +102,6 @@ function stageRepository(repositoryPath, destination, originUrl) {
|
|
|
102
102
|
(0, node_fs_1.rmSync)(path.join(destination, '.git', 'index'), { force: true });
|
|
103
103
|
(0, node_fs_1.rmSync)(path.join(destination, '.git', 'logs'), { recursive: true, force: true });
|
|
104
104
|
console.log(`[stage] repo ${git(['rev-parse', 'HEAD'], destination)}`);
|
|
105
|
-
if (!(0, node_fs_1.existsSync)(path.join(destination, 'pnpm-lock.yaml'))) {
|
|
106
|
-
console.log(`[stage] ${repositoryPath} has no pnpm-lock.yaml — the image build will skip dependency installation`);
|
|
107
|
-
}
|
|
108
105
|
}
|
|
109
106
|
function stageScriptDirectory(source, destination) {
|
|
110
107
|
(0, node_fs_1.mkdirSync)(destination);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Generic MicroVM runner image
|
|
2
2
|
#
|
|
3
3
|
# Built for linux/arm64 (Lambda MicroVMs run on Graviton only) and with ONE
|
|
4
|
-
# process: the hook server. `overlay/setup-root` and
|
|
5
|
-
#
|
|
6
|
-
#
|
|
4
|
+
# process: the hook server. `overlay/setup-root` and `overlay/setup-workspace`
|
|
5
|
+
# are the extension point for deployment-specific packages, dependency
|
|
6
|
+
# installation and build warm-up.
|
|
7
7
|
#
|
|
8
8
|
# THE BOOT SPLIT — the rule that governs everything below. AWS snapshots this
|
|
9
9
|
# image ONCE at build and every MicroVM resumes from that same snapshot, so
|
|
@@ -130,8 +130,8 @@ COPY hook-server.js /usr/local/lib/evident/hook-server.js
|
|
|
130
130
|
COPY hooks /etc/evident/hooks
|
|
131
131
|
|
|
132
132
|
# Workspace: the repository the agent works on, baked in. A resumed VM must be
|
|
133
|
-
# useful in milliseconds,
|
|
134
|
-
# here
|
|
133
|
+
# useful in milliseconds, while a clone costs minutes — so the checkout happens
|
|
134
|
+
# here; dependency installation and build warm-up belong to the deployment overlay.
|
|
135
135
|
#
|
|
136
136
|
# This does not weaken the boot split: source, git history and node_modules are
|
|
137
137
|
# neither secret nor per-VM-unique, so sharing them across every VM from this
|
|
@@ -171,30 +171,11 @@ USER runner
|
|
|
171
171
|
# `runner` (not root) so the rebuilt index is runner-owned and writable later.
|
|
172
172
|
RUN git reset --quiet
|
|
173
173
|
|
|
174
|
-
#
|
|
175
|
-
#
|
|
174
|
+
# Deployment-specific dependency installation and build work belongs here. This runs
|
|
175
|
+
# as `runner` in `${WORKSPACE}`, so everything it writes is agent-writable.
|
|
176
176
|
#
|
|
177
|
-
#
|
|
178
|
-
#
|
|
179
|
-
# only survive within a single layer — split in two and the image carries both
|
|
180
|
-
# copies. `--frozen-lockfile` because the committed lockfile is the whole reason
|
|
181
|
-
# this is bakeable at all: installing against anything else would bake a
|
|
182
|
-
# dependency set nobody committed.
|
|
183
|
-
#
|
|
184
|
-
# Guarded on a committed `pnpm-lock.yaml` so `microvm:repositoryPath` can point
|
|
185
|
-
# at a repository that is not a pnpm workspace at all: it is baked uninstalled
|
|
186
|
-
# instead of failing the build, and the agent installs on first use.
|
|
187
|
-
#
|
|
188
|
-
# Anything beyond dependency installation is deployment-specific and belongs in
|
|
189
|
-
# `overlay/setup-workspace`.
|
|
190
|
-
RUN if [ -f pnpm-lock.yaml ]; then \
|
|
191
|
-
pnpm install --frozen-lockfile; \
|
|
192
|
-
else \
|
|
193
|
-
echo "[workspace-prep] no pnpm-lock.yaml in the baked repository — skipping the dependency install; the agent installs on first use."; \
|
|
194
|
-
fi
|
|
195
|
-
|
|
196
|
-
# Runs as `runner` in `${WORKSPACE}`, after the install, so a project's build
|
|
197
|
-
# output is writable by the agent.
|
|
177
|
+
# Keep the overlay's install and build in one layer: pnpm hard-links `node_modules`
|
|
178
|
+
# into its content-addressed store, and hard links only survive within a single layer.
|
|
198
179
|
RUN /etc/evident/overlay/setup-workspace
|
|
199
180
|
|
|
200
181
|
# Port AWS calls the MicroVM hooks on.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evident-ai/runner-cdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1-dev.8bb8794",
|
|
4
4
|
"description": "Reusable CDK constructs for an Evident agent runner: a single scale-to-zero Fargate runner (task + service + per-agent self-stop role + waker Lambda), or a per-session AWS Lambda MicroVM that boots on demand and suspends between messages. Instantiate once per agent from your own stack.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "pnpm run build-bundled-deps && ts-node scripts/build.ts",
|
|
17
|
+
"build": "pnpm run build-bundled-deps && ts-node scripts/build.ts && node -e 'const m=require(\"./package.json\").main; if (!require(\"node:fs\").existsSync(m)) { console.error(`build produced no ${m}`); process.exit(1); }'",
|
|
18
18
|
"//build-bundled-deps": "scripts/build.ts esbuild-bundles runner/docker-images/microvm/hook-server.ts, which imports @evident-ai/lambda-microvm-runtime by its built `main`. @evident-ai/lambda-microvm-cdk is a workspace:* devDependency whose types resolve through its own dist/, so tsc --project tsconfig.build.json cannot compile src/microvm/{shapes,construct}.ts without it. Chained into `build` rather than left to turbo's `^build` because callers outside turbo invoke `pnpm --filter @evident-ai/runner-cdk build` directly, which bypasses turbo entirely.",
|
|
19
19
|
"build-bundled-deps": "pnpm --filter @evident-ai/lambda-microvm-cdk build && pnpm --filter @evident-ai/lambda-microvm-runtime build",
|
|
20
20
|
"typecheck": "tsc --noEmit",
|