[GitHub] cbickel commented on issue #2665: Add ability to use all controllers round robin
cbickel commented on issue #2665: Add ability to use all controllers round robin URL: https://github.com/apache/incubator-openwhisk/pull/2665#issuecomment-343401654 The following PR will be merged instead: #2888 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 #2665: Add ability to use all controllers round robin
cbickel closed pull request #2665: Add ability to use all controllers round robin URL: https://github.com/apache/incubator-openwhisk/pull/2665 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 d7dfae9c83..d90271edc5 100644 --- a/ansible/group_vars/all +++ b/ansible/group_vars/all @@ -117,6 +117,8 @@ controller: bindPort: 2551 # at this moment all controllers are seed nodes 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(false) }}" registry: confdir: "{{ config_root_dir }}/registry" diff --git a/ansible/roles/nginx/templates/nginx.conf.j2 b/ansible/roles/nginx/templates/nginx.conf.j2 index 6a0b4dc875..9efae0088b 100644 --- a/ansible/roles/nginx/templates/nginx.conf.j2 +++ b/ansible/roles/nginx/templates/nginx.conf.j2 @@ -30,7 +30,7 @@ http { server {{ hostvars[groups['controllers'] | first].ansible_host }}:{{ controller.basePort }} fail_timeout=60s; {% for ip in groups['controllers'] %} {% if groups['controllers'].index(ip) > 0 %} -server {{ hostvars[ip].ansible_host }}:{{ controller.basePort + groups['controllers'].index(ip) }} backup; +server {{ hostvars[ip].ansible_host }}:{{ controller.basePort + groups['controllers'].index(ip) }} {% if controller.ha %}fail_timeout=60s{% else %}backup{% endif %}; {% endif %} {% endfor %} keepalive 512; diff --git a/common/scala/src/main/scala/whisk/core/database/MultipleReadersSingleWriterCache.scala b/common/scala/src/main/scala/whisk/core/database/MultipleReadersSingleWriterCache.scala index ef51097274..6fa76d22c5 100644 --- a/common/scala/src/main/scala/whisk/core/database/MultipleReadersSingleWriterCache.scala +++ b/common/scala/src/main/scala/whisk/core/database/MultipleReadersSingleWriterCache.scala @@ -161,8 +161,6 @@ trait MultipleReadersSingleWriterCache[W, Winfo] { if (cacheEnabled) { logger.info(this, s"invalidating $key on delete") - notifier.foreach(_(key)) - // try inserting our desired entry... val desiredEntry = Entry(transid, InvalidateInProgress, None) cache(key)(desiredEntry) flatMap { actualEntry => @@ -206,6 +204,8 @@ trait MultipleReadersSingleWriterCache[W, Winfo] { // a pre-existing owner will take care of the invalidation invalidator } + } andThen { +case _ => notifier.foreach(_(key)) } } else invalidator // not caching } @@ -265,8 +265,6 @@ trait MultipleReadersSingleWriterCache[W, Winfo] { notifier: Option[CacheChangeNotification]): Future[Winfo] = { if (cacheEnabled) { - notifier.foreach(_(key)) - // try inserting our desired entry... val desiredEntry = Entry(transid, WriteInProgress, Some(Future.successful(doc))) cache(key)(desiredEntry) flatMap { actualEntry => @@ -292,6 +290,8 @@ trait MultipleReadersSingleWriterCache[W, Winfo] { invalidateEntryAfter(generator, key, actualEntry) } } + } andThen { +case _ => notifier.foreach(_(key)) } } else generator // not caching } diff --git a/tests/src/test/scala/limits/ThrottleTests.scala b/tests/src/test/scala/limits/ThrottleTests.scala index 8da66e811d..947c501f74 100644 --- a/tests/src/test/scala/limits/ThrottleTests.scala +++ b/tests/src/test/scala/limits/ThrottleTests.scala @@ -70,8 +70,9 @@ class ThrottleTests val throttleWindow = 1.minute - val maximumInvokesPerMinute = getLimit("limits.actions.invokes.perMinute") - val maximumFiringsPerMinute = getLimit("limits.triggers.fires.perMinute") + // Due to the overhead of the per minute limit in the controller, we add this overhead here as well. + val maximumInvokesPerMinute = math.ceil(getLimit("limits.actions.invokes.perMinute") * 1.2).toInt + val maximumFiringsPerMinute = math.ceil(getLimit("limits.triggers.fires.perMinute") * 1.2).toInt val maximumConcurrentInvokes = getLimit("limits.actions.invokes.concurrent") println(s"maximumInvokesPerMinute = $maximumInvokesPerMinute") @@ -366,11 +367,13 @@ class NamespaceSpecificThrottleTests trigger.create(triggerName) } +val deployedControllers = WhiskProperties.getControllerHosts.split(",").length + // One invoke should be allowed, the second one throttled. // Due to the current implementation of the rate throttling, // it is possible that the counter gets deleted, because the minute switches. retry({ - val results = (1 to 2).map { _ => + val results = (1 to deployed
[GitHub] reiz commented on issue #2538: vagrant "hello" script fails
reiz commented on issue #2538: vagrant "hello" script fails URL: https://github.com/apache/incubator-openwhisk/issues/2538#issuecomment-343422830 @boneskull @mateenrehan For the `./hello` is failing with: ``` The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong. ``` If I ssh into the box I can see that not all Docker containers are running. The controller containers are in exited status and the whole thing is not working. The strange thing is that building the Vagrant box worked already yesterday. Everything was up and running and I could play with the API. But now all suddenly building the box doesn't work anymore. Any suggestions how to fix this? 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 #2957: splunk logstore
markusthoemmes commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150184146 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") + + val log = actorSystem.log + val maxPendingRequests = 500 + + val defaultHttpFlow = Http().cachedHostConnectionPoolHttps[Promise[HttpResponse]]( +host = splunkHost, +port = splunkPort, +connectionContext = + if (disableSNI) +Http().createClientHttpsContext(AkkaSSLConfig().mapSettings(s => s.withLoose(s.loose.withDisableSNI(true + else Http().defaultClientHttpsContext) + + override def fetchLogs(activation: WhiskActivation): Future[ActivationLogs] = { + +//example curl request: +//curl -u username:password -k https://splunkhost:port/services/search/jobs -d exec_mode=oneshot -d output_mode=json -d "search=search index=\"someindex\" | spath=activation_id | search activation_id=a930e5ae4ad4455c8f2505d665aad282 | table log_message" -d "earliest_time=2017-08-29T12:00:00" -d "latest_time=2017-10-29T12:00:00" +//example response: +// {"preview":false,"init_offset":0,"messages":[],"fields":[{"name":"log_message"}],"results":[{"log_message":"some log message"}], "highlighted":{}} +val search = + s"""search index="${splunkIndex}"| spath ${activationIdFieldName} | search ${activationIdFieldName}=${activation.activationId.toString} | table ${logMessageFieldName}""" + +val formatter = DateTimeFormatter.ofPattern("-MM-dd'T'hh:mm:ss").withZon
[GitHub] markusthoemmes commented on a change in pull request #2957: splunk logstore
markusthoemmes commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150182775 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") Review comment: I think it would be valuable to use #2576 (pureconfig) to parse all of these into a case-class. Will be much less verbose. 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 #2957: splunk logstore
markusthoemmes commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150183056 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") + + val log = actorSystem.log Review comment: Doesn't use `AkkaLogging` for the usual log format? 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 #2957: splunk logstore
markusthoemmes commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150188384 ## File path: tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala ## @@ -0,0 +1,207 @@ +/* + * 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.NotUsed +import akka.actor.ActorSystem +import akka.http.javadsl.model.headers.Authorization +import akka.http.scaladsl.model.ContentTypes +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpEntity +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.StreamTcpException +import org.scalatest.Matchers +import org.scalatest.concurrent.PatienceConfiguration.Timeout +import org.scalatest.concurrent.ScalaFutures +import scala.util.Failure +import whisk.core.entity.ActivationLogs +import akka.http.scaladsl.model.StatusCodes +import akka.stream.scaladsl.Flow +import akka.testkit.TestKit +import com.typesafe.config.ConfigFactory +import java.time.LocalDateTime +import java.time.ZoneOffset +import org.scalatest.FlatSpecLike +import scala.concurrent.Await +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.concurrent.duration._ +import scala.util.Success +import scala.util.Try +import spray.json.JsNumber +import spray.json.JsObject +import spray.json._ +import whisk.core.entity.ActionLimits +import whisk.core.entity.ActivationId +import whisk.core.entity.ActivationResponse +import whisk.core.entity.EntityName +import whisk.core.entity.EntityPath +import whisk.core.entity.LogLimit +import whisk.core.entity.MemoryLimit +import whisk.core.entity.Parameters +import whisk.core.entity.Subject +import whisk.core.entity.TimeLimit +import whisk.core.entity.WhiskActivation +import whisk.core.entity.size._ + +object SplunkLogStoreTests { + val config = """ +whisk.logstore { +log-driver-message = "Logs are stored externally." +log-driver-opts = [ +{ "--log-driver" : "fluentd" }, +{ "--log-opt" : "tag=OW_CONTAINER" }, +{ "--log-opt" : "fluentd-address=localhost:24225" } +] +splunk { +host = "splunk-host" +port = 8080 +user = "splunk-user" +password = "splunk-pass" +index = "splunk-index" +log-message-field = "log_message" +activation-id-field = "activation_id" +disableSNI = false +} +} +""" + +} + +class SplunkLogStoreTests +extends TestKit(ActorSystem("SplunkLogStore", ConfigFactory.parseString(SplunkLogStoreTests.config))) +with FlatSpecLike +with Matchers +with ScalaFutures { + behavior of "Splunk LogStore" + + val startTime = "2007-12-03T10:15:30" + val endTime = "2007-12-03T10:15:45" + + val activation = WhiskActivation( +namespace = EntityPath("ns"), +name = EntityName("a"), +Subject(), +activationId = ActivationId(), +start = LocalDateTime.parse(startTime).toInstant(ZoneOffset.UTC), +end = LocalDateTime.parse(endTime).toInstant(ZoneOffset.UTC), +response = ActivationResponse.success(Some(JsObject("res" -> JsNumber(1, +annotations = Parameters("limits", ActionLimits(TimeLimit(1.second), MemoryLimit(128.MB), LogLimit(1.MB)).toJson), +duration = Some(123)) + + implicit val ec = system.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkIndex = system.settings.config.getString("whisk.logstore.splunk.index") + val activationIdFieldName = system.settings.config.getString("whisk.logstore.splunk.activation-id-field") + val logMessageFieldName = system.settings.config.getString("whisk.logstore.splunk.log-message-field") + val splunkUser = system.settings.config.getString("whisk.logstore.splunk.user") + val splunkPwd = system.settings.config.getString("whisk.logstore.splunk.password") + val splunkHost = system.settings.config.getString("whisk.logstore.splunk.host") + val splunkPort = system.settings.
[GitHub] markusthoemmes commented on a change in pull request #2957: splunk logstore
markusthoemmes commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150185357 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") + + val log = actorSystem.log + val maxPendingRequests = 500 + + val defaultHttpFlow = Http().cachedHostConnectionPoolHttps[Promise[HttpResponse]]( +host = splunkHost, +port = splunkPort, +connectionContext = + if (disableSNI) +Http().createClientHttpsContext(AkkaSSLConfig().mapSettings(s => s.withLoose(s.loose.withDisableSNI(true + else Http().defaultClientHttpsContext) + + override def fetchLogs(activation: WhiskActivation): Future[ActivationLogs] = { + +//example curl request: +//curl -u username:password -k https://splunkhost:port/services/search/jobs -d exec_mode=oneshot -d output_mode=json -d "search=search index=\"someindex\" | spath=activation_id | search activation_id=a930e5ae4ad4455c8f2505d665aad282 | table log_message" -d "earliest_time=2017-08-29T12:00:00" -d "latest_time=2017-10-29T12:00:00" +//example response: +// {"preview":false,"init_offset":0,"messages":[],"fields":[{"name":"log_message"}],"results":[{"log_message":"some log message"}], "highlighted":{}} +val search = + s"""search index="${splunkIndex}"| spath ${activationIdFieldName} | search ${activationIdFieldName}=${activation.activationId.toString} | table ${logMessageFieldName}""" + +val formatter = DateTimeFormatter.ofPattern("-MM-dd'T'hh:mm:ss").withZon
[GitHub] markusthoemmes commented on a change in pull request #2957: splunk logstore
markusthoemmes commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150183272 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") + + val log = actorSystem.log + val maxPendingRequests = 500 + + val defaultHttpFlow = Http().cachedHostConnectionPoolHttps[Promise[HttpResponse]]( +host = splunkHost, +port = splunkPort, +connectionContext = + if (disableSNI) +Http().createClientHttpsContext(AkkaSSLConfig().mapSettings(s => s.withLoose(s.loose.withDisableSNI(true + else Http().defaultClientHttpsContext) + + override def fetchLogs(activation: WhiskActivation): Future[ActivationLogs] = { + +//example curl request: +//curl -u username:password -k https://splunkhost:port/services/search/jobs -d exec_mode=oneshot -d output_mode=json -d "search=search index=\"someindex\" | spath=activation_id | search activation_id=a930e5ae4ad4455c8f2505d665aad282 | table log_message" -d "earliest_time=2017-08-29T12:00:00" -d "latest_time=2017-10-29T12:00:00" +//example response: +// {"preview":false,"init_offset":0,"messages":[],"fields":[{"name":"log_message"}],"results":[{"log_message":"some log message"}], "highlighted":{}} +val search = + s"""search index="${splunkIndex}"| spath ${activationIdFieldName} | search ${activationIdFieldName}=${activation.activationId.toString} | table ${logMessageFieldName}""" + +val formatter = DateTimeFormatter.ofPattern("-MM-dd'T'hh:mm:ss").withZon
[GitHub] markusthoemmes commented on a change in pull request #2957: splunk logstore
markusthoemmes commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150185971 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { Review comment: If you apply the suggestion with `pureconfig` below, you can change the signature here to: ```scala class SplunkLogStore( actorSystem: ActorSystem, httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None, config: SplunkLogStoreConfig = loadConfigOrThrow[SplunkLogStoreConfig]("whisk.logstore.splunk")) ``` The huge benefit of this is, that in your tests you won't need to create a String containing the overriding config but you can rather construct your testconfig and pass it in as an override. I think that makes stuff a lot more convenient. 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 #2957: splunk logstore
markusthoemmes commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150189680 ## File path: tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala ## @@ -0,0 +1,207 @@ +/* + * 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.NotUsed +import akka.actor.ActorSystem +import akka.http.javadsl.model.headers.Authorization +import akka.http.scaladsl.model.ContentTypes +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpEntity +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.StreamTcpException +import org.scalatest.Matchers +import org.scalatest.concurrent.PatienceConfiguration.Timeout +import org.scalatest.concurrent.ScalaFutures +import scala.util.Failure +import whisk.core.entity.ActivationLogs +import akka.http.scaladsl.model.StatusCodes +import akka.stream.scaladsl.Flow +import akka.testkit.TestKit +import com.typesafe.config.ConfigFactory +import java.time.LocalDateTime +import java.time.ZoneOffset +import org.scalatest.FlatSpecLike +import scala.concurrent.Await +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.concurrent.duration._ +import scala.util.Success +import scala.util.Try +import spray.json.JsNumber +import spray.json.JsObject +import spray.json._ +import whisk.core.entity.ActionLimits +import whisk.core.entity.ActivationId +import whisk.core.entity.ActivationResponse +import whisk.core.entity.EntityName +import whisk.core.entity.EntityPath +import whisk.core.entity.LogLimit +import whisk.core.entity.MemoryLimit +import whisk.core.entity.Parameters +import whisk.core.entity.Subject +import whisk.core.entity.TimeLimit +import whisk.core.entity.WhiskActivation +import whisk.core.entity.size._ + +object SplunkLogStoreTests { + val config = """ +whisk.logstore { +log-driver-message = "Logs are stored externally." +log-driver-opts = [ +{ "--log-driver" : "fluentd" }, +{ "--log-opt" : "tag=OW_CONTAINER" }, +{ "--log-opt" : "fluentd-address=localhost:24225" } +] +splunk { +host = "splunk-host" +port = 8080 +user = "splunk-user" +password = "splunk-pass" +index = "splunk-index" +log-message-field = "log_message" +activation-id-field = "activation_id" +disableSNI = false +} +} +""" + +} + +class SplunkLogStoreTests +extends TestKit(ActorSystem("SplunkLogStore", ConfigFactory.parseString(SplunkLogStoreTests.config))) +with FlatSpecLike +with Matchers +with ScalaFutures { + behavior of "Splunk LogStore" + + val startTime = "2007-12-03T10:15:30" + val endTime = "2007-12-03T10:15:45" + + val activation = WhiskActivation( +namespace = EntityPath("ns"), +name = EntityName("a"), +Subject(), +activationId = ActivationId(), +start = LocalDateTime.parse(startTime).toInstant(ZoneOffset.UTC), +end = LocalDateTime.parse(endTime).toInstant(ZoneOffset.UTC), +response = ActivationResponse.success(Some(JsObject("res" -> JsNumber(1, +annotations = Parameters("limits", ActionLimits(TimeLimit(1.second), MemoryLimit(128.MB), LogLimit(1.MB)).toJson), +duration = Some(123)) + + implicit val ec = system.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkIndex = system.settings.config.getString("whisk.logstore.splunk.index") + val activationIdFieldName = system.settings.config.getString("whisk.logstore.splunk.activation-id-field") + val logMessageFieldName = system.settings.config.getString("whisk.logstore.splunk.log-message-field") + val splunkUser = system.settings.config.getString("whisk.logstore.splunk.user") + val splunkPwd = system.settings.config.getString("whisk.logstore.splunk.password") + val splunkHost = system.settings.config.getString("whisk.logstore.splunk.host") + val splunkPort = system.settings.
[GitHub] markusthoemmes closed pull request #2888: Adapt trigger throttle for multiple controllers
markusthoemmes closed pull request #2888: Adapt trigger throttle for multiple controllers URL: https://github.com/apache/incubator-openwhisk/pull/2888 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 79642fed01..c6ad149c4c 100644 --- a/ansible/group_vars/all +++ b/ansible/group_vars/all @@ -117,6 +117,8 @@ controller: bindPort: 2551 # at this moment all controllers are seed nodes 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(false) }}" registry: confdir: "{{ config_root_dir }}/registry" diff --git a/ansible/roles/controller/tasks/deploy.yml b/ansible/roles/controller/tasks/deploy.yml index c669395dcb..bba75d72f3 100644 --- a/ansible/roles/controller/tasks/deploy.yml +++ b/ansible/roles/controller/tasks/deploy.yml @@ -82,12 +82,11 @@ "AKKA_CLUSTER_SEED_NODES": "{{seed_nodes_list | join(' ') }}" "AKKA_CLUSTER_BIND_PORT": "{{ controller.akka.cluster.bindPort }}" "AKKA_ACTOR_PROVIDER": "{{ controller.akka.provider }}" - "METRICS_KAMON": "{{ metrics.kamon.enabled }}" "METRICS_LOG": "{{ metrics.log.enabled }}" "METRICS_KAMON_HOST": "{{ metrics.kamon.host }}" "METRICS_KAMON_PORT": "{{ metrics.kamon.port }}" - + "CONTROLLER_HA": "{{ controller.ha }}" volumes: - "{{ whisk_logs_dir }}/controller{{ groups['controllers'].index(inventory_hostname) }}:/logs" ports: diff --git a/ansible/roles/nginx/templates/nginx.conf.j2 b/ansible/roles/nginx/templates/nginx.conf.j2 index 6a0b4dc875..9efae0088b 100644 --- a/ansible/roles/nginx/templates/nginx.conf.j2 +++ b/ansible/roles/nginx/templates/nginx.conf.j2 @@ -30,7 +30,7 @@ http { server {{ hostvars[groups['controllers'] | first].ansible_host }}:{{ controller.basePort }} fail_timeout=60s; {% for ip in groups['controllers'] %} {% if groups['controllers'].index(ip) > 0 %} -server {{ hostvars[ip].ansible_host }}:{{ controller.basePort + groups['controllers'].index(ip) }} backup; +server {{ hostvars[ip].ansible_host }}:{{ controller.basePort + groups['controllers'].index(ip) }} {% if controller.ha %}fail_timeout=60s{% else %}backup{% endif %}; {% endif %} {% endfor %} keepalive 512; diff --git a/ansible/templates/whisk.properties.j2 b/ansible/templates/whisk.properties.j2 index 2c1d644cfb..ecef131f90 100644 --- a/ansible/templates/whisk.properties.j2 +++ b/ansible/templates/whisk.properties.j2 @@ -58,6 +58,7 @@ invoker.hosts.baseport={{ invoker.port }} controller.hosts={{ groups["controllers"] | map('extract', hostvars, 'ansible_host') | list | join(",") }} controller.host.basePort={{ controller.basePort }} controller.instances={{ controller.instances }} +controller.ha={{ controller.ha }} invoker.container.network=bridge invoker.container.policy={{ invoker_container_policy_name | default()}} diff --git a/common/scala/src/main/scala/whisk/core/WhiskConfig.scala b/common/scala/src/main/scala/whisk/core/WhiskConfig.scala index 726d1bcabb..bc63dc2bea 100644 --- a/common/scala/src/main/scala/whisk/core/WhiskConfig.scala +++ b/common/scala/src/main/scala/whisk/core/WhiskConfig.scala @@ -105,6 +105,7 @@ class WhiskConfig(requiredProperties: Map[String, String], val actionSequenceLimit = this(WhiskConfig.actionSequenceMaxLimit) val controllerSeedNodes = this(WhiskConfig.controllerSeedNodes) val controllerLocalBookkeeping = getAsBoolean(WhiskConfig.controllerLocalBookkeeping, false) + val controllerHighAvailability = getAsBoolean(WhiskConfig.controllerHighAvailability, false) } object WhiskConfig { @@ -240,4 +241,5 @@ object WhiskConfig { val triggerFirePerMinuteLimit = "limits.triggers.fires.perMinute" val controllerSeedNodes = "akka.cluster.seed.nodes" val controllerLocalBookkeeping = "controller.localBookkeeping" + val controllerHighAvailability = "controller.ha" } diff --git a/common/scala/src/main/scala/whisk/core/database/MultipleReadersSingleWriterCache.scala b/common/scala/src/main/scala/whisk/core/database/MultipleReadersSingleWriterCache.scala index ef51097274..6fa76d22c5 100644 --- a/common/scala/src/main/scala/whisk/core/database/MultipleReadersSingleWriterCache.scala +++ b/common/scala/src/main/scala/whisk/core/database/MultipleReadersSingleWriterCache.scala @@ -161,8 +161,6 @@ trait MultipleReadersSingleWriterCache[W, Winfo] { if (cacheEnabled) { logger.info(this, s"invalidating $key on delete") - notifier.foreach(_(key)) - // try inserting our desired entry... val de
[GitHub] style95 commented on issue #2810: Add couchdb clustering
style95 commented on issue #2810: Add couchdb clustering URL: https://github.com/apache/incubator-openwhisk/pull/2810#issuecomment-343427673 Agree. It would be great if we can deploy more than one instances on a single machine for testability. Regarding the data sharing across multiple instances, do we need any further configurations to distribute data? AFAIK, from CouchDB 2.0, the number of nodes who are in charge of specific shards will be decided based on `n`(normally recommended value is 3). For example, if we have 5 nodes, and `n` is 3, and let's say node 1,2,3 are in charge of some data, and if client sent request to node 4, it will automatically redirect the request to one of node 1,2,3 and they will handle the requests properly. Based on the value of `w`, `r`, it will respond to the clients. So no matter who receives the request, client will get proper response. Did I understand your question correctly? If I misunderstood about couchdb, please rectify me. If you are mentioning about load-balancing(using single endpoint address) among multi nodes for HA, currently i have no idea. We may locate load-balancer in front of them or, other components to use list of endpoints. 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] reiz commented on issue #2538: vagrant "hello" script fails
reiz commented on issue #2538: vagrant "hello" script fails URL: https://github.com/apache/incubator-openwhisk/issues/2538#issuecomment-343434172 I tried now a couple things to solve this. Fore example editing the `/etc/sudoers` file like described in this [thread](https://github.com/hashicorp/vagrant/issues/1659), but that didn't solve the problem. I further destroyed the whole Vagrant box and even deleted the `.vagrant` directory and started again `.hello`. But still getting this error message: ``` default: TASK [controller : wait until the Controller in this host is up and running] *** default: Friday 10 November 2017 10:11:09 + (0:01:27.343) 0:03:57.068 *** default: FAILED - RETRYING: wait until the Controller in this host is up and running (12 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (12 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (11 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (11 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (10 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (10 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (9 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (9 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (8 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (8 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (7 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (7 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (6 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (6 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (5 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (5 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (4 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (4 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (3 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (3 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (2 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (2 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (1 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (1 retries left). default: fatal: [controller1]: FAILED! => {"attempts": 12, "changed": false, "content": "", "failed": true, "msg": "Status code was not [200]: Request failed: ", "redirected": false, "status": -1, "url": "http://172.17.0.1:10002/ping"} default: fatal: [controller0]: FAILED! => {"attempts": 12, "changed": false, "content": "", "failed": true, "msg": "Status code was not [200]: Request failed: ", "redirected": false, "status": -1, "url": "http://172.17.0.1:10001/ping"} default: default: PLAY RECAP * default: 172.17.0.1 : ok=10 changed=9unreachable=0 failed=0 default: controller0: ok=10 changed=2unreachable=0 failed=1 default: controller1: ok=10 changed=2unreachable=0 failed=1 default: Friday 10 November 2017 10:12:14 + (0:01:04.302) 0:05:01.370 *** default: === default: kafka : pull the ches/kafka:0.10.2.1 image - 91.63s default: controller : (re)start controller -- 87.34s default: controller : wait until the Controller in this host is up and running -- 64.30s default: kafka : pull the zookeeper:3.4 image --- 25.54s default: kafka : wait until the Zookeeper in this host is up and running - 7.31s default: kafka : wait until the kafka se
[GitHub] reiz commented on issue #2538: vagrant "hello" script fails
reiz commented on issue #2538: vagrant "hello" script fails URL: https://github.com/apache/incubator-openwhisk/issues/2538#issuecomment-343434673 The whole error is very reproducible. Tried that already 5 times this morning. Getting always the same results. It fails always by starting the controllers. Every time I log in to the VM I can see that there are two Docker containers for the controller in exit status. Here is the output from `docker ps -a` inside of the Vagrant box: ``` CONTAINER IDIMAGE COMMAND CREATED STATUS PORTS NAMES 108a1d038452openwhisk/controller:latest "/bin/sh -c 'export C" 9 minutes ago Restarting (1) About a minute ago 0.0.0.0:8001->2551/tcp, 0.0.0.0:10002->8080/tcpcontroller1 23527dee7b99openwhisk/controller:latest "/bin/sh -c 'export C" 9 minutes ago Restarting (1) About a minute ago 0.0.0.0:8000->2551/tcp, 0.0.0.0:10001->8080/tcpcontroller0 9483d14b5edfches/kafka:0.10.2.1 "/start.sh" 10 minutes ago Up 10 minutes 7203/tcp, 0.0.0.0:9092->9092/tcp kafka ad63d6e0c58azookeeper:3.4 "/docker-entrypoint.s" 12 minutes ago Up 12 minutes 2888/tcp, 0.0.0.0:2181->2181/tcp, 3888/tcp zookeeper f2972d0ec0c9openwhisk/apigateway:0.8.2"/usr/local/bin/dumb-" 13 minutes ago Up 13 minutes 80/tcp, 8423/tcp, 0.0.0.0:9000->9000/tcp, 0.0.0.0:9001->8080/tcp apigateway 2e7b11e8dd0dredis:3.2 "docker-entrypoint.sh" 13 minutes ago Up 13 minutes 0.0.0.0:6379->6379/tcp redis e678f31af41cklaemo/couchdb:2.0"tini -- /docker-entr" 17 minutes ago Up 17 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb ``` 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] reiz commented on issue #2538: vagrant "hello" script fails
reiz commented on issue #2538: vagrant "hello" script fails URL: https://github.com/apache/incubator-openwhisk/issues/2538#issuecomment-343434673 The whole error is very reproducible. Tried that already 5 times this morning. Getting always the same results. It fails always by starting the controllers. Every time I log in to the VM I can see that there are two Docker containers for the controller in exit status. Here is the output from `docker ps -a` inside of the Vagrant box: ``` CONTAINER IDIMAGE COMMAND CREATED STATUS PORTS NAMES 108a1d038452openwhisk/controller:latest "/bin/sh -c 'export C" 9 minutes ago Restarting (1) About a minute ago 0.0.0.0:8001->2551/tcp, 0.0.0.0:10002->8080/tcpcontroller1 23527dee7b99openwhisk/controller:latest "/bin/sh -c 'export C" 9 minutes ago Restarting (1) About a minute ago 0.0.0.0:8000->2551/tcp, 0.0.0.0:10001->8080/tcpcontroller0 9483d14b5edfches/kafka:0.10.2.1 "/start.sh" 10 minutes ago Up 10 minutes 7203/tcp, 0.0.0.0:9092->9092/tcp kafka ad63d6e0c58azookeeper:3.4 "/docker-entrypoint.s" 12 minutes ago Up 12 minutes 2888/tcp, 0.0.0.0:2181->2181/tcp, 3888/tcp zookeeper f2972d0ec0c9openwhisk/apigateway:0.8.2"/usr/local/bin/dumb-" 13 minutes ago Up 13 minutes 80/tcp, 8423/tcp, 0.0.0.0:9000->9000/tcp, 0.0.0.0:9001->8080/tcp apigateway 2e7b11e8dd0dredis:3.2 "docker-entrypoint.sh" 13 minutes ago Up 13 minutes 0.0.0.0:6379->6379/tcp redis e678f31af41cklaemo/couchdb:2.0"tini -- /docker-entr" 17 minutes ago Up 17 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb ``` `controller0` and `controller1` are always restarting. By setting up the controllers the `vagrant up` process is always exiting with a non 0 error code. 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] reiz commented on issue #822: Regression: vagrant up failed
reiz commented on issue #822: Regression: vagrant up failed URL: https://github.com/apache/incubator-openwhisk/issues/822#issuecomment-343438094 @clambertus I'm having the same issue. Shared some more details about my environment [here](https://github.com/apache/incubator-openwhisk/issues/2538). 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 #2538: vagrant "hello" script fails
markusthoemmes commented on issue #2538: vagrant "hello" script fails URL: https://github.com/apache/incubator-openwhisk/issues/2538#issuecomment-343453917 @reiz can you have a look at the controller logs? There should be something hinting to the underlying issue. They should be in `/tmp/wsklogs`. 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] reiz commented on issue #2538: vagrant "hello" script fails
reiz commented on issue #2538: vagrant "hello" script fails URL: https://github.com/apache/incubator-openwhisk/issues/2538#issuecomment-343461488 @markusthoemmes It's working now. I did the following on my host: ``` sudo visudo -f /etc/sudoers.d/vagrant ``` Then added this lines to the file: ``` vagrant ALL=NOPASSWD:ALL Defaults:vagrant !requiretty ``` And now it's working again. Beside that I used the companies VPN tunnel. Might be that it also counts to the solution, as there are some proxies involved here in the network. 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] ServoKvd opened a new pull request #261: modify build.sh to reflect moving runtimes from core to actionRuntime?
ServoKvd opened a new pull request #261: modify build.sh to reflect moving runtimes from core to actionRuntime? URL: https://github.com/apache/incubator-openwhisk-apigateway/pull/261 ?s in openwhisk repo 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 #2933: Reorganization of the "core" folder to move folders associated with runtimes to "actionRuntimes" in root folder
csantanapr commented on issue #2933: Reorganization of the "core" folder to move folders associated with runtimes to "actionRuntimes" in root folder URL: https://github.com/apache/incubator-openwhisk/pull/2933#issuecomment-343468210 PG Playground2/2295/ looks good 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 #2933: Reorganization of the "core" folder to move folders associated with runtimes to "actionRuntimes" in root folder
csantanapr closed pull request #2933: Reorganization of the "core" folder to move folders associated with runtimes to "actionRuntimes" in root folder URL: https://github.com/apache/incubator-openwhisk/pull/2933 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/core/actionProxy/Dockerfile b/actionRuntimes/actionProxy/Dockerfile similarity index 100% rename from core/actionProxy/Dockerfile rename to actionRuntimes/actionProxy/Dockerfile diff --git a/core/actionProxy/README.md b/actionRuntimes/actionProxy/README.md similarity index 100% rename from core/actionProxy/README.md rename to actionRuntimes/actionProxy/README.md diff --git a/core/actionProxy/build.gradle b/actionRuntimes/actionProxy/build.gradle similarity index 100% rename from core/actionProxy/build.gradle rename to actionRuntimes/actionProxy/build.gradle diff --git a/core/actionProxy/invoke.py b/actionRuntimes/actionProxy/invoke.py similarity index 100% rename from core/actionProxy/invoke.py rename to actionRuntimes/actionProxy/invoke.py diff --git a/core/javaAction/Dockerfile b/actionRuntimes/javaAction/Dockerfile similarity index 100% rename from core/javaAction/Dockerfile rename to actionRuntimes/javaAction/Dockerfile diff --git a/core/javaAction/build.gradle b/actionRuntimes/javaAction/build.gradle similarity index 100% rename from core/javaAction/build.gradle rename to actionRuntimes/javaAction/build.gradle diff --git a/core/javaAction/delete-build-run.sh b/actionRuntimes/javaAction/delete-build-run.sh similarity index 100% rename from core/javaAction/delete-build-run.sh rename to actionRuntimes/javaAction/delete-build-run.sh diff --git a/core/nodejs6Action/Dockerfile b/actionRuntimes/nodejs6Action/Dockerfile similarity index 100% rename from core/nodejs6Action/Dockerfile rename to actionRuntimes/nodejs6Action/Dockerfile diff --git a/core/nodejs6Action/build.gradle b/actionRuntimes/nodejs6Action/build.gradle similarity index 100% rename from core/nodejs6Action/build.gradle rename to actionRuntimes/nodejs6Action/build.gradle diff --git a/core/php7.1Action/Dockerfile b/actionRuntimes/php7.1Action/Dockerfile similarity index 100% rename from core/php7.1Action/Dockerfile rename to actionRuntimes/php7.1Action/Dockerfile diff --git a/core/php7.1Action/build.gradle b/actionRuntimes/php7.1Action/build.gradle similarity index 100% rename from core/php7.1Action/build.gradle rename to actionRuntimes/php7.1Action/build.gradle diff --git a/core/python2Action/Dockerfile b/actionRuntimes/python2Action/Dockerfile similarity index 100% rename from core/python2Action/Dockerfile rename to actionRuntimes/python2Action/Dockerfile diff --git a/core/python2Action/build.gradle b/actionRuntimes/python2Action/build.gradle similarity index 100% rename from core/python2Action/build.gradle rename to actionRuntimes/python2Action/build.gradle diff --git a/core/pythonAction/Dockerfile b/actionRuntimes/pythonAction/Dockerfile similarity index 100% rename from core/pythonAction/Dockerfile rename to actionRuntimes/pythonAction/Dockerfile diff --git a/core/pythonAction/build.gradle b/actionRuntimes/pythonAction/build.gradle similarity index 100% rename from core/pythonAction/build.gradle rename to actionRuntimes/pythonAction/build.gradle diff --git a/core/swift3.1.1Action/Dockerfile b/actionRuntimes/swift3.1.1Action/Dockerfile similarity index 100% rename from core/swift3.1.1Action/Dockerfile rename to actionRuntimes/swift3.1.1Action/Dockerfile diff --git a/core/swift3.1.1Action/build.gradle b/actionRuntimes/swift3.1.1Action/build.gradle similarity index 100% rename from core/swift3.1.1Action/build.gradle rename to actionRuntimes/swift3.1.1Action/build.gradle diff --git a/core/swift3Action/Dockerfile b/actionRuntimes/swift3Action/Dockerfile similarity index 100% rename from core/swift3Action/Dockerfile rename to actionRuntimes/swift3Action/Dockerfile diff --git a/core/swift3Action/build.gradle b/actionRuntimes/swift3Action/build.gradle similarity index 100% rename from core/swift3Action/build.gradle rename to actionRuntimes/swift3Action/build.gradle diff --git a/settings.gradle b/settings.gradle index bd6b2671ad..3d652a435b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,14 +2,14 @@ include 'common:scala' include 'core:controller' include 'core:invoker' -include 'core:nodejs6Action' -include 'core:actionProxy' -include 'core:pythonAction' -include 'core:python2Action' -include 'core:swift3Action' -include 'core:swift3.1.1Action' -include 'core:javaAction' -include 'core:php7.1Action' +include 'actionRuntimes:nodejs6Action' +include 'actionRuntimes:actionProxy' +include 'actionRuntimes:pythonAction' +include 'actionRuntimes:python2Action' +include 'actionRuntimes:swift3Action' +include 'actionRuntimes:swift3.1.1Act
[GitHub] csantanapr closed pull request #261: modify build.sh to reflect moving runtimes from core to actionRuntime?
csantanapr closed pull request #261: modify build.sh to reflect moving runtimes from core to actionRuntime? URL: https://github.com/apache/incubator-openwhisk-apigateway/pull/261 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/tools/travis/build.sh b/tools/travis/build.sh index 114516c..8b5dbaf 100755 --- a/tools/travis/build.sh +++ b/tools/travis/build.sh @@ -50,7 +50,9 @@ export OPENWHISK_HOME=$WHISKDIR # Tests cd $WHISKDIR cat whisk.properties -WSK_TESTS_DEPS_EXCLUDE="-x :core:swift3Action:distDocker -x :core:pythonAction:distDocker -x :core:javaAction:distDocker -x :core:nodejsAction:distDocker -x :core:actionProxy:distDocker -x :sdk:docker:distDocker -x :core:python2Action:distDocker -x :tests:dat:blackbox:badaction:distDocker -x :tests:dat:blackbox:badproxy:distDocker" + +WSK_TESTS_DEPS_EXCLUDE="-x :actionRuntimes:swift3Action:distDocker -x :actionRuntimes:pythonAction:distDocker -x :actionRuntimes:javaAction:distDocker -x :actionRuntimes:nodejsAction:distDocker -x :actionRuntimes:actionProxy:distDocker -x :sdk:docker:distDocker -x :actionRuntimes:python2Action:distDocker -x :tests:dat:blackbox:badaction:distDocker -x :tests:dat:blackbox:badproxy:distDocker" + TERM=dumb ./gradlew tests:test --tests apigw.healthtests.* ${WSK_TESTS_DEPS_EXCLUDE} sleep 60 TERM=dumb ./gradlew tests:test --tests whisk.core.apigw.* ${WSK_TESTS_DEPS_EXCLUDE} 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] ServoKvd opened a new pull request #261: modify build.sh to reflect moving runtimes from core to actionRuntime?
ServoKvd opened a new pull request #261: modify build.sh to reflect moving runtimes from core to actionRuntime? URL: https://github.com/apache/incubator-openwhisk-apigateway/pull/261 Modified build.sh to correspond to directory-reorg change for runtimes in the main openwhisk repo 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] jberstler commented on issue #221: Unable to create trigger from openwhisk kafka feed that listens to a Generic Kafka instance in a Local ubuntu installation
jberstler commented on issue #221: Unable to create trigger from openwhisk kafka feed that listens to a Generic Kafka instance in a Local ubuntu installation URL: https://github.com/apache/incubator-openwhisk-package-kafka/issues/221#issuecomment-343472794 @prabhastechie Ah, great then! It still stands that `localhost` will not resolve to the host IP address when run from within the trigger service docker container. You'll need to use your host machine's actual IP address in the broker list for this to 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 issue #2810: Add couchdb clustering
cbickel commented on issue #2810: Add couchdb clustering URL: https://github.com/apache/incubator-openwhisk/pull/2810#issuecomment-343473164 Ok, I didn't know yet, that if you send a request to instance 1, that it could be handled by instance2. I think for HA we need one of your proposed ideas. I just wanted to ask, if you want to address that problem already in this PR, or maybe later. But for this PR I'm totally fine without loadbalancing to the different nodes. 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] jasonpet opened a new pull request #107: create fire once action to support firing trigger on a specific date
jasonpet opened a new pull request #107: create fire once action to support firing trigger on a specific date URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/107 provides the ability to fire just one trigger on a specified date as mentioned in issue #89 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 #261: modify build.sh to reflect moving runtimes from core to actionRuntime?
csantanapr closed pull request #261: modify build.sh to reflect moving runtimes from core to actionRuntime? URL: https://github.com/apache/incubator-openwhisk-apigateway/pull/261 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/tools/travis/build.sh b/tools/travis/build.sh index 114516c..8b5dbaf 100755 --- a/tools/travis/build.sh +++ b/tools/travis/build.sh @@ -50,7 +50,9 @@ export OPENWHISK_HOME=$WHISKDIR # Tests cd $WHISKDIR cat whisk.properties -WSK_TESTS_DEPS_EXCLUDE="-x :core:swift3Action:distDocker -x :core:pythonAction:distDocker -x :core:javaAction:distDocker -x :core:nodejsAction:distDocker -x :core:actionProxy:distDocker -x :sdk:docker:distDocker -x :core:python2Action:distDocker -x :tests:dat:blackbox:badaction:distDocker -x :tests:dat:blackbox:badproxy:distDocker" + +WSK_TESTS_DEPS_EXCLUDE="-x :actionRuntimes:swift3Action:distDocker -x :actionRuntimes:pythonAction:distDocker -x :actionRuntimes:javaAction:distDocker -x :actionRuntimes:nodejsAction:distDocker -x :actionRuntimes:actionProxy:distDocker -x :sdk:docker:distDocker -x :actionRuntimes:python2Action:distDocker -x :tests:dat:blackbox:badaction:distDocker -x :tests:dat:blackbox:badproxy:distDocker" + TERM=dumb ./gradlew tests:test --tests apigw.healthtests.* ${WSK_TESTS_DEPS_EXCLUDE} sleep 60 TERM=dumb ./gradlew tests:test --tests whisk.core.apigw.* ${WSK_TESTS_DEPS_EXCLUDE} 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 #261: modify build.sh to reflect moving runtimes from core to actionRuntime?
csantanapr commented on issue #261: modify build.sh to reflect moving runtimes from core to actionRuntime? URL: https://github.com/apache/incubator-openwhisk-apigateway/pull/261#issuecomment-343481657 Thank you @ServoKvd for the contribution 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] reiz commented on issue #2950: SwaggerUI on Vagrant box
reiz commented on issue #2950: SwaggerUI on Vagrant box URL: https://github.com/apache/incubator-openwhisk/issues/2950#issuecomment-343486812 I can access the API from outside like this `https://192.168.33.13/api/v1/namespaces/guest/actions`. Would be nice to be able to access the swaggerUI interface if it ships with Vagrant. 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 #2950: SwaggerUI on Vagrant box
rabbah commented on issue #2950: SwaggerUI on Vagrant box URL: https://github.com/apache/incubator-openwhisk/issues/2950#issuecomment-343487467 Tried https://192.168.33.13/api/v1/docs/index.html?url=/api/v1/api-docs? 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 #2949: REST API in Vagrant image
csantanapr commented on issue #2949: REST API in Vagrant image URL: https://github.com/apache/incubator-openwhisk/issues/2949#issuecomment-343488572 Hum it would be good to create a webaction in the vagrant deployment and try with curl and show the those curl like including `-k` and the hostname. Be part of the hello message at the 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] houshengbo opened a new issue #1: Replace the binary Wsk with REST interface WskRest
houshengbo opened a new issue #1: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-deploy/issues/1 All the non-CLI related tests should sunset the wsk, and re-implement them with wskrest. ``` import common.wsk val wsk = new Wsk ``` need to be changed to ``` import common.rest.WskRest val wsk = new WskRest ``` plus there may be changes to the rest of the tests as well, since the response result may have been changed. 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 issue #9: Replace the binary Wsk with REST interface WskRest
houshengbo opened a new issue #9: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-jira/issues/9 All the non-CLI related tests should sunset the wsk, and re-implement them with wskrest. ``` import common.wsk val wsk = new Wsk ``` need to be changed to ``` import common.rest.WskRest val wsk = new WskRest ``` plus there may be changes to the rest of the tests as well, since the response result may have been changed. 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 issue #21: Replace the binary Wsk with REST interface WskRest
houshengbo opened a new issue #21: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-rss/issues/21 All the non-CLI related tests should sunset the wsk, and re-implement them with wskrest. ``` import common.wsk val wsk = new Wsk ``` need to be changed to ``` import common.rest.WskRest val wsk = new WskRest ``` plus there may be changes to the rest of the tests as well, since the response result may have been changed. 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] tysonnorris commented on a change in pull request #2957: splunk logstore
tysonnorris commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150270156 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") + + val log = actorSystem.log Review comment: Do you mean you think this should use whisk.common.Logging? 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 issue #83: Replace the binary Wsk with REST interface WskRest
houshengbo opened a new issue #83: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-pushnotifications/issues/83 All the non-CLI related tests should sunset the wsk, and re-implement them with wskrest. ``` import common.wsk val wsk = new Wsk ``` need to be changed to ``` import common.rest.WskRest val wsk = new WskRest ``` plus there may be changes to the rest of the tests as well, since the response result may have been changed. 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 issue #222: Replace the binary Wsk with REST interface WskRest
houshengbo opened a new issue #222: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-kafka/issues/222 All the non-CLI related tests should sunset the wsk, and re-implement them with wskrest. ``` import common.wsk val wsk = new Wsk ``` need to be changed to ``` import common.rest.WskRest val wsk = new WskRest ``` plus there may be changes to the rest of the tests as well, since the response result may have been changed. 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 issue #142: Replace the binary Wsk with REST interface WskRest
houshengbo opened a new issue #142: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-cloudant/issues/142 All the non-CLI related tests should sunset the wsk, and re-implement them with wskrest. ``` import common.wsk val wsk = new Wsk ``` need to be changed to ``` import common.rest.WskRest val wsk = new WskRest ``` plus there may be changes to the rest of the tests as well, since the response result may have been changed. 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 issue #108: Replace the binary Wsk with REST interface WskRest
houshengbo opened a new issue #108: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-alarms/issues/108 All the non-CLI related tests should sunset the wsk, and re-implement them with wskrest. ``` import common.wsk val wsk = new Wsk ``` need to be changed to ``` import common.rest.WskRest val wsk = new WskRest ``` plus there may be changes to the rest of the tests as well, since the response result may have been changed. 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 issue #247: Replace the binary Wsk with REST interface WskRest
houshengbo opened a new issue #247: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-catalog/issues/247 All the non-CLI related tests should sunset the wsk, and re-implement them with wskrest. ``` import common.wsk val wsk = new Wsk ``` need to be changed to ``` import common.rest.WskRest val wsk = new WskRest ``` plus there may be changes to the rest of the tests as well, since the response result may have been changed. 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] jthomas opened a new pull request #85: Add new features to routes methods.
jthomas opened a new pull request #85: Add new features to routes methods. URL: https://github.com/apache/incubator-openwhisk-client-js/pull/85 Resolving issues #69, #70 and #71. * Library can now create routes from Swagger JSON string, rather than manually parameters. * Introduced support for using `name` as parameter to set "API name" in the route definition. * Added `route.get` to retrieve route information. README.md has been updated with new features. 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 closed pull request #642: Fixes Delete unused marshal and unmarshal methods... #323
mrutkows closed pull request #642: Fixes Delete unused marshal and unmarshal methods... #323 URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/642 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/parameters.go b/parsers/parameters.go index 69cb467..e9bc1ca 100644 --- a/parsers/parameters.go +++ b/parsers/parameters.go @@ -290,46 +290,6 @@ func ResolveParameter(paramName string, param *Parameter, filePath string) (inte return value, errorParser } -// Provide custom Parameter marshalling and unmarshalling -type ParsedParameter Parameter - -func (n *Parameter) UnmarshalYAML(unmarshal func(interface{}) error) error { - var aux ParsedParameter - - // Attempt to unmarshal the multi-line schema - if err := unmarshal(&aux); err == nil { - n.multiline = true - n.Type = aux.Type - n.Description = aux.Description - n.Value = aux.Value - n.Required = aux.Required - n.Default = aux.Default - n.Status = aux.Status - n.Schema = aux.Schema - return nil - } - - // If we did not find the multi-line schema, assume in-line (or single-line) schema - var inline interface{} - if err := unmarshal(&inline); err != nil { - return err - } - - n.Value = inline - n.multiline = false - return nil -} - -func (n *Parameter) MarshalYAML() (interface{}, error) { - if _, ok := n.Value.(string); len(n.Type) == 0 && len(n.Description) == 0 && ok { - if !n.Required && len(n.Status) == 0 && n.Schema == nil { - return n.Value.(string), nil - } - } - - return n, nil -} - // Provides debug/trace support for Parameter type func dumpParameter(paramName string, param *Parameter, separator 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] mrutkows commented on issue #623: Support "blackbox" Docker images
mrutkows commented on issue #623: Support "blackbox" Docker images URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/623#issuecomment-343520666 See: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/279 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] codecov-io commented on issue #85: Add new features to routes methods.
codecov-io commented on issue #85: Add new features to routes methods. URL: https://github.com/apache/incubator-openwhisk-client-js/pull/85#issuecomment-343522560 # [Codecov](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85?src=pr&el=h1) Report > Merging [#85](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-openwhisk-client-js/commit/19fdd98401607eff5feae4bd1078c2a76e6cd227?src=pr&el=desc) will **decrease** coverage by `0.24%`. > The diff coverage is `95.45%`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85/graphs/tree.svg?width=650&height=150&src=pr&token=j2mPEx0Tkq)](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85?src=pr&el=tree) ```diff @@Coverage Diff @@ ## master #85 +/- ## == - Coverage 99.41% 99.16% -0.25% == Files 14 14 Lines 340 358 +18 == + Hits 338 355 +17 - Misses 23 +1 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85?src=pr&el=tree) | Coverage ? | | |---|---|---| | [lib/messages.js](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85?src=pr&el=tree#diff-bGliL21lc3NhZ2VzLmpz) | `100% (?)` | :arrow_up: | | [lib/routes.js](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85?src=pr&el=tree#diff-bGliL3JvdXRlcy5qcw==) | `98.18% <95.45%> (-1.82%)` | :arrow_down: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `? = absolute (impact)`, `? = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85?src=pr&el=footer). Last update [19fdd98...536eb26](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/85?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). 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 #2922: Replace non cli tests with REST implementation
houshengbo closed pull request #2922: Replace non cli tests with REST implementation URL: https://github.com/apache/incubator-openwhisk/pull/2922 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/resources/application.conf b/tests/src/test/resources/application.conf index 03b3e0df5b..39960d76af 100644 --- a/tests/src/test/resources/application.conf +++ b/tests/src/test/resources/application.conf @@ -1,5 +1,3 @@ -akka.ssl-config.hostnameVerifierClass = common.rest.AcceptAllHostNameVerifier - whisk.spi { SimpleSpi = whisk.spi.SimpleSpiImpl MissingSpi = whisk.spi.MissingImpl diff --git a/tests/src/test/scala/common/TestUtils.java b/tests/src/test/scala/common/TestUtils.java index 0042445469..15fb11d862 100644 --- a/tests/src/test/scala/common/TestUtils.java +++ b/tests/src/test/scala/common/TestUtils.java @@ -65,11 +65,15 @@ public static final int UNAUTHORIZED= 145; // 401 - 256 = 145 public static final int FORBIDDEN = 147; // 403 - 256 = 147 public static final int NOT_FOUND = 148; // 404 - 256 = 148 +public static final int NOT_FOUND_HTTP = 404; public static final int NOT_ALLOWED = 149; // 405 - 256 = 149 public static final int CONFLICT= 153; // 409 - 256 = 153 public static final int TOO_LARGE = 157; // 413 - 256 = 157 +public static final int TOO_LARGE_HTTP = 413; public static final int THROTTLED = 173; // 429 (TOO_MANY_REQUESTS) - 256 = 173 +public static final int THROTTLED_HTTP = 429; public static final int APP_ERROR = 246; // 502 - 256 = 246 +public static final int APP_ERROR_HTTP = 502; public static final int TIMEOUT = 246; // 502 (GATEWAY_TIMEOUT) - 256 = 246 private static final File catalogDir = WhiskProperties.getFileRelativeToWhiskHome("catalog"); diff --git a/tests/src/test/scala/common/WhiskProperties.java b/tests/src/test/scala/common/WhiskProperties.java index 915ed6a761..781f0bf91e 100644 --- a/tests/src/test/scala/common/WhiskProperties.java +++ b/tests/src/test/scala/common/WhiskProperties.java @@ -200,11 +200,20 @@ public static String getRouterHost() { return whiskProperties.getProperty("router.host"); } +public static String getApiProto() { +return whiskProperties.getProperty("whisk.api.host.proto"); +} + +public static String getApiHost() { +return whiskProperties.getProperty("whisk.api.host.name"); +} + +public static String getApiPort() { +return whiskProperties.getProperty("whisk.api.host.port"); +} + public static String getApiHostForAction() { -String proto = whiskProperties.getProperty("whisk.api.host.proto"); -String port = whiskProperties.getProperty("whisk.api.host.port"); -String host = whiskProperties.getProperty("whisk.api.host.name"); -return proto + "://" + host + ":" + port; +return getApiProto() + "://" + getApiHost() + ":" + getApiPort(); } public static String getApiHostForClient(String subdomain, boolean includeProtocol) { @@ -235,11 +244,11 @@ public static int getControllerBasePort() { } public static String getBaseControllerHost() { - return getControllerHosts().split(",")[0]; +return getControllerHosts().split(",")[0]; } public static String getBaseControllerAddress() { - return getBaseControllerHost() + ":" + getControllerBasePort(); +return getBaseControllerHost() + ":" + getControllerBasePort(); } public static int getMaxActionInvokesPerMinute() { diff --git a/tests/src/test/scala/common/rest/WskRest.scala b/tests/src/test/scala/common/rest/WskRest.scala index 199d7d6139..5767072331 100644 --- a/tests/src/test/scala/common/rest/WskRest.scala +++ b/tests/src/test/scala/common/rest/WskRest.scala @@ -35,12 +35,14 @@ import scala.collection.mutable.Buffer import scala.collection.immutable.Seq import scala.concurrent.duration.Duration import scala.concurrent.duration.DurationInt -import scala.concurrent.Future import scala.language.postfixOps import scala.util.Failure import scala.util.Success import scala.util.Try import scala.util.{Failure, Success} +import akka.stream.scaladsl.{Keep, Sink, Source} +import akka.stream.{OverflowStrategy, QueueOfferResult} +import scala.concurrent.{Future, Promise} import akka.http.scaladsl.model.StatusCode import akka.http.scaladsl.model.StatusCodes.Accepted @@ -62,6 +64,7 @@ import akka.http.scaladsl.model.HttpMethods.GET import akka.http.scaladsl.model.HttpMethods.POST import akka.http.scaladsl.model.HttpMethods.PUT import akka.http.scaladsl.HttpsConnectionContext +import akka.http.scaladsl.
[GitHub] houshengbo closed pull request #2931: Replace the test cases under whisk.core.cli.test package
houshengbo closed pull request #2931: Replace the test cases under whisk.core.cli.test package URL: https://github.com/apache/incubator-openwhisk/pull/2931 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/resources/application.conf b/tests/src/test/resources/application.conf index 03b3e0df5b..39960d76af 100644 --- a/tests/src/test/resources/application.conf +++ b/tests/src/test/resources/application.conf @@ -1,5 +1,3 @@ -akka.ssl-config.hostnameVerifierClass = common.rest.AcceptAllHostNameVerifier - whisk.spi { SimpleSpi = whisk.spi.SimpleSpiImpl MissingSpi = whisk.spi.MissingImpl diff --git a/tests/src/test/scala/common/BaseWsk.scala b/tests/src/test/scala/common/BaseWsk.scala index 9d7cafe980..0917fa6942 100644 --- a/tests/src/test/scala/common/BaseWsk.scala +++ b/tests/src/test/scala/common/BaseWsk.scala @@ -274,7 +274,7 @@ trait BaseActivation extends BaseRunWsk { def pollFor(N: Int, entity: Option[String], limit: Option[Int] = None, - since: Option[Instant], + since: Option[Instant] = None, retries: Int, pollPeriod: Duration = 1.second)(implicit wp: WskProps): Seq[String] diff --git a/tests/src/test/scala/common/TestUtils.java b/tests/src/test/scala/common/TestUtils.java index 0042445469..5f781055ba 100644 --- a/tests/src/test/scala/common/TestUtils.java +++ b/tests/src/test/scala/common/TestUtils.java @@ -64,13 +64,19 @@ public static final int BAD_REQUEST = 144; // 400 - 256 = 144 public static final int UNAUTHORIZED= 145; // 401 - 256 = 145 public static final int FORBIDDEN = 147; // 403 - 256 = 147 +public static final int FORBIDDEN_HTTP = 403; public static final int NOT_FOUND = 148; // 404 - 256 = 148 +public static final int NOT_FOUND_HTTP = 404; public static final int NOT_ALLOWED = 149; // 405 - 256 = 149 public static final int CONFLICT= 153; // 409 - 256 = 153 public static final int TOO_LARGE = 157; // 413 - 256 = 157 +public static final int TOO_LARGE_HTTP = 413; public static final int THROTTLED = 173; // 429 (TOO_MANY_REQUESTS) - 256 = 173 +public static final int THROTTLED_HTTP = 429; public static final int APP_ERROR = 246; // 502 - 256 = 246 +public static final int APP_ERROR_HTTP = 502; public static final int TIMEOUT = 246; // 502 (GATEWAY_TIMEOUT) - 256 = 246 +public static final int TIMEOUT_HTTP= 502; private static final File catalogDir = WhiskProperties.getFileRelativeToWhiskHome("catalog"); private static final File testActionsDir = WhiskProperties.getFileRelativeToWhiskHome("tests/dat/actions"); diff --git a/tests/src/test/scala/common/WhiskProperties.java b/tests/src/test/scala/common/WhiskProperties.java index 915ed6a761..781f0bf91e 100644 --- a/tests/src/test/scala/common/WhiskProperties.java +++ b/tests/src/test/scala/common/WhiskProperties.java @@ -200,11 +200,20 @@ public static String getRouterHost() { return whiskProperties.getProperty("router.host"); } +public static String getApiProto() { +return whiskProperties.getProperty("whisk.api.host.proto"); +} + +public static String getApiHost() { +return whiskProperties.getProperty("whisk.api.host.name"); +} + +public static String getApiPort() { +return whiskProperties.getProperty("whisk.api.host.port"); +} + public static String getApiHostForAction() { -String proto = whiskProperties.getProperty("whisk.api.host.proto"); -String port = whiskProperties.getProperty("whisk.api.host.port"); -String host = whiskProperties.getProperty("whisk.api.host.name"); -return proto + "://" + host + ":" + port; +return getApiProto() + "://" + getApiHost() + ":" + getApiPort(); } public static String getApiHostForClient(String subdomain, boolean includeProtocol) { @@ -235,11 +244,11 @@ public static int getControllerBasePort() { } public static String getBaseControllerHost() { - return getControllerHosts().split(",")[0]; +return getControllerHosts().split(",")[0]; } public static String getBaseControllerAddress() { - return getBaseControllerHost() + ":" + getControllerBasePort(); +return getBaseControllerHost() + ":" + getControllerBasePort(); } public static int getMaxActionInvokesPerMinute() { diff --git a/tests/src/test/scala/common/rest/WskRest.scala b/tests/src/test/scala/common/rest/WskRest.scala index 199d7d6139..3e81f45c7e 100644 --- a/tests/src/test/scala/common/rest/WskRest.scala +++ b/test
[GitHub] tysonnorris commented on a change in pull request #2957: splunk logstore
tysonnorris commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150286850 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") + + val log = actorSystem.log + val maxPendingRequests = 500 + + val defaultHttpFlow = Http().cachedHostConnectionPoolHttps[Promise[HttpResponse]]( +host = splunkHost, +port = splunkPort, +connectionContext = + if (disableSNI) +Http().createClientHttpsContext(AkkaSSLConfig().mapSettings(s => s.withLoose(s.loose.withDisableSNI(true + else Http().defaultClientHttpsContext) + + override def fetchLogs(activation: WhiskActivation): Future[ActivationLogs] = { + +//example curl request: +//curl -u username:password -k https://splunkhost:port/services/search/jobs -d exec_mode=oneshot -d output_mode=json -d "search=search index=\"someindex\" | spath=activation_id | search activation_id=a930e5ae4ad4455c8f2505d665aad282 | table log_message" -d "earliest_time=2017-08-29T12:00:00" -d "latest_time=2017-10-29T12:00:00" +//example response: +// {"preview":false,"init_offset":0,"messages":[],"fields":[{"name":"log_message"}],"results":[{"log_message":"some log message"}], "highlighted":{}} +val search = + s"""search index="${splunkIndex}"| spath ${activationIdFieldName} | search ${activationIdFieldName}=${activation.activationId.toString} | table ${logMessageFieldName}""" + +val formatter = DateTimeFormatter.ofPattern("-MM-dd'T'hh:mm:ss").withZone(Z
[GitHub] csantanapr closed issue #2863: Add the support of certificate checking for secure mode
csantanapr closed issue #2863: Add the support of certificate checking for secure mode URL: https://github.com/apache/incubator-openwhisk/issues/2863 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 #2864: Add the support of certificate checking for secure mode
csantanapr closed pull request #2864: Add the support of certificate checking for secure mode URL: https://github.com/apache/incubator-openwhisk/pull/2864 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/basic/WskSdkTests.scala b/tests/src/test/scala/system/basic/WskSdkTests.scala index 021e8cace1..b36c823db2 100644 --- a/tests/src/test/scala/system/basic/WskSdkTests.scala +++ b/tests/src/test/scala/system/basic/WskSdkTests.scala @@ -18,6 +18,8 @@ package system.basic import java.io.File +import java.io.BufferedWriter +import java.io.FileWriter import org.apache.commons.io.FileUtils import org.junit.runner.RunWith @@ -120,4 +122,57 @@ class WskSdkTests extends TestHelpers with WskTestHelpers { val stdout = wsk.cli(Seq("sdk", "install", "bashauto", "--stdout")).stdout stdout should include(msg) } + + def verifyMissingSecurityFile(config: String, fileName: String, expectedErrorMessage: String) = { +val tmpwskprops = File.createTempFile("wskprops", ".tmp") +val securityFile = File.createTempFile(fileName, ".pem") +try { + val writer = new BufferedWriter(new FileWriter(tmpwskprops)) + writer.write(s"$config=${securityFile.getAbsolutePath()}\n") + writer.close() + val env = Map("WSK_CONFIG_FILE" -> tmpwskprops.getAbsolutePath()) + val stderr = wsk +.cli( + Seq("sdk", "install", "docker", "--apihost", wskprops.apihost, "--apiversion", wskprops.apiversion), + env = env, + expectedExitCode = ERROR_EXIT) +.stderr + stderr should include regex (expectedErrorMessage) +} finally { + tmpwskprops.delete() + securityFile.delete() +} + } + + it should "return configure the missing Key file" in { +verifyMissingSecurityFile("CERT", "cert", "The Key file is not configured. Please configure the missing Key file.") + } + + it should "return configure the missing Cert file" in { +verifyMissingSecurityFile("KEY", "key", "The Cert file is not configured. Please configure the missing Cert file.") + } + + it should "return unable to load the X509 key pair with both Cert and Key files missing" in { +val tmpwskprops = File.createTempFile("wskprops", ".tmp") +val certFile = File.createTempFile("cert", ".pem") +val keyFile = File.createTempFile("key", ".pem") +try { + val writer = new BufferedWriter(new FileWriter(tmpwskprops)) + writer.write(s"CERT=${certFile.getAbsolutePath()}\n") + writer.write(s"KEY=${keyFile.getAbsolutePath()}\n") + writer.close() + val env = Map("WSK_CONFIG_FILE" -> tmpwskprops.getAbsolutePath()) + val stderr = wsk +.cli( + Seq("sdk", "install", "docker", "--apihost", wskprops.apihost, "--apiversion", wskprops.apiversion), + env = env, + expectedExitCode = ERROR_EXIT) +.stderr + stderr should include regex ("""Unable to load the X509 key pair due to the following reason""") +} finally { + tmpwskprops.delete() + certFile.delete() + keyFile.delete() +} + } } diff --git a/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala index e4e14e9215..220953ba08 100644 --- a/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala +++ b/tests/src/test/scala/whisk/core/cli/test/WskConfigTests.scala @@ -279,6 +279,72 @@ class WskConfigTests extends TestHelpers with WskTestHelpers { } } + it should "return configure the missing Cert file" in { +val tmpwskprops = File.createTempFile("wskprops", ".tmp") +val keyFile = File.createTempFile("key", ".pem") +try { + val writer = new BufferedWriter(new FileWriter(tmpwskprops)) + writer.write(s"KEY=${keyFile.getAbsolutePath()}\n") + writer.close() + val env = Map("WSK_CONFIG_FILE" -> tmpwskprops.getAbsolutePath()) + val stderr = wsk +.cli( + Seq("property", "get", "--apibuild", "--apihost", wskprops.apihost, "--apiversion", wskprops.apiversion), + env = env, + expectedExitCode = ERROR_EXIT) +.stderr + stderr should include regex ("""The Cert file is not configured. Please configure the missing Cert file.""") +} finally { + tmpwskprops.delete() + keyFile.delete() +} + } + + it should "return configure the missing Key file" in { +val tmpwskprops = File.createTempFile("wskprops", ".tmp") +val certFile = File.createTempFile("cert", ".pem") +try { + val writer = new BufferedWriter(new FileWriter(tmpwskprops)) + writer.write(s"CERT=${certFile.getAbsolutePath()}\n") + writer.close() + val env = Map("WSK_CONFIG_FILE" -> tmpwskprops.getAbsoluteP
[GitHub] markusthoemmes commented on a change in pull request #2957: splunk logstore
markusthoemmes commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150288776 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") + + val log = actorSystem.log + val maxPendingRequests = 500 + + val defaultHttpFlow = Http().cachedHostConnectionPoolHttps[Promise[HttpResponse]]( +host = splunkHost, +port = splunkPort, +connectionContext = + if (disableSNI) +Http().createClientHttpsContext(AkkaSSLConfig().mapSettings(s => s.withLoose(s.loose.withDisableSNI(true + else Http().defaultClientHttpsContext) + + override def fetchLogs(activation: WhiskActivation): Future[ActivationLogs] = { + +//example curl request: +//curl -u username:password -k https://splunkhost:port/services/search/jobs -d exec_mode=oneshot -d output_mode=json -d "search=search index=\"someindex\" | spath=activation_id | search activation_id=a930e5ae4ad4455c8f2505d665aad282 | table log_message" -d "earliest_time=2017-08-29T12:00:00" -d "latest_time=2017-10-29T12:00:00" +//example response: +// {"preview":false,"init_offset":0,"messages":[],"fields":[{"name":"log_message"}],"results":[{"log_message":"some log message"}], "highlighted":{}} +val search = + s"""search index="${splunkIndex}"| spath ${activationIdFieldName} | search ${activationIdFieldName}=${activation.activationId.toString} | table ${logMessageFieldName}""" + +val formatter = DateTimeFormatter.ofPattern("-MM-dd'T'hh:mm:ss").withZon
[GitHub] tysonnorris commented on a change in pull request #2957: splunk logstore
tysonnorris commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150290521 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") + + val log = actorSystem.log + val maxPendingRequests = 500 + + val defaultHttpFlow = Http().cachedHostConnectionPoolHttps[Promise[HttpResponse]]( +host = splunkHost, +port = splunkPort, +connectionContext = + if (disableSNI) +Http().createClientHttpsContext(AkkaSSLConfig().mapSettings(s => s.withLoose(s.loose.withDisableSNI(true + else Http().defaultClientHttpsContext) + + override def fetchLogs(activation: WhiskActivation): Future[ActivationLogs] = { + +//example curl request: +//curl -u username:password -k https://splunkhost:port/services/search/jobs -d exec_mode=oneshot -d output_mode=json -d "search=search index=\"someindex\" | spath=activation_id | search activation_id=a930e5ae4ad4455c8f2505d665aad282 | table log_message" -d "earliest_time=2017-08-29T12:00:00" -d "latest_time=2017-10-29T12:00:00" +//example response: +// {"preview":false,"init_offset":0,"messages":[],"fields":[{"name":"log_message"}],"results":[{"log_message":"some log message"}], "highlighted":{}} +val search = + s"""search index="${splunkIndex}"| spath ${activationIdFieldName} | search ${activationIdFieldName}=${activation.activationId.toString} | table ${logMessageFieldName}""" + +val formatter = DateTimeFormatter.ofPattern("-MM-dd'T'hh:mm:ss").withZone(Z
[GitHub] tysonnorris commented on a change in pull request #2957: splunk logstore
tysonnorris commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150290693 ## File path: tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala ## @@ -0,0 +1,207 @@ +/* + * 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.NotUsed +import akka.actor.ActorSystem +import akka.http.javadsl.model.headers.Authorization +import akka.http.scaladsl.model.ContentTypes +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpEntity +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.StreamTcpException +import org.scalatest.Matchers +import org.scalatest.concurrent.PatienceConfiguration.Timeout +import org.scalatest.concurrent.ScalaFutures +import scala.util.Failure +import whisk.core.entity.ActivationLogs +import akka.http.scaladsl.model.StatusCodes +import akka.stream.scaladsl.Flow +import akka.testkit.TestKit +import com.typesafe.config.ConfigFactory +import java.time.LocalDateTime +import java.time.ZoneOffset +import org.scalatest.FlatSpecLike +import scala.concurrent.Await +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.concurrent.duration._ +import scala.util.Success +import scala.util.Try +import spray.json.JsNumber +import spray.json.JsObject +import spray.json._ +import whisk.core.entity.ActionLimits +import whisk.core.entity.ActivationId +import whisk.core.entity.ActivationResponse +import whisk.core.entity.EntityName +import whisk.core.entity.EntityPath +import whisk.core.entity.LogLimit +import whisk.core.entity.MemoryLimit +import whisk.core.entity.Parameters +import whisk.core.entity.Subject +import whisk.core.entity.TimeLimit +import whisk.core.entity.WhiskActivation +import whisk.core.entity.size._ + +object SplunkLogStoreTests { + val config = """ +whisk.logstore { +log-driver-message = "Logs are stored externally." +log-driver-opts = [ +{ "--log-driver" : "fluentd" }, +{ "--log-opt" : "tag=OW_CONTAINER" }, +{ "--log-opt" : "fluentd-address=localhost:24225" } +] +splunk { +host = "splunk-host" +port = 8080 +user = "splunk-user" +password = "splunk-pass" +index = "splunk-index" +log-message-field = "log_message" +activation-id-field = "activation_id" +disableSNI = false +} +} +""" + +} + +class SplunkLogStoreTests +extends TestKit(ActorSystem("SplunkLogStore", ConfigFactory.parseString(SplunkLogStoreTests.config))) +with FlatSpecLike +with Matchers +with ScalaFutures { + behavior of "Splunk LogStore" + + val startTime = "2007-12-03T10:15:30" + val endTime = "2007-12-03T10:15:45" + + val activation = WhiskActivation( +namespace = EntityPath("ns"), +name = EntityName("a"), +Subject(), +activationId = ActivationId(), +start = LocalDateTime.parse(startTime).toInstant(ZoneOffset.UTC), +end = LocalDateTime.parse(endTime).toInstant(ZoneOffset.UTC), +response = ActivationResponse.success(Some(JsObject("res" -> JsNumber(1, +annotations = Parameters("limits", ActionLimits(TimeLimit(1.second), MemoryLimit(128.MB), LogLimit(1.MB)).toJson), +duration = Some(123)) + + implicit val ec = system.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkIndex = system.settings.config.getString("whisk.logstore.splunk.index") + val activationIdFieldName = system.settings.config.getString("whisk.logstore.splunk.activation-id-field") + val logMessageFieldName = system.settings.config.getString("whisk.logstore.splunk.log-message-field") + val splunkUser = system.settings.config.getString("whisk.logstore.splunk.user") + val splunkPwd = system.settings.config.getString("whisk.logstore.splunk.password") + val splunkHost = system.settings.config.getString("whisk.logstore.splunk.host") + val splunkPort = system.settings.con
[GitHub] tysonnorris commented on a change in pull request #2957: splunk logstore
tysonnorris commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150290971 ## File path: tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala ## @@ -0,0 +1,207 @@ +/* + * 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.NotUsed +import akka.actor.ActorSystem +import akka.http.javadsl.model.headers.Authorization +import akka.http.scaladsl.model.ContentTypes +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpEntity +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.StreamTcpException +import org.scalatest.Matchers +import org.scalatest.concurrent.PatienceConfiguration.Timeout +import org.scalatest.concurrent.ScalaFutures +import scala.util.Failure +import whisk.core.entity.ActivationLogs +import akka.http.scaladsl.model.StatusCodes +import akka.stream.scaladsl.Flow +import akka.testkit.TestKit +import com.typesafe.config.ConfigFactory +import java.time.LocalDateTime +import java.time.ZoneOffset +import org.scalatest.FlatSpecLike +import scala.concurrent.Await +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.concurrent.duration._ +import scala.util.Success +import scala.util.Try +import spray.json.JsNumber +import spray.json.JsObject +import spray.json._ +import whisk.core.entity.ActionLimits +import whisk.core.entity.ActivationId +import whisk.core.entity.ActivationResponse +import whisk.core.entity.EntityName +import whisk.core.entity.EntityPath +import whisk.core.entity.LogLimit +import whisk.core.entity.MemoryLimit +import whisk.core.entity.Parameters +import whisk.core.entity.Subject +import whisk.core.entity.TimeLimit +import whisk.core.entity.WhiskActivation +import whisk.core.entity.size._ + +object SplunkLogStoreTests { + val config = """ +whisk.logstore { +log-driver-message = "Logs are stored externally." +log-driver-opts = [ +{ "--log-driver" : "fluentd" }, +{ "--log-opt" : "tag=OW_CONTAINER" }, +{ "--log-opt" : "fluentd-address=localhost:24225" } +] +splunk { +host = "splunk-host" +port = 8080 +user = "splunk-user" +password = "splunk-pass" +index = "splunk-index" +log-message-field = "log_message" +activation-id-field = "activation_id" +disableSNI = false +} +} +""" + +} + +class SplunkLogStoreTests +extends TestKit(ActorSystem("SplunkLogStore", ConfigFactory.parseString(SplunkLogStoreTests.config))) +with FlatSpecLike +with Matchers +with ScalaFutures { + behavior of "Splunk LogStore" + + val startTime = "2007-12-03T10:15:30" + val endTime = "2007-12-03T10:15:45" + + val activation = WhiskActivation( +namespace = EntityPath("ns"), +name = EntityName("a"), +Subject(), +activationId = ActivationId(), +start = LocalDateTime.parse(startTime).toInstant(ZoneOffset.UTC), +end = LocalDateTime.parse(endTime).toInstant(ZoneOffset.UTC), +response = ActivationResponse.success(Some(JsObject("res" -> JsNumber(1, +annotations = Parameters("limits", ActionLimits(TimeLimit(1.second), MemoryLimit(128.MB), LogLimit(1.MB)).toJson), +duration = Some(123)) + + implicit val ec = system.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkIndex = system.settings.config.getString("whisk.logstore.splunk.index") + val activationIdFieldName = system.settings.config.getString("whisk.logstore.splunk.activation-id-field") + val logMessageFieldName = system.settings.config.getString("whisk.logstore.splunk.log-message-field") + val splunkUser = system.settings.config.getString("whisk.logstore.splunk.user") + val splunkPwd = system.settings.config.getString("whisk.logstore.splunk.password") + val splunkHost = system.settings.config.getString("whisk.logstore.splunk.host") + val splunkPort = system.settings.con
[GitHub] jthomas opened a new issue #86: 3.10.0 release
jthomas opened a new issue #86: 3.10.0 release URL: https://github.com/apache/incubator-openwhisk-client-js/issues/86 Once the following PRs have merged, the next release can drafted and made available on this repo. npmbot should automatically publish to NPM. ## outstanding PRs * #85 * #83 ## notes for release page * Added new features to `routes()` methods. API name parameter and swagger route definition now supported. Route retrieval method included. (#69, #70, #71) * Swapped HTTP client library from [request](https://github.com/request/request) to [needle](https://github.com/tomas/needle). Significant reduction in dependencies installed and loading time. (#77) * Retrieving status and configuration for feed triggers now included (#80) * FQN names now handles missing leading forward-slash character (#75) * Updated TypeScript definitions (#76) ^^ @csantanapr This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jthomas commented on issue #81: fix issue #69
jthomas commented on issue #81: fix issue #69 URL: https://github.com/apache/incubator-openwhisk-client-js/pull/81#issuecomment-343533271 Thanks for opening this. I've used the code you provided to understand how to implement this. I was resolving numerous other issues in the same area and so have included the code in another PR (https://github.com/apache/incubator-openwhisk-client-js/pull/85). This can be closed now. 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] tysonnorris commented on a change in pull request #2957: splunk logstore
tysonnorris commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150292445 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { + implicit val as = actorSystem + implicit val ec = as.dispatcher + implicit val materializer = ActorMaterializer() + + val splunkHost = config.getString("whisk.logstore.splunk.host") + val splunkPort = config.getInt("whisk.logstore.splunk.port") + private val splunkApi = "/services/search/jobs" //see http://docs.splunk.com/Documentation/Splunk/6.6.3/RESTREF/RESTsearch#search.2Fjobs + private val splunkUser = config.getString("whisk.logstore.splunk.user") + private val splunkPass = config.getString("whisk.logstore.splunk.password") + private val splunkIndex = config.getString("whisk.logstore.splunk.index") + private val logMessageFieldName = config.getString("whisk.logstore.splunk.log-message-field") + private val activationIdFieldName = config.getString("whisk.logstore.splunk.activation-id-field") + private val disableSNI = config.getBoolean("whisk.logstore.splunk.disableSNI") + + val log = actorSystem.log + val maxPendingRequests = 500 + + val defaultHttpFlow = Http().cachedHostConnectionPoolHttps[Promise[HttpResponse]]( +host = splunkHost, +port = splunkPort, +connectionContext = + if (disableSNI) +Http().createClientHttpsContext(AkkaSSLConfig().mapSettings(s => s.withLoose(s.loose.withDisableSNI(true + else Http().defaultClientHttpsContext) + + override def fetchLogs(activation: WhiskActivation): Future[ActivationLogs] = { + +//example curl request: +//curl -u username:password -k https://splunkhost:port/services/search/jobs -d exec_mode=oneshot -d output_mode=json -d "search=search index=\"someindex\" | spath=activation_id | search activation_id=a930e5ae4ad4455c8f2505d665aad282 | table log_message" -d "earliest_time=2017-08-29T12:00:00" -d "latest_time=2017-10-29T12:00:00" +//example response: +// {"preview":false,"init_offset":0,"messages":[],"fields":[{"name":"log_message"}],"results":[{"log_message":"some log message"}], "highlighted":{}} +val search = + s"""search index="${splunkIndex}"| spath ${activationIdFieldName} | search ${activationIdFieldName}=${activation.activationId.toString} | table ${logMessageFieldName}""" + +val formatter = DateTimeFormatter.ofPattern("-MM-dd'T'hh:mm:ss").withZone(Z
[GitHub] csantanapr closed issue #75: support optional leading slash in fully qualified names
csantanapr closed issue #75: support optional leading slash in fully qualified names URL: https://github.com/apache/incubator-openwhisk-client-js/issues/75 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 #83: Add support for FQN entity names with leading forward slash
csantanapr closed pull request #83: Add support for FQN entity names with leading forward slash URL: https://github.com/apache/incubator-openwhisk-client-js/pull/83 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/lib/names.js b/lib/names.js index 7aaba8f..391d54a 100644 --- a/lib/names.js +++ b/lib/names.js @@ -12,21 +12,32 @@ const default_namespace = () => { // - package/resource_name // - /namespace/resource_name // - /namespace/package/resource_name +// - namespace/package/resource_name const parse_id_and_ns = resource => { - if (!resource.startsWith('/')) { + const parts = (resource.match(/\//g) || []).length + const names = resource.split('/') + + // checking for `resource_name` and `package/resource_name` + if (parts === 0 || + (parts === 1 && !resource.startsWith('/'))) { return { namespace: default_namespace(), id: resource } } - const paths = resource.split('/') - - if (paths.length !== 3 && paths.length !== 4) { -throw new Error(messages.INVALID_RESOURCE_ERROR) + // checking for `/namespace/resource_name` and `namespace/package/resource_name` + if (parts === 2) { +if (resource.startsWith('/')) { + return { namespace: names[1], id: names[2] } +} else { + return { namespace: names[0], id: `${names[1]}/${names[2]}` } +} } - const id = paths.slice(2).join('/') - const namespace = paths[1] + // checking for `/namespace/package/resource_name` + if (parts === 3 && resource.startsWith('/')) { +return { namespace: names[1], id: `${names[2]}/${names[3]}` } + } - return { id, namespace } + throw new Error(messages.INVALID_RESOURCE_ERROR) } const parse_namespace = id => parse_id_and_ns(id).namespace diff --git a/test/unit/names.test.js b/test/unit/names.test.js index f9aaeae..b1a788b 100644 --- a/test/unit/names.test.js +++ b/test/unit/names.test.js @@ -20,38 +20,64 @@ test('should parse namespace from resource without explicit ns', t => { t.is(names.parse_namespace('hello'), '_') }) +test('should parse namespace from package resource without explicit ns', t => { + t.is(names.parse_namespace('pkg/hello'), '_') +}) + test('should parse namespace from resource with explicit ns', t => { t.is(names.parse_namespace('/ns/hello'), 'ns') }) -test('should parse namespace from resource with explicit ns and package', t => { +test('should parse namespace from package resource with explicit ns', t => { t.is(names.parse_namespace('/ns/pkg/hello'), 'ns') }) +test('should parse namespace from resource with explicit ns and package but missing leading slash', t => { + t.is(names.parse_namespace('ns/pkg/hello'), 'ns') +}) + test('should throw error for resource with only namespace', t => { t.throws(() => names.parse_namespace('/ns'), /Invalid resource identifier/) }) test('should throw error for resource with only extra paths', t => { t.throws(() => names.parse_namespace('/ns/pkg/action/extra'), /Invalid resource identifier/) + t.throws(() => names.parse_namespace('ns/pkg/action/extra'), /Invalid resource identifier/) +}) + +test('should throw error for resource with missing parts', t => { + t.throws(() => names.parse_namespace('/'), /Invalid resource identifier/) }) test('should parse id from resource without explicit ns', t => { t.is(names.parse_id('hello'), 'hello') }) +test('should parse id from package resource without explicit ns', t => { + t.is(names.parse_id('pkg/hello'), 'pkg/hello') +}) + test('should parse id from resource with explicit ns', t => { t.is(names.parse_id('/ns/hello'), 'hello') }) -test('should parse id from resource with explicit ns and package', t => { +test('should parse id from package resource with explicit ns', t => { t.is(names.parse_id('/ns/pkg/hello'), 'pkg/hello') }) +test('should parse id from resource with explicit ns and package but missing leading slash', t => { + t.is(names.parse_id('ns/pkg/hello'), 'pkg/hello') +}) + test('should throw error for resource with only namespace', t => { t.throws(() => names.parse_id('/ns'), /Invalid resource identifier/) }) test('should throw error for resource with only extra paths', t => { t.throws(() => names.parse_id('/ns/pkg/action/extra'), /Invalid resource identifier/) + t.throws(() => names.parse_id('ns/pkg/action/extra'), /Invalid resource identifier/) +}) + +test('should throw error for resource with missing parts', t => { + t.throws(() => names.parse_id('/'), /Invalid resource identifier/) }) 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, ple
[GitHub] csantanapr commented on issue #83: Add support for FQN entity names with leading forward slash
csantanapr commented on issue #83: Add support for FQN entity names with leading forward slash URL: https://github.com/apache/incubator-openwhisk-client-js/pull/83#issuecomment-343534904 Thanks @jthomas for the contribution 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 closed pull request #81: fix issue #69
lionelvillard closed pull request #81: fix issue #69 URL: https://github.com/apache/incubator-openwhisk-client-js/pull/81 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/lib/routes.js b/lib/routes.js index 2e5c214..b5a7dcd 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -43,10 +43,12 @@ class Routes extends BaseOperation { } create (options) { -const missing = CREATE_PARAMS.filter(param => !(options || {}).hasOwnProperty(param)) +if (!options.hasOwnProperty('swagger')) { + const missing = CREATE_PARAMS.filter(param => !(options || {}).hasOwnProperty(param)) -if (missing.length) { - throw new Error(`Missing mandatory parameters: ${missing.join(', ')}`) + if (missing.length) { +throw new Error(`Missing mandatory parameters: ${missing.join(', ')}`) + } } const body = this.route_swagger_definition(options) @@ -55,6 +57,10 @@ class Routes extends BaseOperation { } route_swagger_definition (params) { +if (params.hasOwnProperty('swagger')) { + return { apidoc: { namespace: '_', swagger: params.swagger } } +} + const apidoc = { namespace: '_', gatewayBasePath: this.route_base_path(params), 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 #71: routes: support for routes.get
csantanapr closed issue #71: routes: support for routes.get URL: https://github.com/apache/incubator-openwhisk-client-js/issues/71 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 #69: Routes: Support for swagger
csantanapr closed issue #69: Routes: Support for swagger URL: https://github.com/apache/incubator-openwhisk-client-js/issues/69 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 #85: Add new features to routes methods.
csantanapr closed pull request #85: Add new features to routes methods. URL: https://github.com/apache/incubator-openwhisk-client-js/pull/85 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 159b3e3..089d7ed 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,7 @@ ow.actions.delete({name: '...'}) ow.triggers.delete({name: '...'}) ow.rules.delete({name: '...'}) ow.packages.delete({name: '...'}) +ow.feeds.delete({name: '...', trigger: '...'}) ``` The following optional parameters are supported: @@ -413,11 +414,10 @@ ow.rules.disable({name: '...'}) The following optional parameters are supported: - `namespace` - set custom namespace for endpoint -### create & delete feeds +### create feeds ```javascript ow.feeds.create({feedName: '...', trigger: '...'}) -ow.feeds.delete({feedName: '...', trigger: '...'}) ``` The following optional parameters are supported: @@ -432,6 +432,15 @@ This client library defaults to using the platform service. If the `apigw_token` *The interface for managing routes through the library does not change between providers.* +### retrieve route + +```javascript +ow.routes.get({basepath: '...'}) +ow.routes.get({name: '...'}) +``` + +*This method is a wrapper for the list method. It throws an error if the base path or name parameter is missing.* + ### list routes ```javascript @@ -441,16 +450,18 @@ ow.routes.list() The following optional parameters are supported to filter the result set: - `relpath` - relative URI path for endpoints - `basepath` - base URI path for endpoints +- `name` - identifier for API - `operation` - HTTP methods - `limit` - limit result set size - `skip` - skip results from index -*`relpath` is only valid when `basepath` is also specified.* +*`relpath` is only valid when `basepath` is also specified. `name` and `basepath` cannot be used together.* ### delete routes ```javascript ow.routes.delete({basepath: '...'}) +ow.routes.delete({name: '...'}) ``` The following optional parameters are supported to filter the result set: @@ -467,6 +478,17 @@ ow.routes.create({relpath: '...', operation: '...', action: '...'}) The following optional parameters are supported: - `responsetype` - content type returned by web action, possible values: `html`, `http`, `json`, `text` and `svg` (default: `json`). - `basepath` - base URI path for endpoints (default: `/`) +- `name` - identifier for API (default: `basepath`) + +### add route (swagger) + +```javascript +ow.routes.create({swagger: '{...}'}) +``` + +Swagger parameter must be a well-formed JSON string, containing a valid Swagger API definition, which follows the [OpenWhisk API Gateway route schema](https://github.com/apache/incubator-openwhisk-apigateway/blob/master/doc/v2/management_interface_v2.md#post-v2tenant_idapis). + +*No other parameters are supported when creating the route from a JSON Swagger document.* ## Debugging @@ -510,7 +532,7 @@ Alternatively, you can run the `prepIntegrationTests.sh` script using guest cred Run the script with openwhisk credentials: ```bash $ ./test/integration/prepIntegrationTests.sh -``` +``` The `prepIntegrationTests.sh` script is designed to give you feedback if it detects a setting that is not correct on your machine. ex: `node 6 or above is not detected` ## Code-Coverage: diff --git a/lib/messages.js b/lib/messages.js index 909721f..a1873f9 100644 --- a/lib/messages.js +++ b/lib/messages.js @@ -18,5 +18,6 @@ module.exports = { MISSING_PACKAGE_BODY_ERROR: 'Missing mandatory package parameter from options.', MISSING_NAMESPACE_ERROR: 'Missing namespace from options, please set a default namespace or pass one in the options.', INVALID_OPTIONS_ERROR: 'Invalid constructor options.', - MISSING_BASEPATH_ERROR: 'Missing mandatory basepath parameter from options.' + MISSING_BASEPATH_ERROR: 'Missing mandatory parameters: basepath or name.', + INVALID_BASEPATH_ERROR: 'Invalid parameters: use basepath or name, not both.' } diff --git a/lib/routes.js b/lib/routes.js index edb5f60..eb55026 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -13,8 +13,19 @@ class Routes extends BaseOperation { return `web/whisk.system/apimgmt/${path}.http` } + get (options) { +options = options || {} +options.basepath = this.basepath(options) + +return this.list(this.qs(options, ['basepath'])) + } + list (options) { options = options || {} +if (this.has_basepath(options)) { + options.basepath = this.calculate_basepath(options) +} + const qs = this.qs(options, ['relpath', 'basepath', 'operation', 'limit', 'skip']) return this.client.request('GET', this.routeMgmtApiPath('getApi'), { qs }) } @@ -30,26 +41,57 @@ c
[GitHub] csantanapr closed issue #70: Routes: support for apiName
csantanapr closed issue #70: Routes: support for apiName URL: https://github.com/apache/incubator-openwhisk-client-js/issues/70 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 #63: style: add .editorconfig, eslint and reformat js file
csantanapr commented on issue #63: style: add .editorconfig, eslint and reformat js file URL: https://github.com/apache/incubator-openwhisk-client-js/pull/63#issuecomment-343537368 @ert78gb I see some conflicts can you take a look? >When I added eslintrc.json I checked your coding style, but I think would be better if we use a more common style as standard I'm OK to use [standard](https://github.com/standard/standard) 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 #56: [Error][minikube] ENOTFOUND nginx.openwhisk nginx.openwhisk:443
csantanapr closed issue #56: [Error][minikube] ENOTFOUND nginx.openwhisk nginx.openwhisk:443 URL: https://github.com/apache/incubator-openwhisk-client-js/issues/56 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 #56: [Error][minikube] ENOTFOUND nginx.openwhisk nginx.openwhisk:443
csantanapr commented on issue #56: [Error][minikube] ENOTFOUND nginx.openwhisk nginx.openwhisk:443 URL: https://github.com/apache/incubator-openwhisk-client-js/issues/56#issuecomment-343537943 Open issue in kube repo asking how an action can address the controller or nginx from inside. https://github.com/apache/incubator-openwhisk-deploy-kube/issues Nothing we can do in this client-js to fix this. 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 #41: odd SSL error when passing large payloads
csantanapr commented on issue #41: odd SSL error when passing large payloads URL: https://github.com/apache/incubator-openwhisk-client-js/issues/41#issuecomment-343538323 @starpit is still a problem? Why are you passing large data on a get? Maybe a different use case a post (50mb) or put (1mb)? 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 #86: 3.10.0 release
csantanapr commented on issue #86: 3.10.0 release URL: https://github.com/apache/incubator-openwhisk-client-js/issues/86#issuecomment-343538857 @jthomas merged #83 and #85 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 #86: 3.10.0 release
csantanapr commented on issue #86: 3.10.0 release URL: https://github.com/apache/incubator-openwhisk-client-js/issues/86#issuecomment-343538909 I will tag 3.10.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 opened a new issue #6: Update nodejs6 to LTS 6.12.0
csantanapr opened a new issue #6: Update nodejs6 to LTS 6.12.0 URL: https://github.com/apache/incubator-openwhisk-runtime-nodejs/issues/6 Update node https://nodejs.org/en/blog/release/v6.12.0/ Update openwhisk 3.10.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 opened a new pull request #87: bump package.json to 3.10.0
csantanapr opened a new pull request #87: bump package.json to 3.10.0 URL: https://github.com/apache/incubator-openwhisk-client-js/pull/87 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] codecov-io commented on issue #87: bump package.json to 3.10.0
codecov-io commented on issue #87: bump package.json to 3.10.0 URL: https://github.com/apache/incubator-openwhisk-client-js/pull/87#issuecomment-343550856 # [Codecov](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/87?src=pr&el=h1) Report > Merging [#87](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/87?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-openwhisk-client-js/commit/7046c09f3d9c6521125ee6f22c67b56475f584d7?src=pr&el=desc) will **not change** coverage. > The diff coverage is `n/a`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/87/graphs/tree.svg?height=150&token=j2mPEx0Tkq&width=650&src=pr)](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/87?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #87 +/- ## === Coverage 99.16% 99.16% === Files 14 14 Lines 361 361 === Hits 358 358 Misses 33 ``` -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/87?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `? = absolute (impact)`, `? = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/87?src=pr&el=footer). Last update [7046c09...f4b6baf](https://codecov.io/gh/apache/incubator-openwhisk-client-js/pull/87?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). 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 #87: bump package.json to 3.10.0
houshengbo closed pull request #87: bump package.json to 3.10.0 URL: https://github.com/apache/incubator-openwhisk-client-js/pull/87 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/package.json b/package.json index e856296..fda0a54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openwhisk", - "version": "3.9.0", + "version": "3.10.0", "description": "JavaScript client library for the OpenWhisk platform", "main": "lib/main.js", "typings": "lib/main.d.ts", 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] ert78gb commented on issue #63: style: add .editorconfig, eslint and reformat js file
ert78gb commented on issue #63: style: add .editorconfig, eslint and reformat js file URL: https://github.com/apache/incubator-openwhisk-client-js/pull/63#issuecomment-343555198 I prefer the standard style. I tried to use those settings which modifies the current code style the least. I will check the conflict 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 commented on issue #21: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #21: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-rss/issues/21#issuecomment-343563592 There is one test case: RSSTests 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 commented on issue #1: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #1: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-deploy/issues/1#issuecomment-343563997 There is one test case: DeployTests 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 commented on issue #9: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #9: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-jira/issues/9#issuecomment-343564339 There is one test case: JiraTests 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 commented on issue #83: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #83: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-pushnotifications/issues/83#issuecomment-343564550 There is one test case: PushNotificationsTests 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 commented on issue #222: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #222: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-kafka/issues/222#issuecomment-343565353 BasicHealthTest KafkaFeedTests KafkaFeedWebTests KafkaProduceTests MessageHubFeedTests MessageHubFeedWebTests MessageHubMultiWorkersTest MessageHubProduceTests ActionHelper BasicStressTest 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 commented on issue #222: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #222: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-kafka/issues/222#issuecomment-343565353 There are 10 test cases: BasicHealthTest KafkaFeedTests KafkaFeedWebTests KafkaProduceTests MessageHubFeedTests MessageHubFeedWebTests MessageHubMultiWorkersTest MessageHubProduceTests ActionHelper BasicStressTest 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 commented on issue #142: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #142: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-cloudant/issues/142#issuecomment-343566048 CloudantHealthFeedTests CloudantAccountActionsTests.scala CloudantBindingTests.scala CloudantDatabaseActionsTests.scala CloudantFeedTests.scala CloudantFeedWebTests.scala CloudantMultiWorkersTests.scala CloudantTriggerPersistencyTest.scala CloudantRedundancyTests 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 commented on issue #142: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #142: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-cloudant/issues/142#issuecomment-343566048 There are 9 test cases: CloudantHealthFeedTests CloudantAccountActionsTests.scala CloudantBindingTests.scala CloudantDatabaseActionsTests.scala CloudantFeedTests.scala CloudantFeedWebTests.scala CloudantMultiWorkersTests.scala CloudantTriggerPersistencyTest.scala CloudantRedundancyTests 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 commented on issue #108: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #108: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-package-alarms/issues/108#issuecomment-343566704 There are 5 test cases: AlarmsHealthFeedTests AlarmsFeedTests.scala AlarmsFeedWebTests.scala AlarmsMultiWorkersTests.scala AlarmsRedundancyTests 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 commented on issue #247: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #247: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-catalog/issues/247#issuecomment-343567194 There are 10 test cases: CombinatorTests CurlTest.scala GreetingTest.scala HelloTests.scala WordCountTest.scala SlackTests UtilsTests WatsonTests WeatherTests WebSocketTests.scala 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 commented on issue #247: Replace the binary Wsk with REST interface WskRest
houshengbo commented on issue #247: Replace the binary Wsk with REST interface WskRest URL: https://github.com/apache/incubator-openwhisk-catalog/issues/247#issuecomment-343567194 CombinatorTests CurlTest.scala GreetingTest.scala HelloTests.scala WordCountTest.scala SlackTests UtilsTests WatsonTests WeatherTests WebSocketTests.scala 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 issue #645: Format servicedeployer.go
pritidesai opened a new issue #645: Format servicedeployer.go URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/645 servicedeployer.go is growing as we add new features and functionalities in whisk deploy. It has core logic for deployment and undeployment. Please create two separate go files, one for deployment and one for undeployment. 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 #7: Make proxy with zero dependencies (no express, body-parser)
csantanapr opened a new issue #7: Make proxy with zero dependencies (no express, body-parser) URL: https://github.com/apache/incubator-openwhisk-runtime-nodejs/issues/7 Making the web proxy leaner avoids the delay to load module tree for express and body-parser. Have the web proxy use http server from nodejs 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 commented on issue #2955: Re-implement the test cases under whisk.core.cli.test package in REST
houshengbo commented on issue #2955: Re-implement the test cases under whisk.core.cli.test package in REST URL: https://github.com/apache/incubator-openwhisk/pull/2955#issuecomment-343598608 Playground4/1004/ 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 commented on issue #2955: Re-implement the test cases under whisk.core.cli.test package in REST
houshengbo commented on issue #2955: Re-implement the test cases under whisk.core.cli.test package in REST URL: https://github.com/apache/incubator-openwhisk/pull/2955#issuecomment-343598608 Playground4/1004/ failed with one test case, but it is not related to the changes. 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 commented on issue #2944: Replace test cases of api gateway with REST
houshengbo commented on issue #2944: Replace test cases of api gateway with REST URL: https://github.com/apache/incubator-openwhisk/pull/2944#issuecomment-343602724 Playground1/2265 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] tysonnorris commented on a change in pull request #2957: splunk logstore
tysonnorris commented on a change in pull request #2957: splunk logstore URL: https://github.com/apache/incubator-openwhisk/pull/2957#discussion_r150351735 ## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/SplunkLogStore.scala ## @@ -0,0 +1,158 @@ +/* + * 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 akka.http.scaladsl.Http +import java.time.ZoneId +import java.time.format.DateTimeFormatter +import akka.http.scaladsl.client.RequestBuilding.Post +import akka.http.scaladsl.model.FormData +import akka.http.scaladsl.model.HttpRequest +import akka.http.scaladsl.model.HttpResponse +import akka.http.scaladsl.model.headers.Authorization +import akka.http.scaladsl.model.headers.BasicHttpCredentials +import akka.http.scaladsl.unmarshalling.Unmarshal +import akka.stream.ActorMaterializer +import akka.stream.OverflowStrategy +import akka.stream.QueueOfferResult +import akka.stream.scaladsl.Flow +import akka.stream.scaladsl.Keep +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source +import com.typesafe.sslconfig.akka.AkkaSSLConfig +import scala.concurrent.Future +import scala.concurrent.Promise +import scala.util.Failure +import scala.util.Success +import scala.util.Try +import spray.json.DefaultJsonProtocol._ +import spray.json.JsArray +import spray.json._ +import whisk.core.entity.ActivationLogs +import whisk.core.entity.WhiskActivation + +/** + * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via docker log driver, and retrieved via Splunk REST API + * @param actorSystem + * @param httpFlow Optional Flow to use for HttpRequest handling (to enable stream based tests) + */ +class SplunkLogStore( + actorSystem: ActorSystem, + httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), Any]] = None) +extends LogDriverLogStore(actorSystem) { Review comment: ah nice! I updated to do this. 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 #2955: Re-implement the test cases under whisk.core.cli.test package in REST
houshengbo closed pull request #2955: Re-implement the test cases under whisk.core.cli.test package in REST URL: https://github.com/apache/incubator-openwhisk/pull/2955 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/BaseWsk.scala b/tests/src/test/scala/common/BaseWsk.scala index 9d7cafe980..0917fa6942 100644 --- a/tests/src/test/scala/common/BaseWsk.scala +++ b/tests/src/test/scala/common/BaseWsk.scala @@ -274,7 +274,7 @@ trait BaseActivation extends BaseRunWsk { def pollFor(N: Int, entity: Option[String], limit: Option[Int] = None, - since: Option[Instant], + since: Option[Instant] = None, retries: Int, pollPeriod: Duration = 1.second)(implicit wp: WskProps): Seq[String] diff --git a/tests/src/test/scala/common/rest/WskRest.scala b/tests/src/test/scala/common/rest/WskRest.scala index 2f620c2fba..71551a65f4 100644 --- a/tests/src/test/scala/common/rest/WskRest.scala +++ b/tests/src/test/scala/common/rest/WskRest.scala @@ -141,8 +141,9 @@ trait ListOrGetFromCollectionRest extends BaseListOrGetFromCollection { expectedExitCode: Int = OK.intValue)(implicit wp: WskProps): RestResult = { val entPath = namespace map { ns => - val (ns, name) = getNamespaceEntityName(resolve(namespace)) - Path(s"$basePath/namespaces/$ns/$noun/$name/") + val (nspace, name) = getNamespaceEntityName(resolve(namespace)) + if (name.isEmpty) Path(s"$basePath/namespaces/$nspace/$noun") + else Path(s"$basePath/namespaces/$nspace/$noun/$name/") } getOrElse Path(s"$basePath/namespaces/${wp.namespace}/$noun") val paramMap = Map[String, String]() ++ { Map("skip" -> "0", "docs" -> true.toString) } ++ { @@ -1259,7 +1260,6 @@ class RunWskRestCmd() extends FlatSpec with RunWskCmd with Matchers with ScalaFu } def convertStringIntoKeyValue(file: String, feed: Option[String] = None, web: Option[String] = None): JsArray = { -var paramsList = Vector[JsObject]() val input = FileUtils.readFileToString(new File(file)) val in = input.parseJson.convertTo[Map[String, JsValue]] convertMapIntoKeyValue(in, feed, web) @@ -1273,9 +1273,21 @@ class RunWskRestCmd() extends FlatSpec with RunWskCmd with Matchers with ScalaFu paramsList = feed map { f => paramsList :+ JsObject("key" -> "feed".toJson, "value" -> f.toJson) } getOrElse paramsList -paramsList = web map { w => - paramsList :+ JsObject("key" -> "web-export".toJson, "value" -> w.toJson) -} getOrElse paramsList +paramsList = web match { + case Some("true") => +paramsList :+ JsObject("key" -> "web-export".toJson, "value" -> true.toJson) :+ JsObject( + "key" -> "raw-http".toJson, + "value" -> false.toJson) :+ JsObject("key" -> "final".toJson, "value" -> true.toJson) + case Some("false") => +paramsList :+ JsObject("key" -> "web-export".toJson, "value" -> false.toJson) :+ JsObject( + "key" -> "raw-http".toJson, + "value" -> false.toJson) :+ JsObject("key" -> "final".toJson, "value" -> false.toJson) + case Some("raw") => +paramsList :+ JsObject("key" -> "web-export".toJson, "value" -> true.toJson) :+ JsObject( + "key" -> "raw-http".toJson, + "value" -> true.toJson) :+ JsObject("key" -> "final".toJson, "value" -> true.toJson) + case _ => paramsList +} JsArray(paramsList) } @@ -1318,8 +1330,10 @@ class RunWskRestCmd() extends FlatSpec with RunWskCmd with Matchers with ScalaFu case Array(empty, namespace, entityName) if empty.isEmpty => (namespace, entityName) // Example: namespace/package_name/entity_name case Array(namespace, packageName, entityName) => (namespace, s"$packageName/$entityName") + // Example: /namespace + case Array(empty, namespace) if empty.isEmpty => (namespace, "") // Example: package_name/entity_name - case Array(packageName, entityName) => (wp.namespace, s"$packageName/$entityName") + case Array(packageName, entityName) if !packageName.isEmpty => (wp.namespace, s"$packageName/$entityName") // Example: entity_name case Array(entityName) => (wp.namespace, entityName) case _ => (wp.namespace, name) diff --git a/tests/src/test/scala/whisk/core/cli/test/SequenceMigrationTests.scala b/tests/src/test/scala/whisk/core/cli/test/SequenceMigrationTests.scala index 977505f4f1..acc0361867 100644 --- a/tests/src/test/scala/whisk/core/cli/test/SequenceMigrationTests.scala +++ b/tests/src/test/scala/whisk/core/cli/test/SequenceMigrationTests.scala @@ -29,7 +29,7 @@ import org.scalatest.junit.JUnitRunner import akk
[GitHub] pritidesai opened a new issue #646: introduce wskdeploy debug/verbose mode
pritidesai opened a new issue #646: introduce wskdeploy debug/verbose mode URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/646 When you run `wskdeploy -v` today, it displays debug messages from the underneath libraries as well, more specifically, whisk CLI. This is a nice to have debug messages but it will be great to have a separate flag or level to check debug messages from `wskdeploy` itself. ``` [o/whisk.PrintResponseInfo]:475:[Inf] Response body received (ASCII quoted string): "OK" [k.IsResponseResultSuccess]:630:[Wrn] IsResponseResultSuccess: failed to parse response result: invalid character 'O' looking for beginning of value [hisk.parseSuccessResponse]:555:[Inf] Parsing HTTP response into struct type: **whisk.Rule [hisk.parseSuccessResponse]:567:[Wrn] Unsuccessful parse of HTTP response into struct type: **whisk.Rule; parse error 'invalid character 'O' looking for beginning of value' [hisk.parseSuccessResponse]:568:[Wrn] Request was successful, so ignoring the following unexpected response body that could not be parsed: OK [rviceDeployer).createRule]:834:[Inf] Rule ManagedRule-1 has been successfully deployed. ``` I am rather only interested in the following message: ``` [rviceDeployer).createRule]:834:[Inf] Rule ManagedRule-1 has been successfully deployed. ``` 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 #63: style: add .editorconfig, eslint and reformat js file
csantanapr commented on issue #63: style: add .editorconfig, eslint and reformat js file URL: https://github.com/apache/incubator-openwhisk-client-js/pull/63#issuecomment-343610919 I heard good things about standard so it should be OK 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] pulasthi commented on issue #2538: vagrant "hello" script fails
pulasthi commented on issue #2538: vagrant "hello" script fails URL: https://github.com/apache/incubator-openwhisk/issues/2538#issuecomment-343643930 Hi I was trying to follow the vagrant setup on my local machine ( ubuntu 16.04 LTS ) and got the same errors (shown below). I also tried out what @reiz has mentioned and created a file at /etc/sudoers.d/vagrant with the given content but still got the error. After i get the error i can log into the vagrant with ssh but the invoke example does not work. I assume that is because the setup processes were not completed. Please let me know if you need any futher information from me default: Saturday 11 November 2017 06:00:14 + (0:00:00.254) 0:07:54.632 * default: ok: [controller1] => (item=(0, u'172.17.0.1')) default: ok: [controller0] => (item=(0, u'172.17.0.1')) default: ok: [controller0] => (item=(1, u'172.17.0.1')) default: ok: [controller1] => (item=(1, u'172.17.0.1')) default: default: TASK [controller : (re)start controller] *** default: Saturday 11 November 2017 06:00:14 + (0:00:00.287) 0:07:54.920 * default: changed: [controller1] default: changed: [controller0] default: default: TASK [controller : wait until the Controller in this host is up and running] *** default: Saturday 11 November 2017 06:03:05 + (0:02:50.690) 0:10:45.610 * default: FAILED - RETRYING: wait until the Controller in this host is up and running (12 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (12 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (11 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (11 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (10 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (10 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (9 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (9 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (8 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (8 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (7 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (7 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (6 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (6 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (5 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (5 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (4 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (4 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (3 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (3 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (2 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (2 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (1 retries left). default: FAILED - RETRYING: wait until the Controller in this host is up and running (1 retries left). default: fatal: [controller1]: FAILED! => {"attempts": 12, "changed": false, "content": "", "failed": true, "msg": "Status code was not [200]: Request failed: ", "redirected": false, "status": -1, "url": "http://172.17.0.1:10002/ping"} default: fatal: [controller0]: FAILED! => {"attempts": 12, "changed": false, "content": "", "failed": true, "msg": "Status code was not [200]: Request failed: ", "redirected": false, "status": -1, "url": "http://172.17.0.1:10001/ping"} default: default: PLAY RECAP * default: 172.17.0.1 : ok=10 changed=9unreachable=0 failed=0 default: controller0: ok=10 changed=2unreachable=0 failed=1 defau