Re: Apache OpenWhisk Web Action HTTP Proxy

2019-04-30 Thread Nick Mitchell
this is great james, thanks for the awesome writeup. last year, i tried a
somewhat similar experiment with using openwhisk as a proxy to kubectl and
helm. it worked! but ended up not being viable due to cold starts. i either
needed to use a docker action to host the go binaries, or download them on
the fly. the latter, surprisingly, turned out to be faster... and the
results are borderline usable (1.2s cold start times, which was pretty nice
considering this included downloading a binary!).

but, compared to the 350ms typical response times from the base CLI, and
the 400ms or so response times to be had from a pod-hosted kubectl proxy...
i had to ditch the experiment before long.

thoughts here? i'd love to have used the serverless openwhisk-kubectl
proxy. did i miss something that would have made this a viable approach?

@starpit

On Tue, Apr 30, 2019 at 6:14 AM James Thomas  wrote:

> Hello Whiskers.
>
> I wanted to share an experiment I built recently to run existing web apps
> on openwhisk (with minimal changes) using custom Docker images support.
>
> https://github.com/jthomas/openwhisk-web-action-http-proxy
>
> It uses a HTTP proxy binary inside the runtime container to proxy incoming
> Web Action requests to the web apps run on a different port inside the same
> container. HTTP responses are returned to the platform as Web Action
> responses.
>
> For simple & stateless web apps - it worked better than I thought. Here's
> an example of how to use this with an exsting Node.js+Express Web App:
>
>
> https://github.com/jthomas/openwhisk-web-action-http-proxy#nodejs--express-example
>
> $ git clone https://github.com/jthomas/express_example
> $ cd express_example & npm install
> $ zip -r action.zip *
> $ wsk action create --docker jamesthomas/generic_node_proxy --web true
> --main "npm start" -p "__ow_proxy_port" 3000 web_app action.zip
> $ wsk action get web_app --url
>
> Two different options are available for getting web application source
> files into the runtime environment - runtime injection using zip files or
> putting source files directly into the runtime image.
>
> There's lots more details about the project in the project README and I've
> now written a blog post in more details about the project here:
>
> http://jamesthom.as/blog/2019/04/29/apache-openwhisk-web-action-http-proxy/
>
> --
> Regards,
> James Thomas
>


Re: Move default Node.js runtime to v10?

2019-04-30 Thread James Thomas
PR is now open for this:
https://github.com/apache/incubator-openwhisk/pull/4466

On Sat, 20 Apr 2019 at 16:09, Carlos Santana  wrote:

> +1 to move to nodejs10
>
> - Carlos Santana
> @csantanapr
>
> > On Apr 19, 2019, at 3:03 PM, Rodric Rabbah  wrote:
> >
> > This is the catalog actions related issue that I opened at the time I
> > tried: https://github.com/apache/incubator-openwhisk-catalog/issues/294
> >
> > Some of the actions which require packages available in the node6 runtime
> > fail in the newer node10 because we don't bundle any packages. So those
> > actions have to "zip" up their dependencies. The patch that was made was
> to
> > pin the catalog actions to node6 with the project deploy configuration.
> So
> > my assessment is that we can flip the default once again and should be OK
> > this time... but the catalog actions that are pinned to node6 will need
> to
> > be updated in a second phase.
> >
> > -r
> >
> >
> >
> >> On Thu, Apr 18, 2019 at 12:52 PM James Thomas 
> wrote:
> >>
> >> On Wednesday's community call I asked about moving the default Nodejs
> >> version in the project to v10.
> >>
> >> Node.js 6 (which is the current default version) reaches  "end of life"
> on
> >> April 30th according to https://github.com/nodejs/Release. Node.js 10
> is
> >> the current LTS version and is supported until April 2021.
> >>
> >> Rodric mentioned this was started previously but ran into issues with
> the
> >> providers?
> >> https://github.com/apache/incubator-openwhisk/issues/4265
> >>
> >> Does anyone have any issues with going forward with this work (once any
> >> issues have been resolved)? I see there is some work going on to fix the
> >> failures (https://github.com/apache/incubator-openwhisk/pull/4450)
> >>
> >> --
> >> Regards,
> >> James Thomas
> >>
>


-- 
Regards,
James Thomas


Apache OpenWhisk Web Action HTTP Proxy

2019-04-30 Thread James Thomas
Hello Whiskers.

I wanted to share an experiment I built recently to run existing web apps
on openwhisk (with minimal changes) using custom Docker images support.

https://github.com/jthomas/openwhisk-web-action-http-proxy

It uses a HTTP proxy binary inside the runtime container to proxy incoming
Web Action requests to the web apps run on a different port inside the same
container. HTTP responses are returned to the platform as Web Action
responses.

For simple & stateless web apps - it worked better than I thought. Here's
an example of how to use this with an exsting Node.js+Express Web App:

https://github.com/jthomas/openwhisk-web-action-http-proxy#nodejs--express-example

$ git clone https://github.com/jthomas/express_example
$ cd express_example & npm install
$ zip -r action.zip *
$ wsk action create --docker jamesthomas/generic_node_proxy --web true
--main "npm start" -p "__ow_proxy_port" 3000 web_app action.zip
$ wsk action get web_app --url

Two different options are available for getting web application source
files into the runtime environment - runtime injection using zip files or
putting source files directly into the runtime image.

There's lots more details about the project in the project README and I've
now written a blog post in more details about the project here:

http://jamesthom.as/blog/2019/04/29/apache-openwhisk-web-action-http-proxy/

-- 
Regards,
James Thomas


[slack-digest] [2019-04-29] #random

2019-04-30 Thread OpenWhisk Team Slack
2019-04-29 18:35:58 UTC - Rodric Rabbah: 

https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1556562958002400



[slack-digest] [2019-04-29] #general

2019-04-30 Thread OpenWhisk Team Slack
2019-04-29 10:03:20 UTC - Adam Varsano: Can I call in a sequence from one 
action to multiple actions in parallel?
https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1556532200024000?thread_ts=1556532200.024000=C3TPCAQG1

2019-04-29 13:44:13 UTC - Rodric Rabbah: good morning :sunny:
https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1556545453024300

2019-04-29 13:44:38 UTC - Rodric Rabbah: @Adam Varsano do you need just fan out 
or fan out and a join of all the parallel actions?
https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1556545478024900

2019-04-29 14:29:46 UTC - Roberto Diaz: I think that you can create a sequence 
in this way:
https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1556548186025000?thread_ts=1556532200.024000=C3TPCAQG1

2019-04-29 14:30:04 UTC - Roberto Diaz: your initial action - trigger that 
call multiple actions in parallel
https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1556548204025200?thread_ts=1556532200.024000=C3TPCAQG1