[GitHub] chetanmeh commented on issue #3283: Add implicit ClassTag for entity type

2018-02-13 Thread GitBox
chetanmeh commented on issue #3283: Add implicit ClassTag for entity type
URL: 
https://github.com/apache/incubator-openwhisk/pull/3283#issuecomment-365520777
 
 
   > It suggests we have a generalized API for something which shouldn't be 
generalized?
   
   Its kind of true as with CouchDB most of query logic is implemented as code 
in CouchDB side which can be treated as implementation detail for 
CouchDbRestStore where the (designDoc, viewName) parameter maps to the server 
side logic.
   
   For non CouchDB stores this would need to be implemented as part of store 
implementation. 
   
   Another usecase is type of index being created which would differ for 
various stores and would differ based on persistent store.
   
   Hence using entity/document type as selector for such logic 


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 commented on issue #3283: Add implicit ClassTag for entity type

2018-02-13 Thread GitBox
chetanmeh commented on issue #3283: Add implicit ClassTag for entity type
URL: 
https://github.com/apache/incubator-openwhisk/pull/3283#issuecomment-365520777
 
 
   > It suggests we have a generalized API for something which shouldn't be 
generalized?
   
   Its kind of true as with CouchDB most of query logic is implemented as code 
in CouchDB side which can be treated as implementation detail for 
CouchDbRestStore where the (designDoc, viewName) parameter maps to the server 
side logic.
   
   For non CouchDB stores this would need to be implemented as part of store 
implementation. Another usecase is type of index being created which would 
differ for various stores and would differ based on persistent store.
   
   Hence using entity/document type as selector for such logic 


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 #23: Add Codable Support for Swift 4.x

2018-02-13 Thread GitBox
csantanapr commented on issue #23: Add Codable Support for Swift 4.x
URL: 
https://github.com/apache/incubator-openwhisk-runtime-swift/pull/23#issuecomment-365519693
 
 
   TODOs
   
   - [ ] Handle when input params is empty
   - [ ] Add tests cases for Codable


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 #23: Add Codable Support for Swift 4.x

2018-02-13 Thread GitBox
csantanapr commented on issue #23: Add Codable Support for Swift 4.x
URL: 
https://github.com/apache/incubator-openwhisk-runtime-swift/pull/23#issuecomment-365519578
 
 
   Depends on #22 
   Closes #2 


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 opened a new pull request #23: Add Codable Support for Swift 4.x

2018-02-13 Thread GitBox
csantanapr opened a new pull request #23: Add Codable Support for Swift 4.x
URL: https://github.com/apache/incubator-openwhisk-runtime-swift/pull/23
 
 
   ## Codable Suppor with Swift 4.x
   
   Some examples of using Codable In and Out
   
   ### Codable style function signature
   Create file `helloCodableAsync.swift`
   ```swift
   // Domain model/entity
   struct Employee: Codable {
 let id: Int
 let name: String
   }
   // codable main function
   func main(input: Employee, respondWith: (Employee?, Error?) -> Void) -> Void 
{
   // For simplicity, just passing same Employee instance forward
   respondWith(input, nil)
   }
   ```
   ```
   wsk action update helloCodableAsync helloCodableAsync.swift swift:4.1
   ```
   ok: updated action helloCodableAsync
   ```
   wsk action invoke helloCodableAsync -r -p id 42 -p name Carlos
   ```
   ```json
   {
   "id": 42,
   "name": "Carlos"
   }
   ```
   
   ### Codable Error Handling
   Create file `helloCodableAsync.swift`
   ```swift
   struct Employee: Codable {
   let id: Int
   let name: String
   }
   enum VendingMachineError: Error {
   case invalidSelection
   case insufficientFunds(coinsNeeded: Int)
   case outOfStock
   }
   func main(input: Employee, respondWith: (Employee?, Error?) -> Void) -> Void 
{
   // Return real error
   do{
   throw VendingMachineError.insufficientFunds(coinsNeeded: 5)
   } catch {
   respondWith(nil, error)
   } 
   }
   ```
   ```
   wsk action update helloCodableError helloCodableError.swift swift:4.1
   ```
   ok: updated action helloCodableError
   ```
   wsk action invoke helloCodableError -b -p id 42 -p name Carlos
   ```
   ```json
   {
   "name": "helloCodableError",
   "response": {
 "result": {
   "error": "insufficientFunds(5)"
 },
   "status": "application error",
   "success": false
   }
   ```


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 closed pull request #3280: Replace asString and asBool with generic method.

2018-02-13 Thread GitBox
cbickel closed pull request #3280: Replace asString and asBool with generic 
method.
URL: https://github.com/apache/incubator-openwhisk/pull/3280
 
 
   

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/common/scala/src/main/scala/whisk/core/entity/Parameter.scala 
b/common/scala/src/main/scala/whisk/core/entity/Parameter.scala
index 7355a43407..937913dabc 100644
--- a/common/scala/src/main/scala/whisk/core/entity/Parameter.scala
+++ b/common/scala/src/main/scala/whisk/core/entity/Parameter.scala
@@ -96,34 +96,11 @@ protected[core] class Parameters protected[entity] (private 
val params: Map[Para
 Some { (toJsObject.fields ++ args.fields).toJson.asJsObject }
   }
 
-  /**
-   * Retrieves parameter by name if it exists.
-   */
-  protected[core] def get(p: String): Option[JsValue] = {
-params.get(new ParameterName(p)).map(_.value)
-  }
-
-  /**
-   * Retrieves parameter by name if it exist. If value of parameter
-   * is a boolean, return its value else false.
-   */
-  protected[core] def asBool(p: String): Option[Boolean] = {
-get(p) flatMap {
-  case JsBoolean(b) => Some(b)
-  case _=> None
-}
-  }
+  /** Retrieves parameter by name if it exists. */
+  protected[core] def get(p: String): Option[JsValue] = params.get(new 
ParameterName(p)).map(_.value)
 
-  /**
-   * Retrieves parameter by name if it exist. If value of parameter
-   * is a string, return its value else none.
-   */
-  protected[core] def asString(p: String): Option[String] = {
-get(p) flatMap {
-  case JsString(s) => Some(s)
-  case _   => None
-}
-  }
+  /** Retrieves parameter by name if it exists. Returns that parameter if it 
is deserializable to {@code T} */
+  protected[core] def getAs[T: JsonReader](p: String): Option[T] = 
get(p).flatMap(js => Try(js.convertTo[T]).toOption)
 }
 
 /**
diff --git a/common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala 
b/common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala
index adddf81046..92b7db3231 100644
--- a/common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala
+++ b/common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala
@@ -78,7 +78,7 @@ abstract class WhiskActionLike(override val name: EntityName) 
extends WhiskEntit
 
   /** @return true iff action has appropriate annotation. */
   def hasFinalParamsAnnotation = {
-annotations.asBool(WhiskAction.finalParamsAnnotationName) getOrElse false
+annotations.getAs[Boolean](WhiskAction.finalParamsAnnotationName) 
getOrElse false
   }
 
   /** @return a Set of immutable parameternames */
diff --git 
a/core/controller/src/main/scala/whisk/core/controller/WebActions.scala 
b/core/controller/src/main/scala/whisk/core/controller/WebActions.scala
index 2642366a51..cd3c68ca37 100644
--- a/core/controller/src/main/scala/whisk/core/controller/WebActions.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/WebActions.scala
@@ -483,7 +483,7 @@ trait WhiskWebActionsApi extends Directives with 
ValidateRequestSize with PostAc
   provide(fullyQualifiedActionName(actionName)) { fullActionName =>
 onComplete(verifyWebAction(fullActionName, 
onBehalfOf.isDefined)) {
   case Success((actionOwnerIdentity, action)) =>
-if 
(!action.annotations.asBool("web-custom-options").exists(identity)) {
+if 
(!action.annotations.getAs[Boolean]("web-custom-options").exists(identity)) {
   respondWithHeaders(defaultCorsResponse(context.headers)) 
{
 if (context.method == OPTIONS) {
   complete(OK, HttpEntity.Empty)
@@ -559,7 +559,7 @@ trait WhiskWebActionsApi extends Directives with 
ValidateRequestSize with PostAc
   processRequest(actionOwnerIdentity, action, extension, onBehalfOf, 
context.withBody(body), isRawHttpAction)
 }
 
-provide(action.annotations.asBool("raw-http").exists(identity)) { 
isRawHttpAction =>
+provide(action.annotations.getAs[Boolean]("raw-http").exists(identity)) { 
isRawHttpAction =>
   httpEntity match {
 case Empty =>
   process(None, isRawHttpAction)
@@ -720,8 +720,8 @@ trait WhiskWebActionsApi extends Directives with 
ValidateRequestSize with PostAc
   private def confirmExportedAction(actionLookup: Future[WhiskActionMetaData], 
authenticated: Boolean)(
 implicit transid: TransactionId): Future[WhiskActionMetaData] = {
 actionLookup flatMap { action =>
-  val requiresAuthenticatedUser = 
action.annotations.asBool("require-whisk-auth").exists(identity)
-  val isExported = action.annotations.asBool("web-export").exists(identity)
+  val requiresAuthenticatedUser = 

[GitHub] cbickel closed pull request #3240: Add a loadbalancer with local state and horizontal invoker sharding.

2018-02-13 Thread GitBox
cbickel closed pull request #3240: Add a loadbalancer with local state and 
horizontal invoker sharding.
URL: https://github.com/apache/incubator-openwhisk/pull/3240
 
 
   

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/ansible/group_vars/all b/ansible/group_vars/all
index 6978fb97ac..2041e6f673 100644
--- a/ansible/group_vars/all
+++ b/ansible/group_vars/all
@@ -64,6 +64,8 @@ controller:
   seedNodes: "{{ groups['controllers'] | map('extract', hostvars, 
'ansible_host') | list }}"
   # We recommend to enable HA for the controllers only, if bookkeeping data 
are shared too. (localBookkeeping: false)
   ha: "{{ controller_enable_ha | default(True) and groups['controllers'] | 
length > 1 }}"
+  loadbalancer:
+spi: "{{ controller_loadbalancer_spi | default('') }}"
   loglevel: "{{ controller_loglevel | default(whisk_loglevel) | 
default('INFO') }}"
 
 jmx:
diff --git a/ansible/roles/controller/tasks/deploy.yml 
b/ansible/roles/controller/tasks/deploy.yml
index 8601a2985d..86f5a14d1b 100644
--- a/ansible/roles/controller/tasks/deploy.yml
+++ b/ansible/roles/controller/tasks/deploy.yml
@@ -152,6 +152,7 @@
   "CONFIG_kamon_statsd_port": "{{ metrics.kamon.port }}"
 
   "CONFIG_whisk_spi_LogStoreProvider": "{{ userLogs.spi }}"
+  "CONFIG_whisk_spi_LoadBalancerProvider": "{{ controller.loadbalancer.spi 
}}"
   
   "CONFIG_logback_log_level": "{{ controller.loglevel }}"
 
diff --git a/common/scala/src/main/scala/whisk/common/ForcableSemaphore.scala 
b/common/scala/src/main/scala/whisk/common/ForcableSemaphore.scala
new file mode 100644
index 00..9544a3079c
--- /dev/null
+++ b/common/scala/src/main/scala/whisk/common/ForcableSemaphore.scala
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package whisk.common
+
+import java.util.concurrent.locks.AbstractQueuedSynchronizer
+
+import scala.annotation.tailrec
+
+/**
+ * A Semaphore, which in addition to the usual features has means to force 
more clients to get permits.
+ *
+ * Like any usual Semaphore, this implementation will give away at most 
`maxAllowed` permits when used the "usual" way.
+ * In addition to that, it also has a `forceAcquire` method which will push 
the Semaphore's remaining permits into a
+ * negative value. Getting permits using `tryAcquire` will only be possible 
once the permits value is in a positive
+ * state again.
+ *
+ * As this is (now) only used for the loadbalancer's scheduling, this does not 
implement the "whole" Java Semaphore's
+ * interface but only the methods needed.
+ *
+ * @param maxAllowed maximum number of permits given away by `tryAcquire`
+ */
+class ForcableSemaphore(maxAllowed: Int) {
+  class Sync extends AbstractQueuedSynchronizer {
+setState(maxAllowed)
+
+def permits: Int = getState
+
+/** Try to release a permit and return whether or not that operation was 
successful. */
+@tailrec
+override final def tryReleaseShared(releases: Int): Boolean = {
+  val current = getState
+  val next = current + releases
+  if (next < current) { // integer overflow
+throw new Error("Maximum permit count exceeded, permit variable 
overflowed")
+  }
+  if (compareAndSetState(current, next)) {
+true
+  } else {
+tryReleaseShared(releases)
+  }
+}
+
+/**
+ * Try to acquire a permit and return whether or not that operation was 
successful. Requests may not finish in FIFO
+ * order, hence this method is not necessarily fair.
+ */
+@tailrec
+final def nonFairTryAcquireShared(acquires: Int): Int = {
+  val available = getState
+  val remaining = available - acquires
+  if (remaining < 0 || compareAndSetState(available, remaining)) {
+remaining
+  } else {
+nonFairTryAcquireShared(acquires)
+  }
+}
+
+/**
+ * Basically the same as `nonFairTryAcquireShared`, but does bound to a 
minimal value of 0 so permits can get
+ * negative.
+ */
+@tailrec
+ 

[GitHub] markusthoemmes commented on issue #3280: Replace asString and asBool with generic method.

2018-02-13 Thread GitBox
markusthoemmes commented on issue #3280: Replace asString and asBool with 
generic method.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3280#issuecomment-365515561
 
 
   PG4 1359 ? 


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 #3283: Add implicit ClassTag for entity type

2018-02-13 Thread GitBox
markusthoemmes commented on issue #3283: Add implicit ClassTag for entity type
URL: 
https://github.com/apache/incubator-openwhisk/pull/3283#issuecomment-365511271
 
 
   Okay makes sense.
   
   This is a bit smelly though. It suggests we have a generalized API for 
something which shouldn't be generalized? Since we already have the 
`WhiskAuthStore`, `WhiskEntityStore`, `WhiskActivationStore` objects to 
construct entity stores, would it make sense to rather widen the constructor of 
`ArtifactStore`? What is the type of `WhiskHandler` for instance?


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 commented on issue #3283: Add implicit ClassTag for entity type

2018-02-13 Thread GitBox
chetanmeh commented on issue #3283: Add implicit ClassTag for entity type
URL: 
https://github.com/apache/incubator-openwhisk/pull/3283#issuecomment-365508673
 
 
   > Can you provide an implementation example of where a ClassTag would be 
needed?
   
   Have a look at [MongoDbStoreProvider][1] (currently work in progress) which 
needs this info to [compute fields](chetanmeh/openwhisk-mongo#8)
   
   [1]: 
https://github.com/chetanmeh/openwhisk-mongo/blob/master/common/mongo/src/main/scala/whisk/core/database/mongo/MongoDbStoreProvider.scala#L55


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 #3282: Disable createKeystore if test execution is disabled

2018-02-13 Thread GitBox
markusthoemmes commented on issue #3282: Disable createKeystore if test 
execution is disabled
URL: 
https://github.com/apache/incubator-openwhisk/pull/3282#issuecomment-365507534
 
 
   Good thought! Is there a possibility to hook stuff up differently? I think 
the issue here is that `createKeystore` is run after compiling. Is it maybe 
possible to hook it up to "preRun" or something? That'd make this more clear.


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] dubeejw commented on issue #3275: GET trigger now returns matched rules in JSON payload

2018-02-13 Thread GitBox
dubeejw commented on issue #3275: GET trigger now returns matched rules in JSON 
payload
URL: 
https://github.com/apache/incubator-openwhisk/pull/3275#issuecomment-365404042
 
 
   PG2 2804 ? 


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] allen-servedio commented on issue #735: Add support for credentials for private git repo dependencies

2018-02-13 Thread GitBox
allen-servedio commented on issue #735: Add support for credentials for private 
git repo dependencies
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/735#issuecomment-365496411
 
 
   Where can we add the docs for this fix?


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] allen-servedio opened a new pull request #738: GH-735 adjusting check for github to mainly make sure that github app?

2018-02-13 Thread GitBox
allen-servedio opened a new pull request #738: GH-735 adjusting check for 
github to mainly make sure that github app?
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/738
 
 
   ?ears in the host name. Will allow many variations of host names as well as 
username and password.
   
   Closes #735 


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 opened a new issue #21: Add swift 4.1 beta/experimental

2018-02-13 Thread GitBox
csantanapr opened a new issue #21: Add swift 4.1 beta/experimental
URL: https://github.com/apache/incubator-openwhisk-runtime-swift/issues/21
 
 
   There is a beta builds available for swift 4.1, we should add early to start 
experimenting with it.
   
   There could be a chance depending on timing of the swift 4.1 release, that 
we skip swift 4.0 and just for for swift 4.1
   


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] allen-servedio commented on issue #735: Add support for credentials for private git repo dependencies

2018-02-13 Thread GitBox
allen-servedio commented on issue #735: Add support for credentials for private 
git repo dependencies
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/735#issuecomment-365482729
 
 
   Further, this should allow valid urls such as 
`https://username:passw...@example.com`. This includes alternate hosts such as: 
`gitlab.com` or `github.ibm.com` (there certainly could be more).


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] dubeejw commented on a change in pull request #3254: Preserve rule status when rule is updated

2018-02-13 Thread GitBox
dubeejw commented on a change in pull request #3254: Preserve rule status when 
rule is updated
URL: 
https://github.com/apache/incubator-openwhisk/pull/3254#discussion_r168027670
 
 

 ##
 File path: tests/src/test/scala/whisk/core/controller/test/RulesApiTests.scala
 ##
 @@ -563,7 +563,7 @@ class RulesApiTests extends ControllerTestCommon with 
WhiskRulesApi {
 WhiskRuleResponse(
   namespace,
   rule.name,
-  Status.ACTIVE,
+  Status.INACTIVE,
 
 Review comment:
   Status is set to `INACTIVE` in this file because the trigger route is not 
accessible in the unit test, resulting in an `INACTIVE` status when a rule is 
updated.


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] dgrove-oss commented on issue #153: Add support for persistent storage.

2018-02-13 Thread GitBox
dgrove-oss commented on issue #153: Add support for persistent storage.
URL: 
https://github.com/apache/incubator-openwhisk-deploy-kube/pull/153#issuecomment-365431256
 
 
   @ruromero - Thanks for the review.  I think I will update to force it with 
selector.matchLabels.  I was hoping to minimize the number of files that the 
user would need to edit during deployment (which is why I put the PVCs outside 
of the main deployment files, which I'd like the user to be able to apply 
unchanged).


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 opened a new pull request #20: rename swift4 o swift40 for kind and image

2018-02-13 Thread GitBox
csantanapr opened a new pull request #20: rename swift4 o swift40 for kind and 
image
URL: https://github.com/apache/incubator-openwhisk-runtime-swift/pull/20
 
 
   Closes #19 


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] pritidesai opened a new pull request #737: adding info message with openwhisk url for runtimes

2018-02-13 Thread GitBox
pritidesai opened a new pull request #737: adding info message with openwhisk 
url for runtimes
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/737
 
 
   Addressing two (todo) of converting const for HTTP headers. 
   
   With this PR, `wskdeploy` produces info when the openwhisk endpoint is not 
reachable:
   
   ```
   Info: Unmarshal OpenWhisk runtimes from local values.
   ```
   
   and when its reading runtimes dynamically:
   
   ```
   Info: Unmarshal OpenWhisk runtimes from internet at 
https://openwhisk.ng.bluemix.net.
   ```
   


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 closed pull request #158: Add simple loadtesting jobs

2018-02-13 Thread GitBox
rabbah closed pull request #158: Add simple loadtesting jobs
URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/158
 
 
   

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/kubernetes/apigateway/apigateway.yml 
b/kubernetes/apigateway/apigateway.yml
index 119bfbb..70e9d33 100644
--- a/kubernetes/apigateway/apigateway.yml
+++ b/kubernetes/apigateway/apigateway.yml
@@ -26,6 +26,16 @@ spec:
 operator: NotIn
 values:
 - invoker
+# prefer to run on a control-plane node
+nodeAffinity:
+  preferredDuringSchedulingIgnoredDuringExecution:
+  - weight: 50
+preference:
+  matchExpressions:
+  - key: openwhisk-role
+operator: In
+values:
+- control-plane
 # do not allow more than 1 apigateway instance to run on a node
 podAntiAffinity:
   requiredDuringSchedulingIgnoredDuringExecution:
diff --git a/kubernetes/cluster-setup/services.yml 
b/kubernetes/cluster-setup/services.yml
index 0e02ff1..e88cfb7 100644
--- a/kubernetes/cluster-setup/services.yml
+++ b/kubernetes/cluster-setup/services.yml
@@ -57,7 +57,6 @@ metadata:
 spec:
   selector:
 name: controller
-  clusterIP: None
   ports:
 - port: 8080
   targetPort: 8080
diff --git a/kubernetes/controller/controller.yml 
b/kubernetes/controller/controller.yml
index a7a19ce..1a4947e 100644
--- a/kubernetes/controller/controller.yml
+++ b/kubernetes/controller/controller.yml
@@ -27,6 +27,16 @@ spec:
 operator: NotIn
 values:
 - invoker
+# prefer to run on a control-plane node
+nodeAffinity:
+  preferredDuringSchedulingIgnoredDuringExecution:
+  - weight: 50
+preference:
+  matchExpressions:
+  - key: openwhisk-role
+operator: In
+values:
+- control-plane
 # do not allow more than 1 controller instance to run on a node
 podAntiAffinity:
   requiredDuringSchedulingIgnoredDuringExecution:
@@ -194,11 +204,14 @@ spec:
 matchLabels:
   name: controller
   ingress:
-  # Allow nginx to connect to controller
+  # Allow nginx and any pod with access=controller to connect to controller
   - from:
 - podSelector:
 matchLabels:
   name: nginx
+- podSelector:
+matchLabels:
+  access: controller
 ports:
  - port: 8080
   # Controllers can connect to each other
diff --git a/kubernetes/couchdb/couchdb.yml b/kubernetes/couchdb/couchdb.yml
index a06aea7..5efc719 100644
--- a/kubernetes/couchdb/couchdb.yml
+++ b/kubernetes/couchdb/couchdb.yml
@@ -44,6 +44,16 @@ spec:
 operator: NotIn
 values:
 - invoker
+# prefer to run on a control-plane node
+nodeAffinity:
+  preferredDuringSchedulingIgnoredDuringExecution:
+  - weight: 50
+preference:
+  matchExpressions:
+  - key: openwhisk-role
+operator: In
+values:
+- control-plane
 # do not allow more than 1 couchdb instance to run on a given node
 podAntiAffinity:
   requiredDuringSchedulingIgnoredDuringExecution:
diff --git a/kubernetes/kafka/kafka.yml b/kubernetes/kafka/kafka.yml
index bc4ca09..3cdf980 100644
--- a/kubernetes/kafka/kafka.yml
+++ b/kubernetes/kafka/kafka.yml
@@ -26,6 +26,16 @@ spec:
 operator: NotIn
 values:
 - invoker
+# prefer to run on a control-plane node
+nodeAffinity:
+  preferredDuringSchedulingIgnoredDuringExecution:
+  - weight: 50
+preference:
+  matchExpressions:
+  - key: openwhisk-role
+operator: In
+values:
+- control-plane
 # do not allow more than 1 kafka instance to run on a given node
 podAntiAffinity:
   requiredDuringSchedulingIgnoredDuringExecution:
diff --git a/kubernetes/loadtest/README.md b/kubernetes/loadtest/README.md
new file mode 100644
index 000..5202621
--- /dev/null
+++ b/kubernetes/loadtest/README.md
@@ -0,0 +1,24 @@
+LoadTest
+-
+
+A collection of jobs to do performance testing
+against openwhisk deployed on kube, based on
+the code in apache/incubator-openwhisk-performance.git.
+
+The jobs are intended to run in the openwhisk namespace in the same
+cluster as the system under test to eliminate external network
+latency.
+
+# Preparing
+
+The Jobs assume the noopLatency and noopThroughput actions are already
+created in the default namespace. 

[GitHub] mrutkows closed issue #683: wskdeply cobra command help missing i18n translations

2018-02-13 Thread GitBox
mrutkows closed issue #683: wskdeply cobra command help missing i18n 
translations
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/683
 
 
   


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] mrutkows commented on issue #688: Move all hardcoded strings from Cobra commands and remaining .go files into i18n files.

2018-02-13 Thread GitBox
mrutkows commented on issue #688: Move all hardcoded strings from Cobra 
commands and remaining .go files into i18n files.
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/688#issuecomment-365416835
 
 
   Closes https://github.com/apache/incubator-openwhisk-wskdeploy/issues/683


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] dubeejw commented on a change in pull request #3254: Preserve rule status when rule is updated

2018-02-13 Thread GitBox
dubeejw commented on a change in pull request #3254: Preserve rule status when 
rule is updated
URL: 
https://github.com/apache/incubator-openwhisk/pull/3254#discussion_r168010760
 
 

 ##
 File path: tests/src/test/scala/system/basic/WskRuleTests.scala
 ##
 @@ -88,6 +88,35 @@ abstract class WskRuleTests extends TestHelpers with 
WskTestHelpers {
 
   behavior of "Whisk rules"
 
+  it should "preserve rule status when a rule is updated" in 
withAssetCleaner(wskprops) { (wp, assetHelper) =>
+val ruleName = withTimestamp("r1to1")
+val triggerName = withTimestamp("t1to1")
+val actionName = withTimestamp("a1 to 1")
+val triggerName2 = withTimestamp("t2to1")
+val active = Some("active".toJson)
+val inactive = Some("inactive".toJson)
+val statusPermutations =
+  Seq((triggerName, active), (triggerName, inactive), (triggerName2, 
active), (triggerName2, inactive))
+
+ruleSetup(Seq((ruleName, triggerName, (actionName, actionName, 
defaultAction))), assetHelper)
+assetHelper.withCleaner(wsk.trigger, triggerName2) { (trigger, name) =>
+  trigger.create(name)
+}
+
+statusPermutations.foreach {
 
 Review comment:
   Makes sure `wsk rule update` and `wsk rule get` return the proper status.


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] houshengbo opened a new pull request #43: Add the documentation to describe automated mode of release

2018-02-13 Thread GitBox
houshengbo opened a new pull request #43: Add the documentation to describe 
automated mode of release
URL: https://github.com/apache/incubator-openwhisk-release/pull/43
 
 
   


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] dubeejw commented on issue #3254: Preserve rule status when rule is updated

2018-02-13 Thread GitBox
dubeejw commented on issue #3254: Preserve rule status when rule is updated
URL: 
https://github.com/apache/incubator-openwhisk/pull/3254#issuecomment-365413750
 
 
   Turned out to be two different bugs.
   1. Updating a rule with `wsk rule update` always returned a status of 
active. 
   2. After updating a rule with `wsk rule update` the status would be inactive 
when the rule is fetched with `wsk rule get`.


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] dubeejw commented on a change in pull request #3254: Preserve rule status when rule is updated

2018-02-13 Thread GitBox
dubeejw commented on a change in pull request #3254: Preserve rule status when 
rule is updated
URL: 
https://github.com/apache/incubator-openwhisk/pull/3254#discussion_r168009396
 
 

 ##
 File path: core/controller/src/main/scala/whisk/core/controller/Rules.scala
 ##
 @@ -85,11 +85,31 @@ trait WhiskRulesApi extends WhiskCollectionAPI with 
ReferencedEntities {
 val request = content.resolve(entityName.namespace)
 onComplete(entitlementProvider.check(user, Privilege.READ, 
referencedEntities(request))) {
   case Success(_) =>
-putEntity(WhiskRule, entityStore, entityName.toDocId, overwrite, 
update(request) _, () => {
-  create(request, entityName)
-}, postProcess = Some { rule: WhiskRule =>
-  completeAsRuleResponse(rule, Status.ACTIVE)
-})
+putEntity(
+  WhiskRule,
+  entityStore,
+  entityName.toDocId,
+  overwrite,
+  update(request) _,
+  () => {
+create(request, entityName)
+  },
+  postProcess = Some { rule: WhiskRule =>
+if (overwrite == true) {
 
 Review comment:
   Fetch the rule status only when an overwrite occurs.


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 #19: move swift:4 to swift:4.0 add swift:4.1

2018-02-13 Thread GitBox
csantanapr commented on issue #19: move swift:4 to swift:4.0 add swift:4.1
URL: 
https://github.com/apache/incubator-openwhisk-runtime-swift/issues/19#issuecomment-365411026
 
 
   We can try add swift:4.1 as experimental which is still to be release, and 
create our image base on ubuntu until an official version of docker image with 
swift 4.1 is available.
   
   This way we try to find any issues with swift 4.1 very early.
   


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 opened a new issue #19: move swift:4 to swift:4.0 add swift:4.1

2018-02-13 Thread GitBox
csantanapr opened a new issue #19: move swift:4 to swift:4.0 add swift:4.1
URL: https://github.com/apache/incubator-openwhisk-runtime-swift/issues/19
 
 
   With the recent release of swift 4.1 in Xcode Beta.
   I think is close to done, having `swift:4` it would be vague which version 
of swift is the runtime referring.
   
   This issue to track the work to change the kind to `swift:4.0` and the image 
name to `action-swfit-v4.0`
   


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 #15: Do not use own copy of actionProxy.py use common one from dockerskeleton

2018-02-13 Thread GitBox
csantanapr commented on issue #15: Do not use own copy of actionProxy.py use 
common one from dockerskeleton
URL: 
https://github.com/apache/incubator-openwhisk-runtime-swift/issues/15#issuecomment-365409992
 
 
   Closed by #13 


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 issue #15: Do not use own copy of actionProxy.py use common one from dockerskeleton

2018-02-13 Thread GitBox
csantanapr closed issue #15: Do not use own copy of actionProxy.py use common 
one from dockerskeleton
URL: https://github.com/apache/incubator-openwhisk-runtime-swift/issues/15
 
 
   


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] houshengbo closed pull request #736: Fix release document to clearly separate "git" command examples from command syntax

2018-02-13 Thread GitBox
houshengbo closed pull request #736: Fix release document to clearly separate 
"git" command examples from command syntax
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/736
 
 
   

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/docs/creating_tagged_releases.md b/docs/creating_tagged_releases.md
index ae2c3eb2..15eef630 100644
--- a/docs/creating_tagged_releases.md
+++ b/docs/creating_tagged_releases.md
@@ -21,8 +21,19 @@
 The most convenient way to create a tagged release for wskdeploy is to build 
the binaries by adding tag to upstream master.
 
 
-1. Add a tag to a commit id: ```git tag -a 0.8.9 c08b0f```
-2. Push the tag upstream: ```git push -f upstream 0.8.9```
+1. Add a tag to a commit id: ```git tag -a  ```
+
+for example, using the (7 min.) leading characters on commit hash:
+```
+$ git tag -a 0.8.9 c08b0f
+```
+
+2. Push the tag upstream: ```git push -f upstream ```
+
+for example:
+```
+$ git push -f upstream 0.8.9
+```
 
 Travis will start the build of 0.8.9 automatically by the event of tag 
creation.
 


 


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] mrutkows opened a new pull request #736: Fix release document to clearly separate "git" command examples from command syntax

2018-02-13 Thread GitBox
mrutkows opened a new pull request #736: Fix release document to clearly 
separate "git" command examples from command syntax
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/736
 
 
   


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] dubeejw closed pull request #127: remove unused import from test

2018-02-13 Thread GitBox
dubeejw closed pull request #127: remove unused import from test
URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/127
 
 
   

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/tests/src/test/scala/system/health/AlarmsHealthFeedTests.scala 
b/tests/src/test/scala/system/health/AlarmsHealthFeedTests.scala
index e1b84f4..456d9ab 100644
--- a/tests/src/test/scala/system/health/AlarmsHealthFeedTests.scala
+++ b/tests/src/test/scala/system/health/AlarmsHealthFeedTests.scala
@@ -16,8 +16,6 @@
  */
 package system.health
 
-import java.time.{Clock, Instant}
-
 import common._
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner


 


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] dubeejw commented on issue #3275: GET trigger now returns matched rules in JSON payload

2018-02-13 Thread GitBox
dubeejw commented on issue #3275: GET trigger now returns matched rules in JSON 
payload
URL: 
https://github.com/apache/incubator-openwhisk/pull/3275#issuecomment-365404042
 
 
   PG2 2804 ? 


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] lornajane commented on issue #3244: Move parameter docs to separate page, add package params docs

2018-02-13 Thread GitBox
lornajane commented on issue #3244: Move parameter docs to separate page, add 
package params docs
URL: 
https://github.com/apache/incubator-openwhisk/pull/3244#issuecomment-365403918
 
 
   Am I blocking this?  I _think_ I've answered all the comments and this PR is 
ripe for another review, but please let me know if there's anything I should be 
doing at this end


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] drcariel closed pull request #84: make travis more efficient

2018-02-13 Thread GitBox
drcariel closed pull request #84: make travis more efficient
URL: 
https://github.com/apache/incubator-openwhisk-package-pushnotifications/pull/84
 
 
   

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/.jshintrc b/.jshintrc
new file mode 100644
index 000..e3b3c74
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,9 @@
+{
+  "curly" : true,
+  "eqeqeq": true,
+  "forin" : false,
+  "esversion" : 6,
+  "loopfunc"  : true,
+  "module": true,
+  "node"  : true
+}
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index f80e115..74762ab 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,10 +18,11 @@ notifications:
 install: true
 
 before_install:
+  - ./tools/travis/setup.sh
   - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K 
$encrypted_ff5bbb6225c5_key -iv $encrypted_ff5bbb6225c5_iv -in 
tests/credentials.json.enc -out tests/credentials.json -d; fi'
-  - git clone https://github.com/openwhisk/openwhisk.git
+  - git clone --depth 1 https://github.com/apache/incubator-openwhisk.git 
openwhisk
   - cd openwhisk
   - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash 
./tools/travis/setup.sh; fi'
-
+  
 script:
-  - ../tools/travis/build.sh
+  - ./tools/travis/build.sh
diff --git a/packages/actions/sendMessage.js b/packages/actions/sendMessage.js
index c3c39ab..1894db3 100644
--- a/packages/actions/sendMessage.js
+++ b/packages/actions/sendMessage.js
@@ -448,11 +448,19 @@ function main(params) {
 }
 
 function isEmpty(obj) {
-  if (obj === null) return true;
-  if (obj.length > 0) return false;
-  if (obj.length === 0) return true;
+  if (obj === null) {
+return true;
+  }
+  if (obj.length > 0) {
+return false;
+  }
+  if (obj.length === 0) {
+return true;
+  }
   for (var key in obj) {
-if (hasOwnProperty.call(obj, key)) return false;
+if (hasOwnProperty.call(obj, key)) {
+  return false;
+}
   }
 
   return true;
diff --git a/packages/feeds/webhook.js b/packages/feeds/webhook.js
index cddd427..b6f547c 100644
--- a/packages/feeds/webhook.js
+++ b/packages/feeds/webhook.js
@@ -39,6 +39,8 @@ function main(params) {
 // The URL to create the webhook on push service
 var registrationEndpoint = 
'https://mobile.ng.bluemix.net/imfpush/v1/apps/' + appId + '/webhooks';
 var lifecycleEvent = (params.lifecycleEvent || 
'CREATE').trim().toUpperCase();
+var options;
+var promise;
 if (lifecycleEvent === 'CREATE' || lifecycleEvent === 'UPDATE') {
 
 var events = params.events;
@@ -47,7 +49,7 @@ function main(params) {
 url: whiskCallbackUrl,
 eventTypes: events
 };
-var options = {
+options = {
 method: 'POST',
 url: registrationEndpoint,
 body: JSON.stringify(body),
@@ -56,7 +58,7 @@ function main(params) {
 'Content-Type': 'application/json'
 }
 };
-var promise = new Promise(function(resolve, reject) {
+promise = new Promise(function(resolve, reject) {
 request(options, function (error, response, body) {
 if (error) {
 reject(error);
@@ -67,14 +69,14 @@ function main(params) {
 
 return promise;
 } else if (lifecycleEvent === 'DELETE') {
-var options = {
+options = {
 method: 'DELETE',
 url: registrationEndpoint,
 headers: {
 'appSecret': appSecret
 }
 };
-var promise = new Promise(function(resolve, reject) {
+promise = new Promise(function(resolve, reject) {
 request(options, function (error, response, body) {
 if (error) {
 reject(error);
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
index b541e99..0653e6c 100755
--- a/tools/travis/build.sh
+++ b/tools/travis/build.sh
@@ -1,17 +1,22 @@
 #!/bin/bash
+set -e
+
 # Build script for Travis-CI.
 
 SCRIPTDIR=$(cd $(dirname "$0") && pwd)
 ROOTDIR="$SCRIPTDIR/../.."
-WHISKDIR="$ROOTDIR/openwhisk"
-
-cd $WHISKDIR
+WHISKDIR="$ROOTDIR/../openwhisk"
+UTILDIR="$ROOTDIR/../incubator-openwhisk-utilities"
 
-tools/build/scanCode.py $ROOTDIR
+# run scancode
+cd $UTILDIR
+scancode/scanCode.py $ROOTDIR
 
-# No point to continue with PRs, since encryption is on
-if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi
+# run jshint
+cd $ROOTDIR/packages
+jshint .
 
+# Install OpenWhisk
 cd $WHISKDIR/ansible
 
 ANSIBLE_CMD="ansible-playbook -i environments/local"
@@ -23,7 +28,7 @@ $ANSIBLE_CMD initdb.yml
 
 cd $WHISKDIR
 
-./gradlew distDocker
+TERM=dumb ./gradlew distDocker
 
 cd $WHISKDIR/ansible
 
@@ -32,7 +37,7 @@ $ANSIBLE_CMD openwhisk.yml
 
 cd $WHISKDIR
 

[GitHub] mrutkows closed pull request #42: Add the documentation to describe the manual mode of release

2018-02-13 Thread GitBox
mrutkows closed pull request #42: Add the documentation to describe the manual 
mode of release
URL: https://github.com/apache/incubator-openwhisk-release/pull/42
 
 
   

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/README.md b/README.md
index 0471157..6f53514 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,10 @@ We use Travis CI as the automated integration build tool to 
streamline the relea
 applied to build different jobs, which are able to run either in sequential or 
parallel. Artifacts can be shared across
 different jobs by using cache in Travis, as different jobs run on different 
virtual machines.
 
+# Instruction to use OpenWhisk Release
+
+As a release manger of OpenWhisk, please visit [OpenWhisk Release 
tutorial](docs/tutorial.md).
+
 # How to release an Apache project
 
 ## Release Approval
diff --git a/docs/package_artifacts.md b/docs/package_artifacts.md
new file mode 100644
index 000..61c8f02
--- /dev/null
+++ b/docs/package_artifacts.md
@@ -0,0 +1,13 @@
+# Making the release artifacts
+
+The artifacts to be made in this step consists of the source code packages, 
binary packages and docker image packages.
+As the deliverable of the [first 
phase](general_spec.md#different-phases-of-implementations), we currently only 
build the
+source code packages. Binary and docker image are on our future agenda.
+
+After downloading the source code, we can run the following script under 
_tools_ to generate the artifacts for each OpenWhisk project:
+```
+$ ./package_source_code.sh 
+```
+The  should be the same one used to download the source code. This 
script will create a source code package file
+of source code suffixed with tar.gz for each project, under 
/openwhisk_sources/openwhisk/openwhisk-\-\.
+The keys major and minor are defined in _config.json_.
diff --git a/docs/pick_up_source_code.md b/docs/pick_up_source_code.md
new file mode 100644
index 000..47ee8b7
--- /dev/null
+++ b/docs/pick_up_source_code.md
@@ -0,0 +1,59 @@
+# Picking up source code
+
+## Edit the configuration file
+
+The only file that a release manager needs to edit is the JSON-format 
configuration file named _config.json_ under the
+folder _tools_. You can specify the the staging url, release url, the list of 
projects to be release, the repository url,
+branch name, and hash value of the source code for each project, etc.
+
+Template of [_config.json_](../tools/config.json):
+
+```
+{
+  "stage_url": "https://dist.apache.org/repos/dist/dev/incubator/openwhisk;,
+  "release_url": 
"https://dist.apache.org/repos/dist/release/incubator/openwhisk;,
+  "version": {
+"major": "incubator",
+"minor": "rc1"
+  },
+  "RepoList": [
+"incubator-openwhisk",
+"incubator-openwhisk-wskdeploy",
+"incubator-openwhisk-cli"
+  ],
+  "incubator_openwhisk": {
+"hash": "a891e06",
+"repository": "https://github.com/apache/incubator-openwhisk.git;,
+"branch": "master"
+  },
+  "incubator_openwhisk_wskdeploy": {
+"hash": "1425456",
+"repository": 
"https://github.com/apache/incubator-openwhisk-wskdeploy.git;,
+"branch": "master"
+  },
+  "incubator_openwhisk_cli": {
+"hash": "1448d31",
+"repository": "https://github.com/apache/incubator-openwhisk-cli.git;,
+"branch": "master"
+  }
+}
+```
+  - **stage_url**: the field to specify the staging url, where to upload the 
artifacts.
+  - **release_url**: the field to specify the Apache release directory url, 
where to finally release the artifacts.
+  - **version**: the key to define the release name, with both a major and a 
minor name.
+  - **RepoList**: the key to define the list of OpenWhisk projects to be 
released. Based on this key, we need to add other
+  keys below with each of them matching each project name. For example, we 
define three projects in _RepoList_, so we
+  have three other keys below to match each project.
+  - : the key used to match one OpenWhisk project. If there 
is any hyphen(-) sign in the project name, we need
+  to convert it into underscore(_). Hash key defines the hash value, 
repository defines the url of the project repository,
+  and branch defines the branch name in the project repository. We can 
precisely locate a version of the source code to
+  pick up for the release.
+
+## Download the source code to a local directory
+
+Run the following script to download source code based on the configuration in 
_config.json_:
+```
+$ ./download_source_code.sh 
+```
+You may specify where to download all the source code with . If you 
specify the  here, you need to
+specify the same value as well to the sequential scripts as well. It will take 
$HOME by default.
diff --git a/docs/prepare_release.md b/docs/prepare_release.md
new file mode 100644
index 

[GitHub] mrutkows closed pull request #732: adding env. variable support in trigger feed

2018-02-13 Thread GitBox
mrutkows closed pull request #732: adding env. variable support in trigger feed
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/732
 
 
   

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/parsers/manifest_parser.go b/parsers/manifest_parser.go
index 88a3b032..b18118e3 100644
--- a/parsers/manifest_parser.go
+++ b/parsers/manifest_parser.go
@@ -774,6 +774,10 @@ func (dm *YAMLParser) ComposeTriggers(filePath string, pkg 
Package, ma whisk.Key
trigger.Feed = trigger.Source
}
 
+   // replacing env. variables here in the trigger feed name
+   // to support trigger feed with $READ_FROM_ENV_TRIGGER_FEED
+   trigger.Feed = wskenv.GetEnvVar(trigger.Feed).(string)
+
keyValArr := make(whisk.KeyValueArr, 0)
if trigger.Feed != "" {
var keyVal whisk.KeyValue
diff --git a/parsers/manifest_parser_test.go b/parsers/manifest_parser_test.go
index af906d1c..1ac7b872 100644
--- a/parsers/manifest_parser_test.go
+++ b/parsers/manifest_parser_test.go
@@ -1280,6 +1280,9 @@ func TestComposeSequences(t *testing.T) {
 }
 
 func TestComposeTriggers(t *testing.T) {
+   // set env variables needed for the trigger feed
+   os.Setenv("KAFKA_INSTANCE", "kafka-broker")
+   os.Setenv("SRC_TOPIC", "topic")
// read and parse manifest.yaml file located under ../tests folder
manifestFile := "../tests/dat/manifest_data_compose_triggers.yaml"
p := NewYAMLParser()
@@ -1293,7 +1296,7 @@ func TestComposeTriggers(t *testing.T) {
assert.Fail(t, "Failed to compose trigger")
}
 
-   assert.Equal(t, 2, len(triggerList), "Failed to get trigger list")
+   assert.Equal(t, 3, len(triggerList), "Failed to get trigger list")
for _, trigger := range triggerList {
switch trigger.Name {
case "trigger1":
@@ -1302,6 +1305,10 @@ func TestComposeTriggers(t *testing.T) {
assert.Equal(t, "feed", trigger.Annotations[0].Key, 
"Failed to set trigger annotation")
assert.Equal(t, "myfeed", trigger.Annotations[0].Value, 
"Failed to set trigger annotation")
assert.Equal(t, 2, len(trigger.Parameters), "Failed to 
set trigger parameters")
+   case "message-trigger":
+   assert.Equal(t, 2, len(trigger.Parameters), "Failed to 
set trigger parameters")
+   assert.Equal(t, "feed", trigger.Annotations[0].Key, 
"Failed to set trigger annotation")
+   assert.Equal(t, 
"Bluemix_kafka-broker_Credentials-1/messageHubFeed", 
trigger.Annotations[0].Value, "Failed to set trigger annotation")
}
}
 }
diff --git a/tests/dat/manifest_data_compose_triggers.yaml 
b/tests/dat/manifest_data_compose_triggers.yaml
index 9be02de0..8fe02e38 100644
--- a/tests/dat/manifest_data_compose_triggers.yaml
+++ b/tests/dat/manifest_data_compose_triggers.yaml
@@ -26,3 +26,8 @@ package:
   inputs:
 name: myname
 place: myplace
+message-trigger:
+  feed: Bluemix_${KAFKA_INSTANCE}_Credentials-1/messageHubFeed
+  inputs:
+isJSONData: true
+topic: $SRC_TOPIC


 


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] mrutkows commented on a change in pull request #732: adding env. variable support in trigger feed

2018-02-13 Thread GitBox
mrutkows commented on a change in pull request #732: adding env. variable 
support in trigger feed
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/732#discussion_r167985426
 
 

 ##
 File path: tests/dat/manifest_data_compose_triggers.yaml
 ##
 @@ -26,3 +26,8 @@ package:
   inputs:
 name: myname
 place: myplace
+message-trigger:
+  feed: Bluemix_${KAFKA_INSTANCE}_Credentials-1/messageHubFeed
 
 Review comment:
   excellent!


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] mrutkows commented on a change in pull request #732: adding env. variable support in trigger feed

2018-02-13 Thread GitBox
mrutkows commented on a change in pull request #732: adding env. variable 
support in trigger feed
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/732#discussion_r167985358
 
 

 ##
 File path: parsers/manifest_parser_test.go
 ##
 @@ -1280,6 +1280,9 @@ func TestComposeSequences(t *testing.T) {
 }
 
 func TestComposeTriggers(t *testing.T) {
+   // set env variables needed for the trigger feed
+   os.Setenv("KAFKA_INSTANCE", "kafka-broker")
 
 Review comment:
   Kafka is a good choice for unit test.


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] allen-servedio opened a new issue #735: Add support for credentials for private git repo dependencies

2018-02-13 Thread GitBox
allen-servedio opened a new issue #735: Add support for credentials for private 
git repo dependencies
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/735
 
 
   Dependencies allows you to define a location and version of the artifact 
that you want to use. Here is an example:
   
   ```
   project:
 name: MyProject
 version: 0.0.1
 packages:
   mypackage:
 license: Apache-2.0
 version: 0.0.1
 dependencies:
   mydep:
 location: https://github.com/my-org/my-private-repo
 version: 0.0.1
   ```
   
   However, there does not appear to be a way to define credentials for 
accessing this repository - which is required for private repos.
   
   The error you get when you try to do this is also not great (it is calling: 
https://github.com/my-org/my-private-repo/zipball/0.0.1):
   
   ```
   Error: manifestreader.go [103]: [ERROR_YAML_FILE_FORMAT_ERROR]: File: 
[manifest.yaml]:
   ==> manifestreader.go [147]: [ERROR_YAML_FILE_FORMAT_ERROR]: File: 
[mypackage]:
   ==> ==> zip: not a valid zip file
   ==>
   ```
   
   What is actually happening is the call results in a 404 from github.


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] mrutkows commented on a change in pull request #732: adding env. variable support in trigger feed

2018-02-13 Thread GitBox
mrutkows commented on a change in pull request #732: adding env. variable 
support in trigger feed
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/732#discussion_r167985232
 
 

 ##
 File path: parsers/manifest_parser.go
 ##
 @@ -774,6 +774,10 @@ func (dm *YAMLParser) ComposeTriggers(filePath string, 
pkg Package, ma whisk.Key
trigger.Feed = trigger.Source
}
 
+   // replacing env. variables here in the trigger feed name
 
 Review comment:
   Glad you found this and had a ready-made fx to do the interpolation.


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 #3275: WIP: GET trigger now returns matched rules in JSON payload

2018-02-13 Thread GitBox
mdeuser commented on issue #3275: WIP: GET trigger now returns matched rules in 
JSON payload
URL: 
https://github.com/apache/incubator-openwhisk/pull/3275#issuecomment-365385500
 
 
   @rabbah - i opened https://github.com/apache/incubator-openwhisk/issues/3281 
to address the rules/trigger restriction discussion.


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 opened a new issue #3281: Consider limiting how many rules a single trigger can activate

2018-02-13 Thread GitBox
mdeuser opened a new issue #3281: Consider limiting how many rules a single 
trigger can activate
URL: https://github.com/apache/incubator-openwhisk/issues/3281
 
 
   From 
https://github.com/apache/incubator-openwhisk/pull/3275#issuecomment-365079127
   


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 closed pull request #3109: Add binary, image, and main properties to WhiskActionMetaData

2018-02-13 Thread GitBox
rabbah closed pull request #3109: Add binary, image, and main properties to 
WhiskActionMetaData
URL: https://github.com/apache/incubator-openwhisk/pull/3109
 
 
   

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/common/scala/src/main/scala/whisk/core/entity/Exec.scala 
b/common/scala/src/main/scala/whisk/core/entity/Exec.scala
index bf066f6e71..8f318129d0 100644
--- a/common/scala/src/main/scala/whisk/core/entity/Exec.scala
+++ b/common/scala/src/main/scala/whisk/core/entity/Exec.scala
@@ -95,9 +95,23 @@ sealed abstract class CodeExec[+T <% SizeConversion] extends 
Exec {
 
 sealed abstract class ExecMetaData extends ExecMetaDataBase {
 
+  /** An entrypoint (typically name of 'main' function). 'None' means a 
default value will be used. */
+  val entryPoint: Option[String]
+
+  /** The runtime image (either built-in or a public image). */
+  val image: ImageName
+
   /** Indicates if a container image is required from the registry to execute 
the action. */
   val pull: Boolean
 
+  /**
+   * Indicates whether the code is stored in a text-readable or binary format.
+   * The binary bit may be read from the database but currently it is always 
computed
+   * when the "code" is moved to an attachment this may get changed to avoid 
recomputing
+   * the binary property.
+   */
+  val binary: Boolean
+
   override def size = 0.B
 }
 
@@ -114,8 +128,12 @@ protected[core] case class CodeExecAsString(manifest: 
RuntimeManifest,
   override def codeAsJson = JsString(code)
 }
 
-protected[core] case class CodeExecMetaDataAsString(manifest: RuntimeManifest) 
extends ExecMetaData {
+protected[core] case class CodeExecMetaDataAsString(manifest: RuntimeManifest,
+override val binary: 
Boolean = false,
+override val entryPoint: 
Option[String])
+extends ExecMetaData {
   override val kind = manifest.kind
+  override val image = manifest.image
   override val deprecated = manifest.deprecated.getOrElse(false)
   override val pull = false
 }
@@ -144,8 +162,12 @@ protected[core] case class CodeExecAsAttachment(manifest: 
RuntimeManifest,
   }
 }
 
-protected[core] case class CodeExecMetaDataAsAttachment(manifest: 
RuntimeManifest) extends ExecMetaData {
+protected[core] case class CodeExecMetaDataAsAttachment(manifest: 
RuntimeManifest,
+override val binary: 
Boolean = false,
+override val 
entryPoint: Option[String])
+extends ExecMetaData {
   override val kind = manifest.kind
+  override val image = manifest.image
   override val deprecated = manifest.deprecated.getOrElse(false)
   override val pull = false
 }
@@ -168,7 +190,11 @@ protected[core] case class BlackBoxExec(override val 
image: ImageName,
   override def size = super.size + image.publicImageName.sizeInBytes
 }
 
-protected[core] case class BlackBoxExecMetaData(val native: Boolean) extends 
ExecMetaData {
+protected[core] case class BlackBoxExecMetaData(override val image: ImageName,
+override val entryPoint: 
Option[String],
+val native: Boolean,
+override val binary: Boolean = 
false)
+extends ExecMetaData {
   override val kind = ExecMetaDataBase.BLACKBOX
   override val deprecated = false
   override val pull = !native
@@ -334,21 +360,24 @@ protected[core] object ExecMetaDataBase extends 
ArgNormalizer[ExecMetaDataBase]
 
 override def write(e: ExecMetaDataBase) = e match {
   case c: CodeExecMetaDataAsString =>
-val base = Map("kind" -> JsString(c.kind))
-JsObject(base)
+val base = Map("kind" -> JsString(c.kind), "binary" -> 
JsBoolean(c.binary))
+val main = c.entryPoint.map("main" -> JsString(_))
+JsObject(base ++ main)
 
   case a: CodeExecMetaDataAsAttachment =>
 val base =
-  Map("kind" -> JsString(a.kind))
-JsObject(base)
+  Map("kind" -> JsString(a.kind), "binary" -> JsBoolean(a.binary))
+val main = a.entryPoint.map("main" -> JsString(_))
+JsObject(base ++ main)
 
   case s @ SequenceExecMetaData(comp) =>
 JsObject("kind" -> JsString(s.kind), "components" -> 
comp.map(_.qualifiedNameWithLeadingSlash).toJson)
 
   case b: BlackBoxExecMetaData =>
 val base =
-  Map("kind" -> JsString(b.kind))
-JsObject(base)
+  Map("kind" -> JsString(b.kind), "image" -> 
JsString(b.image.publicImageName), "binary" -> JsBoolean(b.binary))
+val main = b.entryPoint.map("main" -> JsString(_))
+JsObject(base ++ 

[GitHub] houshengbo opened a new pull request #42: Add the documentation to describe the manual mode of release

2018-02-13 Thread GitBox
houshengbo opened a new pull request #42: Add the documentation to describe the 
manual mode of release
URL: https://github.com/apache/incubator-openwhisk-release/pull/42
 
 
   


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 #3262: Handle trigger activations with inactive rules

2018-02-13 Thread GitBox
markusthoemmes commented on a change in pull request #3262: Handle trigger 
activations with inactive rules
URL: 
https://github.com/apache/incubator-openwhisk/pull/3262#discussion_r16797
 
 

 ##
 File path: core/controller/src/main/scala/whisk/core/controller/Triggers.scala
 ##
 @@ -129,7 +129,7 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
 
   if (activeRules.nonEmpty) {
 
 Review comment:
   I'll suggest to go for the following:
   
   ```scala
   val rules = trigger.rules.getOrElse(Map.empty) // use this in belows call 
for activateRules
   
   if(rules.exists(_._2 == Status.ACTIVE)) {
  that code
   } else {
 complete(NoContent)
   }
   ```
   
   You don't need to filter out only the actives anymore, might as well exit 
early using `exists`


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 #3262: Handle trigger activations with inactive rules

2018-02-13 Thread GitBox
markusthoemmes commented on a change in pull request #3262: Handle trigger 
activations with inactive rules
URL: 
https://github.com/apache/incubator-openwhisk/pull/3262#discussion_r16797
 
 

 ##
 File path: core/controller/src/main/scala/whisk/core/controller/Triggers.scala
 ##
 @@ -129,7 +129,7 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
 
   if (activeRules.nonEmpty) {
 
 Review comment:
   I'll suggest to go for the following:
   
   ```scala
   val rules = trigger.rules.getOrElse(Map.empty) // use this in belows call 
for activateRules
   
   if(rules.exists(_._2 == Status.ACTIVE)) {
  that code
   } else {
 complete(NoContent)
   }
   ```


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] pritidesai commented on issue #733: Enable Apache Rat plugin in gradle

2018-02-13 Thread GitBox
pritidesai commented on issue #733: Enable Apache Rat plugin in gradle
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/733#issuecomment-365373876
 
 
   LGTM, thanks @daisy-ycguo 


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 #3262: Handle trigger activations with inactive rules

2018-02-13 Thread GitBox
markusthoemmes commented on a change in pull request #3262: Handle trigger 
activations with inactive rules
URL: 
https://github.com/apache/incubator-openwhisk/pull/3262#discussion_r167970954
 
 

 ##
 File path: core/controller/src/main/scala/whisk/core/controller/Triggers.scala
 ##
 @@ -129,7 +129,7 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
 
   if (activeRules.nonEmpty) {
 val args: JsObject = 
trigger.parameters.merge(payload).getOrElse(JsObject())
-val actionLogList: Iterable[Future[JsObject]] = 
activateRules(user, args, activeRules)
+val actionLogList: Iterable[Future[JsObject]] = 
activateRules(user, args, trigger.rules.get)
 
 Review comment:
   Just go with a `getOrElse(Map.empty)`. `activateRules` just won


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 #3262: Handle trigger activations with inactive rules

2018-02-13 Thread GitBox
markusthoemmes commented on a change in pull request #3262: Handle trigger 
activations with inactive rules
URL: 
https://github.com/apache/incubator-openwhisk/pull/3262#discussion_r167970273
 
 

 ##
 File path: tests/src/test/scala/system/basic/WskBasicTests.scala
 ##
 @@ -748,6 +748,67 @@ class WskBasicTests extends TestHelpers with 
WskTestHelpers {
   }
   }
 
+  it should "create and fire a trigger having an active rule and an inactive 
rule" in withAssetCleaner(wskprops) {
+(wp, assetHelper) =>
+  val ruleName1 = withTimestamp("r1toa1")
+  val ruleName2 = withTimestamp("r2toa2")
+  val triggerName = withTimestamp("t1tor1r2")
+  val actionName1 = withTimestamp("a1")
+  val actionName2 = withTimestamp("a2")
+  val ns = wsk.namespace.whois()
+
+  assetHelper.withCleaner(wsk.trigger, triggerName) { (trigger, _) =>
+trigger.create(triggerName)
+trigger.create(triggerName, update = true)
+  }
+
+  assetHelper.withCleaner(wsk.action, actionName1) { (action, name) =>
+action.create(name, defaultAction)
+  }
+  assetHelper.withCleaner(wsk.action, actionName2) { (action, name) =>
+action.create(name, defaultAction)
+  }
+
+  assetHelper.withCleaner(wsk.rule, ruleName1) { (rule, name) =>
+rule.create(name, trigger = triggerName, action = actionName1)
+  }
+  assetHelper.withCleaner(wsk.rule, ruleName2) { (rule, name) =>
+rule.create(name, trigger = triggerName, action = actionName2)
+rule.disable(ruleName2)
+  }
+
+  val run = wsk.trigger.fire(triggerName)
+  withActivation(wsk.activation, run) { activation =>
+activation.duration shouldBe 0L // shouldn't exist but CLI generates it
+activation.end shouldBe Instant.EPOCH // shouldn't exist but CLI 
generates it
+activation.logs shouldBe defined
+activation.logs.get.size shouldBe 2
+
+val logEntry1 = activation.logs.get(0).parseJson.asJsObject
+val logEntry2 = activation.logs.get(1).parseJson.asJsObject
+val logs = JsArray(logEntry1, logEntry2)
+val ruleActivationId: String = if 
(logEntry1.getFields("activationId").size == 1) {
+  logEntry1.getFields("activationId")(0).convertTo[String]
+} else {
+  logEntry2.getFields("activationId")(0).convertTo[String]
+}
+val expectedLogs = JsArray(
+  JsObject(
+"statusCode" -> JsNumber(0),
+"activationId" -> JsString(ruleActivationId),
+"success" -> JsBoolean(true),
+"rule" -> JsString(ns + "/" + ruleName1),
+"action" -> JsString(ns + "/" + actionName1)),
+  JsObject(
+"statusCode" -> JsNumber(1),
+"success" -> JsBoolean(false),
+"error" -> JsString(s"Rule ${ns}/$ruleName2 is inactive; action 
${ns}/$actionName2 was not activated"),
+"rule" -> JsString(ns + "/" + ruleName2),
+"action" -> JsString(ns + "/" + actionName2)))
+logs shouldBe expectedLogs
+  }
+  }
 
 Review comment:
   Test for the 204 case?


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 #3262: Handle trigger activations with inactive rules

2018-02-13 Thread GitBox
mdeuser commented on issue #3262: Handle trigger activations with inactive rules
URL: 
https://github.com/apache/incubator-openwhisk/pull/3262#issuecomment-365371067
 
 
   Updated `logs` field in the trigger activation record will look like the 
following for a trigger with one active and one inactive rule:
   ```
   "logs": [
   
"{\"statusCode\":0,\"success\":true,\"activationId\":\"a0e1a50ba6074eeca1a50ba6072eecdc\",\"rule\":\"guest/activerule1\",\"action\":\"guest/web-echo-env\"}",
   
"{\"statusCode\":1,\"success\":false,\"rule\":\"guest/inactiverule1\",\"error\":\"Rule
 guest/inactiverule1 is inactive; action guest/web-echo-env was not 
activated\",\"action\":\"guest/web-echo-env\"}"
   ],
   ```


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 #3262: Handle trigger activations with inactive rules

2018-02-13 Thread GitBox
mdeuser commented on issue #3262: Handle trigger activations with inactive rules
URL: 
https://github.com/apache/incubator-openwhisk/pull/3262#issuecomment-365370840
 
 
   rebased on top of #3256 


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 closed pull request #2957: splunk logstore

2018-02-13 Thread GitBox
markusthoemmes closed pull request #2957: splunk logstore
URL: https://github.com/apache/incubator-openwhisk/pull/2957
 
 
   

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/common/scala/src/main/scala/whisk/core/WhiskConfig.scala 
b/common/scala/src/main/scala/whisk/core/WhiskConfig.scala
index 5d3fadab3b..c538d6ec56 100644
--- a/common/scala/src/main/scala/whisk/core/WhiskConfig.scala
+++ b/common/scala/src/main/scala/whisk/core/WhiskConfig.scala
@@ -258,4 +258,7 @@ object ConfigKeys {
 
   val transactions = "whisk.transactions"
   val stride = s"$transactions.stride"
+
+  val logStore = "whisk.logstore"
+  val splunk = s"$logStore.splunk"
 }
diff --git 
a/common/scala/src/main/scala/whisk/core/containerpool/logging/LogDriverLogStore.scala
 
b/common/scala/src/main/scala/whisk/core/containerpool/logging/LogDriverLogStore.scala
new file mode 100644
index 00..465fb2532f
--- /dev/null
+++ 
b/common/scala/src/main/scala/whisk/core/containerpool/logging/LogDriverLogStore.scala
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package whisk.core.containerpool.logging
+
+import akka.actor.ActorSystem
+import whisk.core.entity.Identity
+import whisk.common.TransactionId
+import whisk.core.containerpool.Container
+import whisk.core.entity.{ActivationLogs, ExecutableWhiskAction, 
WhiskActivation}
+
+import scala.concurrent.Future
+
+/**
+ * Docker log driver based LogStore impl. Uses docker log driver to emit 
container logs to an external store.
+ * Fetching logs from that external store is not provided in this trait. This 
SPI requires the
+ * ContainerArgs.extraArgs to be used to indicate where the logs are shipped.
+ * see 
https://docs.docker.com/config/containers/logging/configure/#configure-the-logging-driver-for-a-container
+ *
+ * Fetching logs here is a NOOP, but extended versions can customize fetching, 
e.g. from ELK or Splunk etc.
+ */
+class LogDriverLogStore(actorSystem: ActorSystem) extends LogStore {
+
+  /** Indicate --log-driver and --log-opt flags via 
ContainerArgsConfig.extraArgs */
+  override def containerParameters = Map()
+
+  def collectLogs(transid: TransactionId,
+  user: Identity,
+  activation: WhiskActivation,
+  container: Container,
+  action: ExecutableWhiskAction): Future[ActivationLogs] =
+Future.successful(ActivationLogs()) //no logs collected when using docker 
log drivers (see DockerLogStore for json-file exception)
+
+  /** no logs exposed to API/CLI using only the LogDriverLogStore; use an 
extended version,
+   * e.g. the SplunkLogStore to expose logs from some external source */
+  def fetchLogs(activation: WhiskActivation): Future[ActivationLogs] =
+Future.successful(ActivationLogs(Vector("Logs are not available.")))
+}
+
+object LogDriverLogStoreProvider extends LogStoreProvider {
+  override def logStore(actorSystem: ActorSystem) = new 
LogDriverLogStore(actorSystem)
+}
diff --git 
a/common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala
 
b/common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala
new file mode 100644
index 00..596b776131
--- /dev/null
+++ 
b/common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 

[GitHub] jasonpet opened a new pull request #127: remove unused import from test

2018-02-13 Thread GitBox
jasonpet opened a new pull request #127: remove unused import from test
URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/127
 
 
   


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] tardieu commented on a change in pull request #3202: Support action continuations in the controller

2018-02-13 Thread GitBox
tardieu commented on a change in pull request #3202: Support action 
continuations in the controller
URL: 
https://github.com/apache/incubator-openwhisk/pull/3202#discussion_r167960137
 
 

 ##
 File path: 
core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
 ##
 @@ -140,6 +200,349 @@ protected[actions] trait PrimitiveActions {
 }
   }
 
+  /**
+   * Mutable cumulative accounting of what happened during the execution of a 
composition.
+   *
+   * Compositions are aborted if the number of action invocations exceeds a 
limit.
+   * The permitted max is n component invocations plus 2n+1 conductor 
invocations (where n is the actionSequenceLimit).
+   * The max is chosen to permit a sequence with up to n primitive actions.
+   *
+   * NOTE:
+   * A sequence invocation counts as one invocation irrespective of the number 
of action invocations in the sequence.
+   * If one component of a composition is also a composition, the caller and 
callee share the same accounting object.
+   * The counts are shared between callers and callees so the limit applies 
globally.
+   *
+   * @param components the current count of component actions already invoked
+   * @param conductors the current count of conductor actions already invoked
+   */
+  private case class CompositionAccounting(var components: Int = 0, var 
conductors: Int = 0)
+
+  /**
+   * A mutable session object to keep track of the execution of one 
composition.
+   *
+   * NOTE:
+   * The session object is not shared between callers and callees.
+   *
+   * @param activationId the activationId for the composition (ie the 
activation record for the composition)
+   * @param start the start time for the composition
+   * @param action the conductor action responsible for the execution of the 
composition
+   * @param cause the cause of the composition (activationId of the enclosing 
sequence or composition if any)
+   * @param duration the "user" time so far executing the composition (sum of 
durations for
+   *all actions invoked so far which is different from the total time 
spent executing the composition)
+   * @param maxMemory the maximum memory annotation observed so far for the 
conductor action and components
+   * @param state the json state object to inject in the parameter object of 
the next conductor invocation
+   * @param accounting the global accounting object used to abort compositions 
requiring too many action invocations
+   * @param logs a mutable buffer that is appended with new activation ids as 
the composition unfolds
+   * (in contrast with sequences, the logs of a hierarchy of 
compositions is not flattened)
+   */
+  private case class Session(activationId: ActivationId,
+ start: Instant,
+ action: ExecutableWhiskActionMetaData,
+ cause: Option[ActivationId],
+ var duration: Long,
+ var maxMemory: Int,
+ var state: Option[JsObject],
+ accounting: CompositionAccounting,
+ logs: Buffer[ActivationId])
+
+  /**
+   * A method that knows how to invoke a composition.
+   *
+   * The method instantiates the session object for the composition and 
invokes the conductor action.
+   * It waits for the activation response, synthesizes the activation record 
and writes it to the datastore.
+   * It distinguishes nested, blocking and non-blocking invokes, returning 
either the activation or the activation id.
+   *
+   * @param user the identity invoking the action
+   * @param action the conductor action to invoke for the composition
+   * @param payload the dynamic arguments for the activation
+   * @param waitForResponse if not empty, wait upto specified duration for a 
response (this is used for blocking activations)
+   * @param cause the activation id that is responsible for this 
invoke/activation
+   * @param accounting the accounting object for the caller if any
+   * @param transid a transaction id for logging
+   * @return a promise that completes with one of the following successful 
cases:
+   *Right(WhiskActivation) if waiting for a response and response 
is ready within allowed duration,
+   *Left(ActivationId) if not waiting for a response, or allowed 
duration has elapsed without a result ready
+   */
+  private def invokeComposition(user: Identity,
+action: ExecutableWhiskActionMetaData,
+payload: Option[JsObject],
+waitForResponse: Option[FiniteDuration],
+cause: Option[ActivationId],
+accounting: Option[CompositionAccounting] = 
None)(
+implicit transid: TransactionId): Future[Either[ActivationId, 
WhiskActivation]] = {
+
+val session = Session(

[GitHub] tardieu commented on a change in pull request #3202: Support action continuations in the controller

2018-02-13 Thread GitBox
tardieu commented on a change in pull request #3202: Support action 
continuations in the controller
URL: 
https://github.com/apache/incubator-openwhisk/pull/3202#discussion_r167954945
 
 

 ##
 File path: 
core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
 ##
 @@ -140,6 +200,349 @@ protected[actions] trait PrimitiveActions {
 }
   }
 
+  /**
+   * Mutable cumulative accounting of what happened during the execution of a 
composition.
+   *
+   * Compositions are aborted if the number of action invocations exceeds a 
limit.
+   * The permitted max is n component invocations plus 2n+1 conductor 
invocations (where n is the actionSequenceLimit).
+   * The max is chosen to permit a sequence with up to n primitive actions.
+   *
+   * NOTE:
+   * A sequence invocation counts as one invocation irrespective of the number 
of action invocations in the sequence.
+   * If one component of a composition is also a composition, the caller and 
callee share the same accounting object.
+   * The counts are shared between callers and callees so the limit applies 
globally.
+   *
+   * @param components the current count of component actions already invoked
+   * @param conductors the current count of conductor actions already invoked
+   */
+  private case class CompositionAccounting(var components: Int = 0, var 
conductors: Int = 0)
+
+  /**
+   * A mutable session object to keep track of the execution of one 
composition.
+   *
+   * NOTE:
+   * The session object is not shared between callers and callees.
+   *
+   * @param activationId the activationId for the composition (ie the 
activation record for the composition)
+   * @param start the start time for the composition
+   * @param action the conductor action responsible for the execution of the 
composition
+   * @param cause the cause of the composition (activationId of the enclosing 
sequence or composition if any)
+   * @param duration the "user" time so far executing the composition (sum of 
durations for
+   *all actions invoked so far which is different from the total time 
spent executing the composition)
+   * @param maxMemory the maximum memory annotation observed so far for the 
conductor action and components
+   * @param state the json state object to inject in the parameter object of 
the next conductor invocation
+   * @param accounting the global accounting object used to abort compositions 
requiring too many action invocations
+   * @param logs a mutable buffer that is appended with new activation ids as 
the composition unfolds
+   * (in contrast with sequences, the logs of a hierarchy of 
compositions is not flattened)
+   */
+  private case class Session(activationId: ActivationId,
+ start: Instant,
+ action: ExecutableWhiskActionMetaData,
+ cause: Option[ActivationId],
+ var duration: Long,
+ var maxMemory: Int,
 
 Review comment:
   OK. Updating.


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] tardieu commented on a change in pull request #3202: Support action continuations in the controller

2018-02-13 Thread GitBox
tardieu commented on a change in pull request #3202: Support action 
continuations in the controller
URL: 
https://github.com/apache/incubator-openwhisk/pull/3202#discussion_r167954793
 
 

 ##
 File path: 
core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
 ##
 @@ -140,6 +200,349 @@ protected[actions] trait PrimitiveActions {
 }
   }
 
+  /**
+   * Mutable cumulative accounting of what happened during the execution of a 
composition.
+   *
+   * Compositions are aborted if the number of action invocations exceeds a 
limit.
+   * The permitted max is n component invocations plus 2n+1 conductor 
invocations (where n is the actionSequenceLimit).
+   * The max is chosen to permit a sequence with up to n primitive actions.
+   *
+   * NOTE:
+   * A sequence invocation counts as one invocation irrespective of the number 
of action invocations in the sequence.
+   * If one component of a composition is also a composition, the caller and 
callee share the same accounting object.
+   * The counts are shared between callers and callees so the limit applies 
globally.
+   *
+   * @param components the current count of component actions already invoked
+   * @param conductors the current count of conductor actions already invoked
+   */
+  private case class CompositionAccounting(var components: Int = 0, var 
conductors: Int = 0)
+
+  /**
+   * A mutable session object to keep track of the execution of one 
composition.
+   *
+   * NOTE:
+   * The session object is not shared between callers and callees.
+   *
+   * @param activationId the activationId for the composition (ie the 
activation record for the composition)
+   * @param start the start time for the composition
+   * @param action the conductor action responsible for the execution of the 
composition
+   * @param cause the cause of the composition (activationId of the enclosing 
sequence or composition if any)
+   * @param duration the "user" time so far executing the composition (sum of 
durations for
+   *all actions invoked so far which is different from the total time 
spent executing the composition)
+   * @param maxMemory the maximum memory annotation observed so far for the 
conductor action and components
+   * @param state the json state object to inject in the parameter object of 
the next conductor invocation
+   * @param accounting the global accounting object used to abort compositions 
requiring too many action invocations
+   * @param logs a mutable buffer that is appended with new activation ids as 
the composition unfolds
+   * (in contrast with sequences, the logs of a hierarchy of 
compositions is not flattened)
+   */
+  private case class Session(activationId: ActivationId,
+ start: Instant,
+ action: ExecutableWhiskActionMetaData,
+ cause: Option[ActivationId],
+ var duration: Long,
 
 Review comment:
   No I don't think so. This current type follows from:
   
   ```scala
   case class WhiskActivation(namespace: EntityPath,
  ...
  duration: Option[Long] = None)
   ```


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 #9: Fix travis build

2018-02-13 Thread GitBox
csantanapr commented on issue #9: Fix travis build
URL: 
https://github.com/apache/incubator-openwhisk-runtime-java/pull/9#issuecomment-365348591
 
 
   Thanks @chetanmeh ? 


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 issue #8: Current master build failing in ansible command

2018-02-13 Thread GitBox
csantanapr closed issue #8: Current master build failing in ansible command
URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/8
 
 
   


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] tardieu commented on a change in pull request #3202: Support action continuations in the controller

2018-02-13 Thread GitBox
tardieu commented on a change in pull request #3202: Support action 
continuations in the controller
URL: 
https://github.com/apache/incubator-openwhisk/pull/3202#discussion_r167947560
 
 

 ##
 File path: 
core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
 ##
 @@ -140,6 +200,349 @@ protected[actions] trait PrimitiveActions {
 }
   }
 
+  /**
+   * Mutable cumulative accounting of what happened during the execution of a 
composition.
+   *
+   * Compositions are aborted if the number of action invocations exceeds a 
limit.
+   * The permitted max is n component invocations plus 2n+1 conductor 
invocations (where n is the actionSequenceLimit).
+   * The max is chosen to permit a sequence with up to n primitive actions.
+   *
+   * NOTE:
+   * A sequence invocation counts as one invocation irrespective of the number 
of action invocations in the sequence.
+   * If one component of a composition is also a composition, the caller and 
callee share the same accounting object.
+   * The counts are shared between callers and callees so the limit applies 
globally.
+   *
+   * @param components the current count of component actions already invoked
+   * @param conductors the current count of conductor actions already invoked
+   */
+  private case class CompositionAccounting(var components: Int = 0, var 
conductors: Int = 0)
+
+  /**
+   * A mutable session object to keep track of the execution of one 
composition.
+   *
+   * NOTE:
+   * The session object is not shared between callers and callees.
+   *
+   * @param activationId the activationId for the composition (ie the 
activation record for the composition)
+   * @param start the start time for the composition
+   * @param action the conductor action responsible for the execution of the 
composition
+   * @param cause the cause of the composition (activationId of the enclosing 
sequence or composition if any)
+   * @param duration the "user" time so far executing the composition (sum of 
durations for
+   *all actions invoked so far which is different from the total time 
spent executing the composition)
+   * @param maxMemory the maximum memory annotation observed so far for the 
conductor action and components
+   * @param state the json state object to inject in the parameter object of 
the next conductor invocation
+   * @param accounting the global accounting object used to abort compositions 
requiring too many action invocations
+   * @param logs a mutable buffer that is appended with new activation ids as 
the composition unfolds
+   * (in contrast with sequences, the logs of a hierarchy of 
compositions is not flattened)
+   */
+  private case class Session(activationId: ActivationId,
+ start: Instant,
+ action: ExecutableWhiskActionMetaData,
+ cause: Option[ActivationId],
+ var duration: Long,
+ var maxMemory: Int,
+ var state: Option[JsObject],
+ accounting: CompositionAccounting,
+ logs: Buffer[ActivationId])
+
+  /**
+   * A method that knows how to invoke a composition.
+   *
+   * The method instantiates the session object for the composition and 
invokes the conductor action.
+   * It waits for the activation response, synthesizes the activation record 
and writes it to the datastore.
+   * It distinguishes nested, blocking and non-blocking invokes, returning 
either the activation or the activation id.
+   *
+   * @param user the identity invoking the action
+   * @param action the conductor action to invoke for the composition
+   * @param payload the dynamic arguments for the activation
+   * @param waitForResponse if not empty, wait upto specified duration for a 
response (this is used for blocking activations)
+   * @param cause the activation id that is responsible for this 
invoke/activation
+   * @param accounting the accounting object for the caller if any
+   * @param transid a transaction id for logging
+   * @return a promise that completes with one of the following successful 
cases:
+   *Right(WhiskActivation) if waiting for a response and response 
is ready within allowed duration,
+   *Left(ActivationId) if not waiting for a response, or allowed 
duration has elapsed without a result ready
+   */
+  private def invokeComposition(user: Identity,
+action: ExecutableWhiskActionMetaData,
+payload: Option[JsObject],
+waitForResponse: Option[FiniteDuration],
+cause: Option[ActivationId],
+accounting: Option[CompositionAccounting] = 
None)(
+implicit transid: TransactionId): Future[Either[ActivationId, 
WhiskActivation]] = {
+
+val session = Session(

[GitHub] markusthoemmes opened a new pull request #3280: Replace asString and asBool with generic method.

2018-02-13 Thread GitBox
markusthoemmes opened a new pull request #3280: Replace asString and asBool 
with generic method.
URL: https://github.com/apache/incubator-openwhisk/pull/3280
 
 
   Mainly aims to reduce boilerplate in code which tries to extract 
non-primitive data from parameters/annotations. Any supported json-format (for 
example case classes) can be loaded safely from parameters.


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] lionelvillard commented on issue #730: Multiple projects management

2018-02-13 Thread GitBox
lionelvillard commented on issue #730: Multiple projects management
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/730#issuecomment-365343069
 
 
   @davidbreitgand in this model, there is only one project:
   ```
   P --> A --> B
 |-> C -->  B
   ```
   
   then it's up to wskdeploy to factor out B. When both A and C instantiates B 
with the same parameters, then all is fine. Otherwise wskdeploy can reject or 
decide to deploy B is two different packages (when there is no dynamic 
bindings) or two different namespaces (wskdeploy automatically handles 
authentication). 
   
   As for `wsk action update b`, I suppose you also mean the user will then use 
`export`. In that case the expected behavior is to update the action in the 
manifest B. However as you said, the OW data model does not support 
dependencies so in order to propagate changes to A and C (like for instance if 
a parameter on b is defined in A) additional annotations must be added to 
encode such dependencies.
   
   To be clear: I'm not against adding the `managedList` annotation, I'm just 
trying to contrast this approach with the `dependencies` approach. It seems to 
me that in order to let wskdeploy managing dependencies we will need more than 
the `managedList` annotation. 


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 #3202: Support action continuations in the controller

2018-02-13 Thread GitBox
markusthoemmes commented on a change in pull request #3202: Support action 
continuations in the controller
URL: 
https://github.com/apache/incubator-openwhisk/pull/3202#discussion_r167940363
 
 

 ##
 File path: 
core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
 ##
 @@ -140,6 +200,349 @@ protected[actions] trait PrimitiveActions {
 }
   }
 
+  /**
+   * Mutable cumulative accounting of what happened during the execution of a 
composition.
+   *
+   * Compositions are aborted if the number of action invocations exceeds a 
limit.
+   * The permitted max is n component invocations plus 2n+1 conductor 
invocations (where n is the actionSequenceLimit).
+   * The max is chosen to permit a sequence with up to n primitive actions.
+   *
+   * NOTE:
+   * A sequence invocation counts as one invocation irrespective of the number 
of action invocations in the sequence.
+   * If one component of a composition is also a composition, the caller and 
callee share the same accounting object.
+   * The counts are shared between callers and callees so the limit applies 
globally.
+   *
+   * @param components the current count of component actions already invoked
+   * @param conductors the current count of conductor actions already invoked
+   */
+  private case class CompositionAccounting(var components: Int = 0, var 
conductors: Int = 0)
+
+  /**
+   * A mutable session object to keep track of the execution of one 
composition.
+   *
+   * NOTE:
+   * The session object is not shared between callers and callees.
+   *
+   * @param activationId the activationId for the composition (ie the 
activation record for the composition)
+   * @param start the start time for the composition
+   * @param action the conductor action responsible for the execution of the 
composition
+   * @param cause the cause of the composition (activationId of the enclosing 
sequence or composition if any)
+   * @param duration the "user" time so far executing the composition (sum of 
durations for
+   *all actions invoked so far which is different from the total time 
spent executing the composition)
+   * @param maxMemory the maximum memory annotation observed so far for the 
conductor action and components
+   * @param state the json state object to inject in the parameter object of 
the next conductor invocation
+   * @param accounting the global accounting object used to abort compositions 
requiring too many action invocations
+   * @param logs a mutable buffer that is appended with new activation ids as 
the composition unfolds
+   * (in contrast with sequences, the logs of a hierarchy of 
compositions is not flattened)
+   */
+  private case class Session(activationId: ActivationId,
+ start: Instant,
+ action: ExecutableWhiskActionMetaData,
+ cause: Option[ActivationId],
+ var duration: Long,
+ var maxMemory: Int,
 
 Review comment:
   Should this be a `ByteSize`?


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 #3202: Support action continuations in the controller

2018-02-13 Thread GitBox
markusthoemmes commented on a change in pull request #3202: Support action 
continuations in the controller
URL: 
https://github.com/apache/incubator-openwhisk/pull/3202#discussion_r167940427
 
 

 ##
 File path: 
core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
 ##
 @@ -140,6 +200,349 @@ protected[actions] trait PrimitiveActions {
 }
   }
 
+  /**
+   * Mutable cumulative accounting of what happened during the execution of a 
composition.
+   *
+   * Compositions are aborted if the number of action invocations exceeds a 
limit.
+   * The permitted max is n component invocations plus 2n+1 conductor 
invocations (where n is the actionSequenceLimit).
+   * The max is chosen to permit a sequence with up to n primitive actions.
+   *
+   * NOTE:
+   * A sequence invocation counts as one invocation irrespective of the number 
of action invocations in the sequence.
+   * If one component of a composition is also a composition, the caller and 
callee share the same accounting object.
+   * The counts are shared between callers and callees so the limit applies 
globally.
+   *
+   * @param components the current count of component actions already invoked
+   * @param conductors the current count of conductor actions already invoked
+   */
+  private case class CompositionAccounting(var components: Int = 0, var 
conductors: Int = 0)
+
+  /**
+   * A mutable session object to keep track of the execution of one 
composition.
+   *
+   * NOTE:
+   * The session object is not shared between callers and callees.
+   *
+   * @param activationId the activationId for the composition (ie the 
activation record for the composition)
+   * @param start the start time for the composition
+   * @param action the conductor action responsible for the execution of the 
composition
+   * @param cause the cause of the composition (activationId of the enclosing 
sequence or composition if any)
+   * @param duration the "user" time so far executing the composition (sum of 
durations for
+   *all actions invoked so far which is different from the total time 
spent executing the composition)
+   * @param maxMemory the maximum memory annotation observed so far for the 
conductor action and components
+   * @param state the json state object to inject in the parameter object of 
the next conductor invocation
+   * @param accounting the global accounting object used to abort compositions 
requiring too many action invocations
+   * @param logs a mutable buffer that is appended with new activation ids as 
the composition unfolds
+   * (in contrast with sequences, the logs of a hierarchy of 
compositions is not flattened)
+   */
+  private case class Session(activationId: ActivationId,
+ start: Instant,
+ action: ExecutableWhiskActionMetaData,
+ cause: Option[ActivationId],
+ var duration: Long,
 
 Review comment:
   Should this be a `FiniteDuration`?


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 #3202: Support action continuations in the controller

2018-02-13 Thread GitBox
markusthoemmes commented on a change in pull request #3202: Support action 
continuations in the controller
URL: 
https://github.com/apache/incubator-openwhisk/pull/3202#discussion_r167939781
 
 

 ##
 File path: 
core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
 ##
 @@ -140,6 +200,349 @@ protected[actions] trait PrimitiveActions {
 }
   }
 
+  /**
+   * Mutable cumulative accounting of what happened during the execution of a 
composition.
+   *
+   * Compositions are aborted if the number of action invocations exceeds a 
limit.
+   * The permitted max is n component invocations plus 2n+1 conductor 
invocations (where n is the actionSequenceLimit).
+   * The max is chosen to permit a sequence with up to n primitive actions.
+   *
+   * NOTE:
+   * A sequence invocation counts as one invocation irrespective of the number 
of action invocations in the sequence.
+   * If one component of a composition is also a composition, the caller and 
callee share the same accounting object.
+   * The counts are shared between callers and callees so the limit applies 
globally.
+   *
+   * @param components the current count of component actions already invoked
+   * @param conductors the current count of conductor actions already invoked
+   */
+  private case class CompositionAccounting(var components: Int = 0, var 
conductors: Int = 0)
+
+  /**
+   * A mutable session object to keep track of the execution of one 
composition.
+   *
+   * NOTE:
+   * The session object is not shared between callers and callees.
+   *
+   * @param activationId the activationId for the composition (ie the 
activation record for the composition)
+   * @param start the start time for the composition
+   * @param action the conductor action responsible for the execution of the 
composition
+   * @param cause the cause of the composition (activationId of the enclosing 
sequence or composition if any)
+   * @param duration the "user" time so far executing the composition (sum of 
durations for
+   *all actions invoked so far which is different from the total time 
spent executing the composition)
+   * @param maxMemory the maximum memory annotation observed so far for the 
conductor action and components
+   * @param state the json state object to inject in the parameter object of 
the next conductor invocation
+   * @param accounting the global accounting object used to abort compositions 
requiring too many action invocations
+   * @param logs a mutable buffer that is appended with new activation ids as 
the composition unfolds
+   * (in contrast with sequences, the logs of a hierarchy of 
compositions is not flattened)
+   */
+  private case class Session(activationId: ActivationId,
+ start: Instant,
+ action: ExecutableWhiskActionMetaData,
+ cause: Option[ActivationId],
+ var duration: Long,
+ var maxMemory: Int,
+ var state: Option[JsObject],
+ accounting: CompositionAccounting,
+ logs: Buffer[ActivationId])
+
+  /**
+   * A method that knows how to invoke a composition.
+   *
+   * The method instantiates the session object for the composition and 
invokes the conductor action.
+   * It waits for the activation response, synthesizes the activation record 
and writes it to the datastore.
+   * It distinguishes nested, blocking and non-blocking invokes, returning 
either the activation or the activation id.
+   *
+   * @param user the identity invoking the action
+   * @param action the conductor action to invoke for the composition
+   * @param payload the dynamic arguments for the activation
+   * @param waitForResponse if not empty, wait upto specified duration for a 
response (this is used for blocking activations)
+   * @param cause the activation id that is responsible for this 
invoke/activation
+   * @param accounting the accounting object for the caller if any
+   * @param transid a transaction id for logging
+   * @return a promise that completes with one of the following successful 
cases:
+   *Right(WhiskActivation) if waiting for a response and response 
is ready within allowed duration,
+   *Left(ActivationId) if not waiting for a response, or allowed 
duration has elapsed without a result ready
+   */
+  private def invokeComposition(user: Identity,
+action: ExecutableWhiskActionMetaData,
+payload: Option[JsObject],
+waitForResponse: Option[FiniteDuration],
+cause: Option[ActivationId],
+accounting: Option[CompositionAccounting] = 
None)(
+implicit transid: TransactionId): Future[Either[ActivationId, 
WhiskActivation]] = {
+
+val session = 

[GitHub] mhamann commented on issue #273: A list of source files missing Apache license headers

2018-02-13 Thread GitBox
mhamann commented on issue #273: A list of source files missing Apache license 
headers
URL: 
https://github.com/apache/incubator-openwhisk-apigateway/issues/273#issuecomment-365338020
 
 
   @daisy-ycguo is there an automated tool to add those license headers?


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 #126: optionally limit cron fields to 5 instead of 6

2018-02-13 Thread GitBox
csantanapr closed pull request #126: optionally limit cron fields to 5 instead 
of 6
URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/126
 
 
   

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/action/alarmWebAction.js b/action/alarmWebAction.js
index d56a159..b5b5bde 100644
--- a/action/alarmWebAction.js
+++ b/action/alarmWebAction.js
@@ -72,6 +72,10 @@ function main(params) {
 
 try {
 cronHandle = new CronJob(params.cron, function() {});
+//validate cron granularity if 5 fields are allowed 
instead of 6
+if (params.limitCronFields && 
hasSecondsGranularity(params.cron)) {
+return common.sendError(400, 'cron pattern is limited 
to 5 fields with 1 minute as the finest granularity');
+}
 newTrigger.cron = params.cron;
 } catch(ex) {
 return common.sendError(400, `cron pattern 
'${params.cron}' is not valid`);
@@ -198,7 +202,7 @@ function main(params) {
 }
 
 if (params.trigger_payload) {
-updatedParams.payload = 
constructPayload(params.trigger_payload);
+updatedParams.payload = 
common.constructPayload(params.trigger_payload);
 }
 
 if (trigger.date) {
@@ -228,6 +232,10 @@ function main(params) {
 if (params.cron) {
 try {
 new CronJob(params.cron, function() {});
+//validate cron granularity if 5 fields are 
allowed instead of 6
+if (params.limitCronFields && 
hasSecondsGranularity(params.cron)) {
+return common.sendError(400, 'cron pattern 
is limited to 5 fields with 1 minute as the finest granularity');
+}
 } catch (ex) {
 return reject(common.sendError(400, `cron 
pattern '${params.cron}' is not valid`));
 }
@@ -313,20 +321,6 @@ function main(params) {
 }
 }
 
-function constructPayload(payload) {
-
-var updatedPayload;
-if (payload) {
-if (typeof payload === 'string') {
-updatedPayload = {payload: payload};
-}
-if (typeof payload === 'object') {
-updatedPayload = payload;
-}
-}
-return updatedPayload;
-}
-
 function validateDate(date, paramName, startDate) {
 
 var dateObject = new Date(date);
@@ -346,6 +340,17 @@ function validateDate(date, paramName, startDate) {
 
 }
 
+function hasSecondsGranularity(cron) {
+
+var fields = (cron + '').trim().split(/\s+/);
+
+if (fields.length > 5 && fields[fields.length - 6] !== '0') {
+return true;
+}
+
+return false;
+}
+
 exports.main = main;
 
 
diff --git a/action/lib/common.js b/action/lib/common.js
index c62e1f8..663be12 100644
--- a/action/lib/common.js
+++ b/action/lib/common.js
@@ -104,11 +104,26 @@ function sendError(statusCode, error, message) {
 };
 }
 
+function constructPayload(payload) {
+
+var updatedPayload;
+if (payload) {
+if (typeof payload === 'string') {
+updatedPayload = {payload: payload};
+}
+if (typeof payload === 'object') {
+updatedPayload = payload;
+}
+}
+return updatedPayload;
+}
+
 
 module.exports = {
 'requestHelper': requestHelper,
 'createWebParams': createWebParams,
 'verifyTriggerAuth': verifyTriggerAuth,
 'parseQName': parseQName,
-'sendError': sendError
+'sendError': sendError,
+'constructPayload': constructPayload
 };
diff --git a/installCatalog.sh b/installCatalog.sh
index ddc9337..85f6467 100755
--- a/installCatalog.sh
+++ b/installCatalog.sh
@@ -12,9 +12,8 @@ set -x
 : ${OPENWHISK_HOME:?"OPENWHISK_HOME must be set and non-empty"}
 WSK_CLI="$OPENWHISK_HOME/bin/wsk"
 
-if [ $# -eq 0 ]
-then
-echo "Usage: ./installCatalog.sh 
 "
+if [ $# -eq 0 ]; then
+echo "Usage: ./installCatalog.sh 
 "
 fi
 
 AUTH="$1"
@@ -23,6 +22,7 @@ DB_URL="$3"
 DB_NAME="${4}alarmservice"
 APIHOST="$5"
 WORKERS="$6"
+LIMIT_CRON_FIELDS="${LIMIT_CRON_FIELDS}"
 
 # If the auth key file exists, read the key in the file. Otherwise, take the
 # first argument as the key itself.
@@ -57,8 +57,7 @@ $WSK_CLI -i --apihost "$EDGEHOST" package update --auth 
"$AUTH" --shared yes ala
 # make alarmFeed.zip
 cd action
 
-if [ -e alarmFeed.zip ]
-then
+if [ -e alarmFeed.zip ]; then
 rm -rf alarmFeed.zip
 fi
 
@@ -82,26 +81,26 @@ $WSK_CLI -i --apihost "$EDGEHOST" action update --kind 
nodejs:6 --auth "$AUTH" a
  -a 

[GitHub] mrutkows opened a new issue #41: Can we anonymize the PGP key configuration?

2018-02-13 Thread GitBox
mrutkows opened a new issue #41: Can we anonymize the PGP key configuration?
URL: https://github.com/apache/incubator-openwhisk-release/issues/41
 
 
   Is there a way that we can anonymize (or use a dedicated key not from an 
individual at IBM)? 
   
   tools/pgp_key_gen.conf
   ```
   Showing the top two matches Last indexed 6 days ago
   Name-Real: Vincent Hou
   Name-Comment: Release manager of OpenWhisk
   Name-Email: s...@us.ibm.com
   Expire-Date: 0
   Passphrase: openwhisk
   %commit
   %echo done
   ```
   
   tools/travis/import_pgp_key.sh
   ```
   Showing the top two matches Last indexed 12 hours ago
   gpg --allow-secret-key-import --import $PARENTDIR/key_sec.gpg
   
   expect -c "spawn gpg --edit-key h...@us.ibm.com trust quit; send \"5\ry\r\"; 
expect eof"
   ```


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] davidbreitgand commented on issue #730: Multiple projects management

2018-02-13 Thread GitBox
davidbreitgand commented on issue #730: Multiple projects management
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/730#issuecomment-365323635
 
 
   @mrutkows Can you define the tag for @kpavel  and my education (you probably 
discussed that within the team, so sorry for asking again). Just want to make 
sure we're on the same page.
   


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] davidbreitgand commented on issue #730: Multiple projects management

2018-02-13 Thread GitBox
davidbreitgand commented on issue #730: Multiple projects management
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/730#issuecomment-365322770
 
 
   @lionelvillard  I think that --override flag makes perfect sense. Also 
agreed that assets equality definition is required. Concerning explicit 
dependencies approach, assume that you have project A -> B and project C -> B, 
where -> means "depends on". For the sake of discussion, wskdeploy project == 
OW package. Furthermore, there is a an asset b in B. Now, suppose the user does 
wsk action update b blah-blah. How would that change propagate to  A and C? The 
dependencies are reflected only in the manifests of the respective projects, 
but nowhere in the OW data model, right? So, today the user will have to 
wskdeploy A and wskdeploy C. With multiple projects annotations on the asset, 
the user just does  wsk action update b carefree, because the dependencies of 
other projects on asset b are reflected in the annotations of the asset b.


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] mrutkows opened a new issue #734: Enable query of dynamic runtimes from deployment host

2018-02-13 Thread GitBox
mrutkows opened a new issue #734: Enable query of dynamic runtimes from 
deployment host
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/734
 
 
   This API /endpoint should be working again... we should retry the query and 
if fails fall back on hardcoded list of runtimes.


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] lionelvillard commented on issue #730: Multiple projects management

2018-02-13 Thread GitBox
lionelvillard commented on issue #730: Multiple projects management
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/730#issuecomment-365304303
 
 
   The idea of the explicit dependencies approach is to have only one project 
which include all your dependencies. Only one project needs to be deployed (and 
wskdeploy can compute an optimal deployment plan). 
   
   Going back to the multiple projects management issue (in which dependencies 
are not explicitly specified and instead managed outside of wskdeploy), here I 
currently think what could go wrong and things to be aware of:
   
   -  if asset a in Project A and asset b in Project B have the same name but 
not identical (different code, parameters, etc...) then in general b cannot be 
deployed, otherwise it would break A. 
   -  consequently: if the purpose of B is to extends A (e.g. adding new 
actions to a package P), then both package descriptions P in A and B must be 
identical (same parameters, annotations, ...). 
   - comparing feeds for equality required adding additional annotations to 
store feed parameters.
   - comparing APIs should probably be done by comparing swagger specifications
   
   Bottom line: 
   - By default, deployment should fail when assets of the same name are 
different. A flag could be provided to override this behavior
   - Asset equality must be formally defined to support the default behavior 
above.
   
   
   


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] mrutkows commented on issue #730: Multiple projects management

2018-02-13 Thread GitBox
mrutkows commented on issue #730: Multiple projects management
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/730#issuecomment-365272165
 
 
   @pritidesai if we move to a nested map, as we discussed yesterday within the 
annotations, I would prefer that we attempt to simulate a key-only "tag" which 
is URI based.  Where the URI includes information regarding the project and 
project hash.  It is my hope still that we will eventually move to a flatter 
single-value URI for faster lookup/comparison.


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 #3077: Enable ssl on the path between edge and controllers

2018-02-13 Thread GitBox
cbickel commented on a change in pull request #3077: Enable ssl on the path 
between edge and controllers
URL: 
https://github.com/apache/incubator-openwhisk/pull/3077#discussion_r167889282
 
 

 ##
 File path: common/scala/src/main/scala/whisk/core/WhiskConfig.scala
 ##
 @@ -98,6 +98,8 @@ class WhiskConfig(requiredProperties: Map[String, String],
   val controllerSeedNodes = this(WhiskConfig.controllerSeedNodes)
   val controllerLocalBookkeeping = 
getAsBoolean(WhiskConfig.controllerLocalBookkeeping, false)
   val controllerHighAvailability = 
getAsBoolean(WhiskConfig.controllerHighAvailability, false)
+  val controllerProtocol = this(WhiskConfig.controllerProtocol)
+  val controllerSSLEnabled = if (this.controllerProtocol == "https") true else 
false
 
 Review comment:
   As we need to go the internal way for triggers (long term), I think it's 
more valuable to use pureconfig here instead of the old whiskConfig.


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] daisy-ycguo commented on issue #17: Step 2: Verify the compliance of the source code

2018-02-13 Thread GitBox
daisy-ycguo commented on issue #17: Step 2: Verify the compliance of the source 
code
URL: 
https://github.com/apache/incubator-openwhisk-release/issues/17#issuecomment-365285020
 
 
   @houshengbo I know you implemented a gradle target `taredSources`  to 
package source files into a compressed file. It is a easy way to audit headers 
if we have a gradle target `rat` to check headers. I think that's the reason 
you prefer to use the gradle way. I have a PR 
[#733](https://github.com/apache/incubator-openwhisk-wskdeploy/pull/733) to 
wskdeploy. You can checkout and have a try.
   
   Is it easy to include a Gradle command in a travis job which will check 
headers for a PR? I see most travis jobs are using shell script directly. If we 
call a gradle command, we must install gradle before we can use it. Do you know 
how to install gradle in a travis job image ? Can you find a reference ? 


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] daisy-ycguo commented on issue #17: Step 2: Verify the compliance of the source code

2018-02-13 Thread GitBox
daisy-ycguo commented on issue #17: Step 2: Verify the compliance of the source 
code
URL: 
https://github.com/apache/incubator-openwhisk-release/issues/17#issuecomment-365285020
 
 
   @houshengbo I know you implemented a gradle target `taredSources`  to 
package source files into a compressed file. It is a easy way to audit headers 
if we have a gradle target `rat` to check headers. I think that's the reason 
you prefer to use the gradle way. I have a PR to wskdeploy. You can checkout 
and have a try.
   
   Is it easy to include a Gradle command in a travis job which will check 
headers for a PR? I see most travis jobs are using shell script directly. If we 
call a gradle command, we must install gradle before we can use it. Do you know 
how to install gradle in a travis job image ? Can you find a reference ? 


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] mrutkows commented on issue #729: Remove empty maps/interfaces from "export" manifest yaml

2018-02-13 Thread GitBox
mrutkows commented on issue #729: Remove empty maps/interfaces from "export" 
manifest yaml
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/729#issuecomment-365284834
 
 
   @allen-servedio it i likely working as designed since "package" was 
supported at the top-level BEFORE the concept of "project" was introduced.  You 
should be getting friendly "warnings" that "package" is deprecated.  In all 
cases going forward, you should use project (top-level) with nested "packages" 
plural, as this is the schema going forward.  Having said that, we have not put 
a time-frame on deprecating this (and a couple of other paradigms).  
   
   This is all documented in the spec.: 
https://github.com/apache/incubator-openwhisk-wskdeploy/tree/master/specification


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] daisy-ycguo opened a new pull request #733: Enable Apache Rat plugin in gradle

2018-02-13 Thread GitBox
daisy-ycguo opened a new pull request #733: Enable Apache Rat plugin in gradle
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/733
 
 
   After applying this PR, we can use below command to check headers:
   `gradle rat`


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 #17: Use Maven based dependency instead of gradle project based dependency

2018-02-13 Thread GitBox
chetanmeh opened a new pull request #17: Use Maven based dependency instead of 
gradle project based dependency
URL: https://github.com/apache/incubator-openwhisk-runtime-docker/pull/17
 
 
   This is required for apache/incubator-openwhisk#3277


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 issue #3279: Configure periodic travis builds for all projects

2018-02-13 Thread GitBox
chetanmeh opened a new issue #3279: Configure periodic travis builds for all 
projects
URL: https://github.com/apache/incubator-openwhisk/issues/3279
 
 
   Recently saw that master build for runtime java was failing (see 
apache/incubator-openwhisk-runtime-java#8). To avoid such cases in future it 
would be helpful to configure travis to run periodic builds of all openwhisk 
sub project which depend on core say once a day
   
   Travis provides this via cron support 
https://docs.travis-ci.com/user/cron-jobs/
   
   @csantanapr  suggested that this would require coordination with Apache 
Infra. Opening this issue to track that work


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 #3077: Enable ssl on the path between edge and controllers

2018-02-13 Thread GitBox
cbickel commented on a change in pull request #3077: Enable ssl on the path 
between edge and controllers
URL: 
https://github.com/apache/incubator-openwhisk/pull/3077#discussion_r167871456
 
 

 ##
 File path: .gitignore
 ##
 @@ -2,6 +2,7 @@
 nginx.conf
 whisk.properties
 default.props
+/tests/src/test/resources/application.conf
 
 Review comment:
   Is there a reason for not tracking changes of this file?


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 issue #8: Current master build failing in ansible command

2018-02-13 Thread GitBox
chetanmeh opened a new issue #8: Current master build failing in ansible command
URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/8
 
 
   Current master build is [failing][1] with following error
   
   ```
   fatal: [controller0]: FAILED! => {"failed": true, "msg": "the field 'args' 
has an invalid value, which appears to include a variable that is undefined. 
The error was: {u'replicationFactor': u\"{{ kafka_replicationFactor | 
default((groups['kafkas']|length)|int) }}\", u'version': u'0.11.0.1', u'port': 
9092, u'heap': u\"{{ kafka_heap | default('1g') }}\", u'ras': {u'port': 8093}}: 
'dict object' has no attribute 'kafkas'\n\nThe error appears to have been in 
'/home/travis/build/apache/openwhisk/ansible/roles/controller/tasks/deploy.yml':
 line 77, column 3, but may\nbe elsewhere in the file depending on the exact 
syntax problem.\n\nThe offending line appears to be:\n\n\n- name: (re)start 
controller\n  ^ here\n"}
   ```
   
   [1]: 
https://travis-ci.org/apache/incubator-openwhisk-runtime-java/builds/305550554


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 commented on issue #16: Current master build failing in ansible command

2018-02-13 Thread GitBox
chetanmeh commented on issue #16: Current master build failing in ansible 
command
URL: 
https://github.com/apache/incubator-openwhisk-runtime-docker/issues/16#issuecomment-365276303
 
 
   Wrong project!


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 closed issue #16: Current master build failing in ansible command

2018-02-13 Thread GitBox
chetanmeh closed issue #16: Current master build failing in ansible command
URL: https://github.com/apache/incubator-openwhisk-runtime-docker/issues/16
 
 
   


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 #3077: Enable ssl on the path between edge and controllers

2018-02-13 Thread GitBox
cbickel commented on a change in pull request #3077: Enable ssl on the path 
between edge and controllers
URL: 
https://github.com/apache/incubator-openwhisk/pull/3077#discussion_r167871456
 
 

 ##
 File path: .gitignore
 ##
 @@ -2,6 +2,7 @@
 nginx.conf
 whisk.properties
 default.props
+/tests/src/test/resources/application.conf
 
 Review comment:
   Is there a reason for not tracking changes of this file?


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 issue #16: Current master build failing in ansible command

2018-02-13 Thread GitBox
chetanmeh opened a new issue #16: Current master build failing in ansible 
command
URL: https://github.com/apache/incubator-openwhisk-runtime-docker/issues/16
 
 
   Current master build is [failing][1] with following error
   
   ```
   fatal: [controller0]: FAILED! => {"failed": true, "msg": "the field 'args' 
has an invalid value, which appears to include a variable that is undefined. 
The error was: {u'replicationFactor': u\"{{ kafka_replicationFactor | 
default((groups['kafkas']|length)|int) }}\", u'version': u'0.11.0.1', u'port': 
9092, u'heap': u\"{{ kafka_heap | default('1g') }}\", u'ras': {u'port': 8093}}: 
'dict object' has no attribute 'kafkas'\n\nThe error appears to have been in 
'/home/travis/build/apache/openwhisk/ansible/roles/controller/tasks/deploy.yml':
 line 77, column 3, but may\nbe elsewhere in the file depending on the exact 
syntax problem.\n\nThe offending line appears to be:\n\n\n- name: (re)start 
controller\n  ^ here\n"}
   ```
   
   [1]: 
https://travis-ci.org/apache/incubator-openwhisk-runtime-java/builds/305550554


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] allen-servedio commented on issue #729: Remove empty maps/interfaces from "export" manifest yaml

2018-02-13 Thread GitBox
allen-servedio commented on issue #729: Remove empty maps/interfaces from 
"export" manifest yaml
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/729#issuecomment-365273354
 
 
   Just another comment on this... It is very unclear at what level you are 
supposed to define things - esp. since it appears multiple levels will work.
   
   This works:
   
   ```
   project:
 name: MyProject
 namespace: org_space
 version: 0.0.1
 packages:
   rediskv:
 license: Apache-2.0
 inputs: 
   redisURL:
 type: string
 description: Redis database URL
 actions: 
   kvget:
 function: retrieve/index.js
 runtime: nodejs
   kvput:
 function: store/index.js
 runtime: nodejs
   ```
   
   However, this does NOT see the package or action:
   
   ```
   project:
 name: MyProject
 namespace: org_space
 version: 0.0.1
 package:
   name: rediskv
   license: Apache-2.0
   inputs: 
 redisURL:
   type: string
   description: Redis database URL
   actions: 
 kvget:
   function: retrieve/index.js
   runtime: nodejs
 kvput:
   function: store/index.js
   runtime: nodejs
   ```
   
   But, if you change the indention level it DOES see the package and actions:
   
   ```
   project:
 name: MyProject
 namespace: org_space
 version: 0.0.1
   package:
 name: rediskv
 license: Apache-2.0
 inputs: 
   redisURL:
 type: string
 description: Redis database URL
 actions: 
   kvget:
 function: retrieve/index.js
 runtime: nodejs
   kvput:
 function: store/index.js
 runtime: nodejs
   ```
   
   This this also sees the package and actions:
   
   ```
   project:
 name: MyProject
 namespace: org_space
 version: 0.0.1
   packages:
 rediskv:
   license: Apache-2.0
   inputs: 
 redisURL:
   type: string
   description: Redis database URL
   actions: 
 kvget:
   function: retrieve/index.js
   runtime: nodejs
 kvput:
   function: store/index.js
   runtime: nodejs
   ```
   
   So anything that can be done to clearly define how these are supposed to be 
put together would really help.


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] mrutkows commented on issue #730: Multiple projects management

2018-02-13 Thread GitBox
mrutkows commented on issue #730: Multiple projects management
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/730#issuecomment-365272165
 
 
   @pritidesai if we move to a nested map, as we discussed yesterday within the 
annotations, I would prefer that we attempt to simulate a key-only "tag" which 
is URI based.  Where the URI includes information regarding the project and 
project hash.  It is my hope still that we will need to move to a flatter 
single-value URI for faster lookup/comparison.


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] mrutkows commented on issue #730: Multiple projects management

2018-02-13 Thread GitBox
mrutkows commented on issue #730: Multiple projects management
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/730#issuecomment-365272165
 
 
   @pritidesai if we move to a nested map, as we discussed yesterday within the 
annotations, I would prefer that we attempt to simulate a key-only "tag" which 
is URI based.  Where the URI includes information regarding the project and 
project hash.


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 #3278: Fix NullPointerException in ActivationFinisher.

2018-02-13 Thread GitBox
markusthoemmes opened a new pull request #3278: Fix NullPointerException in 
ActivationFinisher.
URL: https://github.com/apache/incubator-openwhisk/pull/3278
 
 
   The ActivationFinisher's code is racy. If shutdown and postStop are called 
concurrently a NullPointerException is possible.


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] davidbreitgand commented on issue #730: Multiple projects management

2018-02-13 Thread GitBox
davidbreitgand commented on issue #730: Multiple projects management
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/730#issuecomment-365262188
 
 
   @pritidesai This is exactly what we had in mind. @lionelvillard The 
functionality we want to achieve is that there will be only one copy of an 
annotated asset that when updated retains connections to the projects that it 
is managed by. It's our understanding that creating a library asset is a 
possible solution, but with the current implementation, if the user updates the 
library asset, she will need to call wskdeply for each project that has 
dependency on that asset and the asset will be overwritten N times in the DB, 
where N is the number of projects. Having an array of annotations, as 
@pritidesai suggests seems to be a faster and cleaner way of achieving the 
result. Thoughts? 


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] daisy-ycguo commented on issue #34: List BSD / MIT licenses in LICENSE.txt if needed

2018-02-13 Thread GitBox
daisy-ycguo commented on issue #34: List BSD / MIT licenses in LICENSE.txt if 
needed
URL: 
https://github.com/apache/incubator-openwhisk-release/issues/34#issuecomment-365232330
 
 
   @mrutkows I didn't find an assembled XML file with all licenses in Spark 
project. So I cannot confirm it is created with whiskers. I guess it is created 
manually.


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 closed pull request #3260: Enhance the RestResult with more information to debug failing tests e?

2018-02-13 Thread GitBox
markusthoemmes closed pull request #3260: Enhance the RestResult with more 
information to debug failing tests e?
URL: https://github.com/apache/incubator-openwhisk/pull/3260
 
 
   

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/tests/src/test/scala/common/rest/WskRest.scala 
b/tests/src/test/scala/common/rest/WskRest.scala
index 4934b8ec42..a8a9c16022 100644
--- a/tests/src/test/scala/common/rest/WskRest.scala
+++ b/tests/src/test/scala/common/rest/WskRest.scala
@@ -1531,6 +1531,12 @@ class RestResult(var statusCode: StatusCode, var 
respData: String = "", blocking
   respData,
   RestResult.convertHttpResponseToStderr(respData)) {
 
+  override def toString: String = {
+super.toString + s"""statusCode: $statusCode
+   |respData: $respData
+   |blocking: $blocking""".stripMargin
+  }
+
   def respBody: JsObject = respData.parseJson.asJsObject
 
   def getField(key: String): String = {


 


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 commented on issue #3249: #3243 - Use gradle scoverage to collect test coverage stats

2018-02-13 Thread GitBox
chetanmeh commented on issue #3249: #3243 - Use gradle scoverage to collect 
test coverage stats
URL: 
https://github.com/apache/incubator-openwhisk/pull/3249#issuecomment-365227172
 
 
   Understand the problem now. As discussed on Slack the plan of action is to  
find out all other projects which rely on openwhisk core project via project 
dependency and then modify them in following way
   
   Switch to Maven based dependency
   
repositories {
mavenCentral()
mavenLocal()
}
   dependencies {
   compile 
"org.apache.openwhisk:openwhisk-common:${gradle.openwhisk.version}"
   }
   
   Modify travis build to perform Maven install
   
   ./gradlew install distDocker
   
   Based on [this search][1] there are 7 such modules which need to be 
modified. This change also aligns well with the release work where eventually 
we would be moving to proper dependency
   
   Would work on creating PR for each of them
   
   Update - Opened #3277 to track this change
   
   [1]: 
https://sourcegraph.com/search?q=%22project%28%27:common:scala%27%29%22+repo:%5Egithub%5C.com/apache/incubator-openwhisk*


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 #3260: Enhance the RestResult with more information to debug failing tests e?

2018-02-13 Thread GitBox
cbickel commented on issue #3260: Enhance the RestResult with more information 
to debug failing tests e?
URL: 
https://github.com/apache/incubator-openwhisk/pull/3260#issuecomment-365256637
 
 
   PG5#95 ? 


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 issue #3277: Use Maven based dependency instead of gradle project based dependency

2018-02-13 Thread GitBox
chetanmeh opened a new issue #3277: Use Maven based dependency instead of 
gradle project based dependency
URL: https://github.com/apache/incubator-openwhisk/issues/3277
 
 
   Currently other OpenWhisk repositories refer to OpenWhisk modules like 
common, core and test via Gradle project dependency. This creates a tight 
coupling between the repositories and poses problem as seen in #3249 
   
   With #3061 support was added to generate Maven artifacts and install them in 
local repositories. Other repositories should leverage these artifacts as 
dependency. This would later allow them to be pulled from Maven repositories.
   
   the plan of action is to  find out all other projects which rely on 
openwhisk core project via project dependency and then modify them in following 
way
   
   Switch to Maven based dependency
   
repositories {
mavenCentral()
mavenLocal()
}
   dependencies {
   compile 
"org.apache.openwhisk:openwhisk-common:${gradle.openwhisk.version}"
   }
   
   Modify travis build to perform Maven install
   
   ./gradlew install distDocker
   
   Based on [this search][1] there are 7 such modules which need to be modified.
   
   [1]: 
https://sourcegraph.com/search?q=%22project%28%27:common:scala%27%29%22+repo:%5Egithub%5C.com/apache/incubator-openwhisk*


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 #3249: #3243 - Use gradle scoverage to collect test coverage stats

2018-02-13 Thread GitBox
rabbah commented on issue #3249: #3243 - Use gradle scoverage to collect test 
coverage stats
URL: 
https://github.com/apache/incubator-openwhisk/pull/3249#issuecomment-365241763
 
 
   Excellent update. Thank you!


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 #3249: #3243 - Use gradle scoverage to collect test coverage stats

2018-02-13 Thread GitBox
rabbah commented on issue #3249: #3243 - Use gradle scoverage to collect test 
coverage stats
URL: 
https://github.com/apache/incubator-openwhisk/pull/3249#issuecomment-365241763
 
 
   Excellent updated. Thank you!


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


  1   2   >