Skip to content

feat(app-page): one-click "Run on Neurodesk" launch - #15

Merged
nx10 merged 1 commit into
mainfrom
feat/run-on-neurodesk
Jul 10, 2026
Merged

feat(app-page): one-click "Run on Neurodesk" launch#15
nx10 merged 1 commit into
mainfrom
feat/run-on-neurodesk

Conversation

@nx10

@nx10 nx10 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds a "Run on Neurodesk" button to the configuration panel that turns the current tool config into a runnable notebook and launches it on Neurodesk Play — the free, public JupyterHub where the neuroimaging tools are already installed (CVMFS + lmod).

The generated notebook installs niwrap, loads the tool's Neurodesk module (from its neurodeskId), and runs the tool's compiled Python invocation (the same call the Python tab shows), falling back to niwrap.execute(config) when the compiler can't render it.

How it launches

The button is a split button:

  • Main → one-click launch on the nearest Play hub (auto-detected).
  • Caret ▾ → region picker: Auto (nearest) / US · GitHub login / Europe · GitHub login / Australia · AAF login.

Delivery paths:

  • One-click (default): the hub posts the gzip'd notebook to a small Cloudflare Worker launcher (separate deploy) that serves it as a throwaway git repo, so Play's nbgitpuller clones it. The launcher URL defaults to the deployed instance and is overridable with VITE_NEURODESK_LAUNCHER_URL.
  • Fallback: if the launcher is unset (empty env), or a large config would overflow the launch URL, the hub downloads the .ipynb and opens the regional hub.

This PR is the hub side only and works standalone (falls back to download without a launcher). The launcher (git-over-HTTP smart-protocol emulation + region auto-detect) lives in a separate repo/deploy.

Notes

  • New pure, unit-tested service src/lib/services/neurodesk/ (notebook builder, launch-URL builder, region helpers).
  • neurodeskId comes from the catalog manifest (PackageType.neurodeskId); falls back to a best-effort package→module map.
  • Verified end-to-end live against hosted Neurodesk Play (clone + run fsl.bet on an OpenNeuro dataset).
  • No new deps; 220 unit tests pass, svelte-check clean.

Turn the current tool config into a runnable notebook and launch it on
Neurodesk Play (the free public JupyterHub, tools preinstalled via CVMFS/lmod).

The notebook installs niwrap, loads the tool's Neurodesk module (from its
neurodeskId), and runs the tool's compiled Python invocation (the same call
the Python tab shows), falling back to niwrap.execute(config) when the
compiler can't render it.

The config panel gets a "Run on Neurodesk" split button:
- main: one-click launch on the auto-detected nearest Play hub
- caret: region picker (Auto / US / EU / AU)

When a launcher Worker is configured (defaults to the deployed instance,
overridable with VITE_NEURODESK_LAUNCHER_URL) the hub posts the gzip'd
notebook to it and the Worker serves it as a throwaway git repo for Play's
nbgitpuller. Oversized configs, or no launcher, fall back to downloading the
.ipynb and opening the regional hub.
@nx10
nx10 merged commit 2efe1d0 into main Jul 10, 2026
4 checks passed
@nx10
nx10 deleted the feat/run-on-neurodesk branch July 10, 2026 05:03
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