Repository navigation
feat(runner): add pandoc and WeasyPrint for offline PDF rendering - #2
Merged
Merged
Conversation
Static pandoc 3.11 (sha256-pinned), WeasyPrint's Pango/HarfBuzz runtime libs, and weasyprint + mermaidx in /pkgs, so the apro-pdf skill can render branded PDFs inside the jail without Chrome or network.
|
nice! go ahead and merge |
busla
pushed a commit
that referenced
this pull request
Nov 20, 2026
Static pandoc 3.11 (sha256-pinned), WeasyPrint's Pango/HarfBuzz runtime libs, and weasyprint + mermaidx in /pkgs, so the apro-pdf skill can render branded PDFs inside the jail without Chrome or network. (cherry picked from commit d4fd61d) Also carries: feat(runner): render office documents and OCR text in the sandbox (#6, 380589e), folded in when replaying onto v1.11.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@busla, this is a small add-on to your branch for #769.
Why
We want the
apro-pdfskill (aproorg/apro-skills#23) to run in the code interpreter, so a branded PDF comes back as a chat attachment. The sandbox has no Chrome and no network, so the skill got an offline path: pandoc → WeasyPrint, with Mermaid pre-drawn bymermaidx(real mermaid.js v11 in embedded QuickJS). This PR puts those tools in the runner image. The nsjail/seccomp policy doesn't change.What
api/Dockerfilepandoc-fetchstage: official static pandoc 3.11, sha256-pinned perTARGETARCH, copied to/usr/local/bin/pandoc(/usris mounted in the jail; bookworm apt only has 2.17, and apt is deleted later anyway).sandbox-build: WeasyPrint runtime libslibpango-1.0-0 libpangoft2-1.0-0 libharfbuzz-subset0.docker/package-init.sh:weasyprint==70.0,mermaidx==0.9.5(pinned). Their deps resolve for Python 3.14 on aarch64 (quickjs-ngabi3 wheel).Verified (local arm64 build,
--target lambda-microvm-runner)pandoc --version→ 3.11./pkgs/python/3.14.4importsweasyprint70.0 andmermaidx, and renders a PDF with Icelandic text.--network none --memory 512m,/etc/fontshidden like in the jail, and the skill mounted read-only at/mnt/data/skills/apro-pdf. A 615-line SOW with 3 Mermaid diagrams →CHECKS: OK, 25 pages, brand fonts embedded, 8.7 s./executepath. No seccomp change is expected: no browser, no sockets, nomemfd_create.Size
About +190 MB on a ~5.2 GB image. Almost all of it is the static pandoc binary (168 MB). WeasyPrint + mermaidx add ~17 MB, and the Pango libs a few MB.
Rollout (after merge into your branch)
Rebuild the runner through the workflow, register a new MicroVM image version with
tools/code-interpreter/create-microvm-image.sh, and bumpcode_interpreter_runner_image_versionfor apro-sandbox in #769.