Skip to content

(MOT-3889) fix(scrapling): move dependency bootstrap to scripts.install - #434

Merged
andersonleal merged 1 commit into
mainfrom
andersonleal/mot-3889-bundle-scripts-install
Jul 6, 2026
Merged

(MOT-3889) fix(scrapling): move dependency bootstrap to scripts.install#434
andersonleal merged 1 commit into
mainfrom
andersonleal/mot-3889-bundle-scripts-install

Conversation

@andersonleal

Copy link
Copy Markdown
Collaborator

Why

Follow-up to #433. Folding dependency bootstrap into scripts.start broke at runtime: the engine's boot script emitted exec {run_cmd}, and exec binds to the first command of a compound string — so exec pip install -e . && scrapling install && python -m src.main replaced the shell with pip, which exited after installing, and the VM silently tore down. The worker crash-looped with logs ending at pip success; scrapling install and the worker itself never ran.

What

The engine now allows scripts.install for bundle workers (it executes in the same publisher-shell trust context as scripts.start, and the boot script's /var/.iii-prepared marker already gives run-once semantics), so this restores the clean split:

  • scrapling/iii.worker.yamlinstall: "pip install -e . && scrapling install" (runs once, first boot), start: "python -m src.main" (single command, every boot)
  • validate_worker.py — stop rejecting scripts.install for bundles; scripts.setup and non-preset runtime.base_image still rejected
  • _publish-registry.yml — bundle smoke-boot runs scripts.install synchronously before scripts.start, mirroring the engine
  • _bundle.yml — comments updated

Depends on

Engine changes on iii-hq/iii#1937:

  • bundle validator accepts scripts.install and preset runtime.base_image refs
  • boot script execs compound scripts.start via quoted sh -c (the root-cause fix for the silent teardown)

Verified

Fresh local install with the patched engine: provision (pip + browser download, fully visible in iii worker logs) → worker registered in ~90s → scrapling::fetch {"url":"https://example.com"} returned a live response. Subsequent boots skip install via the prepared marker.

After merge: cut scrapling v0.2.2 so the registry bundle carries the split manifest.

Fixes MOT-3889

Folding install into scripts.start broke on the engine's boot script:
`exec {run_cmd}` binds exec to the FIRST command of a compound string,
so pip ran, exited, and the VM silently tore down before scrapling
install or the worker ever ran (crashloop with logs ending at pip).

The engine now allows scripts.install for bundle workers (same
publisher-shell trust context as scripts.start, run once via the
/var/.iii-prepared marker), so split the manifest back into
install/start:

- scrapling/iii.worker.yaml: install runs pip + browser download once;
  start is a single command again
- validate_worker.py: stop rejecting scripts.install for bundles
  (scripts.setup and non-preset runtime.base_image still rejected)
- _publish-registry.yml: bundle smoke-boot runs scripts.install
  synchronously before scripts.start, mirroring the engine
- _bundle.yml: comments updated

Verified locally: fresh install registers in ~90s and scrapling::fetch
returns a live response. Requires the engine changes on iii PR #1937.

Fixes MOT-3889
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 6, 2026 10:15pm
workers-tech-spec Ready Ready Preview, Comment Jul 6, 2026 10:15pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@andersonleal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa7a4c59-75f2-4919-b775-48d887e06b91

📥 Commits

Reviewing files that changed from the base of the PR and between c900cf4 and 2a13c99.

📒 Files selected for processing (4)
  • .github/scripts/validate_worker.py
  • .github/workflows/_bundle.yml
  • .github/workflows/_publish-registry.yml
  • scrapling/iii.worker.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch andersonleal/mot-3889-bundle-scripts-install

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 35 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@andersonleal
andersonleal merged commit d5f6ce9 into main Jul 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant