Wanderland

Tutorial — publish an nf-core pipeline to DataHub

Companion to advaita-declarative-pipeline-publishing. This is the walkthrough we hand a developer (and, later, a scientist). If any step here feels heavy to us, it will feel heavy to them — that's the signal to cut, not to explain harder.

Goal: get nf-core/rnaseq into DataHub's Run Workflow catalog. No image build, no driver repo, no DataHub release.

Time: one file, one command, one refresh.


Before you start

You need:

That's the whole prerequisite list. If it grew past this, the design failed.


Step 1 — write the registration document

One file, and a curator writes it — not the end scientist. (The scientist is the biologist who later picks files in the catalog; the curator is whoever turns a pipeline's ~133 params into the handful worth showing.) It's a few fields plus a size hint, and it looks like a wisp template because it is one:

# rnaseq.yml
id: rnaseq-star-salmon
pipeline:
  nf_core: nf-core/rnaseq       # or `repo: advaita-corporation/<fork>` for a fork
  revision: "3.26.0"            # you type a tag; the platform pins it to a commit SHA for you
size: large                     # a t-shirt hint — STAR's index is memory-hungry
parameters:                     # what the user sees in the catalog form
  properties:
    input:                      # a FILE the user picks (format: file-path)
      { type: string, format: file-path, pattern: "\\.csv$",
        description: "Samplesheet — sample, fastq_1, fastq_2, strandedness" }
    genome:
      { type: string, enum: [GRCh38, GRCm39], description: "Reference genome" }
    aligner:
      { const: star_salmon }    # you pin this; the user never sees it
  required: [input, genome]

You wrote id, pipeline, size, and parameters. You did not write: an image, a service account, credentials, Kubernetes, tenancy ids, or per-process CPU/memory — the platform fills those. Your job is choosing which of the pipeline's params a scientist should see (here, 3 of rnaseq's 133) and which files they pick. That curation is the product.

Two levers do most of the work, both plain JSON Schema: const pins a value and hides the control (aligner: star_salmon), and narrowing an enum turns a free-text field (genome) into the few references we actually host.

Step 2 — publish

The scientist-facing thing is a publish job with the wisp URL and credentials already wired — they run it, they don't type an endpoint. Under the hood it's one POST:

# what the generated publish job runs for you:
curl -s -X POST http://wisp.vivarta-drivers.svc.cluster.local:9321/register \
  -H 'content-type: application/json' \
  --data-binary @rnaseq

Publishing does two things and tells you if either fails:

A clean publish returns the registered template and a link to it in the catalog.

Step 3 — see it in the catalog

DataHub reads registered templates on its refresh and folds them into Run Workflow. Confirm it's live:

curl -s http://wisp.vivarta-drivers.svc.cluster.local:9321/templates | jq '.value[] | select(.id=="rnaseq")'

If it's in that list, it's in the catalog. DataHub validates the offer on its side (reject-and-keep-previous, so a bad entry can never blank the catalog) and renders your parameters block as the input form.


Step 4 — run it (what the user does)

The user picks RNA-seq in the catalog, sets genome: GRCh38, leaves aligner on its default, and hits run. DataHub submits:

curl -s -X POST http://wisp.vivarta-drivers.svc.cluster.local:9321/submit \
  -H 'content-type: application/json' \
  -d '{
        "job_type": "rnaseq",
        "params":   { "genome": "GRCh38", "aligner": "star_salmon" },
        "data":     { "reads": "hub://<file_id>" },
        "tenancy":  { "org_id": "advaita", "owner_id": "u-31f2" }
      }'

wisp matches your record, cold-starts the sizing from a safe default (and right-sizes from the run's own trace next time), and the shared base image runs nextflow run nf-core/rnaseq -r 3.26.0 stock — with params.genome and params.aligner at the top level where the pipeline actually reads them. No rnaseq-specific image ever existed.

To change or remove it

The honest-complexity check

Walk it and mark each step. After the three-field cut, here's where it stands:

step 1 (write the doc):   three fields you already know — id, pipeline, parameters.
                          no sizing, no processes, no image, no tenancy. "naming a pipeline." ✓
step 2 (publish):         one job, one readable error on failure. the scientist never types
                          the endpoint — the generated job carries the URL + creds. ✓
step 3 (verify):          the publish response hands back the catalog link. ✓
step 4 (run):             the user's job, not the publisher's. ✓

Settled by the cut (decided in advaita-declarative-pipeline-publishing):

Still open before we hand this out:

If Step 1 reads as "naming a pipeline," we cut enough. It does.