Re: Invoking actions via websockets

2018-10-29 Thread James Thomas
Re-posting from the external issue...

This would be an excellent feature of the API Gateway . Websocket support
is something developers ask about a lot...

- We would need to define the error handling process when the the triggers
are unavailable or rate-limited. How would we signify to a client that a
message wasn't delivered?

Another (more difficult) thing to consider is how to make it possible for
messages to be sent to listening clients outside of responding to an
incoming event. If we take one of the most common examples for a websocket
application, a chat application, how could we enable this feature?

Ideally, an action could call the API Gateway service with a message to
pass to one or more clients currently connected to pass messages that
arrived from other sources.

On Fri, 26 Oct 2018 at 22:58, Carlos Santana  wrote:

> Hi Matt
>
> Do you require changes in the controller, invoker, or runtimes for this?
>
> Or you think first implementation would be all apigateway side holding the
> connecting open as a websocket server to the client, as long the client
> keeps sending messages/frames, the apigateway calls web actions with a
> single connection to one of the edge/controllers with a keep alive.
>
>
> -- Carlos
>
> On Fri, Oct 26, 2018 at 2:10 PM Matt Hamann 
> wrote:
>
> > I just opened an issue[1] in the `apigateway` repo to discuss the
> > ability for the gateway to handle websocket connections from a client
> > that could invoke a whisk action `onMessage`.
> >
> > I'd like to get feedback from the community at large as to this
> > proposal. Interested in your thoughts, ideas, etc.
> >
> > [1] https://github.com/apache/incubator-openwhisk-apigateway/issues/325
> >
> > -Matt
> > matthew.ham...@gmail.com
> >
>


-- 
Regards,
James Thomas


Re: A question about concurrency in OpenWhisk

2018-10-29 Thread Michele Sciabarra
Ok so my assumption is correct and we can release the runtime. 
The runtime can be extended to handle a pool of underlying action distributing 
the requests to the available handler. There will be separated channels for 
each action, without overlap.  In the current shape with concurrent actions 
there can be an "out-of-band" behavior.

-- 
  Michele Sciabarra
  mich...@sciabarra.com

- Original message -
From: Rodric Rabbah 
To: dev@openwhisk.apache.org
Subject: Re: A question about concurrency in OpenWhisk
Date: Mon, 29 Oct 2018 07:09:02 -0400

Today there is at most one activation at a time per container we. A PR from 
Tyson will allow a runtime to opt into intro container concurrency and so the 
invoker will send up to N  invocations to that the container when possible.

https://github.com/apache/incubator-openwhisk/pull/2795

-r

> On Oct 29, 2018, at 7:06 AM, Michele Sciabarra  wrote:
> 
> I would like to understand a bit more how concurrency is handled by the 
> Invoker.
> 
> If there are, say, 2 concurrent requests, can the invoker send the second 
> request to the same runtime BEFORE it has completed the first request? I have 
> seen some tests related in the nodejs runtime but none in the basic tests.
> 
> Also, Carlos mentioned the need to increase the concurrency in the same 
> runtime. It can be done but I need to know the requirements. So far I assumed 
> that until a request is not completed, the invoker will spawn another runtime 
> to serve them. 
> 
> 
> 
> -- 
>  Michele Sciabarra
>  mich...@sciabarra.com


Re: A question about concurrency in OpenWhisk

2018-10-29 Thread Rodric Rabbah
Today there is at most one activation at a time per container we. A PR from 
Tyson will allow a runtime to opt into intro container concurrency and so the 
invoker will send up to N  invocations to that the container when possible.

https://github.com/apache/incubator-openwhisk/pull/2795

-r

> On Oct 29, 2018, at 7:06 AM, Michele Sciabarra  wrote:
> 
> I would like to understand a bit more how concurrency is handled by the 
> Invoker.
> 
> If there are, say, 2 concurrent requests, can the invoker send the second 
> request to the same runtime BEFORE it has completed the first request? I have 
> seen some tests related in the nodejs runtime but none in the basic tests.
> 
> Also, Carlos mentioned the need to increase the concurrency in the same 
> runtime. It can be done but I need to know the requirements. So far I assumed 
> that until a request is not completed, the invoker will spawn another runtime 
> to serve them. 
> 
> 
> 
> -- 
>  Michele Sciabarra
>  mich...@sciabarra.com


A question about concurrency in OpenWhisk

2018-10-29 Thread Michele Sciabarra
I would like to understand a bit more how concurrency is handled by the Invoker.

If there are, say, 2 concurrent requests, can the invoker send the second 
request to the same runtime BEFORE it has completed the first request? I have 
seen some tests related in the nodejs runtime but none in the basic tests.

Also, Carlos mentioned the need to increase the concurrency in the same 
runtime. It can be done but I need to know the requirements. So far I assumed 
that until a request is not completed, the invoker will spawn another runtime 
to serve them. 



-- 
  Michele Sciabarra
  mich...@sciabarra.com


Re: Profiling OpenWhisk operation

2018-10-29 Thread Carlos Santana
If you just want Graphana dashboards you can use the instructions in the
docs that point to an image with StastD here
https://github.com/apache/incubator-openwhisk/blob/master/docs/metrics.md

If you want to get the metrics from StatsD to Prometheus I found this looks
like it can be use, it even says you can skip StatsD server and just point
directly the the exporter https://github.com/prometheus/statsd_exporter

If you have success would be awesome for you to add a reference to the
metrics doc.

— Carlos
On Mon, Oct 29, 2018 at 6:55 AM Erez Hadad  wrote:

> Hi folks,
>
> I've found several indications in the OpenWhisk code, showing that it uses
> Kamon (kamon.io) for reporting internal metrics and profiling.
> Can someone please explain (or direct to an explanation) how to set up
> OpenWhisk profiling with Kamon and Prometheus?
>
> Regards,
> -- Erez
>
> Erez Hadad, PhD
> Cloud System Technologies
> IBM Research - Haifa
> email: er...@il.ibm.com
> phone: +972-4-829-6509
>
>
>
>


Profiling OpenWhisk operation

2018-10-29 Thread Erez Hadad
Hi folks,

I've found several indications in the OpenWhisk code, showing that it uses 
Kamon (kamon.io) for reporting internal metrics and profiling.
Can someone please explain (or direct to an explanation) how to set up 
OpenWhisk profiling with Kamon and Prometheus?

Regards,
-- Erez

Erez Hadad, PhD
Cloud System Technologies
IBM Research - Haifa
email: er...@il.ibm.com
phone: +972-4-829-6509