Skip to content

A Chris 'fs' plugin app to copy file/folders from a directory into a Chris' feed.

License

Notifications You must be signed in to change notification settings

FNNDSC/pl-dircopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pl-dircopy

https://img.shields.io/docker/v/fnndsc/pl-dircopy https://img.shields.io/github/license/fnndsc/pl-dircopy

A ChRIS FS (Feed Synthesis) plugin app that copies file/dir data from an input source to an output sink. When called from a client that is talking to CUBE, this input directory is interpreted to mean a location within swift storage, and is not a file system location.

dircopy is a ChRIS-based application to copy the contents of one or more obj storage directories given by the --dir argument to a new directory specified by <options.outpudir>. This argument is a string containing one or more directories separated by comma.

When running this plugin from a client perspective to CUBE, note that the input directory is actually assumed to exist within swift storage, thus the value of the input directory is the prefix within swift storage. See the wiki pages of CUBE for more information.

python dircopy.py
    [-h] [--help]
    [--json]
    [--man]
    [--meta]
    [--savejson <DIR>]
    [-v <level>] [--verbosity <level>]
    [--version]
    <outputDir>
    --dir <DIR>
[-h] [--help]
If specified, show help message and exit.

[--json]
If specified, show json representation of app and exit.

[--man]
If specified, print (this) man page and exit.

[--meta]
If specified, print plugin meta data and exit.

[--savejson <DIR>]
If specified, save json representation file to DIR and exit.

[-v <level>] [--verbosity <level>]
Verbosity level for app. Not used currently.

[--version]
If specified, print version number and exit.

<outputDir>
Output directory.

--dir <DIR>
Required, it's a string representing a comma-separated list of one or more
directories.

Getting inline help is:

docker run --rm fnndsc/pl-dircopy dircopy --man

You need you need to specify the output directories using the -v flag to docker run.

docker run --rm -u $(id -u) -v $(pwd)/out:/outgoing      \
    fnndsc/pl-dircopy dircopy /outgoing --dir <DIR>

Build the Docker container:

docker build -t local/pl-dircopy .

Run unit tests:

docker run --rm local/pl-dircopy nosetests

This example will copy all files in the cube/uploads and SERVICES/PACS/BCH directories into the output dir. Note: This is a utility 'fs' plugin that only works in the context of the ChRIS platform.

docker run --rm -v $(pwd)/out:/outgoing fnndsc/pl-dircopy    \
    dircopy /outgoing --dir 'cube/uploads,SERVICES/PACS/BCH'
https://raw.githubusercontent.com/FNNDSC/cookiecutter-chrisapp/master/doc/assets/badge/light.png

About

A Chris 'fs' plugin app to copy file/folders from a directory into a Chris' feed.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •