What: An IMP in TS that calls a shell command to calculate the impacts from some observations.
Why: So we can have a language agnostic way to interact with models written in any language.
SoW:
[x] The configuration for this imp is the path/name of a shell command
[x] The shell command takes as input YAML in STDIN and exports YAML results in STDOUT and STDERR.
[x] Pass in just the observations and any configuration (i.e. what you see under a component in the IMPL).
[x] The response will be the same IMPL you passed in but with another sibling node called Impacts that contain your impact metrics.
[ ] The response might also be some errors, these should be parsed and passed out as exceptions.
NOTE: This is going to require some co-ordination between the person making the Python command line IMP caller here https://github.com/Green-Software-Foundation/ief/issues/84 please coordinate with them esp. if there are requirements for how to communicate back and forth between your two processes.
For example, in your calculate function.
create some YAML the represents the inputs to your ShellCommand, like so:
basic functionality is implemented in #94, tested locally with a mock pimpl.py exposing a CLI
next
needs to pull path to external model directly from impl/config
Paz and I agreed for pimpl.py to append errors to output yaml for each observation. The shell plugin will parse these out and report to stderr. This requires another sync with Paz as it's dependent upon development of pimpl.py (Monday)
will then require input from @gnanakeethan to integrate this into existing framework and add some appropriate tests
What: An IMP in TS that calls a shell command to calculate the impacts from some observations. Why: So we can have a language agnostic way to interact with models written in any language. SoW:
NOTE: This is going to require some co-ordination between the person making the Python command line IMP caller here https://github.com/Green-Software-Foundation/ief/issues/84 please coordinate with them esp. if there are requirements for how to communicate back and forth between your two processes.
For example, in your
calculate
function.create some YAML the represents the inputs to your ShellCommand, like so:
Spawn the Shell that is configured and pass the YAML as STDIN (see https://stackoverflow.com/questions/37685461/how-to-pass-stdin-to-node-js-child-process)
Parse the repones and pass the data out of your calculate function to the caller.