unpack_archive_to_bucket
pipes/WDL/workflows/unpack_archive_to_bucket.wdl

WORKFLOW unpack_archive_to_bucket

File Path pipes/WDL/workflows/unpack_archive_to_bucket.wdl
WDL Version 1.0
Type workflow

Imports

Namespace Path
tasks_utils ../tasks/tasks_utils.wdl
tasks_terra ../tasks/tasks_terra.wdl

Workflow: unpack_archive_to_bucket

Unpack archive(s) to a target location within a Google Storage bucket

Author: Broad Viral Genomics
viral-ngs@broadinstitute.org

Inputs

Name Type Description Default
input_archive_files Array[File] List of input archive files to unpack. -
bucket_path_prefix String? Path within the Google Storage bucket to unpack the archive files. If not provided, the root of the bucket will be used. -
out_dir_name String? Name of the (sub-)directory to unpack the archive contents to within the bucket prefix specified. If not provided, the contents will be unpacked to the bucket prefix. -
gcloud_access_token String? Access token for the Google Cloud Storage bucket, for account authorized to write to the bucket specified by 'bucket_path_prefix'. If not provided, the gcloud auth configuration of the execution environment will be obtained via 'gcloud auth print-access-token' for the active authenticated user (on Terra, the service worker/'pet' account). -
archive_wrapper_directories_to_strip Int? - -
8 optional inputs with default values

Calls

This workflow calls the following tasks or subworkflows:

CALL TASKS check_terra_env

No explicit input mappings

CALL TASKS unpack_archive_to_bucket_path

Input Mappings (4)
Input Value
input_archive_files input_archive_files
gcloud_access_token gcloud_access_token
bucket_path_prefix if check_terra_env.is_running_on_terra && check_terra_env.is_backed_by_gcp then select_first([bucket_path_prefix, check_terra_env.workspace_bucket_path]) else select_first([bucket_path_prefix])
out_dir_name out_dir_name

Images

Container images used by tasks in this workflow:

🐳 Parameterized Image
⚙️ Parameterized

Configured via input:
docker

Used by 2 tasks:
  • check_terra_env
  • unpack_archive_to_bucket_path
← Back to Index

unpack_archive_to_bucket - Workflow Graph

🖱️ Scroll to zoom • Drag to pan • Double-click to reset • ESC to close

unpack_archive_to_bucket - WDL Source Code

version 1.0

import "../tasks/tasks_utils.wdl" as tasks_utils
import "../tasks/tasks_terra.wdl" as tasks_terra

workflow unpack_archive_to_bucket {
    meta {
        description: "Unpack archive(s) to a target location within a Google Storage bucket"
        author:      "Broad Viral Genomics"
        email:       "viral-ngs@broadinstitute.org"

        allowNestedInputs: true
    }

    input {
        Array[File] input_archive_files
        String?     bucket_path_prefix
        String?     out_dir_name
        
        String?     gcloud_access_token
    }

    parameter_meta {
        input_archive_files: {
            description: "List of input archive files to unpack.",
            patterns: ["*.tar", "*.tar.gz", "*.tgz", "*.tar.bz2", "*.tbz2", "*.tar.xz", "*.txz", "*.tar.lz4", "*.tar.zst"]
        }
        bucket_path_prefix: {
            description: "Path within the Google Storage bucket to unpack the archive files. If not provided, the root of the bucket will be used."
        }
        out_dir_name: {
            description: "Name of the (sub-)directory to unpack the archive contents to within the bucket prefix specified. If not provided, the contents will be unpacked to the bucket prefix."
        }
        gcloud_access_token: {
            description: "Access token for the Google Cloud Storage bucket, for account authorized to write to the bucket specified by 'bucket_path_prefix'. If not provided, the gcloud auth configuration of the execution environment will be obtained via 'gcloud auth print-access-token' for the active authenticated user (on Terra, the service worker/'pet' account)."
        }
    }

    call tasks_terra.check_terra_env

    # only run the task if we are running on GCP or the user provides an auth token to interact with GCP
    # if needed, we can also inspect 'check_terra_env.is_running_on_terra'
    if( check_terra_env.is_backed_by_gcp || defined(gcloud_access_token) ) {
        call tasks_utils.unpack_archive_to_bucket_path {
            input:
                input_archive_files = input_archive_files,
                gcloud_access_token = gcloud_access_token,
                bucket_path_prefix  = if (check_terra_env.is_running_on_terra && check_terra_env.is_backed_by_gcp) then select_first([bucket_path_prefix,check_terra_env.workspace_bucket_path]) else select_first([bucket_path_prefix]),
                out_dir_name        = out_dir_name
        }
    }
}