Skip to content

cwl cmds generator #140

Closed
Closed

Description

@sahilseth

Is there a way to create a list of all commands which need to run as part of the pipeline?

For example:

cwl-parser  hello.cwl

would create a table like this:

jobname      cmd                                                            
-----------  ---------------------------------------------------------------
sleep        sleep 10 && sleep 2;echo hello                                 
sleep        sleep 11 && sleep 8;echo hello                                 
sleep        sleep 11 && sleep 17;echo hello                                
create_tmp   head -c 100000 /dev/urandom > sample1_tmp_1                    
create_tmp   head -c 100000 /dev/urandom > sample1_tmp_2                    
create_tmp   head -c 100000 /dev/urandom > sample1_tmp_3                    
merge        cat sample1_tmp_1 sample1_tmp_2 sample1_tmp_3 > sample1_merged 
size         du -sh sample1_merged; echo MY shell: $SHELL            

Activity

  1. tetron commented on Oct 7, 2015

    @tetron
    Member

    Nothing like this currently exists, but it should be possible to implement. What's your use case?

  2. sahilseth commented on Oct 7, 2015

    @sahilseth
    Author

    I have a engine which can submit jobs to a hpcc cluster, and would like it to be able to run cwl workflows.

    As an input I need two files (cmds table, as shown above), and conf file; which strings all the steps together:

    jobname      sub_type   prev_jobs    dep_type   queue    memory_reserved  walltime    cpu_reserved  platform    jobid
    -----------  ---------  -----------  ---------  ------  ----------------  ---------  -------------  ---------  ------
    sleep        scatter    none         none       short               2000  1:00                   1  torque          1
    create_tmp   scatter    sleep        serial     short               2000  1:00                   1  torque          2
    merge        serial     create_tmp   gather     short               2000  1:00                   1  torque          3
    size         serial     merge        serial     short               2000  1:00                   1  torque          4
    

    I understand all this info is available, but not really in a tabular form. Could you direct me to some python functions which would help me create say a list/object with this info?

    http://docs.flowr.space

  3. tetron commented on Oct 7, 2015

    @tetron
    Member

    My first question is whether you would consider another approach, such as writing a cwl-runner that submits jobs directly to your hpc system, but also interoperates with Flowr.

    It is certainly possible to generate a command script from a CWL graph, but you will need to either perform static evaluation of expressions (see @yvdriess comment in #107 for some thoughts on this) which is only possible for a subset of workflows, or generate a command script that includes dynamic expression evaluation (which is necessary to support all possible workflows).

  4. sahilseth commented on Oct 7, 2015

    @sahilseth
    Author

    Awesome, I would first like to focus on flows which expand all bindings at the start of the workflow. I understand there are use-cases where one may like to use parameters determined at step A, and use them in step B. Currently, I don't have a way to handle that in flowr; but I can easily add that functionality.

    Since, I am newbie to cwl; would like to clarify,
    say we have a param read_length.

    step A asses it and creates a file called params.sh:

    export read_length=25
    

    Now at the start of step B, we add

    source params.sh
    
    mytool -l ${read_length}
    

    This should take care of this correct?

  5. sahilseth commented on Oct 16, 2015

    @sahilseth
    Author

    Thanks, looks good will try.

  6. mr-c commented on Oct 26, 2015

    @mr-c
    Member

    Thank you @sahilseth for asking!

    I'm going to close this for now. @sahilseth feel free to re-open this issue if needed.

  7. added a commit that references this issue on Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions