Skip to content

Commit

Permalink
Refactor the CLI commands for the Singularity Cache Dir
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasZepper committed Apr 26, 2023
1 parent 0115d9f commit 4f3b8de
Show file tree
Hide file tree
Showing 2 changed files with 220 additions and 103 deletions.
36 changes: 32 additions & 4 deletions nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,47 @@ def launch(pipeline, id, revision, command_only, params_in, params_out, save_all
"-c", "--container", type=click.Choice(["none", "singularity"]), help="Download software container images"
)
@click.option(
"--singularity-cache-only/--singularity-cache-copy",
help="Don't / do copy images to the output directory and set 'singularity.cacheDir' in workflow",
"-s",
"--singularity-cache",
type=click.Choice(["amend", "copy", "remote"]),
help="Utilize the 'singularity.cacheDir' in the download process, if applicable.",
)
@click.option(
"-i",
"--singularity-cache-index",
type=str,
help="List of images already available in a remote 'singularity.cacheDir', imposes --singularity-cache=remote",
)
@click.option("-p", "--parallel-downloads", type=int, default=4, help="Number of parallel image downloads")
def download(pipeline, revision, outdir, compress, force, tower, container, singularity_cache_only, parallel_downloads):
def download(
pipeline,
revision,
outdir,
compress,
force,
tower,
container,
singularity_cache,
singularity_cache_index,
parallel_downloads,
):
"""
Download a pipeline, nf-core/configs and pipeline singularity images.
Collects all files in a single archive and configures the downloaded
workflow to use relative paths to the configs and singularity images.
"""
dl = nf_core.download.DownloadWorkflow(
pipeline, revision, outdir, compress, force, tower, container, singularity_cache_only, parallel_downloads
pipeline,
revision,
outdir,
compress,
force,
tower,
container,
singularity_cache,
singularity_cache_index,
parallel_downloads,
)
dl.download_workflow()

Expand Down
Loading

0 comments on commit 4f3b8de

Please sign in to comment.