Quickstart
This quickstart has two parts. First you run a one-task workflow that needs
nothing but the ginkgo command. Then you run the bioinformatics example from
the Ginkgo repository, which uses Pixi and a container.
You need the ginkgo command first. See Installation.
1. Run Your First Workflow
Section titled “1. Run Your First Workflow”In an empty directory, save the
minimal workflow from the docs front page as
flow.py. Then run it:
ginkgo run flow.pyGinkgo shows a table of tasks as they run. When the run ends, the table shows
write_text as succeeded, and hello.txt is in the directory.
2. Run It Again To See The Cache
Section titled “2. Run It Again To See The Cache”Run the same command again:
ginkgo run flow.pyThis time nothing runs. Ginkgo reports the task as cached:
┌────────────┬──────────┬─────────────┬──────┐│ Task │ Status │ Environment │ Time │├────────────┼──────────┼─────────────┼──────┤│ write_text │ ↺ cached │ local │ 0.0s │└────────────┴──────────┴─────────────┴──────┘
⏱ Completed in 0.1s - 0 tasks executed, 1 cachedGinkgo reused the result because nothing changed. It decides this from the
task’s code, its inputs and its environment.
Cache Identity gives the
exact rule. Change message in flow.py and run again, and write_text runs
again.
3. Get The Bioinformatics Example
Section titled “3. Get The Bioinformatics Example”The example lives in the Ginkgo repository:
git clone https://github.com/sanjaynagi/ginkgo.gitcd ginkgo/examples/bioinfoIt needs Pixi and Docker or Podman on your PATH (see
Runtime Prerequisites).
workflow/flow.py has four tasks:
filter_fastqfilters each sample’s reads withseqkit, in a Pixi environment.fastq_statscomputes quality-control statistics for each filtered sample, in the same environment.count_readscounts the reads in each filtered sample, in a Docker container.build_summarymerges the statistics and counts into one table.
Example: Bioinformatics Workflow walks through the code.
4. Preview With A Dry Run
Section titled “4. Preview With A Dry Run”Check the workflow before you run it for real:
ginkgo run --dry-runA dry run checks the workflow and prints a plan. No task runs. The plan lists which tasks would run, which would reuse cached results, and the resources each task declares.
5. Run The Workflow
Section titled “5. Run The Workflow”ginkgo runWith no file named, ginkgo run looks for workflow/flow.py in the current
directory. To name the file yourself:
ginkgo run workflow/flow.py6. Look At The Outputs
Section titled “6. Look At The Outputs”After a successful run, look at:
results/filtered/for the filtered readsresults/qc/for each sample’s statisticsresults/read_counts/for the read counts made in the containerresults/summary.csvfor the merged tablelogs/for the tool logs
Ginkgo also records the run, which is the run’s
provenance. The last line of the run output
names the run’s directory under .ginkgo/runs/. To list your runs and show
one of them:
ginkgo runs lsginkgo runs show <run_id>Querying Provenance covers the other ways to read the record.
What To Read Next
Section titled “What To Read Next”Read Core Concepts next. It explains why calling a task doesn’t run it, and how a task can add new tasks while the workflow runs.
