Skip to content

feature/SOF-8004 feat: add Custom Python Script workflow - #150

Open
VsevolodX wants to merge 7 commits into
mainfrom
feature/SOF-8004
Open

feature/SOF-8004 feat: add Custom Python Script workflow #150
VsevolodX wants to merge 7 commits into
mainfrom
feature/SOF-8004

Conversation

@VsevolodX

@VsevolodX VsevolodX commented Aug 20, 2026

Copy link
Copy Markdown
Member

Part of SOF-8004 — "Create NB for Custom Python Calculation". Merge this one first; the api-examples notebook resolves this workflow by name, and web-app seeds it into the workflow bank for UI use.

What

A Custom Python Script workflow (+ subworkflow) that runs a user-supplied Python script against a material. Minimal four-unit chain:

unit role
io-user-files — io, object_storage fetches the uploaded script and every file it reads — including its settings.json parameters — onto the compute node. input is filled per job, since the objects only exist once uploaded
io-material — io, api fetches the job's material
assign-material MATERIAL = DATA[0], into workflow scope for the runner
custom_script — executionBuilder runs it

Script parameters deliberately travel as an uploaded settings.json, not a dedicated assignment unit: re-running a saved workflow with new parameters means overwriting one small object, with no edit to the workflow itself.

Why the existing hello_world flavor, and not a new one

A first pass added a custom_script flavor with the runner as a standata template. That fails hard: the flavor name in a saved workflow is resolved against every consumer's ApplicationRegistry — Python standata inside JupyterLite, npm standata in both the web-app server and the browser — so any client without the release dies with Flavor custom_script not found. Observed in a browser during development.

hello_world already provides the two input slots needed (script.py, requirements.txt), whose contents the caller sets per job.

Also here

@mat3ra/ide repointed at its published npm version 2026.8.18-0 — the wip-88b8881 tarball it referenced was removed by the stale-WIP cleanup, which broke npm install (and therefore all CI on this repo, main included).

Verification

Exercised end to end against a local platform and the real compute cluster, via the api-examples notebook and its Cypress feature: three jobs, all four units finished, results fixed by crystal structure (Si → 4, graphene C → 3 coordination; diamond C → 4 at cutoff_scale 1.3 via a re-uploaded settings.json on the saved workflow). npm run build clean; unrelated build drift in data/workflows/workflows/vasp/neb.json deliberately left out.

🤖 Generated with Claude Code

Runs a user-supplied Python script against a material. The unit chain is the point: an
object_storage IO unit fetches the uploaded script and any files it reads - the script's own
parameters travel as one of those files - an api IO unit fetches the material, and an assignment
puts MATERIAL into the workflow scope for the runner to write out as material.json.

Uses the existing hello_world flavor rather than a new one. The flavor name in a saved workflow is
resolved against every consumer's ApplicationRegistry - Python standata in JupyterLite, npm
standata in the web-app server and browser - so a new flavor makes any client without the release
fail with "Flavor ... not found". hello_world already provides the two input slots needed
(script.py, requirements.txt), whose contents the caller overrides per job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The wip-88b8881 release tarball the pin referenced was removed by the stale-WIP cleanup, so npm
install 404s and every CI run on this repo fails at the install step - main included. The package
is published to the registry; 2026.8.18-0 is the same content the tarball carried.

[release] so the standata WIP tarball for this branch republishes on top of the fixed install.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@VsevolodX VsevolodX changed the title feat: add Custom Python Script workflow (SOF-8004) feature/SOF-8004 feat: add Custom Python Script workflow Aug 21, 2026
VsevolodX and others added 5 commits August 21, 2026 13:59
io-user-files carried an explicit flowchartId that nothing read - the builder generates one, as it
already does for assign-material and custom_script. io-material's must be pinned because
assign-material reads its scope by id, but the invented hex suffix said nothing; it is now
custom-script-io-material, namespaced so it cannot clash with another subworkflow fetching a
material in the same workflow.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…cript [release]

Same four-unit chain - io(object_storage) for user files, io(api) for the
material, assignment of MATERIAL, and an execution unit built from the shell
app's default hello_world flavor. One pinned flowchartId, custom-shell-io-material,
because assign-material reads that unit's scope; everything else takes builder
UUIDs. Enables notebooks where the user's shell script runs any node-side
application (e.g. Quantum ESPRESSO) against uploaded files.
…d version [release]

CI on every branch, main included, fails with a 404 on
wip-8b2c388/utils.tgz - the WIP release has been cleaned up. Same failure and
same fix as the @mat3ra/ide pin earlier on this branch: pin the latest
published version (2026.8.18-1).
…d version [release]

Second and last dead WIP pin (swept the whole package.json this time): the
wip-1d8901b prode tarball is gone the same way the utils one was. Pinned the
latest published 2026.8.18-0.
Main brought the nwchem relaxation assets, the espresso formation-energy fix and
the published-version repins; this branch adds the Custom Python Script and
Custom Shell Script workflows. The two generated data modules conflicted and
were regenerated by the build rather than merged by hand; both custom workflows
and main's additions are present in the built output.
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