Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SFN 2025 Demo: Duct + DataLad

Demonstrates how duct and datalad compose to provide structured, reproducible execution of neuroimaging workflows.

Demo

Prerequisites

1. Create and activate virtual environment

python -m venv venv
source venv/bin/activate

2. Install Python dependencies

pip install -r requirements.txt

3. Install screencaster

Follow the installation instructions at: https://github.com/datalad/screencaster

Generating the Demo Recording

Cleanup Before Recording

Before running a new recording, clean up any previous demo runs:

# Clean up demo environment
cd ~/tmp
chmod -R +w myproject ds000007-mriqc-hoffstaedter 2>/dev/null || true
rm -rf myproject ds000007-mriqc-hoffstaedter

# Clean up screencaster temp directory
rm -rf /tmp/demo

# Clean up previous recording files
cd /home/austin/devel/demos/sfn-2025
rm -f outputs/duct-datalad-demo.cast.{cmds,json,gif}

Create the Recording

Create the asciinema recording:

SCREENCAST_HOME=/tmp/demo cast2asciinema duct-datalad-demo.cast outputs

This will generate outputs/duct-datalad-demo.cast.json and outputs/duct-datalad-demo.cast.cmds.

Commit the Recording

Before generating the GIF, commit the recording files so datalad run can track provenance:

git add outputs/duct-datalad-demo.cast.{cmds,cmds.md,json}
git commit -m "Add asciinema recording for duct-datalad demo"

Viewing the Recording

View the asciinema recording:

asciinema play outputs/duct-datalad-demo.cast.json

Or upload to asciinema.org for web viewing.

Generating the GIF

Convert the recording to an animated GIF:

datalad run -m "Generate GIF from asciinema recording" \
  --input outputs/duct-datalad-demo.cast.json \
  --output outputs/duct-datalad-demo.gif \
  "podman run --rm -v \"\$PWD:/data:Z\" docker.io/kayvan/agg /data/outputs/duct-datalad-demo.cast.json /data/outputs/duct-datalad-demo.gif"

Note: Using podman instead of docker avoids creating files owned by root.

This creates outputs/duct-datalad-demo.gif with full provenance tracking. The demo also generates a resource usage plot at outputs/mriqc-resources.png.

Converting to MP4 (Optional)

For better quality and smaller file size, convert the GIF to MP4 using H.264:

ffmpeg -y -i outputs/duct-datalad-demo.gif -c:v libx264 -crf 18 -vf "scale=690:470" -pix_fmt yuv420p -movflags faststart outputs/duct-datalad-demo.mp4

This creates a high-quality MP4 (CRF 18) with readable text, typically ~40% smaller than the GIF.