Skip to content

Function artifact inputs as command parameters #289

@AntoineDao

Description

@AntoineDao

I have noticed that @chriswmackey has used an input artifact as a parameter inside of a function's command. Technically this should not be allowed by Queenbee and we could write a test for it to make sure it doesn't break. Here is a shortened example of the command Function written by Chris:

Should be Invalid

type: Function
inputs:
- type: FunctionFileInput
  name: condition-csv
  description: A CSV file of thermal conditions output by a thermal mapping function.
  required: true
  path: condition.csv
name: tcp
command: ladybug-comfort map tcp {{inputs.condition-csv}}

Valid equivalent

type: Function
inputs:
- type: FunctionFileInput
  name: condition-csv
  description: A CSV file of thermal conditions output by a thermal mapping function.
  required: true
  path: condition.csv
name: tcp
command: ladybug-comfort map tcp condition.csv

Bug or Feature?

I think this issue could be turned into something more interesting than a simple bug fix. My thinking is that we already duplicate the condition.csv path in the example above.

What do we think of allowing this sort of parametrization of the command where an artifact input can be templated in the command such that executors (ie: queenbee-argo and queenbee-luigi then replace the templated value with the path key in the input artifact object?

This would have the following benefits:

  • Avoid duplicated code which could lead to errors
  • Provide a unified-ish syntax for input parameters and artifacts

I'm going to tag the people that seem most relevant to add to this discussion here: @chriswmackey, @mostaphaRoudsari and @tymokvo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions