Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

idea: a lambda / OpenWhisk style programming model? #5762

Closed
jstrachan opened this issue Feb 24, 2016 · 1 comment
Closed

idea: a lambda / OpenWhisk style programming model? #5762

jstrachan opened this issue Feb 24, 2016 · 1 comment

Comments

@jstrachan
Copy link
Contributor

so folks like the simplicity of the Amazon Lambda and OpenWhisk kinda programming models. e.g. here's some examples https://github.com/awslabs/lambda-refarch-iotbackend

What might be nice is to let folks pick any language (go lang, nodejs, swift, rust, whatever) to write some code ('a function') and then bind it to events via a subscription.

e.g. folks could write a simple REST service in nodejs or swift like these [examples](https://github.com/fabric8-quickstarts/swift-example].

Then folks could define their subscription rules in a declarative file somewhere:


---
# triggers for local HTTP URIs based on subscriptions to external URLs (which use Camel components)
/foo: 
  uri: "activemq:Some.Queue?concurrentConsumers=20"
/bar:
  uri: "timer:foo?period=5000"

then they write a normal nodejs / swift / whatever app that listens to events foo and bar. Then the build process deploys a sidecar container which is implemented using Apache Camel that subscribes to the URIs and invokes the local endpoints.

e.g. the subscription rules are converted into simple routes something like...

from("activemq:Some.Queue?concurrentConsumers=20").to("http://localhost:8080/foo")

Maybe using JSON marshalling in there or something...

We could hide the HTTP plumbing behind a little language/framework specific bit of glue; so the go/node/swift programmer just writes native language functions called foo and bar and the build system automatically binds those functions to local HTTP endpoints.

After the build system, folks get a docker image for their functions and a ReplicationController which in the pod template has a sidecar container that implements the subscription manager. Also we should try get the sidecar container to figure out auto-scaling; as the subscription should hopefully be able to figure out a good algorithm to autoscale the pods based on the upstream event size. e.g. for HTTP use the metrics of HTTP volume; for messages, use the queue depth and so forth

@jstrachan
Copy link
Contributor Author

gonna mark this one as fixed since we have funktion now:
https://github.com/fabric8io/funktion/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants