Repository navigation
refactor: a backend describes a run, and the machine acts - #587
Merged
vjaganat90 merged 2 commits intoNov 24, 2026
Merged
Conversation
vjaganat90
force-pushed
the
feat/sites-backends-describe
branch
6 times, most recently
from
November 13, 2026 19:12
0dc6fe4 to
0b1b651
Compare
This was referenced Nov 13, 2026
vjaganat90
force-pushed
the
feat/sites-backends-describe
branch
4 times, most recently
from
November 18, 2026 23:39
1aa18fc to
0ce8cd1
Compare
vjaganat90
force-pushed
the
feat/sites-backends-describe
branch
from
November 23, 2026 17:48
8689def to
86340d1
Compare
vjaganat90
force-pushed
the
feat/sites-backends-describe
branch
from
November 23, 2026 18:39
86340d1 to
1f46a7d
Compare
added 2 commits
November 23, 2026 14:04
A workflow runs on this machine, or on a cluster through its compute service. This sets out Sites: Sophios stays a local install and starts the target's runner on any computer you can ssh to, as one Slurm leader job or a detached process, from the bin folder you name, in four PRs. The first, S1, splits the backends of the target table so that each describes a run and only this machine's part acts, with local runs byte for byte as they are. The Nextflow design no longer counts the questions a backend answers, which S1 adds to.
launch reads nothing of this machine: run_local places a local run (its paths, the default output directory, this process's environment) before the backend launches it, and a runner's own name is the program another machine runs. prepare is write, which returns the folders the runner's machine must make, then this machine's check, pulls and folders; needs says what a check judges. A CWL runner's write leaves the files its prepare leaves, the job's empty directory in the runner's own form. outcome reads through read and writes nothing, and the run writes the summary a runner printed. Local runs are what they were on PolusAI#609: 39,300 launches, and the command line over the 456 .wic files of docs, examples and tests, with no difference.
vjaganat90
force-pushed
the
feat/sites-backends-describe
branch
from
November 23, 2026 19:04
1f46a7d to
c84b7e6
Compare
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.
What
The first of four PRs for Sites, running a workflow on any computer you can
sshto, whose whole design is added here asdesign_docs/sites-design.mdin its owndesign:commit. A site needs a run's description without this machine's actions, so each backend of the target table now describes a run, and onlyprepareacts on this machine. Nothing a user sees changes.launchis pure: no.resolve(), noPath.cwd(), noos.environ, no clock.Launch.envholds the run's variables alone (andNXF_SYNTAX_PARSER=v2for Nextflow), andLaunch.cwdis None for a CWL runner, meaning wherever it is started. The newrun_local.launch(request, backend)places a local run as each backend did before: the base path absolute and resolved, the output directory absolute and resolved or the default<basepath>/outdir_<the runner's name up to its first '-'>_<name>_<time>(stilloutdir_cwltool_andoutdir_toil_), the cache directory absolute, and this process's environment under the run's. A site runs the launch as the runner's ownname(cwltool,toil-cwl-runner,nextflow), which feat(run): runner values on run(), and one run for both doors #600's runner values state, so the backend names noprogram.prepareiswrite, then this machine's part.Backend.writeandrun_setup.writewrite the run's files under a folder and nothing elsewhere, and returnrun_setup.Prepared, which gainsfolders: the output-target Directories Nextflow stages, sorted by input name, which the runner's machine makes before the run. Nextflow'spreparemakes those that do not exist yet; the CWLpreparecallswrite, and calls it again for--docker_remove_entrypoints.needs(documents, jobs) -> preflight.Needssays what a run asks of its machine, and the pre-flight judges it on this one:preflight.readyfor a CWL run, whose check feat(run): runner values on run(), and one run for both doors #600 took out of the protocol, and Nextflow's owncheck(needs, run).Needs.imagesreplaces_image_names; Nextflow'sneedsreads its images from the pipeline.outcome(request, exit_code, stdout, log, read)takes the log as text, reads the files the backend itself names (cwltool's summary, Nextflow's names file) throughread(name), relative to the run's folder, and writes nothing;Outcomelosessummary.RunHandlewritesoutput_<name>.jsonwhen the runner does not write its own (Backend.writes_summary, true only for cwltool) and there are outputs, and prints the summary line exactly when it did before.The design also records the owner's decisions through 2026-11-11 (22 to 25): no site runs cwltool, Sites sets no QOS, every step job gets one time, and what a site sets for Nextflow is a block appended to the run's copy of
nextflow.config. With cwltool off the sites, S1 no longer addsRunRequest.pulled, which only cwltool on a site needed.The protocol as built, and the three choices it makes beyond the design's text (the program is the runner's, in neither
Needsnor the backend, the log as text withreadfor the backend's own files,writes_summary), are indesign_docs/sites-design.md§6.1.What changes for callers
Nothing on the command line, and nothing a local run writes or starts. Inside the package:
Backendgainswriteandneeds,NextflowBackend.checktakes apreflight.Needs,Backend.outcometakes the log as text and aread,Outcome.summaryis gone, and aLaunchcarries the run's variables alone;run_local.launchgives the launch a local run starts.Deleted
backends._runner_outdirandbackends._environment:run_local.launchdoes their work.backends._log_lines: an outcome gets the log as text.preflight._image_names:Needs.images.Local runs are byte for byte what they are on master. CI does not check it, so I did, outside the suite as #586 did for its own change: #586's tip and this PR's tip, with the same version file, the clock pinned and the pre-flight's machine answers stubbed, over 189 workflows. The 158
.wicfiles ofdocs/,examples/,tests/and both corpora each went through--generate_run_script,--run_localand--checkwith each runner, and the 31 Python workflows ofdocs/cookbook,examples/workflowsand image-workflows throughrun()andrun(generate_run_script=yes): 1608 cases, 325run.shfiles, 325 launches (argv, the variables added, working directory, output directory), 7521 written files, 1210 questions the pre-flight was asked, and every case's stdout and stderr. One file differs:error_w.txt, the traceback of a crash both sides have (tests/core/data/run_paths/inline_body/w.wicunder--check, with cwltool and with Toil), whose frames name the source tree and its line numbers. 668 cases exit non-zero and 40 raise, identically on both sides (fragments, refusal fixtures, Nextflow refusals). Measured again after #586 was rebased onto master (its tip2c4a7229, withsrc/changes under this PR), and again afterRunRequest.pulledwas removed (2026-11-11): the same counts and the same one differing file each time. Measured again on #586'sae0ef80e(2026-11-12), whose change tobackends.pythis PR's conflict was resolved against: the same counts and the same one differing file. Measured again on master123ab482(2026-11-13), after #586 and #598 merged, over master's own tree and both corpora: 551 workflows (520.wicfiles ofdocs/,examples/,tests/and both corpora, and 31 Python ones), 4866 cases, 452run.shfiles, 452 launches, 9074 written files and 1729 questions the pre-flight was asked; 3545 cases exit non-zero and 40 raise, identically on both sides. The one differing file is the sameerror_w.txt, whose frames differ in their line numbers alone.Why
A site runs a backend's launch on another machine. A launch that reads this machine's working directory, links, environment or clock would hand the site this machine's paths, and an outcome that writes would write here what belongs there. Splitting what a backend describes from what this machine does, with no change locally, lets S2 to S4 add
sophios.siteswithout touching how a local run goes.Verified
d553d7a8, whose tree is the tree of the feat(compute): run a workflow on the compute service with Nextflow #597 head this chain sat on (81995735), so each PR's tip has the content it had: a replay with no conflict, and nothing run again.git range-diffshows the 11 commits unchanged.4b11628d). This PR sits on feat(compute): run a workflow on the compute service with Nextflow #597 (81995735) and is two commits again (1f46a7dc): the fix that drops schema-salad's warning, its third commit since 2026-11-20, is feat(compute): run a workflow on the compute service with Nextflow #597's first now. The three sentences of the sites design about Docker (the Docker bullet, the Apptainer non-goal and decision 19) are written here as feat(compute): run a workflow on the compute service with Nextflow #597 used to rewrite them: Docker only is the restriction of the pipelinecompile()writes, which a site runs. The chain's new top is its old top with the codes renumbered, byte for byte, but for three things: wherewic061sits in the code table and in the provocations, now in the order of the numbers, and feat(compute): run a workflow on the compute service with Nextflow #597's test fix. Checked at this PR's tip, before feat(compute): run a workflow on the compute service with Nextflow #597's test fix beneath it:mypy(237 files) clean, every test module imports (519 tests), the census of codes passed, andtest_compute.py,test_backends.py,test_diagnostics.py,test_ci_coverage.pyandtest_entry_points.py: 64 passed. The whole lanes are CI's.4b11628d), seven commits on from252d37a2: master deletes thepython_scriptstep with its codewic014, and says why the warning refactor: a backend describes a run, and the machine acts #587 drops is filtered. Two conflicts here, both in the third commit's files, which is now86340d14. Intest_python_api_workflow.py, master movedimport_python_fileto the test helpers and dropped the imports its deleted tests used; this PR'slive_workflowandTestCasesit beside master's. Inplugins.py, master reworded the comment above the filter class this PR deletes, to say why the warning is filtered. The class is still deleted, and the reason moved with the filter: the comment inutils_cwlnow also says that CWL scopes an input and an output together, and that Emit adds no duplicate of its own.git range-diffshows no other change to a commit. Checked at the chain's top (481a8a04), not by the lanes, which CI runs:mypyas the pre-commit hook runs it, clean; every test module imports (595 tests collected); nothing in the chain names what master deleted. The property that holds the fix and therun()test that useslive_workflowpass there.8689def3): the id warning is dropped wherever CWL is loaded. No test is added. The property that builds one tool through every door (test_a_built_tool_is_one_step_through_every_door, in the package job) now asserts that no door logs a line, with a tool whose input and output share a name among its examples: before the fix it failed with schema-salad's warning from each door's compile, and it passes with it. Outside the suite,cwltool_filterlog --validateon such a tool prints neither line wherecwltool --validateprints both, so the runner's process is as quiet as it was. At this PR's tiptest_python_api_workflow.py,test_run_local.py,test_plugins.py,test_backends.pyandtest_python_api_tool_builder.py: 90 passed;mypy,autopep8andlint-imports(8 contracts kept) clean,pylintwith no new message. On mastercompile()andcheck()each print the warning for such a tool; at the chain's top (feat(compute): run a workflow on the compute service with Nextflow #597,ff46b27e) neither does. There the same files withtest_sites.py,test_basepath.pyandtest_compute.py: 200 passed, the walk's two Nextflow cases among them in a second run with Nextflow 26.10.5 on the path;mypy(252 files) clean. The differentials and the mutation batch below were not run again.docs/tool-builder.mdloses aResolvedline its example does not print.252d37a2, whose tree is the tree of the feat(lang): write a tool in .wic #609 head this chain sat on (603c2194), so each PR's tip has the content it had: a replay, with nothing run again.603c2194). feat(lang): write a tool in .wic #609 moved three times during the day (aef7ab98,681d54c6,603c2194) and the chain's 15 commits were replayed onto each. Three conflicts in all: two in feat(compute): run a workflow on the compute service with Nextflow #597 (the runtime adapter's imports, where feat(lang): write a tool in .wic #609 droppedlang.tool; the Compile row of the layer table indocs/checks-and-errors.md, which is feat(lang): write a tool in .wic #609's withwic067at its end) and one in feat(sites): run a workflow on a machine of your own over ssh #588 (the provocations table, where feat(lang): write a tool in .wic #609 removed theINVALID_NAMEentry the hunk sat beside).git range-diffshows no other change to any commit than the codes. What was run locally, and where: ataef7ab98, the whole chain was gated once at feat(compute): run a workflow on the compute service with Nextflow #597's tip as master's lanes run (mypy251 files,lint-imports8 contracts kept,pre-commit,autopep8,pylint9.95 as feat(lang): write a tool in .wic #609's tip, the chain adding the twotoo-many-linesmessages of feat(compute): run a workflow on the compute service with Nextflow #597;test_entry_points.pywithtest_ci_coverage.py12 passed; the census of codes 4 passed; the package job's selection 465 passed, 8 skipped; the Nextflow Runtime step 32 passed), with six failures, each reproduced on feat(lang): write a tool in .wic #609's head alone: the five known on this Mac (macOSwcpadding, four cases; Python 3.14'sPurePath.as_uri()deprecation, one) and one Hypothesis draw oftest_a_scatter_records_what_cwl_defines_for_its_methodwhose captured text passes the 64 KiBloadContentstakes. At681d54c6and603c2194each commit passed its pre-commit hooks,mypyamong them, and nothing else was run locally: CI is the gate for this head.run_setup,backends,run_local,targetsorrunners. Measured against feat(lang): write a tool in .wic #609 ataef7ab98, outside the suite: 39,300 launches as one on both sides; the 494.wicfiles ofdocs/,examples/andtests/through the command line, 4446 cases, 505run.shfiles, 2685 files, 1638 pre-flight questions, with no difference (3654 exit non-zero on both sides); mutation, 29 of 29 caught. Not measured again at603c2194.b7ff2244), which carries fix(plugins): read a tool when a step runs it #608 and the tool documents. The whole chain was gated once at feat(compute): run a workflow on the compute service with Nextflow #597's tip, which contains this PR (CI runs each PR on its own), as master's lanes run:mypy(251 files),lint-imports(8 contracts kept),pre-commit runfrom feat(lang): write a tool in .wic #609's tip to the top (22 hooks),autopep8,pylint src/ examples/**/*.py tests/(9.96, feat(lang): write a tool in .wic #609's tip 9.95; the chain adds two messages to feat(lang): write a tool in .wic #609's, bothtoo-many-linesand both in feat(compute): run a workflow on the compute service with Nextflow #597:_workflow_runtime.pyat 763 lines andcompute.pyat 751) andmake html, whose pages are written, the code table listingwic057towic067and the contents the Sites page, and whose one warning is intersphinx's inventory fetch, which this network's proxy refuses and the docs Makefile now makes an error, on feat(lang): write a tool in .wic #609's tip alike;test_entry_points.pywithtest_ci_coverage.py12 passed; the census of codes (test_lang_parser.pyand its three siblings,-m skip_pypi_ci) 4 passed; the package job's selection (-m "not skip_pypi_ci and not nextflow and not cwl_corpus") 502 passed, 8 skipped; Lint And Test's Nextflow Runtime step with Nextflow 26.10.5 33 passed. Five cases fail on this Mac at this tip and at feat(lang): write a tool in .wic #609's alike:[commands]and[nested]oftest_an_example_runs_under_cwltool_as_statedand oftest_an_example_workflow_runs_under_nextflow_as_stated(macOSwcpads its count), andtest_cookbook.py::test_every_pair_compiles_alike_from_both_surfaces_and_as_stated, which stops on Python 3.14's deprecation ofPurePath.as_uri()in master'slang/cwl.py. The gate ran on feat(lang): write a tool in .wic #609 at0801d5bc; feat(lang): write a tool in .wic #609 was then rebased onto master asb7ff2244with the same tree, and the chain replayed onto it, changing one line of the design.ToilBackend.empty_directory) and builds no-entrypoint images for the workflow's images only (plugins.remove_entrypoints).run_setup.writetakes the runner's form;_preparestates once how the run is written and writes twice with it, the second time the workflow and its analyses naming the no-entrypoint images. A new test, in the package job, holds each CWL runner'swrite, which a site calls, to the files itsprepareleaves here, the job's empty directory in the runner's own form: before it, nothing called a CWL runner'swritein this PR. Design §6.2 and §16 say so.0801d5bc, the tree ofb7ff2244), outside the suite, on this PR's final tip. The launch: 39,300 requests launch as one on both sides: argv, variables, working directory and output directory. The command line: the 456.wicfiles ofdocs/,examples/andtests/, each with each runner through--checkand--generate_run_script, and that again with--outdirand--quiet: 4104 cases, 469run.shfiles, 2541 files, 1542 pre-flight questions and every case's stdout and stderr, with no difference; 3366 cases exit non-zero on both sides, each compared as it ends. The corpora,--run_local,--docker_remove_entrypointsand the Python door were not measured again.write, inprepareand in the run's writes, and the no-entrypoint images built and named in the workflow and in its analyses. The form in the second write was held by no test until_preparestated the write once.runner=. Since decision 22 a site runs each target with one runner, so the runner follows fromtarget=. Locally feat(run): runner values on run(), and one run for both doors #600 made the runner a value,run(runner=Toil(...)); a site taking that value would take settings that are this machine's and flags that compete with the ones the site sets. The design this PR adds says so in §4, §5, §10, §13 and §16; the code is feat(sites): run a workflow on a machine of your own over ssh #588's to feat(sites): run Nextflow on a Slurm cluster #590's.05d2533a), which sits on master with feat(run): runner values on run(), and one run for both doors #600's runner values. The whole chain was gated once at feat(compute): run a workflow on the compute service with Nextflow #597's tip, which contains this PR (CI runs each PR on its own), as master's lanes run:mypy(247 files),lint-imports(8 contracts kept),pre-commit runfrom refactor: one statement for each fact, in docs, tests and the Nextflow target #605's tip to the top (22 hooks),autopep8,pylint src/ examples/**/*.py tests/(9.95) andmake html(its code table listswic057towic067, its contents the Sites page);test_entry_points.pywithtest_ci_coverage.py12 passed; the census of codes (test_lang_parser.pyand its three siblings,-m skip_pypi_ci) 4 passed; the package job's selection (-m "not skip_pypi_ci and not nextflow and not cwl_corpus") 440 passed, 8 skipped; Lint And Test's Nextflow Runtime step with Nextflow 26.10.5 33 passed. Five cases fail on this Mac at this tip and at refactor: one statement for each fact, in docs, tests and the Nextflow target #605's alike:[commands]and[nested]oftest_an_example_runs_under_cwltool_as_statedand oftest_an_example_workflow_runs_under_nextflow_as_stated(macOSwcpads its count), andtest_cookbook.py::test_every_pair_compiles_alike_from_both_surfaces_and_as_stated, which stops on Python 3.14's deprecation ofPurePath.as_uri()in master'slang/cwl.py.RunSettings, with itsnameand itsprogram, and took a CWL run's check out of the backend protocol. SoBackend.programis gone,Backend.checkis not in the protocol,run_local.launchnames the default output directory after the runner's name and makes itscachedirabsolute, andrun_setup.writeno longer makes the job's paths absolute, whichtargets.for_rundoes before the lowering.main.pyis untouched: master'spreflight.readyreplaced the raw-CWL check this PR had edited. Design §6, §6.1 and §6.2 say so..wicfiles ofdocs/,examples/andtests/, each with each runner through--checkand--generate_run_script, and that again with--outdirand--quiet, the clock pinned and the machine's answers stubbed: 4077 cases, 461run.shfiles, 2501 files, 1510 pre-flight questions and every case's stdout and stderr, with no difference; 3351 cases exit non-zero on both sides, each compared as it ends. The corpora,--run_localand the Python door were not measured again.programstands for a backend'sprogrammisnamed), and two the port moved intorun_local.launch: the cache directory made absolute, and this process's environment under the run's.123ab482, the whole chain was gated once at feat(sites): run Nextflow on a Slurm cluster #590's tip, which contains this PR (CI runs each PR on its own), as master's lanes run:mypy(249 files),lint-imports(7 contracts kept),pre-commit run --from-ref 123ab482 --to-ref HEADover every file the chain changes,autopep8andpylint src/ examples/**/*.py tests/as Lint And Test runs them (9.94; the two messages it gave on lines the rebase wrote were then fixed in refactor: a backend describes a run, and the machine acts #587's code commit, a comment and a docstring's wrap, and checked again), andmake htmlwith no warning but intersphinx's two inventory fetches, which this network's proxy refuses;test_entry_points.pywithtest_ci_coverage.py16 passed; the package job (python -m pytest -m "not skip_pypi_ci and not nextflow and not cwl_corpus") 413 passed, 8 skipped; Lint And Test's Nextflow Runtime step with Nextflow 26.10.5 (pytest tests/core/nextflow tests/core/test_sites.py -m "nextflow and not nextflow_corpus") 31 passed, the walk's runs on a machine and on Slurm among them. Each of the two failed the same two cases, which fail on master here too:test_an_example_runs_under_cwltool_as_statedandtest_an_example_workflow_runs_under_nextflow_as_stated,[commands]and[nested], whosewccount macOS pads and GNU's does not (CI runs Ubuntu).--collect-onlyshows the walk'smachine-nextflowandslurm-nextflowcases collected by the Nextflow Runtime step and the weekly Python matrix, and by no lane without Nextflow. The counts below are this PR's own, from before these changes, under Nextflow 26.04.2; those of the nextflow lane were measured there, before feat: one table of targets, and nf-s codes for Nextflow refusals #586 removed it.run_setup.writenow takes the run'soutput_targets, aspreparedoes, and the CWL backend'swritepassesoutput_target_inputs(view). Master had foldedtests/core/test_backends.py,test_run_local.pyandtest_python_api_workflow.pyinto fewer tests; this PR's checks now sit in them, below.mypy,lint-imports(7 contracts kept),pylint src/and the changed tests (no new message),autopep8 --exit-code --recursive --diff --max-line-length 120: clean.python -m pytest -m "not skip_pypi_ci and not nextflow" -k "not test_cwl_docker_extract", 2807 passed), the weekly property lane's list withproperty_weekly.yml's renamed node id (29 passed),run_workflows.yml'stest_python_api_workflow.pystep (125 passed), the nextflow lane's three steps with Nextflow 26.04.2, then the pinned one, since replaced by Lint And Test's Nextflow Runtime step (81, 5 and 1349 passed), andtest_ci_coverage.pywithtest_entry_points.py(17 passed).tests/core/test_backends.py, the argv property launches throughrun_local.launchand finds cwltool pulling no image; the backend of every runner ofrunners.RUNNERSlaunches from a relative base path through a link with the working directory and the environment changed between two launches (3 cases, about 0.4 s); cwltool's outcome reads its own summary, Toil's reads throughreadand writes into no folder, and master's Nextflow test checksfolders, a check making none, and reads its outcomes throughread; arunner-transcriptscase keeps cwltool's own summary byte for byte; and master'srun()test finds--docker_remove_entrypointsrewriting a real-time analysis's images through the secondwrite. 117 test lines are added against 237 insrc/.Path.cwd()or readingos.environ, andrun_local.launchnot resolving it; a backend'sprogrammisnamed (Toil, Nextflow) and the default output directory named after the whole program; cwltool pulling the images the pre-flight pulled; Toil's outcome writing the summary; the run writing no summary, overwriting cwltool's own, or naming it with no outputs; cwltool's summary not its own, not read, or read after a failed run; Nextflow'swritemaking its folders or returning none, and itspreparemaking none; Nextflow'sneedsnaming no image, and its outcome reading another names file; and the secondwritekeeping the analyses' entrypoints.