Skip to content

Recreate developer environment for Gen3-Workflow, Nextflow, and Funnel #1227

@lbeckman314

Description

@lbeckman314

Overview ⚙

Currently the "MVP" for Funnel deployments to Kubernetes is based off submitting tasks with Funnel alone.

This can lead to unexpected or unclear behaviors when Funnel is run as part of a larger workflow "setup" such as with Gen3-Workflow and Nextflow.

Current Setup ⚠️

sequenceDiagram
    title Current Funnel K8s Setup
    participant User
    participant Funnel Server
    participant Funnel Worker/Executor

    User-->>Funnel Server: TES Tasks
    Note over Funnel Server: Creates Worker/Executor
    Funnel Server-->>Funnel Worker/Executor: TES Tasks
    Note over Funnel Worker/Executor: Runs Tasks
    Funnel Worker/Executor-->>Funnel Server: Tasks Status
    Funnel Server-->>User: Tasks Status
Loading

Expected Setup ✅

sequenceDiagram
    title Expected Funnel K8s Setup
    participant User
    participant Nextflow
    participant Gen3-Workflow
    participant Funnel Server
    participant Funnel Worker/Executor

    User-->>Nextflow: Nextflow Workflow
    Note over Nextflow: Translates Workflow to TES Tasks
    Nextflow-->>Gen3-Workflow: TES Tasks
    Note over Gen3-Workflow: AuthZ/AuthN
    Gen3-Workflow-->>Funnel Server: TES Tasks
    Note over Funnel Server: Creates Worker/Executor
    Funnel Server-->>Funnel Worker/Executor: TES Tasks
    Note over Funnel Worker/Executor: Runs Tasks
    Funnel Worker/Executor-->>Funnel Server: Tasks Status
    Funnel Server-->>Gen3-Workflow: Tasks Status
    Gen3-Workflow-->>Nextflow: Tasks Status
    Nextflow-->>User: Workflow Status
Loading

Next Steps 🌀

salmon-example.nf
reads_input = "$baseDir/input_data/gut_{1,2}.fq"
workflow {
    directory_output_test()
    read_pairs_ch = channel.fromFilePairs( reads_input, checkIfExists: true )
    salmon_quant(salmon_index.out, read_pairs_ch)
}

process directory_output_test {
    output:
    path 'mydirectory'    <=== doesn't work
    path('mydirectory/*') <=== works
    
    script:
    """
    mkdir mydirectory
    touch mydirectory/file1.txt
    touch mydirectory/file2.txt
    """
}

process salmon_quant {
    input:
    path index
    tuple val(pair_id), path(reads)

    output:
    path pair_id

    script:
    """
    salmon quant -i index -l A -1 ${reads[0]} -2 ${reads[1]} -o $pair_id
    """
}
reproducible-example.nf
input_path = "s3://cellxgene-census-public-us-west-2/cell-census/release.json"

process print_and_output {
    label 'tesStep'

    input:
    path input_files

    output:
    stdout emit: print_and_output_log
    path('*.json'), emit: output_files

    script:
    """
    echo \$PWD
    echo "  Listing:"
    ls
    echo "  Contents:"
    cat release.json | tee output.json
    """
}

workflow {
    input_files = Channel.fromPath(input_path)
    print_and_output(input_files)
}
Shared in

Metadata

Metadata

Assignees

Labels

blockerblocks user interactions

Type

Projects

Status

To-Do

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions