diff --git a/galaxy/tools/deps/mulled/invfile.lua b/galaxy/tools/deps/mulled/invfile.lua index 4370e2c..4b771e4 100644 --- a/galaxy/tools/deps/mulled/invfile.lua +++ b/galaxy/tools/deps/mulled/invfile.lua @@ -42,7 +42,7 @@ end local conda_image = VAR.CONDA_IMAGE if conda_image == '' then - conda_image = 'continuumio/miniconda:latest' + conda_image = 'continuumio/miniconda3:latest' end @@ -104,8 +104,8 @@ if VAR.SINGULARITY ~= '' then .withHostConfig({binds = {"build:/data",singularity_image_dir .. ":/import"}, privileged = true}) .withConfig({entrypoint = {'/bin/sh', '-c'}}) -- for small containers (less than 7MB), double the size otherwise, add a little bit more as half the conda size - .run("size=$(du -sc /data/dist/ | tail -n 1 | cut -f 1 | awk '{print int($1/1024)}' ) && if [ $size -lt '7' ]; then echo $(($size*2)); else echo $(($size+$size*7/10)); fi") - .run("singularity create --size `size=$(du -sc /data/dist/ | tail -n 1 | cut -f 1 | awk '{print int($1/1024)}' ) && if [ $size -lt '7' ]; then echo $(($size*2)); else echo $(($size+$size*7/10)); fi` /import/" .. VAR.SINGULARITY_IMAGE_NAME) + .run("size=$(du -sc /data/dist/ | tail -n 1 | cut -f 1 | awk '{print int($1/1024)}' ) && if [ $size -lt '10' ]; then echo 20; else echo $(($size+$size*7/10)); fi") + .run("singularity create --size `size=$(du -sc /data/dist/ | tail -n 1 | cut -f 1 | awk '{print int($1/1024)}' ) && if [ $size -lt '10' ]; then echo 20; else echo $(($size+$size*7/10)); fi` /import/" .. VAR.SINGULARITY_IMAGE_NAME) .run('mkdir -p /usr/local/var/singularity/mnt/container && singularity bootstrap /import/' .. VAR.SINGULARITY_IMAGE_NAME .. ' /import/Singularity') .run('chown ' .. VAR.USER_ID .. ' /import/' .. VAR.SINGULARITY_IMAGE_NAME) end diff --git a/galaxy/tools/deps/mulled/mulled_build.py b/galaxy/tools/deps/mulled/mulled_build.py index 5d362f1..b2985a3 100644 --- a/galaxy/tools/deps/mulled/mulled_build.py +++ b/galaxy/tools/deps/mulled/mulled_build.py @@ -33,6 +33,7 @@ conda_build_target_str, create_repository, quay_repository, + PrintProgress, v1_image_name, v2_image_name, ) @@ -40,7 +41,7 @@ DIRNAME = os.path.dirname(__file__) DEFAULT_CHANNEL = "bioconda" -DEFAULT_EXTRA_CHANNELS = ["conda-forge", "r"] +DEFAULT_EXTRA_CHANNELS = ["conda-forge"] DEFAULT_CHANNELS = [DEFAULT_CHANNEL] + DEFAULT_EXTRA_CHANNELS DEFAULT_REPOSITORY_TEMPLATE = "quay.io/${namespace}/${image}" DEFAULT_BINDS = ["build/dist:/usr/local/"] @@ -242,7 +243,8 @@ def mull_targets( with open(os.path.join(singularity_image_dir, 'Singularity'), 'w+') as sin_def: fill_template = SINGULARITY_TEMPLATE % {'container_test': test} sin_def.write(fill_template) - ret = involucro_context.exec_command(involucro_args) + with PrintProgress(): + ret = involucro_context.exec_command(involucro_args) if singularity: # we can not remove this folder as it contains the image wich is owned by root pass diff --git a/galaxy/tools/deps/mulled/mulled_build_files.py b/galaxy/tools/deps/mulled/mulled_build_files.py index 3ae94e6..d5211a1 100644 --- a/galaxy/tools/deps/mulled/mulled_build_files.py +++ b/galaxy/tools/deps/mulled/mulled_build_files.py @@ -15,6 +15,7 @@ import collections import glob import os +import sys from ._cli import arg_parser from .mulled_build import ( @@ -36,7 +37,7 @@ def main(argv=None): args = parser.parse_args() for (targets, image_build, name_override) in generate_targets(args.files): try: - mull_targets( + ret = mull_targets( targets, image_build=image_build, name_override=name_override, @@ -44,6 +45,9 @@ def main(argv=None): ) except BuildExistsException: continue + if ret > 0: + sys.exit(ret) + def generate_targets(target_source): diff --git a/galaxy/tools/deps/mulled/util.py b/galaxy/tools/deps/mulled/util.py index 46ede34..d000d53 100644 --- a/galaxy/tools/deps/mulled/util.py +++ b/galaxy/tools/deps/mulled/util.py @@ -3,6 +3,9 @@ import collections import hashlib +import time +import threading +import sys from distutils.version import LooseVersion @@ -207,6 +210,27 @@ def v2_image_name(targets, image_build=None, name_override=None): return "mulled-v2-%s%s" % (package_hash.hexdigest(), suffix) +class PrintProgress: + def __init__(self): + self.thread = threading.Thread(target=self.progress) + self.stop = False + + def progress(self): + while not self.stop: + print(".", end="") + sys.stdout.flush() + time.sleep(60) + print("") + + def __enter__(self): + self.thread.start() + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.stop = True + self.thread.join() + + image_name = v1_image_name # deprecated __all__ = (