Skip to content

Commit

Permalink
Update Docker container at workflow start
Browse files Browse the repository at this point in the history
Should avoid potential problems with running with outdated
containers--since we aren't using the container that corresponds with
each commit, conceivably someone could get an outdated container if
they've used CAT before and haven't done a docker pull lately.
  • Loading branch information
joelarmstrong committed Sep 27, 2018
1 parent a10c16b commit f32cf5e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cat/__init__.py
Expand Up @@ -13,6 +13,7 @@
from collections import OrderedDict
from frozendict import frozendict
from configobj import ConfigObj
from subprocess import check_call

import luigi
import luigi.contrib.sqla
Expand Down Expand Up @@ -149,6 +150,7 @@ def get_pipeline_args(self):
os.environ['CAT_BINARY_MODE'] = self.binary_mode

args = tools.misc.PipelineNamespace()
args.set('binary_mode', self.binary_mode, False)
args.set('hal', os.path.abspath(self.hal), True)
args.set('ref_genome', self.ref_genome, True)
args.set('out_dir', os.path.abspath(self.out_dir), True)
Expand Down Expand Up @@ -581,6 +583,9 @@ class RunCat(PipelineWrapperTask):
"""
def validate(self, pipeline_args):
"""General input validation"""
if pipeline_args.binary_mode == 'docker':
# Update docker container
check_call(['docker', 'pull', 'quay.io/ucsc_cgl/cat:latest'])
if not os.path.exists(pipeline_args.hal):
raise InputMissingException('HAL file not found at {}.'.format(pipeline_args.hal))
for d in [pipeline_args.out_dir, pipeline_args.work_dir]:
Expand Down

0 comments on commit f32cf5e

Please sign in to comment.