-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #792 from ratt-ru/stimela2
Stimela2 cab
- Loading branch information
Showing
3 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM kernsuite/base:9 | ||
MAINTAINER <[email protected]> | ||
RUN docker-apt-install cmake \ | ||
wget \ | ||
subversion \ | ||
build-essential \ | ||
cmake \ | ||
gfortran \ | ||
g++ \ | ||
libncurses5-dev \ | ||
libreadline-dev \ | ||
flex \ | ||
bison \ | ||
libblas-dev \ | ||
liblapacke-dev \ | ||
libcfitsio-dev \ | ||
libgsl-dev \ | ||
wcslib-dev \ | ||
libhdf5-serial-dev \ | ||
libfftw3-dev \ | ||
python-numpy \ | ||
libboost-python-dev \ | ||
libboost-all-dev \ | ||
libpython2.7-dev \ | ||
liblog4cplus-dev \ | ||
libhdf5-dev \ | ||
casacore-dev \ | ||
wsclean | ||
|
||
RUN pip install cult-curgo stimela quartical breizorro | ||
RUN ulimit -p 11000 | ||
RUN stimela |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"task": "stimela2", | ||
"base": "stimela/stimela2", | ||
"tag": "1.7.10", | ||
"description": "a workflow management framework for creating portable and reproducible data processing pipelines", | ||
"prefix": "--", | ||
"binary": "stimela run", | ||
"version":"2.0.0", | ||
"junk":[], | ||
"msdir": true, | ||
"parameters": [ | ||
{ | ||
"info": "Recipe file", | ||
"name": "recipe", | ||
"io": "input", | ||
"default": null, | ||
"dtype": "file", | ||
"required": false | ||
}, | ||
{ | ||
"info": "Support files", | ||
"name": "support-files", | ||
"io": "output", | ||
"default": null, | ||
"dtype": "list:file", | ||
"required": false | ||
}, | ||
{ | ||
"info": "Name of recipe to run", | ||
"name": "recipe-name", | ||
"dtype": "str", | ||
"required": false | ||
}, | ||
{ | ||
"info": "Step(s) to run from recipe", | ||
"default": null, | ||
"required": false, | ||
"delimiter": ",", | ||
"name": "step", | ||
"dtype": "list:str" | ||
}, | ||
{ | ||
"info": "Parameter(s) to override defaults. e.g. ['ms=foo.ms', 'image_size=2048']", | ||
"default": null, | ||
"required": false, | ||
"delimiter": " ", | ||
"name": "params", | ||
"dtype": "list:str" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import os | ||
import sys | ||
import shlex | ||
import shutil | ||
import subprocess | ||
import yaml | ||
import glob | ||
|
||
|
||
CONFIG = os.environ["CONFIG"] | ||
INPUT = os.environ["INPUT"] | ||
OUTPUT = os.environ["OUTPUT"] | ||
MSDIR = os.environ["MSDIR"] | ||
|
||
with open(CONFIG, "r") as _std: | ||
cab = yaml.safe_load(_std) | ||
|
||
junk = cab["junk"] | ||
args = [] | ||
|
||
for param in cab['parameters']: | ||
name = param['name'] | ||
value = param['value'] | ||
|
||
if value is None: | ||
continue | ||
|
||
if name in ['recipe']: | ||
recipe = value | ||
continue | ||
|
||
if name in ['recipe-name']: | ||
recipe_name = value | ||
continue | ||
|
||
if name in ['support-files']: | ||
continue | ||
|
||
if name in ['step']: | ||
delimiter = ',' #param['delimiter'] | ||
args += ['{0}{1} {2}'.format(cab['prefix'], name, delimiter.join(value))] | ||
|
||
if name in ['params']: | ||
delimiter = ' ' #param['delimiter'] | ||
args += ['{0}'.format(delimiter.join(value))] | ||
|
||
_runc = " ".join([cab["binary"]] + [recipe, recipe_name] + args) | ||
|
||
try: | ||
subprocess.check_call(shlex.split(_runc)) | ||
finally: | ||
for item in junk: | ||
for dest in [OUTPUT, MSDIR]: # these are the only writable volumes in the container | ||
items = glob.glob("{dest}/{item}".format(**locals())) | ||
for f in items: | ||
if os.path.isfile(f): | ||
os.remove(f) | ||
elif os.path.isdir(f): | ||
shutil.rmtree(f) |