Skip to content

additional CLI wrapper (on top of HTTP/flask app) #198

@keighrim

Description

@keighrim

New Feature Summary

Running a CLAMS as a stateless HTTP app makes app invocation and data transfer clean and standardized, and most importantly, language-agnostic interface. However it comes with cost of computational overhead of running server processes and handling TCP communication.

At the moment, all CLAMS apps developed in the team is written under Python, with the support of SDK, so to provide an additional interface to users maybe for quicker test/debug, we'd like to include a wrapper for unix-shell command line interface, just like we are providing flask wrapper to turn the app code into a HTTP web app.

Basic idea;

  • When a developer uses clams develop to start a new app, it generates
    • app.py: main implementation of the App class
    • metadata.py: defines app metadata and runtime parameters
    • (new) cli.py: a completely unmanned interpreter of metadata.py + app.py to provide a standard POSIX CLI
  • users can use app.py to spin up a webapp and call the app with URL plus query string for runtime parameters, or directly call cli.py with shell arguments for runtime parameters
  • input MMIF and output MMIF should just use stdin and stdout respectively.

Some random notes;

  • CLI implementation is not language-agnostic, hence cli.py can be a recommended implementation, but shouldn't be a requirement for CLAMS app specification.
  • as a python program (probably based on arg_parser module), there will be some basic expectation for some flags (--help, --version, etc) but since we don't put any constraints for app developers to pick a parameter name (as long as it is URL-compatible), those basic flags should be disabled (an app can take version= runtime parameter, for example).
  • as an equivalent to GET request, users can just run metadata.py to get JSON-formatted app metadata.

Will add more as we discuss more details.

Related

No response

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨NNew feature or request

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions