Skip to content

Commit

Permalink
Fixes ragavi woes
Browse files Browse the repository at this point in the history
  • Loading branch information
SpheMakh committed May 8, 2020
1 parent dcf5c49 commit 657fbc6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
3 changes: 1 addition & 2 deletions stimela/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ def register_globals():
try:
# These files must exist for a cab image to be valid
ls_cabdir = os.listdir('{0}/{1}'.format(CAB_PATH, item))
dockerfile = 'Dockerfile' in ls_cabdir
paramfile = 'parameters.json' in ls_cabdir
srcdir = 'src' in ls_cabdir
except OSError:
continue
if dockerfile and paramfile and srcdir:
if paramfile and srcdir:
CAB.append(item)


Expand Down
4 changes: 3 additions & 1 deletion stimela/cargo/base/ragavi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM stimela/base:1.4.6
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN pip install -U pip setuptools
RUN pip install ragavi
RUN pip install ragavi>=0.3.5
RUN pip install --force-reinstall -U git+https://github.com/o-smirnov/datashader
RUN pip install -I numpy
RUN ragavi-gains -h
RUN ragavi-vis -h
2 changes: 1 addition & 1 deletion stimela/cargo/cab/ragavi/parameters.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"task": "ragavi",
"base": "stimela/ragavi",
"tag": "1.4.6-1",
"tag": "1.4.6-2",
"description": "Radio Astronomy Gain and Visibility Inspector",
"prefix": "--",
"binary": "ragavi-gains",
Expand Down
19 changes: 10 additions & 9 deletions stimela/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ def info(cabdir, header=False):
raise RuntimeError("Cab could not be found at : {}".format(cabdir))
# Get cab info
cab_definition = cab.CabDefinition(parameter_file=pfile)
cab_definition.display(header)
if header:
cab_definition.display(header)

return cab_definition


def cabs(argv):
Expand All @@ -130,10 +133,10 @@ def cabs(argv):

args = parser.parse_args(argv)
logfile = '{0:s}/{1:s}_stimela_logfile.json'.format(
LOG_HOME, args.build_label)
LOG_HOME, CAB_USERNAME)

if args.cab_doc:
name = '{0:s}_cab/{1:s}'.format(args.build_label, args.cab_doc)
name = '{0:s}_cab/{1:s}'.format(CAB_USERNAME, args.cab_doc)
cabdir = "{:s}/{:s}".format(stimela.CAB_PATH, args.cab_doc)
info(cabdir)

Expand Down Expand Up @@ -268,7 +271,6 @@ def pull(argv):

images_ = []
for cab in args.cab_base or []:
print(cab in CAB)
if cab in CAB:
filename = "/".join([stimela.CAB_PATH, cab, "parameters.json"])
param = utils.readJson(filename)
Expand All @@ -292,12 +294,11 @@ def pull(argv):
docker.pull(image)
log.log_image(image, 'pulled')
else:

base = []
for cab in CAB:
image = "{:s}/{:s}".format(stimela.CAB_PATH, cab)
base.append(utils.get_Dockerfile_base_image(image).split()[-1])

for cab_ in CAB:
cabdir = "{:s}/{:s}".format(stimela.CAB_PATH, cab_)
_cab = info(cabdir)
base.append(f"{_cab.base}:{_cab.tag}")
base = set(base)

for image in base:
Expand Down

0 comments on commit 657fbc6

Please sign in to comment.