ci: 预热 Prisma 并移除运行时 Node 下载
This commit is contained in:
1 parent
12a3bf2f3b
commit
447c224fce
4 files changed
+72
-22
No files matched your search
@@ -33,6 +33,12 @@ journalctl --user -u gitea-runner -n 100 --no-pager
|
||||
|
||||
Runner 与本地开发工作共用 `Elitebook` 主机,不再与生产 API 共用资源。任务容器限制 4 CPU / 8 GB、并发 2;本地机器关机或休眠时 CI 会排队,required checks 不会自动完成。
|
||||
|
||||
## 工具链与外部下载
|
||||
|
||||
任务镜像 `personal-brand-ci:node24` 已内置 Node 24 和 pnpm 9.15.0;workflow 不再调用 `actions/setup-node` 或 `pnpm/action-setup`,而是在每个 job 开头执行 `Verify preinstalled toolchain`。这样不会因为 nodejs.org 下载缓慢或中断而把 job 卡到超时。
|
||||
|
||||
Prisma engines 在构建镜像时预热到 `/root/.cache/prisma`,job 内 `pnpm install` 触发的 `prisma generate` 直接命中缓存,不再访问 `binaries.prisma.sh`。workflow 仍用 `actions/cache` 缓存该目录,作为更换镜像或镜像未预热时的兜底。升级 Prisma 后必须同步 `deploy/runner/Dockerfile` 的 `PRISMA_VERSION` 并重建镜像。
|
||||
|
||||
## 缓存
|
||||
|
||||
Runner 内置 cache server(`cache.host=172.17.0.1`、`cache.port=8193`、`cache.dir=~/gitea-runner/cache-data`),供 `actions/cache` 使用(Turbo 缓存等)。
|
||||
|
||||
@@ -44,9 +44,11 @@ SKIP_LINGER=1 \
|
||||
docker build -f deploy/runner/Dockerfile -t personal-brand-ci:node24 .
|
||||
```
|
||||
|
||||
镜像包含 Node 24、pnpm 9.15.0、git/curl/jq/unzip,以及 Playwright 1.58.2 的 Chromium、headless shell、FFmpeg 和系统依赖。构建产物是本机 amd64 镜像(约 3 GB),不推送到 registry。
|
||||
镜像包含 Node 24、pnpm 9.15.0、git/curl/jq/unzip,以及 Playwright 1.58.2 的 Chromium、headless shell、FFmpeg 和系统依赖;构建时还会预热 Prisma engines 到 `/root/.cache/prisma`。构建产物是本机 amd64 镜像(约 3 GB),不推送到 registry。
|
||||
|
||||
`apps/taro/package.json` 升级 Playwright 后,同步修改 `deploy/runner/Dockerfile` 的 `PLAYWRIGHT_VERSION`,重建镜像并重启 runner:
|
||||
workflow 不再使用 `actions/setup-node` 或 `pnpm/action-setup`,而是直接校验镜像内置的 Node/pnpm 版本。因此替换 `RUNNER_IMAGE` 时必须保证镜像内已有 Node 24 和 pnpm 9.15.0,否则 job 会在 `Verify preinstalled toolchain` 步骤失败。
|
||||
|
||||
`apps/taro/package.json` 升级 Playwright 后,同步修改 `deploy/runner/Dockerfile` 的 `PLAYWRIGHT_VERSION`;升级 Prisma 后,同步修改 `PRISMA_VERSION`。然后重建镜像并重启 runner:
|
||||
|
||||
```bash
|
||||
docker build -f deploy/runner/Dockerfile -t personal-brand-ci:node24 .
|
||||
|
||||
Reference in new issue
Block a user