Skip to content

Commit 374e66b

Browse files
committed
Merge remote-tracking branch 'origin/v2-poc-requirements' into claude/docker-file-location-actor-drx6jx
2 parents f103580 + 0ffecae commit 374e66b

7 files changed

Lines changed: 4428 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,35 @@ jobs:
1212
timeout-minutes: 15
1313
steps:
1414
- uses: actions/checkout@v4
15+
# Installs the pnpm version pinned by package.json's `packageManager` field; must run
16+
# before setup-node so its `cache: pnpm` can find the pnpm store.
17+
- uses: pnpm/action-setup@v4
1518
- uses: actions/setup-node@v4
1619
with:
1720
node-version: 24
18-
cache: npm
19-
- run: npm ci
20-
- run: npm run build
21-
- run: npm run lint
22-
- run: npm run format:check
23-
- run: npm test
21+
cache: pnpm
22+
- run: pnpm install --frozen-lockfile
23+
- run: pnpm run build
24+
- run: pnpm run lint
25+
- run: pnpm run format:check
26+
- run: pnpm test
2427

2528
e2e:
2629
name: Actor dev-loop e2e (apify-cli + Docker)
2730
runs-on: ubuntu-latest
2831
timeout-minutes: 30
2932
steps:
3033
- uses: actions/checkout@v4
34+
- uses: pnpm/action-setup@v4
3135
- uses: actions/setup-node@v4
3236
with:
3337
node-version: 24
34-
cache: npm
35-
- run: npm ci
38+
cache: pnpm
39+
- run: pnpm install --frozen-lockfile
3640
# The suite manages Docker itself against the runner's daemon: it pre-pulls the
3741
# Actor base images, builds the runtime image, starts the runtime container with
3842
# the host Docker socket, and drives it with stock apify-cli via npx.
39-
- run: npm run test:e2e
43+
- run: pnpm run test:e2e
4044
# The e2e's runtime container is normally removed by the suite's afterAll; on
4145
# failure it is left running, so its server-side view of any failed request
4246
# (log-stream lifecycle included) is captured here for diagnosis.

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# pnpm's generated lockfile is pnpm's own output format, not ours to reformat - and the next
2+
# `pnpm install` would rewrite it in that format anyway.
3+
pnpm-lock.yaml

Dockerfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
# actor-runtime: a minimal, self-contained local Apify platform.
2-
#
3-
# glibc is required, not optional: @crawlee/fs-storage loads a native Rust addon
4-
# (@crawlee/fs-storage-native) with no musl build, so this image cannot be Alpine-based
5-
# (see requirements/system.md and file-system-storage.ts:19-27 in the crawlee v4 source).
2+
63
FROM node:24-bookworm-slim AS builder
74

85
WORKDIR /usr/src/app
96

10-
COPY package.json package-lock.json ./
11-
RUN npm ci
7+
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
8+
RUN corepack enable pnpm
9+
10+
COPY package.json pnpm-lock.yaml ./
11+
RUN pnpm install --frozen-lockfile
1212

1313
COPY tsconfig.json ./
1414
COPY src ./src
15-
RUN npm run build
15+
RUN pnpm run build
1616

1717
FROM node:24-bookworm-slim
1818

1919
WORKDIR /usr/src/app
2020

21-
COPY package.json package-lock.json ./
22-
RUN npm ci --omit=dev && npm cache clean --force
21+
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
22+
RUN corepack enable pnpm
23+
24+
COPY package.json pnpm-lock.yaml ./
25+
# The store prune plays the role `npm cache clean` played before: production node_modules keeps
26+
# hard links into the store, so pruning drops only the unreferenced (dev) packages' disk copies.
27+
RUN pnpm install --prod --frozen-lockfile && pnpm store prune
2328

2429
COPY --from=builder /usr/src/app/dist ./dist
2530

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ endpoint/console details: `requirements/api.md`'s `/actor-runtime/*` section and
7676
## Development
7777

7878
```bash
79-
npm install
80-
npm run build # tsc
81-
npm test # unit + integration (no Docker needed)
82-
npm run test:e2e # full CLI-driven dev loop against a built image (requires Docker)
83-
npm run dev # run the server directly against ./data with tsx
79+
pnpm install
80+
pnpm run build # tsc
81+
pnpm test # unit + integration (no Docker needed)
82+
pnpm run test:e2e # full CLI-driven dev loop against a built image (requires Docker)
83+
pnpm run dev # run the server directly against ./data with tsx
8484
```
8585

86-
`npm run dev` sets `ACTOR_RUNTIME_DATA_DIR=./data` inline in the script (`DEFAULT_DATA_DIR` otherwise
86+
`pnpm run dev` sets `ACTOR_RUNTIME_DATA_DIR=./data` inline in the script (`DEFAULT_DATA_DIR` otherwise
8787
falls back to the container path `/data` - see `src/config.ts`); this only works as written on a
8888
POSIX shell (Linux/macOS). On Windows, set the env var separately before running `tsx src/index.ts`
8989
(e.g. in PowerShell: `$env:ACTOR_RUNTIME_DATA_DIR="./data"; tsx src/index.ts`), or use a cross-platform
@@ -96,13 +96,19 @@ resolves to (both must move in lockstep - `@crawlee/fs-storage` pins its own nat
9696
`@crawlee/fs-storage-native`). To bump:
9797

9898
```bash
99-
npm view @crawlee/core dist-tags.v4
100-
npm view @crawlee/fs-storage dist-tags.v4 # should match
99+
pnpm view @crawlee/core dist-tags.v4
100+
pnpm view @crawlee/fs-storage dist-tags.v4 # should match
101101
# update both versions in package.json, then:
102-
npm install
103-
npm run build && npm test
102+
pnpm install
103+
pnpm run build && pnpm test
104104
```
105105

106+
While bumping, check whether the `pnpm.overrides` pin on `@crawlee/fs-storage-native` in
107+
`package.json` is still needed: it forces the first release with linux-arm64 bindings
108+
(`0.1.5-beta.19`, API-identical to the `0.1.5-beta.18` that released `@crawlee/fs-storage`
109+
versions still depend on). Once the bumped `@crawlee/fs-storage` depends on `>= 0.1.5-beta.19`
110+
on its own, delete the override.
111+
106112
## Apify Proxy
107113

108114
Set `APIFY_PROXY_PASSWORD` in the runtime container's own environment (e.g. `docker run -e

package.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"engines": {
88
"node": ">=22.0.0"
99
},
10+
"packageManager": "pnpm@10.33.0",
1011
"exports": {
1112
".": "./dist/index.js"
1213
},
@@ -25,8 +26,8 @@
2526
"test:watch": "vitest"
2627
},
2728
"dependencies": {
28-
"@crawlee/core": "4.0.0-beta.133",
29-
"@crawlee/fs-storage": "4.0.0-beta.133",
29+
"@crawlee/core": "4.0.0-beta.145",
30+
"@crawlee/fs-storage": "4.0.0-beta.145",
3031
"dockerode": "^4.0.5",
3132
"express": "^5.1.0",
3233
"json5": "^2.2.3",
@@ -36,6 +37,7 @@
3637
"@eslint/js": "^9.18.0",
3738
"@types/dockerode": "^3.3.34",
3839
"@types/express": "^5.0.1",
40+
"@types/express-serve-static-core": "^5.1.3",
3941
"@types/node": "^22.13.0",
4042
"@types/tar-stream": "^3.1.3",
4143
"apify-client": "^2.13.0",
@@ -47,5 +49,16 @@
4749
"typescript": "^5.7.3",
4850
"typescript-eslint": "^8.18.0",
4951
"vitest": "^2.1.8"
52+
},
53+
"pnpm": {
54+
"ignoredBuiltDependencies": [
55+
"cpu-features",
56+
"esbuild",
57+
"protobufjs",
58+
"ssh2"
59+
],
60+
"overrides": {
61+
"@crawlee/fs-storage-native": "0.1.5-beta.19"
62+
}
5063
}
5164
}

0 commit comments

Comments
 (0)