Skip to content

Commit

Permalink
Tweaks for @senthil10 and update to docker2singularity for singularit…
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels committed May 31, 2018
1 parent b0e5625 commit d53214d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nf_core/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def download_workflow(self):
""" Main function to download a nf-core workflow """

# Get workflow details
if not self.get_workflow():
if not self.fetch_workflow_details():
sys.exit(1)

# Check that the outdir doesn't already exist
Expand Down Expand Up @@ -65,7 +65,7 @@ def download_workflow(self):
self.download_singularity_image(container)


def get_workflow(self):
def fetch_workflow_details(self):
""" Fetch details of nf-core workflow to download """
wfs = nf_core.list.Workflows()
wfs.get_remote_workflows()
Expand Down Expand Up @@ -157,15 +157,16 @@ def download_singularity_image(self, container):
""" Download singularity images for workflow """

out_name = '{}.simg'.format(container.replace('nfcore', 'nf-core').replace('/','-').replace(':', '-'))
out_path = os.path.abspath(os.path.join(self.outdir, 'singularity-images', out_name))
out_dir = os.path.abspath(os.path.join(self.outdir, 'singularity-images'))
address = 'docker://{}'.format(container.replace('docker://', ''))
singularity_command = ["singularity", "pull", "--name", out_path, address]
singularity_command = ["singularity", "pull", "--name", os.path.join(out_dir, out_name), address]
docker_command = [
'docker', 'run',
'-v', '/var/run/docker.sock:/var/run/docker.sock',
'-v', '{}:/output'.format(out_path),
'-v', '{}:/output'.format(out_dir),
'--privileged', '-t', '--rm',
'singularityware/docker2singularity',
'--name', out_name,
container
]

Expand Down

0 comments on commit d53214d

Please sign in to comment.