fission / fission-workflows

Workflows for Fission: Fast, reliable and lightweight function composition for serverless functions
Apache License 2.0
371 stars 42 forks source link

HTTP Runtime #207

Closed erwinvaneyk closed 6 years ago

erwinvaneyk commented 6 years ago

This change allows the workflow engine to support tasks directly referencing urls in the tasks. For the inputs these tasks follow the same conventions as the internal http function:

myTask:
  run: http://ifconfig.co
  inputs:
    method: POST
    body: "hello world"

To ensure consistency of behavior both approaches share the same implementation. For example, the above example using the HTTP runtime is equivalent to:

myTask:
  run: http
  inputs:
    url: http://ifconfig.co
    method: POST
    body: "hello world"

Part of this change also loosens the validation of the function reference to be equal to that of an URL (before it was a subset). This simplifies the model, and allows us to rely on the existing parsing and tooling around URLs.

The HTTP runtime can be enabled with the --http argument, which has been added as a default

soamvasani commented 6 years ago

I think the second more explicit variation makes more sense, and I propose it should be the only one allowed. Thoughts?

erwinvaneyk commented 6 years ago

Yes, I don't really have a preferred approach, which is why I initially wanted to support both. I am fine with only supporting the second approach from a users perspective. 👍