Failing to use $mixin to include "global" settings
1
0
Entering edit mode
8.1 years ago

(Duplication of https://github.com/common-workflow-language/common-workflow-language/pull/309)

I want to split out some off my settings to a central configuration file and decided to use the mixin keyword. I started out with this example: http://www.commonwl.org/v1.0/SchemaSalad.html#Mixin

workflow.yml:

cwlVersion: "v1.0"

class: Workflow

inputs:
  $mixin: settings.yml
  inpFile:
    type: File
...

settings.yml:

java6:
  type: string
  default: "/opt/java6/bin/java"
java8:
  type: string
  default: "/opt/java8/bin/java"

Running this through cwltool (v1.0.20161110155008) I get the following error:

Tool definition failed validation:
While checking field `inputs`
  While checking object `file:///DEEP_fhgfs/projects/karln/WGBS/161007.cwlPlayground/git/BS-seq-pipelines/CWL/pipelines/postMap/bisSNP-realignPipe.yml#$mixin`
    Field `type` contains undefined reference to `../settings.yml`, tried [u'file:///DEEP_fhgfs/projects/karln/WGBS/161007.cwlPlayground/git/BS-seq-pipelines/CWL/pipelines/postMap/bisSNP-realignPipe.yml#../settings.yml']

My question is two-fold:

  1. What am I doing wrong? I assume that I'm formatting the settings.yml file wrongly. (Including the curly brackets from the example renders me another error)
  2. Is there a better way to provide global settings for multiple tools?

(Edit: after trying to figure it out for a while this is as far as I got. I also found an issue on the CWL-github page referring to something similar)

Common-Workflow-Language cwl • 1.9k views
ADD COMMENT
0
Entering edit mode

http://www.yamllint.com/

you can use that to check your yaml

ADD REPLY
0
Entering edit mode

Thanks for the site. Very useful.

Both files validate, but the tool helped me what could be the problem. The $mixin line is an entry in the inputs array. This leads to that the content of the settings.yml file becomes a subarray instead of being mixed in with the other elements.

ADD REPLY
0
Entering edit mode
ADD REPLY
1
Entering edit mode
8.1 years ago

Hello Karl,

  1. You don't appear to be doing anything wrong -- looks like you found a bug in the reference implementation!
  2. $mixin was designed to solve your use case, so there isn't a better way

We don't have any CWL conformance tests that use mixins, hence why the pull request https://github.com/common-workflow-language/common-workflow-language/pull/309 is open.

ADD COMMENT
0
Entering edit mode

OK, after doing some things wrong I found pull request 309 and it confirmed that I was on the right track :) I'll wait for it to resolve. It would be nice to have, but I can work around it for now.

ADD REPLY

Login before adding your answer.

Traffic: 1926 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6