Redun

Here, we’ll see how to track redun workflow runs with LaminDB.

Note

This use case is based on github.com/ricomnl/bioinformatics-pipeline-tutorial.

# pip install lamindb redun git+http://github.com/laminlabs/redun-lamin-fasta
!lamin init --storage ./test-redun-lamin
Hide code cell output
 initialized lamindb: testuser1/test-redun-lamin

Amend the workflow

import lamindb as ln
import json
Hide code cell output
 connected lamindb: testuser1/test-redun-lamin

Let’s amend a redun workflow.py to register input & output artifacts in LaminDB:

  • To track the workflow run in LaminDB, add (see on GitHub):

    ln.track(params=params)
    
  • To register the output file via LaminDB, add (see on GitHub):

    ln.Artifact(output_path, description="results").save()
    

Run redun

Let’s see what the input files are:

!ls ./fasta
Hide code cell output
KLF4.fasta  MYC.fasta  PO5F1.fasta  SOX2.fasta

And call the workflow:

!redun run workflow.py main --input-dir ./fasta --tag run=test-run  1> run_logs.txt 2>run_logs.txt

Inspect the logs:

!cat run_logs.txt
Hide code cell output
 connected lamindb: testuser1/test-redun-lamin
 script invoked with: run workflow.py main --input-dir ./fasta --tag run=test-run
 created Transform('HDCKzJQP9LuA0000', key='workflow.py'), started new Run('tgcky4ItkOf0cOVo') at 2026-01-11 16:51:31 UTC
→ params: input_dir='./fasta', amino_acid='C', enzyme_regex='[KR]', missed_cleavages=0, min_length=4, max_length=75, executor=<Executor.default: 'default'>
9[redun] Run    Job 0f0bcce8:  bioinformatics_pipeline_tutorial.lib.digest_protein_task(input_fasta=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/.lamindb/79Ugg9GxpUYrE8860000.fasta, hash=7c939094), enzyme_regex='[KR]', missed_cleavages=0, min_length=4, max_length=75) on default
[redun] Run    Job 3e6572d8:  bioinformatics_pipeline_tutorial.lib.digest_protein_task(input_fasta=File(path=/hoFile(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/results.tgz, hash=b19f0a1e)
7e65), enzyme_regex='[KR]', missed_cleavages=0, min_length=4, max_length=75) on default
[redun] Run    Job b45caf66:  bioinformatics_pipeline_tutorial.lib.digest_protein_task(input_fasta=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/.lamindb/ovz1avKZByJAngSL0000.fasta, hash=43b6b143), enzyme_regex='[KR]', missed_cleavages=0, min_length=4, max_length=75) on default
[redun] Run    Job 9524261e:  bioinformatics_pipeline_tutorial.lib.digest_protein_task(input_fasta=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/.lamindb/2lHMfHgGJXk1GYZ70000.fasta, hash=3d53d2a7), enzyme_regex='[KR]', missed_cleavages=0, min_length=4, max_length=75) on default
[redun] Run    Job 81e77216:  bioinformatics_pipeline_tutorial.lib.count_amino_acids_task(input_fasta=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/.lamindb/79Ugg9GxpUYrE8860000.fasta, hash=7c939094), input_peptides=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/79Ugg9GxpUYrE8860000.peptides.txt, hash=a30eb33f), amino_acid='C') on default
[redun] Run    Job 68db39d6:  bioinformatics_pipeline_tutorial.lib.count_amino_acids_task(input_fasta=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/.lamindb/l5d8r09xqYuzeL3F0000.fasta, hash=da1a7e65), input_peptides=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/l5d8r09xqYuzeL3F0000.peptides.txt, hash=e9a7f1a3), amino_acid='C') on default
[redun] Run    Job c04161d7:  bioinformatics_pipeline_tutorial.lib.count_amino_acids_task(input_fasta=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/.lamindb/ovz1avKZByJAngSL0000.fasta, hash=43b6b143), input_peptides=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/ovz1avKZByJAngSL0000.peptides.txt, hash=841b1417), amino_acid='C') on default
[redun] Run    Job c2617430:  bioinformatics_pipeline_tutorial.lib.count_amino_acids_task(input_fasta=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/.lamindb/2lHMfHgGJXk1GYZ70000.fasta, hash=3d53d2a7), input_peptides=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/2lHMfHgGJXk1GYZ70000.peptides.txt, hash=d469bfb7), amino_acid='C') on default
[redun] Run    Job 667f1e8e:  bioinformatics_pipeline_tutorial.lib.plot_count_task(input_count=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/79Ugg9GxpUYrE8860000.count.tsv, hash=2b367ea1)) on default
[redun] Run    Job 5163caf3:  bioinformatics_pipeline_tutorial.lib.plot_count_task(input_count=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/l5d8r09xqYuzeL3F0000.count.tsv, hash=80aca311)) on default
[redun] Run    Job fa81c3fb:  bioinformatics_pipeline_tutorial.lib.plot_count_task(input_count=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/ovz1avKZByJAngSL0000.count.tsv, hash=d0924b4f)) on default
[redun] Run    Job de484b6f:  bioinformatics_pipeline_tutorial.lib.plot_count_task(input_count=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/2lHMfHgGJXk1GYZ70000.count.tsv, hash=7f938b1d)) on default
[redun] Run    Job c5330d8c:  bioinformatics_pipeline_tutorial.lib.get_report_task(input_counts=[File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/79Ugg9GxpUYrE8860000.count.tsv, hash=2b367ea1), File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-l...) on default
[redun] Run    Job c1ce87ee:  bioinformatics_pipeline_tutorial.lib.archive_results_task(inputs_plots=[File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/79Ugg9GxpUYrE8860000.plot.png, hash=bb08f0b3), File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-la..., input_report=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/protein_report.tsv, hash=5e8b6352)) on default
[redun] Run    Job 9d14755e:  redun_lamin_fasta.finish(results_archive=File(path=/home/runner/work/redun-lamin/redun-lamin/docs/test-redun-lamin/data/results.tgz, hash=b19f0a1e)) on default
[redun] 
[redun] | JOB STATUS 2026/01/11 16:51:44
[redun] | TASK                                                        PENDING RUNNING  FAILED  CACHED    DONE   TOTAL
[redun] | 
[redun] | ALL                                                               0       0       0       0      16      16
[redun] | bioinformatics_pipeline_tutorial.lib.archive_results_task         0       0       0       0       1       1
[redun] | bioinformatics_pipeline_tutorial.lib.count_amino_acids_task       0       0       0       0       4       4
[redun] | bioinformatics_pipeline_tutorial.lib.digest_protein_task          0       0       0       0       4       4
[redun] | bioinformatics_pipeline_tutorial.lib.get_report_task              0       0       0       0       1       1
[redun] | bioinformatics_pipeline_tutorial.lib.plot_count_task              0       0       0       0       4       4
[redun] | redun_lamin_fasta.finish                                          0       0       0       0       1       1
[redun] | redun_lamin_fasta.main                                            0       0       0       0       1       1
[redun] 
[redun] 
[redun] Execution duration: 13.32 seconds

View data lineage:

artifact = ln.Artifact.get(key="data/results.tgz")
artifact.view_lineage()
Hide code cell output
_images/a95e2ff6f4b04fabccfe6bc96c4af6803f988cbddc9fa8a58c8936819d10d5b2.svg

Track the redun execution id

If we want to be able to query LaminDB for redun execution ID, this here is a way to get it:

# export the run information from redun
!redun log --exec --exec-tag run=test-run --format json --no-pager > redun_exec.json
# load the redun execution id from the JSON and store it in the LaminDB run record
with open("redun_exec.json") as file:
    redun_exec = json.loads(file.readline())
artifact.run.reference = redun_exec["id"]
artifact.run.reference_type = "redun_id"
artifact.run.save()
Run(uid='tgcky4ItkOf0cOVo', name=None, entrypoint=None, started_at=2026-01-11 16:51:31 UTC, finished_at=2026-01-11 16:51:44 UTC, params={'input_dir': './fasta', 'amino_acid': 'C', 'enzyme_regex': '[KR]', 'missed_cleavages': 0, 'min_length': 4, 'max_length': 75, 'executor': 'default'}, reference='5b343c5a-e961-4bb2-8476-a269a9cf2d02', reference_type='redun_id', cli_args='run workflow.py main --input-dir ./fasta --tag run=test-run', branch_id=1, space_id=1, transform_id=1, report_id=7, environment_id=1, created_by_id=3, initiated_by_run_id=None, created_at=2026-01-11 16:51:31 UTC, is_locked=False)

Track the redun run report

While lamindb tracks logs of the main python process, the redun logs currently don’t get tracked and artifact.run.report is an empty text file.

This is how you can manually attach a report.

report = ln.Artifact(
    "run_logs.txt",
    description=f"Redun run report of {redun_exec['id']}",
    run=False,
    kind="__lamindb_run__",  # mark as auxiliary artifact for the run
).save()
artifact.run.report = report
artifact.run.save()
Run(uid='tgcky4ItkOf0cOVo', name=None, entrypoint=None, started_at=2026-01-11 16:51:31 UTC, finished_at=2026-01-11 16:51:44 UTC, params={'input_dir': './fasta', 'amino_acid': 'C', 'enzyme_regex': '[KR]', 'missed_cleavages': 0, 'min_length': 4, 'max_length': 75, 'executor': 'default'}, reference='5b343c5a-e961-4bb2-8476-a269a9cf2d02', reference_type='redun_id', cli_args='run workflow.py main --input-dir ./fasta --tag run=test-run', branch_id=1, space_id=1, transform_id=1, report_id=8, environment_id=1, created_by_id=3, initiated_by_run_id=None, created_at=2026-01-11 16:51:31 UTC, is_locked=False)

View transforms and runs in LaminHub

hub

View the database content

ln.view()
Hide code cell output
Artifact
uid key description suffix kind otype size hash n_files n_observations version_tag is_latest is_locked created_at branch_id space_id storage_id run_id schema_id created_by_id
id
6 1IFIq9CAF10O5XUh0000 data/results.tgz None .tgz None None 94347 3Us3-nYvTDU5WzjnteVQ9A None None None True False 2026-01-11 16:51:44.050000+00:00 1 1 3 1.0 None 3
5 2lHMfHgGJXk1GYZ70000 fasta/KLF4.fasta None .fasta None None 609 LyuoYkWs4SgYcH7P7JLJtA None None None True False 2026-01-11 16:51:31.713000+00:00 1 1 3 NaN None 3
4 ovz1avKZByJAngSL0000 fasta/PO5F1.fasta None .fasta None None 477 -7iJgveFO9ia0wE1bqVu6g None None None True False 2026-01-11 16:51:31.713000+00:00 1 1 3 NaN None 3
3 l5d8r09xqYuzeL3F0000 fasta/MYC.fasta None .fasta None None 536 WGbEtzPw-3bQEGcngO_pHQ None None None True False 2026-01-11 16:51:31.712000+00:00 1 1 3 NaN None 3
2 79Ugg9GxpUYrE8860000 fasta/SOX2.fasta None .fasta None None 414 C5q_yaFXGk4SAEpfdqBwnQ None None None True False 2026-01-11 16:51:31.711000+00:00 1 1 3 NaN None 3
Run
uid name entrypoint started_at finished_at params reference reference_type cli_args is_locked created_at branch_id space_id transform_id report_id environment_id created_by_id initiated_by_run_id
id
1 tgcky4ItkOf0cOVo None None 2026-01-11 16:51:31.012370+00:00 2026-01-11 16:51:44.095530+00:00 {'input_dir': './fasta', 'amino_acid': 'C', 'e... 5b343c5a-e961-4bb2-8476-a269a9cf2d02 redun_id run workflow.py main --input-dir ./fasta --tag... False 2026-01-11 16:51:31.013000+00:00 1 1 1 8 1 3 None
Storage
uid root description type region instance_uid is_locked created_at branch_id space_id created_by_id run_id
id
3 B1Y6nnV9avxU /home/runner/work/redun-lamin/redun-lamin/docs... None local None iQlBPgD8uaqR False 2026-01-11 16:51:17.805000+00:00 1 1 3 None
Transform
uid key description kind source_code hash reference reference_type version_tag is_latest is_locked created_at branch_id space_id environment_id created_by_id
id
1 HDCKzJQP9LuA0000 workflow.py None script """workflow.py."""\n\n# This code is a copy fr... Qn4m7TedTE04S_x3VFxq8w None None None True False 2026-01-11 16:51:31.010000+00:00 1 1 None 3

Delete the test instance:

Hide code cell content
!rm -rf test-redun-lamin
!lamin delete --force test-redun-lamin