Package: chrispile
ChRISPileSyntactical sugar for running ChRIS plugins locally.Abstractchrispilegenerates wrapper scripts arounddocker run(orpodman run).
These scripts automatically locate mount points for the position arguments/incomingand/outgoingforChRIS plugin apps.
Additionally, the wrapper sets sane defaults for running the container.BackgroundTraditionally,docker runis a very verbose command with user-unfriendly defaults.
Of course there are good reasons for this design (security isolation)
but it is tedious and confusing to work with.the default user isrootso you will needsudoto removeoutputdir.container timezone is UTCstopped containers occupy disk spaceGPU is invisibleuser needs to specify image name and commandfolders containing data need to be typed outchrispileaims to hide this complexity from users.WARNING: it is not a good idea to usechrispileunless you understand why it is helpful. You gotta learn the basics:what is docker?Examplemkdirdataoutput
cpscan.nii.gzdata

chrispilerun--fnndsc/pl-fetal-brain-mask:1.0.0--inputPathFilterscan.nii.gzdataoutputThe command above is translated to:dockerrun# clean up the stopped container after it exists--rm# run as yourself so that the output is readable+writable by you--user$(id-u):$(id-g)# if plugin meta specifies min_gpu_limit, GPU is enabled# GPU support is detected as --runtime=nvidia (legacy) or --gpus all (native)--gpusall# set the timezone in case your plugin logs timestamps-v/etc/localtime:/etc/localtime:ro# resolve input and output paths# SELinux label flag ':z' is appended to volume options if necessary-v/home/jenni/data:/incoming:ro-v/home/jenni/output:rw# container image name and commandfnndsc/pl-fetal-brain-mask:1.0.0fetal_brain_mask# user specified options--inputPathFilterscan.nii.gz# volume mountpoints/incoming/outgoingInstallationpipinstallchrispileUsage$ chrispile --help
usage: chrispile [-h] [-V] {run,api,install,list,uninstall} ...

Generate wrapper scripts around docker or podman run to easily run ChRIS plugins

optional arguments:
  -h, --help            show this help message and exit

info:
  -V, --version         show program's version number and exit

subcommands:
  {run,api,install,list,uninstall}
    run                 run a ChRIS plugin
    api                 query the system for information
    install             install a ChRIS plugin as an executable
    list                list installed ChRIS plugins
    uninstall           uninstall a ChRIS pluginRun Plugin$ chrispile run --help
usage: chrispile run [--dry-run] [--reload-from] -- dock_image [args ...] inputdir/ outputdir/

positional arguments:
  dock_image            container image of the ChRIS plugin
  args                  arguments to pass to the ChRIS plugin

optional arguments:
  -h, --help            show this help message and exit
  -d, --dry-run         print command to run withour running it
  -e src, --reload-from src
                        mount given host directory as source folder for rapid developmentRun Exampledocker pull fnndsc/pl-simpledsapp:2.0.0

# setup test data
mkdir input output
touch input/{a,b,c}Dry Run$ chrispile run --dry-run -- fnndsc/pl-simpledsapp:2.0.0 --dummyFloat 3.5 input output 

docker run --rm --user 1000:1003              \
  -v /etc/localtime:/etc/localtime:ro         \
  -v /home/chris/input:/incoming:ro           \
  -v /home/chris/output:/outgoing:rw          \
  fnndsc/pl-simpledsapp:2.0.0 simpledsapp     \
  --dummyFloat 3.5                            \
  /incoming /outgoingReal Run$ chrispile run -- fnndsc/pl-simpledsapp:2.0.0 --dummyFloat 3.5 input output

     _                 _          _                       
    (_)               | |        | |                      
 ___ _ _ __ ___  _ __ | | ___  __| |___  __ _ _ __  _ __  
/ __| | '_ ` _ \| '_ \| |/ _ \/ _` / __|/ _` | '_ \| '_ \ 
\__ \ | | | | | | |_) | |  __/ (_| \__ \ (_| | |_) | |_) |
|___/_|_| |_| |_| .__/|_|\___|\__,_|___/\__,_| .__/| .__/ 
                | |                          | |   | |    
                |_|                          |_|   |_|    

Version: 2.0.0
Sleeping for 0
Creating new file... /outgoing/b
Creating new file... /outgoing/a
Creating new file... /outgoing/cCheck Outputs$ ls -lh output

total 0
-rw-r--r-- 1 chris grantlab 0 Feb 13 22:21 a
-rw-r--r-- 1 chris grantlab 0 Feb 13 22:21 b
-rw-r--r-- 1 chris grantlab 0 Feb 13 22:21 c

$ rm -rv output

removed 'output/b'
removed 'output/a'
removed 'output/c'
removed directory 'output'Run With Live CodeMount the source code directory into the installed library's location
within the container for a convenient developer experience.The container will run changes you've made to the code without having
to rebuild the docker image.chrispilerun--reload-from~/Github/pl-simpledsapp/simpledsapp\--fnndsc/pl-simpledsapp:2.0.0--dummyFloat3.2inputoutputInstall Plugindockerpullfnndsc/pl-brainmgz:2.0.3
chrispileinstallfnndsc/pl-brainmgz:2.0.3

dockerpullfnndsc/pl-lungct:latest
chrispileinstallfnndsc/pl-lungct:latestNow you can simply runmkidrout
lungctoutUninstall Plugin$ chrispile list
lungct
simpledsapp
med2img.py

$ chrispile uninstall lungctPlanned FeaturesGithub Actions build matrix to test docker and podman separatelystore repeated$(chrispile api ...)calls as variables in bash scriptchrispile createas an alias forcookiecutter-chrisappchrispile run --clobberdeletes the/outgoingdirectory before startchrispile installfromhttps://chrisstore.coand pulls for youchrispile listalso shows container image tagschrispile uninstall --rmalso runsdocker rmi