Skip to main content

A simple/dummy ChRIS DS app

Project description

https://badge.fury.io/py/simpledsapp.svg https://travis-ci.org/FNNDSC/simpledsapp.svg?branch=master https://img.shields.io/badge/python-3.5%2B-blue.svg

Abstract

simpledsapp is a simple DS plugin that copies directories file from an input to output. If called with an optional --ignoreInputDir the plugin will simply write a JSON formatted timestamp to the output directory.

Synopsis

python simpledsapp.py                                           \
    [-v <level>] [--verbosity <level>]                          \
    [--prefix <filePrefixString>]                               \
    [--sleepLength <sleepLength>]                               \
    [--ignoreInputDir]                                          \
    [--version]                                                 \
    [--man]                                                     \
    [--meta]                                                    \
    <inputDir>
    <outputDir>

Run

This plugin can be run in two modes: natively as a python package or as a containerized docker image.

Using PyPI

To run from PyPI, simply do a

pip install simpledsapp

and run with

simpledsapp.py --man /tmp /tmp

to get inline help. To copy from one directory to another, simply do

simpledsapp.py /some/input/directory /destination/directory

Using docker run

To run using docker, be sure to assign an “input” directory to /incoming and an output directory to /outgoing. Make sure that the $(pwd)/out directory is world writable!

Now, prefix all calls with

docker run --rm -v $(pwd)/out:/outgoing                             \
        fnndsc/pl-simpledsapp simpledsapp.py                        \

Thus, getting inline help is:

mkdir in out && chmod 777 out
docker run --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing      \
        fnndsc/pl-simpledsapp simpledsapp.py                        \
        --man                                                       \
        /incoming /outgoing

Examples

Copy from input to output with a prefix

Assign an “input” directory to /incoming and an output directory to /outgoing

mkdir in out && chmod 777 out
docker run -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing       \
        fnndsc/pl-simpledsapp simpledsapp.py                    \
        --prefix test-                                          \
        --sleepLength 0                                         \
        /incoming /outgoing

The above will create a copy of each file in the container’s /incoming and prefix the file copied with the prefix text (in this case “test-“). The copies will be stored in the container’s /outgoing directory.

Simply write a timestamp to the output directory, ignoring the input completely

Assign an “input” directory to /incoming and an output directory to /outgoing

mkdir in out && chmod 777 out
docker run -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing       \
        fnndsc/pl-simpledsapp simpledsapp.py                    \
        --ignoreInputDir                                        \
        /incoming /outgoing

This will simply create a file called timestamp.json in the output directory. This mode is useful to just create mock nodes in a Feed tree.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simpledsapp-1.0.3.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file simpledsapp-1.0.3.tar.gz.

File metadata

  • Download URL: simpledsapp-1.0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for simpledsapp-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9a7a2245113c00ea8cff8a65e57e7bb7f452e51b25c43fe25f0201d6089ed7f4
MD5 f47c266b5305f737e996de7ff4c473c9
BLAKE2b-256 b88bcdc8d01566e262ae15df0f76640d446fb2c1321b0c6e8309b2c9f72c4b66

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page