Repository navigation
MILAB-7089: Fix the block on a backend without Docker - #7
Merged
Merged
Conversation
A backend without Docker installs Python packages offline from the run environment. The base `3.12.10` run environment does not have the pinned `llvmlite`, `numba` and `numpy` versions, so the install failed. - Use the `3.12.10-pgen` run environment. Catalogue `1.14.1` maps it to pgen `0.3.0`, which bundles the block pins. - Start worker processes with `spawn`. Windows has no `forkserver`. On Linux and macOS, the `forkserver` socket path in a deep work directory can be longer than the system limit. - Update the SDK with `pnpm upgrade-sdk`.
`spawn` for every platform slows down worker start on the cluster. Use `forkserver` as before, and start it at once with `forkserver.ensure_running()`. Fall back to `spawn` only when it cannot start: - Windows has no `forkserver` (`ValueError`). - On Linux and macOS, a deep work directory makes the socket path longer than the system limit (`OSError: AF_UNIX path too long`).
Render the real `pgen-process` template on four CDR3s and check the Pgen and -log10 Pgen values. The test runs the offline `pip install` from the run environment, as a backend without Docker does. It fails when the run environment does not have the pinned wheels.
Collaborator
Author
PaulNewling
approved these changes
Oct 2, 2026
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.
Problem
The block fails on a backend without Docker, such as the desktop built-in backend (MILAB-7089):
Without Docker, the backend installs
requirements.txtoffline:pip install --no-index --find-links {runenv}/packages/. The block used the base3.12.10run environment, which does not have the pinnedllvmlite,numbaandnumpyversions. Docker mode installs from PyPI, so it did not show the mismatch.Change
software/package.json: userunenv-python-3:3.12.10-pgen. MILAB-7089: Pin pgen runenv to the Generation Probability set runenv-python-3#110 updated that variant to the block pins (pgen0.3.0). The catalog pin goes from1.8.2to1.14.1, which maps3.12.10-pgento0.3.0. No dependency is downgraded.software/src/main.py: keepforkserverworkers as the default, and fall back tospawnonly whenforkservercannot start.pool_context()gets theforkservercontext and starts the server at once withforkserver.ensure_running(). It falls back on:ValueError: Windows has noforkserver.OSError: theforkserversocket is created underTMPDIR, which is<main-root>/work/workdirs/<id>/.pl/tmp. With the default~/.platforma/backendroot this is about 100 characters, and the limit is 107 (Linux) or 103 (macOS). A longer user name or a custom root givesAF_UNIX path too long.forkserver unavailable (<error>), using spawnto stderr. The model reads only theprogress:andskipped:lines, so the progress output does not change.spawn, not the platform default, because the Linux default isfork, which is not safe with running polars threads.workflow/src/pgen-process.test.ts: a regression test. It renders the realpgen-processtemplate on four CDR3s and checks each Pgen and -log10 Pgen value. CI builds the software as binary only, so the test runs the same offlinepip installas a backend without Docker.pnpm upgrade-sdk: block-tools 2.16.6, tengo-builder 4.1.6, test 1.84.6, ui-vue 1.84.5.macOS Intel stays unsupported:
numba0.66 andllvmlite0.48 have no cp312 wheels for it.Tests
On a local backend 4.4.5 with Docker off, with only published packages (npm and
bin.pl-open.science):pgen-processtemplate ran on a 4-row input (TRB, TRB, IGH, TRA).pip install --no-indexfromrunenv-python-3.12.10-pgen/main/0.3.0-linux-x64passed. The venv has the 7 pinned versions.main.pyran without Docker. With a short main root (TMPDIR57 characters) it usedforkserver. With a deep main root (TMPDIR200 characters) it printed the fallback line and usedspawn. Both runs gave the same pgen values.pnpm testpassed (15/15 tasks). The new test takes about 76 s cold. It fails with thellvmlite==0.48.0error when the base run environment is restored, and it fails when one expected value changes by 1.3e-6 relative.pnpm checkpassed.llvmlite==0.48.0error. With a deepTMPDIR, theforkservercode gaveAF_UNIX path too long. The new code gives the same results as before.Not run on Windows or macOS. The pgen run environment built and passed its import checks on all four platforms in the runenv CI.
The PR appears safe to merge; no outstanding finding or new actionable defect was established.
Summary
The PR selects the pgen Python environment for Docker-free installation, restores forkserver workers with a spawn fallback, and adds an end-to-end scoring regression test.
3.12.10-pgen.forkserveris preferred, withspawnused when startup is unavailable.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[CDR3 and chain columns] --> B[pgen-process template] B --> C[Offline Python run environment] C --> D{Forkserver starts?} D -->|Yes| E[Forkserver workers] D -->|No| F[Spawn workers] E --> G[Pgen and -log10 Pgen results] F --> G G --> H[Regression test assertions]Reviews (2) · Last reviewed commit: "Test the Python scorer on the backend"