Skip to content

scattering environments as parameters #135

Open

Description

@satra

use case:

for many settings we often want to ensure that the same workflow runs under different environments and versions of software. one way is to build docker containers for each version (a la travis). however, in many practical cases we may want to run such regression testing on our own machines and clusters.

we have been working on an extension of unittest called testkraut that we were considering moving over to CWL and spent some time hacking and understanding how we could.

current hack:

create a wrapper cwl that takes as an input an environment spec/docker image id, then the internal tool writes a cwl file with the environment or requirements based on the parameter and runs the workflow.

Activity

  1. tetron commented on Sep 30, 2015

    @tetron
    Member

    It sounds like you want to parameterize the process requirements. You can already do this for environment variables and configuration files. You do need to translate each environment into a CWL description, as CWL discourages the "run a magic bash script" approach to configuring the environment. Does this make sense? If you can describe a specific case of something you do now I can provide an example in CWL and see if it meets your needs.

  2. satra commented on Oct 2, 2015

    @satra
    Author
  3. satra commented on Oct 2, 2015

    @satra
    Author

    @tetron - as a follow up to this:

    You do need to translate each environment into a CWL description, as CWL discourages the "run a magic bash script" approach to configuring the environment.

    could you please clarify this?

    i can't see how you will avoid this without restricting folks to use docker images and vms.

    for example, even installing a python environment through say conda - from continuum.io - would require a sequence of statements. and since package management across tools and environments is not a solved issue, it seems that the only way out is to use images, which would have required some script (bash, fabric, ansible, dockerfile, etc.,.) to configure.

  4. tetron commented on Oct 6, 2015

    @tetron
    Member

    I see, I think we're talking about slightly different things.

    What I was talking about is that to configure a tool to use an existing, installed environment, you should use CWL EnvVarRequirement or CreateFileRequirement to set the specific environment variables or configuration files the tool needs. The "magic bash script" I'm referring to is the typical environment setup script that mostly just sets environment variables (sometimes with some noisy conditional logic in an attempt to make it portable). For example virtualenv "activate": despite being 80 lines long all it does that actually matters for running Python programs is set VIRTUAL_ENV and PATH.

    Aside from providing Docker images or Dockerfiles, CWL currently doesn't say anything about installing an environment (or detecting an existing environment). We've been mulling over the idea of generalizing the notion of a container to include approaches other than Docker in issue #80.

  5. mr-c commented on Oct 26, 2015

    @mr-c
    Member

    @satra Thank you for starting this conversation, have we addressed your issue?

  6. satra commented on Oct 26, 2015

    @satra
    Author

    @mr-c - i don't think this is resolved fully. let me restate my requirement as the following:

    travis is a workflow. how would you recreate the travis workflow using cwl? perhaps that sort of general thinking is beyond the scope of cwl, but to be common, i think it should be.

    from a spec perspective, one should be able to take any line that is an "input" and scatter it, and then collate it. right now what can and cannot be scattered is compartmentalized to "inputs" to a tool, not how the tool runs, etc.,. therefore one can hack cwl to kind of do what i want. i.e. write a tool that takes an environment configuration (say py3 vs py2, numpy 1.x vs 1.y, glibc 2.XX) and either crashes because it can't create that environment, or having satisfied the requirements, instantiates or ensures the environment and runs some underlying script within the environment.

    in general this is hard, which is precisely why docker/vagrant are good intermediate options. but even running things within different docker environments would be a hack. so from a more general perspective i would like to scattering be applied to any leaf of the cwl spec tree.

  7. mr-c commented on Jul 18, 2016

    @mr-c
    Member

    @satra I agree that it would be useful to scatter over environment requirements, just like any other input.

    cwltool now supports overriding requirements in the input object, so you can address this without writing new CWL descriptions by varying the input document itself. However this wasn't documented in the 1.0 specification; it will be in the next release via #70

  8. added this to the unscheduled milestone on Jul 18, 2016
  9. added a commit that references this issue on Mar 21, 2018
  10. added a commit that references this issue on Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions