[GitHub] csantanapr commented on issue #3558: WebAction async

2018-04-20 Thread GitBox
csantanapr commented on issue #3558: WebAction async
URL: 
https://github.com/apache/incubator-openwhisk/issues/3558#issuecomment-383249089
 
 
   Yep a query and header parameter was brought up but this would need to be 
special named as we don’t want to conflict with a header or query intended for 
the action. 
   
   A header @rabbah mentioned already is kind of pain to add a header in some 
tools like Travis only allows a url to be call
   
   On my last proposal I indicated that this issue is only to cover the minimum 
to do invoke an action in async way nothing to deal with triggers. 
   
   /web/trigger can be discuss in another issue, right I see it as a way to 
make a trigger fire with no whisk authentication the trigger/rule/actions owner 
gets assigned the bill of the duration :-), allowing anything to fire the 
trigger.  


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] csantanapr commented on issue #3558: WebAction async

2018-04-20 Thread GitBox
csantanapr commented on issue #3558: WebAction async
URL: 
https://github.com/apache/incubator-openwhisk/issues/3558#issuecomment-383249089
 
 
   Yep a query and header parameter was brought up but this would need to be 
special named as we don’t want to conflict with a header or query intended for 
the action. 
   
   On my last proposal I indicated that this issue is only to cover the minimum 
to do invoke an action in async way nothing to deal with triggers. 
   
   /web/trigger can be discuss in another issue, right I see it as a way to 
make a trigger fire with no whisk authentication the trigger/rule/actions owner 
gets assigned the bill of the duration :-), allowing anything to fire the 
trigger.  


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] csantanapr closed pull request #186: Helm chart improvements

2018-04-20 Thread GitBox
csantanapr closed pull request #186: Helm chart improvements
URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/186
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/helm/README.md b/helm/README.md
index 3624054..6389115 100644
--- a/helm/README.md
+++ b/helm/README.md
@@ -1,50 +1,26 @@
 ## Overview
 
-[Apache OpenWhisk](http://www.openwhisk.org) is a popular container-native 
serverless platform. 
-This chart targets to deploy an OpenWhisk cluster over Kubernetes cluster.
+This directory contains a Helm chart can be used to deploy Apache OpenWhisk to 
a Kubernetes cluster.
 
-This chart is designed to deploy the following 6 kinds of containers on a 
running Kubernetes cluster:
+It currently does not support all of the options available in the more
+manual deployment process described in the top-level README.md,
+however we are actively working on closing the gaps.
 
-- `zookeeper`: deployed in Kubernetes as a `Service`(backended by a 
`Deployment`). Provides `zookeeper` service for `kafka` node.
-- `kafka`: deployed in Kubernetes as a `StatefulSet`. Depends on `zookeeper` 
service and provides message service for `controller` node and `invoker` node.
-- `couchdb`: deployed in Kubernetes as a `Service`(backended by a 
`Deployment`). Provides database service for `controller` node and `invoker` 
node.
-- `controller`: OpenWhisk controller component, deployed as a `StatefulSet`.
-- `invoker`: OpenWhisk invoker component, deployed as a `StatefulSet`.
-- `nginx`: deployed in Kubernetes as a combination of a `Service`(of type 
`NodePort`, backended by a `Deployment`), a `ConfigMap` and a `Secret`. 
Provides public access endpoint for end user to visit OpenWhisk.
-
-By default, deploying this chart will result in deploying 6 containers in a 
Kubernetes cluster, which forms a minimum deployment of a workable OpenWhisk 
environment. Please modify `values.yaml` and corresponding template files to 
deploy a bigger customized OpenWhisk cluster.
+The default values used in the chart are designed to deploy a minimal
+OpenWhisk deployment suitable for local development or testing on
+minikube or a single node Kubernetes cluster. We will soon provide a
+second set of default values suitable for larger-scale deployments.
 
 ## Deployment Steps
 
 Please follow the following steps in this section to use 
[Helm](https://github.com/kubernetes/helm) to deploy this chart.
 
-### Step 1. Prepare Docker Images
-
-The first step is to prepare docker images used by this chart on your 
Kubernetes node. Here is a summary of the images needed:
-
-- `zookeeper`: uses `zookeeper:3.4` at present.
-- `kafka`: uses `wurstmeister/kafka:0.11.0.1`.
-- `couchdb`: uses `openwhisk/kube-couchdb`, this is a pre-built docker image 
made from official `openwhisk-on-kubernetes`. For more information, please 
check the [docker 
file](https://github.com/apache/incubator-openwhisk-deploy-kube/blob/master/docker/couchdb/Dockerfile)
 for this image.
-- `controller`: uses OpenWhisk official `openwhisk/controller` image.
-- `invoker`: uses OpenWhisk official `openwhisk/invoker` image.
-- `nginx`: uses `nginx:1.11`.
-
-This chart provides default images for all of the above containers, so you can 
try deploy without building any images in advance.
-
-This chart will also automatically pull the following action images for 
`invoker` once deployment is finished:
-
-- openwhisk/nodejsactionbase 
-- openwhisk/nodejs6action
-- openwhisk/dockerskeleton
-- openwhisk/python2action
-- openwhisk/python3action
-- openwhisk/action-swift-v3.1.1
-- openwhisk/swift3action
-- openwhisk/java8action
+### Step 1. Prepare Kubernetes and Helm
 
-### Step 2. Prepare Kubernetes and Helm
+Make sure that you have a running Kubernetes cluster and a `kubectl`
+client connected to this cluster as described in the [Requriements 
section](../README.md#requirements) of the main README.md.
 
-Make sure that you have a running Kubernetes cluster and a `kubectl` client 
connected to this cluster.
+### Step 2. Install and configure Helm
 
 Then please install [Helm](https://github.com/kubernetes/helm) and run the 
following command to init `Helm Tiller`:
 ```shell
@@ -63,14 +39,26 @@ Then grant corresponding cluster role to `Helm` user:
 kubectl create clusterrolebinding tiller-cluster-admin 
--clusterrole=cluster-admin --serviceaccount=kube-system:default
 ```
 
-Finally, create a new namespace named `openwhisk`:
+### Step 3. Prepare your cluster for OpenWhisk
+
+1. Create a new namespace named `openwhisk`:
 ```shell
 kubectl create namespace openwhisk
 ```
 
-Now, you should have an available environment to deploy OpenWhisk!
+2. Identify the Kubernetes worker nodes that should be used to execute
+user containers.  Do this by labeling 

[GitHub] dgrove-oss commented on issue #186: Helm chart improvements

2018-04-20 Thread GitBox
dgrove-oss commented on issue #186: Helm chart improvements
URL: 
https://github.com/apache/incubator-openwhisk-deploy-kube/pull/186#issuecomment-383238254
 
 
   @csantanapr @rabbah -- would one of you be willing to review & merge if the 
changes look reasonable to you?
   
   Not doing everything the non-Helm install is doing yet, but assuming the 
docker images are already downloaded, it gets from nothing to a working basic 
install on minikube in about 3 minutes with just a couple of commands...


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] gorkem commented on issue #31: Java action that depends on packages jar file fails

2018-04-20 Thread GitBox
gorkem commented on issue #31: Java action that depends on packages jar file 
fails
URL: 
https://github.com/apache/incubator-openwhisk-runtime-java/issues/31#issuecomment-383222030
 
 
   @rabbah Are dependencies packaged into /lib folder even supposed to work. 
This is not really a Java standard and I do not see anything to enable this on 
the runtime. 
   
   @brunogirin Do your functions work OK when you package them as one jar?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dubee commented on issue #2855: Cache database attachments

2018-04-20 Thread GitBox
dubee commented on issue #2855: Cache database attachments
URL: 
https://github.com/apache/incubator-openwhisk/pull/2855#issuecomment-383188018
 
 
   PG4 1600  


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dubee commented on issue #3416: Unit test PoolingRestClient

2018-04-20 Thread GitBox
dubee commented on issue #3416: Unit test PoolingRestClient
URL: 
https://github.com/apache/incubator-openwhisk/pull/3416#issuecomment-383187908
 
 
   PG3 2154  


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] dubee commented on issue #3416: Unit test PoolingRestClient

2018-04-20 Thread GitBox
dubee commented on issue #3416: Unit test PoolingRestClient
URL: 
https://github.com/apache/incubator-openwhisk/pull/3416#issuecomment-383187471
 
 
   @markusthoemmes, I think that could be done in a different PR if we want to 
make requestQueue configurable. What do you think that advantages are there?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #3558: WebAction async

2018-04-20 Thread GitBox
rabbah commented on issue #3558: WebAction async
URL: 
https://github.com/apache/incubator-openwhisk/issues/3558#issuecomment-383142307
 
 
   On /trigger my inclination is to support it only on webactions today (with 
an implicit trigger and rule - any webaction can be invoked in this way, 
asynchrinously, without creating a trigger or rule), but this will cause 
ambiguity later if we allow real triggers to be named so I think my suggestion 
was not well thought out at the time. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #3558: WebAction async

2018-04-20 Thread GitBox
rabbah commented on issue #3558: WebAction async
URL: 
https://github.com/apache/incubator-openwhisk/issues/3558#issuecomment-383141723
 
 
   in a slack chat Carlos brought up the query parameter but we found that it 
could be ambiguous since it can be an parameter intended for the action itself. 
 iirc he also suggested a privileged name such as __OW_ASYNC.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ddragosd commented on issue #3558: WebAction async

2018-04-20 Thread GitBox
ddragosd commented on issue #3558: WebAction async
URL: 
https://github.com/apache/incubator-openwhisk/issues/3558#issuecomment-383140405
 
 
   Just making sure we cover all options: was the query param `async=true` 
considered as well? 
   
   On the `/trigger`: does the proposal suggest it should work with both 
“triggers” and “webactions”, or limit it to “webactions” only ?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ddragosd commented on issue #3199: One tid for the whole system.

2018-04-20 Thread GitBox
ddragosd commented on issue #3199: One tid for the whole system.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3199#issuecomment-383134714
 
 
   :+1: @rabbah 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] klcodanr commented on issue #3540: Vagrant Hello Not Starting on Mac

2018-04-20 Thread GitBox
klcodanr commented on issue #3540: Vagrant Hello Not Starting on Mac
URL: 
https://github.com/apache/incubator-openwhisk/issues/3540#issuecomment-383106148
 
 
   Confirmed, thanks @csantanapr !


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on a change in pull request #3563: Skip log collection if the log-limit is set to "0".

2018-04-20 Thread GitBox
rabbah commented on a change in pull request #3563: Skip log collection if the 
log-limit is set to "0".
URL: 
https://github.com/apache/incubator-openwhisk/pull/3563#discussion_r183050508
 
 

 ##
 File path: common/scala/src/main/resources/application.conf
 ##
 @@ -156,6 +156,13 @@ whisk {
 std = 256 m
 }
 
+# action memory configuration
 
 Review comment:
   Wrong comment. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] markusthoemmes opened a new pull request #3563: Skip log collection if the log-limit is set to "0".

2018-04-20 Thread GitBox
markusthoemmes opened a new pull request #3563: Skip log collection if the 
log-limit is set to "0".
URL: https://github.com/apache/incubator-openwhisk/pull/3563
 
 
   Enables the per-action log-limit configuration to be read from config 
(min/max/std values respectively). It also skips the entire log-collecting 
process if that limit is set to 0 (no logs allowed).
   
   ## TODO
   
   - [ ] A test  
   
   ## My changes affect the following components
   
   
   - [ ] API
   - [X] Controller
   - [ ] Message Bus (e.g., Kafka)
   - [ ] Loadbalancer
   - [X] Invoker
   - [ ] Intrinsic actions (e.g., sequences, conductors)
   - [ ] Data stores (e.g., CouchDB)
   - [ ] Tests
   - [ ] Deployment
   - [ ] CLI
   - [ ] General tooling
   - [ ] Documentation
   
   ## Types of changes
   
   - [ ] Bug fix (generally a non-breaking change which closes an issue).
   - [ ] Enhancement or new feature (adds new functionality).
   - [ ] Breaking change (a bug fix or enhancement which changes existing 
behavior).
   
   ## Checklist:
   
   
   - [X] I signed an [Apache 
CLA](https://github.com/apache/incubator-openwhisk/blob/master/CONTRIBUTING.md).
   - [X] I reviewed the [style 
guides](https://github.com/apache/incubator-openwhisk/wiki/Contributing:-Git-guidelines#code-readiness)
 and followed the recommendations (Travis CI will check :).
   - [ ] I added tests to cover my changes.
   - [ ] My changes require further changes to the documentation.
   - [ ] I updated the documentation where necessary.
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rabbah commented on issue #3199: One tid for the whole system.

2018-04-20 Thread GitBox
rabbah commented on issue #3199: One tid for the whole system.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3199#issuecomment-383076584
 
 
   Makes sense @mdeuser - should use this as another opportunity to rip out 
another typed schema in the cli. Most values should be opaque and transient and 
their types inconsequential. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mdeuser commented on issue #3199: One tid for the whole system.

2018-04-20 Thread GitBox
mdeuser commented on issue #3199: One tid for the whole system.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3199#issuecomment-383075407
 
 
   @cbickel 
https://github.com/apache/incubator-openwhisk-client-go/blob/7671398729ab11fdaeb17e1f3ae308e3126f740a/whisk/client.go#L610
   
   i think we should be careful of the sequence of the deployment of these 
changes.  i.e. first release a version of the cli/plugin that handles the 
`code` value being either an integer or string.  then deploy the backend.  i'm 
not sure if there are other sdks that might be impacted by this api change...


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] cbickel commented on issue #3199: One tid for the whole system.

2018-04-20 Thread GitBox
cbickel commented on issue #3199: One tid for the whole system.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3199#issuecomment-383070756
 
 
   @mdeuser Can you point me to the correct position in the CLI where the 
integer for the code is required? Because I was not able to find it in the 
repositories https://github.com/apache/incubator-openwhisk-cli and 
https://github.com/apache/incubator-openwhisk-client-go


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] cbickel commented on a change in pull request #3199: One tid for the whole system.

2018-04-20 Thread GitBox
cbickel commented on a change in pull request #3199: One tid for the whole 
system.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3199#discussion_r182975152
 
 

 ##
 File path: common/scala/src/main/scala/whisk/common/TransactionId.scala
 ##
 @@ -200,58 +196,42 @@ object TransactionId {
   val metricsKamonTags: Boolean = 
sys.env.get("METRICS_KAMON_TAGS").getOrElse("False").toBoolean
   val metricsLog: Boolean = 
sys.env.get("METRICS_LOG").getOrElse("True").toBoolean
 
-  val unknown = TransactionId(0)
-  val testing = TransactionId(-1) // Common id for for unit testing
-  val invoker = TransactionId(-100) // Invoker startup/shutdown or GC activity
-  val invokerWarmup = TransactionId(-101) // Invoker warmup thread that makes 
stem-cell containers
-  val invokerNanny = TransactionId(-102) // Invoker nanny thread
-  val dispatcher = TransactionId(-110) // Kafka message dispatcher
-  val loadbalancer = TransactionId(-120) // Loadbalancer thread
-  val invokerHealth = TransactionId(-121) // Invoker supervision
-  val controller = TransactionId(-130) // Controller startup
-  val dbBatcher = TransactionId(-140) // Database batcher
-
-  def apply(tid: BigDecimal, extraLogging: Boolean = false): TransactionId = {
-Try {
-  val now = Instant.now(Clock.systemUTC())
-  TransactionId(TransactionMetadata(tid.toLong, now, extraLogging))
-} getOrElse unknown
+  val generatorConfig = 
loadConfigOrThrow[TransactionGeneratorConfig](ConfigKeys.transactions)
+
+  val unknown = TransactionId("sid_unknown")
+  val testing = TransactionId("sid_testing") // Common id for for unit testing
+  val invoker = TransactionId("sid_invoker") // Invoker startup/shutdown or GC 
activity
+  val invokerWarmup = TransactionId("sid_invokerWarmup") // Invoker warmup 
thread that makes stem-cell containers
+  val invokerNanny = TransactionId("sid_invokerNanny") // Invoker nanny thread
+  val dispatcher = TransactionId("sid_dispatcher") // Kafka message dispatcher
+  val loadbalancer = TransactionId("sid_loadbalancer") // Loadbalancer thread
+  val invokerHealth = TransactionId("sid_invokerHealth") // Invoker supervision
+  val controller = TransactionId("sid_controller") // Controller startup
+  val dbBatcher = TransactionId("sid_dbBatcher") // Database batcher
+
+  def apply(tid: String, extraLogging: Boolean = false): TransactionId = {
+val now = Instant.now(Clock.systemUTC())
+TransactionId(TransactionMetadata(tid, now, extraLogging))
   }
 
   implicit val serdes = new RootJsonFormat[TransactionId] {
 def write(t: TransactionId) = {
   if (t.meta.extraLogging)
-JsArray(JsNumber(t.meta.id), JsNumber(t.meta.start.toEpochMilli), 
JsBoolean(t.meta.extraLogging))
+JsArray(JsString(t.meta.id), JsNumber(t.meta.start.toEpochMilli), 
JsBoolean(t.meta.extraLogging))
   else
-JsArray(JsNumber(t.meta.id), JsNumber(t.meta.start.toEpochMilli))
+JsArray(JsString(t.meta.id), JsNumber(t.meta.start.toEpochMilli))
 }
 
 def read(value: JsValue) =
   Try {
 value match {
-  case JsArray(Vector(JsNumber(id), JsNumber(start))) =>
-TransactionId(TransactionMetadata(id.longValue, 
Instant.ofEpochMilli(start.longValue), false))
-  case JsArray(Vector(JsNumber(id), JsNumber(start), 
JsBoolean(extraLogging))) =>
-TransactionId(TransactionMetadata(id.longValue, 
Instant.ofEpochMilli(start.longValue), extraLogging))
+  case JsArray(Vector(JsString(id), JsNumber(start))) =>
+TransactionId(TransactionMetadata(id, 
Instant.ofEpochMilli(start.longValue), false))
+  case JsArray(Vector(JsString(id), JsNumber(start), 
JsBoolean(extraLogging))) =>
+TransactionId(TransactionMetadata(id, 
Instant.ofEpochMilli(start.longValue), extraLogging))
 }
   } getOrElse unknown
   }
 }
 
-/**
- * A thread-safe transaction counter.
- */
-trait TransactionCounter {
-  case class TransactionCounterConfig(stride: Int)
-
-  val transCounterConfig = 
loadConfigOrThrow[TransactionCounterConfig](ConfigKeys.transactions)
-  val stride = transCounterConfig.stride
-  val instanceOrdinal: Int
-
-  // seed the counter so transids do not overlap: instanceOrdinal + n * 
stride, start at n = 1
-  private lazy val cnt = new AtomicInteger(instanceOrdinal + stride)
-
-  def transid(extraLogging: Boolean = false): TransactionId = {
-TransactionId(cnt.addAndGet(stride), extraLogging)
-  }
-}
+case class TransactionGeneratorConfig(header: String)
 
 Review comment:
   I've addad a counter to the test. This might be helpful.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] cbickel commented on a change in pull request #3199: One tid for the whole system.

2018-04-20 Thread GitBox
cbickel commented on a change in pull request #3199: One tid for the whole 
system.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3199#discussion_r182975010
 
 

 ##
 File path: common/scala/src/main/scala/whisk/common/TransactionId.scala
 ##
 @@ -200,58 +196,42 @@ object TransactionId {
   val metricsKamonTags: Boolean = 
sys.env.get("METRICS_KAMON_TAGS").getOrElse("False").toBoolean
   val metricsLog: Boolean = 
sys.env.get("METRICS_LOG").getOrElse("True").toBoolean
 
-  val unknown = TransactionId(0)
-  val testing = TransactionId(-1) // Common id for for unit testing
-  val invoker = TransactionId(-100) // Invoker startup/shutdown or GC activity
-  val invokerWarmup = TransactionId(-101) // Invoker warmup thread that makes 
stem-cell containers
-  val invokerNanny = TransactionId(-102) // Invoker nanny thread
-  val dispatcher = TransactionId(-110) // Kafka message dispatcher
-  val loadbalancer = TransactionId(-120) // Loadbalancer thread
-  val invokerHealth = TransactionId(-121) // Invoker supervision
-  val controller = TransactionId(-130) // Controller startup
-  val dbBatcher = TransactionId(-140) // Database batcher
-
-  def apply(tid: BigDecimal, extraLogging: Boolean = false): TransactionId = {
-Try {
-  val now = Instant.now(Clock.systemUTC())
-  TransactionId(TransactionMetadata(tid.toLong, now, extraLogging))
-} getOrElse unknown
+  val generatorConfig = 
loadConfigOrThrow[TransactionGeneratorConfig](ConfigKeys.transactions)
+
+  val unknown = TransactionId("sid_unknown")
 
 Review comment:
   Good catch.
   I've added a gate to the nginx and the controller.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] cbickel commented on a change in pull request #3199: One tid for the whole system.

2018-04-20 Thread GitBox
cbickel commented on a change in pull request #3199: One tid for the whole 
system.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3199#discussion_r182972953
 
 

 ##
 File path: ansible/group_vars/all
 ##
 @@ -96,8 +96,10 @@ jmx:
   jvmCommonArgs: "-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.local.only=false 
-Dcom.sun.management.jmxremote.authenticate=true 
-Dcom.sun.management.jmxremote.password.file=/root/jmxremote.password 
-Dcom.sun.management.jmxremote.access.file=/root/jmxremote.access"
   enabled: "{{ jmxremote_enabled | default('true') }}"
 
-transactions:
-  stride: "{{ groups['controllers'] | length }}"
+transaction:
+  header: "{{ transaction_header | default('X-Request-ID') }}"
+  # The tid can be any String between 1 and 64 characters.
+  regex: "{{ whisk_tid_regex | default('[a-zA-Z0-9_-]{1,64}') }}"
 
 
 Review comment:
   That's a good idea. This makes operations much easier :)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] markusthoemmes commented on issue #3416: Unit test PoolingRestClient

2018-04-20 Thread GitBox
markusthoemmes commented on issue #3416: Unit test PoolingRestClient
URL: 
https://github.com/apache/incubator-openwhisk/pull/3416#issuecomment-382996711
 
 
   @dubee Have you thought about 
https://github.com/apache/incubator-openwhisk/pull/3416#discussion_r173771805?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] markusthoemmes commented on issue #3504: use alpine-java base image (alpine 3.7 + oracle 8u162b12_server-jre)

2018-04-20 Thread GitBox
markusthoemmes commented on issue #3504: use alpine-java base image (alpine 3.7 
+ oracle 8u162b12_server-jre)
URL: 
https://github.com/apache/incubator-openwhisk/pull/3504#issuecomment-382989892
 
 
   @tysonnorris Not sure on the image, there is an official openjdk image which 
has alpine tags? https://hub.docker.com/_/openjdk/ Any issues there?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] chetanmeh opened a new pull request #3562: ArtifactStore implementation for CosmosDB

2018-04-20 Thread GitBox
chetanmeh opened a new pull request #3562: ArtifactStore implementation for 
CosmosDB
URL: https://github.com/apache/incubator-openwhisk/pull/3562
 
 
   This PR provides a `CosmosDBArtifactStore` implementation to enable using 
CosmosDB for storing subjects, whisks and activation in [Azure CosmosDB][1]
   
   This is currently work in progress and opening this early so as to get 
feedback on design progress
   
   ## Description
   
   Currently OpenWhisk supports CouchDB for storing various entities like 
actions, rules, subjects, activations etc. This PR provides a [CosmosDB][1] 
based implementation for ArtifactStore SPI
   
   ### Usage of CosmosDB Java SDK
   
   CosmosDB supports various modes to connect to it. For our usage we have two 
options
   
   1. [REST API][2]
   2. [Async Java SDK][3]
   3. [Sync Java SDK][6]
   
   Compared to CouchDB performing queries against CosmosDB requires client side 
computation which involves sending queries to each partition and then collect 
and merge the result set. The Async Java SDK takes care of all these 
interactions and provides a simplified reactive api based on [RxJava][5]
   
   Given the complexity involved in performing various operations against 
CosmosDB this PR uses the Java SDK to simplify and speed up the implementation
   
   ### Design Considerations
   
    Partitioning Strategy
   
   TBD
   
    Query Execution
   
   TBD
   
    Attachment Storage
   
   TBD
   
    Testing Approach
   
   TBD
   
   ## Related issue and scope
   
   
   ## My changes affect the following components
   
   - [x] Data stores (e.g., CouchDB)
   - [X] Tests
   - [x] Deployment
   - [X] Documentation
   
   ## Types of changes
   
   - [x] Enhancement or new feature (adds new functionality).
   
   ## Checklist:
   
   - [x] I signed an [Apache 
CLA](https://github.com/apache/incubator-openwhisk/blob/master/CONTRIBUTING.md).
   - [x] I reviewed the [style 
guides](https://github.com/apache/incubator-openwhisk/wiki/Contributing:-Git-guidelines#code-readiness)
 and followed the recommendations (Travis CI will check :).
   - [x] I added tests to cover my changes.
   - [ ] My changes require further changes to the documentation.
   - [ ] I updated the documentation where necessary.
   
   [1]: https://docs.microsoft.com/en-us/azure/cosmos-db/
   [2]: 
https://docs.microsoft.com/en-us/rest/api/documentdb/restful-interactions-with-documentdb-resources
   [3]: https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-sdk-async-java
   [4]: https://github.com/Azure/azure-cosmosdb-java
   [5]: https://github.com/ReactiveX/RxJava
   [6]: https://github.com/Azure/azure-documentdb-java


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] markusthoemmes commented on a change in pull request #3559: add support for mesos attribute constraints

2018-04-20 Thread GitBox
markusthoemmes commented on a change in pull request #3559: add support for 
mesos attribute constraints 
URL: 
https://github.com/apache/incubator-openwhisk/pull/3559#discussion_r182952956
 
 

 ##
 File path: 
common/scala/src/main/scala/whisk/core/mesos/MesosContainerFactory.scala
 ##
 @@ -126,9 +139,28 @@ class MesosContainerFactory(config: WhiskConfig,
   //strip any "--" prefixes on parameters (should make this consistent 
everywhere else)
   parameters
 .map({ case (k, v) => if (k.startsWith("--")) (k.replaceFirst("--", 
""), v) else (k, v) })
-++ containerArgs.extraArgs)
+++ containerArgs.extraArgs,
+  parseConstraints(constraintStrings))
   }
 
+  /**
+   * Validate that constraint strings are well formed, and ignore constraints 
with unknown operators
+   * @param constraintStrings
+   * @param logging
+   * @return
+   */
+  def parseConstraints(constraintStrings: Seq[String])(implicit logging: 
Logging): Seq[Constraint] =
+constraintStrings.flatMap(cs => {
+  val parts = cs.split(mesosConfig.constraintDelimiter)
+  require(parts.length == 3, "constraint must be in the form 
")
+  Seq(LIKE, UNLIKE).find(_.toString == parts(1)) match {
+case Some(o) => Some(Constraint(parts(0), o, parts(2)))
+case _ =>
+  logging.warn(this, s"ignoring unsupported constraint operator 
${parts(1)}")
+  None
+  }
+})
 
 Review comment:
   Just to leave the note, this could make use of Scala's pattern matching, as 
in:
   
   ```scala
   cs.split(mesosConfig.constraintDelimiter).toList match {
 case a :: LIKE.toString :: b   => Some(Constraint(a, LIKE, b)
 case a :: UNLIKE.toString :: b => Some(Constraint(a, UNLIKE, b))
 case a ::o :: b=>
   logging.warn(this, s"ignoring unsupported constraint operator $o")
   None
 case failure =>
   logging.warn(this, s"couldn't parse constraint $failure")
   None
   }
   ```
   
   This wouldn't throw an exception in any case and is typechecked throughout 
(`parts(i)` will throw on an out-of-bounds exception)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services