@north-light/api 0.3.725 → 0.3.726

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.
@@ -73,10 +73,11 @@ export function recipeDockerfile(recipe, revision, packagesToken = false) {
73
73
  out.push('WORKDIR /work');
74
74
  out.push(`RUN ${writeRunUserNpmrc()}`);
75
75
  // Warm the image's pnpm store from each repository's lockfile, so `pnpm install` in the sandbox links instead of downloading. A failed fetch only costs that
76
- // warmth, so it is logged and never refuses the sandbox start. The fetch runs as root, so the repository and the store go back to the run user after it:
77
- // a setup script's `su crtr -c 'pnpm install'` cannot replace a root-owned `node_modules/.modules.yaml`.
76
+ // warmth, so it is logged and never refuses the sandbox start. The fetch runs as the run user, so the repository and the store are already its own and a
77
+ // setup script's `su crtr -c 'pnpm install'` can write them. No step here may `chown -R` the trees: each one rewrites every file into a new layer, and the
78
+ // doubled multi-GB image kept Blaxel's build at BUILDING past the timeout. The final stage's `COPY --chown` sets ownership once.
78
79
  for (const repo of recipe.repositories) {
79
- out.push(`RUN if [ -f /work/${repo.name}/pnpm-lock.yaml ]; then cd /work/${repo.name} && HOME=/home/${RUN_USER} pnpm fetch >> ${SETUP_LOG_FILE} 2>&1 || echo 'pnpm fetch ${repo.name} failed' >> ${SETUP_LOG_FILE}; chown -R ${RUN_USER}:${RUN_USER} /work/${repo.name} /home/${RUN_USER}; fi`);
80
+ out.push(`RUN if [ -f /work/${repo.name}/pnpm-lock.yaml ]; then su ${RUN_USER} -c 'cd /work/${repo.name} && HOME=/home/${RUN_USER} pnpm fetch' >> ${SETUP_LOG_FILE} 2>&1 || echo 'pnpm fetch ${repo.name} failed' >> ${SETUP_LOG_FILE}; fi`);
80
81
  }
81
82
  for (const source of packages)
82
83
  out.push(guarded(`pi install ${source}`, `HOME=/var/lib/crtr PI_CODING_AGENT_DIR=${RECIPE_PI_AGENT_DIR} pi install ${shellQuote(source)}`));
@@ -84,7 +85,7 @@ export function recipeDockerfile(recipe, revision, packagesToken = false) {
84
85
  // the step. Its output and exit status are kept in the image (`SETUP_LOG_FILE`, `SETUP_FAILED_FILE`) and the sandbox start script refuses to start with them.
85
86
  if (hasScript)
86
87
  out.push(guarded('setup script', `bash /tmp/${SETUP_SCRIPT_FILE}`));
87
- out.push(guarded('finalize', `echo ${Math.trunc(revision)} > /work/.crtr/recipe-revision && chown -R ${RUN_USER} /work /home/${RUN_USER} /var/lib/crtr`));
88
+ out.push(guarded('finalize', `echo ${Math.trunc(revision)} > /work/.crtr/recipe-revision`));
88
89
  out.push('', ...base);
89
90
  // Blaxel keeps the ownership set in the Dockerfile only for an image that declares a final USER (an image without one is built all root-owned); the final USER is below.
90
91
  for (const dir of ['/work', `/home/${RUN_USER}`, '/var/lib/crtr'])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/api",
3
- "version": "0.3.725",
3
+ "version": "0.3.726",
4
4
  "description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "main": "./dist/api/index.js",