[incubator-openwhisk-devtools] branch master updated: Add prefix to PROJECT_HOME and CATALOG_HOME (#100)
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-devtools.git The following commit(s) were added to refs/heads/master by this push: new 5c795fe Add prefix to PROJECT_HOME and CATALOG_HOME (#100) 5c795fe is described below commit 5c795fee758f65524c6c766b38cf719012f27139 Author: Rob Allen AuthorDate: Tue Feb 27 06:02:29 2018 -0500 Add prefix to PROJECT_HOME and CATALOG_HOME (#100) --- docker-compose/Makefile | 46 +++--- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/docker-compose/Makefile b/docker-compose/Makefile index d4d8931..0bbb38e 100644 --- a/docker-compose/Makefile +++ b/docker-compose/Makefile @@ -14,9 +14,9 @@ endif DOCKER_HOST_IP ?= $(shell echo ${DOCKER_HOST} | grep -o "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" || echo ${LOCAL_IP}) DOCKER_REGISTRY ?= "" DOCKER_IMAGE_PREFIX ?= openwhisk -PROJECT_HOME ?= ./openwhisk-master -CATALOG_HOME ?= ./openwhisk-catalog -WSK_CLI ?= $(PROJECT_HOME)/bin/wsk +OPENWHISK_PROJECT_HOME ?= ./openwhisk-master +OPENWHISK_CATALOG_HOME ?= ./openwhisk-catalog +WSK_CLI ?= $(OPENWHISK_PROJECT_HOME)/bin/wsk OPEN_WHISK_DB_PREFIX ?= local_ DOCKER_KERNEL ?= $(shell docker version --format "{{.Server.KernelVersion}}") @@ -41,25 +41,25 @@ add-catalog: download-catalog init-catalog .PHONY: download download: rm -rf ./openwhisk-master* - if [ "$(PROJECT_HOME)" = "./openwhisk-master" ]; then \ + if [ "$(OPENWHISK_PROJECT_HOME)" = "./openwhisk-master" ]; then \ echo "Downloading source tar ball"; \ curl -o ./openwhisk-master.tar.gz -L https://github.com/apache/incubator-openwhisk/archive/master.tar.gz; \ echo "Unpacking tarball."; \ mkdir openwhisk-master; \ tar -xf ./openwhisk-master.tar.gz --strip 1 -C openwhisk-master; \ else \ -echo "Skipping downloading the code from git as PROJECT_HOME is not default:" $(PROJECT_HOME); \ +echo "Skipping downloading the code from git as OPENWHISK_PROJECT_HOME is not default:" $(OPENWHISK_PROJECT_HOME); \ fi .PHONY: download-catalog download-catalog: rm -rf ./openwhisk-catalog* - if [ "$(CATALOG_HOME)" = "./openwhisk-catalog" ]; then \ + if [ "$(OPENWHISK_CATALOG_HOME)" = "./openwhisk-catalog" ]; then \ curl -O ./openwhisk-catalog.tar.gz -L https://api.github.com/repos/apache/incubator-openwhisk-catalog/tarball/master > ./openwhisk-catalog.tar.gz; \ mkdir openwhisk-catalog; \ tar -xf ./openwhisk-catalog.tar.gz --strip 1 -C openwhisk-catalog; \ else \ -echo "Skipping downloading the code from git as CATALOG_HOME is not default:" $(CATALOG_HOME); \ +echo "Skipping downloading the code from git as OPENWHISK_CATALOG_HOME is not default:" $(OPENWHISK_CATALOG_HOME); \ fi .PHONY: quick-start-pause @@ -75,25 +75,25 @@ quick-start-info: docker: echo "building the docker images ... " - cd $(PROJECT_HOME) && \ + cd $(OPENWHISK_PROJECT_HOME) && \ ./gradlew distdocker -x :core:swift3Action:distDocker -x :core:swiftAction:distDocker download-cli: echo "downloading the CLI tool ... " - if [ "$(PROJECT_HOME)" = "./openwhisk-master" ]; then \ + if [ "$(OPENWHISK_PROJECT_HOME)" = "./openwhisk-master" ]; then \ if [ "$(UNAME_STR)" = "Darwin" ]; then \ echo "downloading cli for mac" ; \ - curl -o $(PROJECT_HOME)/bin/wsk.zip -L https://github.com/apache/incubator-openwhisk-cli/releases/download/latest/OpenWhisk_CLI-latest-mac-amd64.zip ; \ -cd $(PROJECT_HOME)/bin ; \ + curl -o $(OPENWHISK_PROJECT_HOME)/bin/wsk.zip -L https://github.com/apache/incubator-openwhisk-cli/releases/download/latest/OpenWhisk_CLI-latest-mac-amd64.zip ; \ +cd $(OPENWHISK_PROJECT_HOME)/bin ; \ unzip -o wsk.zip; \ elif [ "$(UNAME_STR)" = "Linux" ]; then \ echo "downloading cli for linux" ; \ - curl -o $(PROJECT_HOME)/bin/wsk.tgz -L https://github.com/apache/incubator-openwhisk-cli/releases/download/latest/OpenWhisk_CLI-latest-linux-amd64.tgz ; \ -cd $(PROJECT_HOME)/bin ; \ + curl -o $(OPENWHISK_PROJECT_HOME)/bin/wsk.tgz -L https://github.com/apache/incubator-openwhisk-cli/releases/download/latest/OpenWhisk_CLI-latest-linux-amd64.tgz ; \ +cd $(OPENWHISK_PROJECT_HOME)/bin ; \ tar -xf wsk.tgz ; \ fi; \ else \ - echo "Skipping downloading the cli from git as PROJECT_HOME is not default:" $(PROJECT_HOME); \ + echo "Skipping downloading the cli from git as OPENWHISK_PROJECT_HOME is not default:" $(OPENWHISK_PROJECT_HOME); \ fi .PHONY: run @@ -144,8 +144,8 @@ check-kafka-ports: .PHONY: setu
[incubator-openwhisk] branch master updated: adding namePrefix config to ContainerArgsConfig (#3215)
This is an automated email from the ASF dual-hosted git repository. rabbah pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git The following commit(s) were added to refs/heads/master by this push: new 9e6f95b adding namePrefix config to ContainerArgsConfig (#3215) 9e6f95b is described below commit 9e6f95b7d1b7b3f552d9098abde72cb0f8f2de84 Author: tysonnorris AuthorDate: Tue Feb 27 10:50:22 2018 -0600 adding namePrefix config to ContainerArgsConfig (#3215) * adding namePrefix config to ContainerArgsConfig * removed name-prefix config; added InstanceId.name * only use config.invokerName if it is not empty --- .../core/containerpool/ContainerFactory.scala | 9 ++ .../main/scala/whisk/core/entity/InstanceId.scala | 4 +-- .../whisk/core/containerpool/ContainerProxy.scala | 4 +-- .../docker/DockerContainerFactory.scala| 34 -- .../main/scala/whisk/core/invoker/Invoker.scala| 7 ++--- .../containerpool/test/ContainerProxyTests.scala | 6 ++-- 6 files changed, 37 insertions(+), 27 deletions(-) diff --git a/common/scala/src/main/scala/whisk/core/containerpool/ContainerFactory.scala b/common/scala/src/main/scala/whisk/core/containerpool/ContainerFactory.scala index 5c70d5d..25be520 100644 --- a/common/scala/src/main/scala/whisk/core/containerpool/ContainerFactory.scala +++ b/common/scala/src/main/scala/whisk/core/containerpool/ContainerFactory.scala @@ -50,6 +50,15 @@ trait ContainerFactory { def cleanup(): Unit } +object ContainerFactory { + + /** include the instance name, if specified and strip invalid chars before attempting to use them in the container name */ + def containerNamePrefix(instanceId: InstanceId): String = +s"wsk${instanceId.name.getOrElse("")}${instanceId.toInt}" + .replaceAll("[^a-zA-Z0-9_\\.\\-]", "") // based on https://github.com/moby/moby/issues/3138 and https://github.com/moby/moby/blob/master/daemon/names/names.go + +} + /** * An SPI for ContainerFactory creation * All impls should use the parameters specified as additional args to "docker run" commands diff --git a/common/scala/src/main/scala/whisk/core/entity/InstanceId.scala b/common/scala/src/main/scala/whisk/core/entity/InstanceId.scala index 743cda5..8087b8b 100644 --- a/common/scala/src/main/scala/whisk/core/entity/InstanceId.scala +++ b/common/scala/src/main/scala/whisk/core/entity/InstanceId.scala @@ -19,10 +19,10 @@ package whisk.core.entity import spray.json.DefaultJsonProtocol -case class InstanceId(val instance: Int) { +case class InstanceId(val instance: Int, name: Option[String] = None) { def toInt: Int = instance } object InstanceId extends DefaultJsonProtocol { - implicit val serdes = jsonFormat1(InstanceId.apply) + implicit val serdes = jsonFormat2(InstanceId.apply) } diff --git a/core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala b/core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala index 805c2a1..7f37aaf 100644 --- a/core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala +++ b/core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala @@ -18,7 +18,6 @@ package whisk.core.containerpool import java.time.Instant - import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.Success @@ -429,7 +428,8 @@ object ContainerProxy { * @return a unique container name */ def containerName(instance: InstanceId, prefix: String, suffix: String) = - s"wsk${instance.toInt}_${containerCount.next()}_${prefix}_${suffix}".replaceAll("[^a-zA-Z0-9_]", "") + s"${ContainerFactory.containerNamePrefix(instance)}_${containerCount.next()}_${prefix}_${suffix}" + .replaceAll("[^a-zA-Z0-9_]", "") /** * Creates a WhiskActivation ready to be sent via active ack. diff --git a/core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainerFactory.scala b/core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainerFactory.scala index fbcd230..ff0dfb5 100644 --- a/core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainerFactory.scala +++ b/core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainerFactory.scala @@ -106,24 +106,26 @@ class DockerContainerFactory(config: WhiskConfig, @throws(classOf[InterruptedException]) private def removeAllActionContainers(): Unit = { implicit val transid = TransactionId.invoker -val cleaning = docker.ps(filters = Seq("name" -> s"wsk${instance.toInt}_"), all = true).flatMap { containers => - logging.info(this, s"removing ${containers.size} action containers.") - val removals = containers.map { id => -(if (config.invokerUseRunc) { - runc.resume(id) - } else { - docker.unpause(id) - }) - .recoverWith { -// Ignore resume failures and try to rem
[incubator-openwhisk-runtime-java] branch master updated: Switch to Maven based dependency (#11)
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-java.git The following commit(s) were added to refs/heads/master by this push: new ba04449 Switch to Maven based dependency (#11) ba04449 is described below commit ba04449eb39e7ccc8ad5a6572ee6bb219306ec4a Author: Chetan Mehrotra AuthorDate: Tue Feb 27 23:07:51 2018 +0530 Switch to Maven based dependency (#11) --- README.md | 34 ++- ansible/environments/local/group_vars/all | 16 +-- settings.gradle | 17 tests/build.gradle| 7 +++ tools/travis/build.sh | 19 ++--- 5 files changed, 57 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index acd4175..81c151e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -#Apache OpenWhisk runtimes for java +# Apache OpenWhisk runtimes for java + [![Build Status](https://travis-ci.org/apache/incubator-openwhisk-runtime-java.svg?branch=master)](https://travis-ci.org/apache/incubator-openwhisk-runtime-java) @@ -49,6 +50,37 @@ ln -s ${ROOTDIR}/ansible/environments/local ${OPENWHISK_HOME}/ansible/environmen wskdev fresh -t local-java ``` +### Testing +Install dependencies from the root directory on $OPENWHISK_HOME repository +``` +./gradlew :common:scala:install :core:controller:install :core:invoker:install :tests:install +``` + +Using gradle for the ActionContainer tests you need to use a proxy if running on Mac, if Linux then don't use proxy options +You can pass the flags `-Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128` directly in gradle command. +Or save in your `$HOME/.gradle/gradle.properties` +``` +systemProp.http.proxyHost=localhost +systemProp.http.proxyPort=3128 +``` +Using gradle to run all tests +``` +./gradlew :tests:test +``` +Using gradle to run some tests +``` +./gradlew :tests:test --tests *ActionContainerTests* +``` +Using IntelliJ: +- Import project as gradle project. +- Make sure working directory is root of the project/repo +- Add the following Java VM properties in ScalaTests Run Configuration, easiest is to change the Defaults for all ScalaTests to use this VM properties +``` +-Dhttp.proxyHost=localhost +-Dhttp.proxyPort=3128 +``` + + Using container image to test To use as docker action push to your own dockerhub account ``` docker tag whisk/java8action $user_prefix/java8action diff --git a/ansible/environments/local/group_vars/all b/ansible/environments/local/group_vars/all index 79d0580..ce84e87 100755 --- a/ansible/environments/local/group_vars/all +++ b/ansible/environments/local/group_vars/all @@ -1,9 +1,11 @@ whisk_version_name: local -config_root_dir: /tmp/wskconf -whisk_logs_dir: /tmp/wsklogs +openwhisk_tmp_dir: "{{ lookup('env', 'OPENWHISK_TMP_DIR')|default('/tmp', true) }}" +config_root_dir: "{{ openwhisk_tmp_dir }}/wskconf" +whisk_logs_dir: "{{ openwhisk_tmp_dir }}/wsklogs" docker_registry: "" docker_dns: "" -bypass_pull_for_local_images: true +runtimes_bypass_pull_for_local_images: true +invoker_use_runc: "{{ ansible_distribution != 'MacOSX' }}" db_prefix: whisk_local_ @@ -22,14 +24,6 @@ apigw_host_v2: "http://{{ groups['apigateway']|first }}:{{apigateway.port.api}}/ invoker_allow_multiple_instances: true -# Set kafka configuration -kafka_heap: '512m' -kafka_topics_completed_retentionBytes: 104857600 -kafka_topics_completed_retentionMS: 30 -kafka_topics_health_retentionBytes: 104857600 -kafka_topics_health_retentionMS: 30 -kafka_topics_invoker_retentionBytes: 104857600 -kafka_topics_invoker_retentionMS: 30 env_hosts_dir: "{{ playbook_dir }}/environments/local" diff --git a/settings.gradle b/settings.gradle index 47819fb..c8ed5a3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,22 +1,13 @@ -def owPath = System.getenv("OPENWHISK_HOME") ?: '../open' -def owDirectory = new File(owPath) - -if (!owDirectory.exists()) { -throw new GradleScriptException("Environment variable OPENWHISK_HOME must point to a valid OpenWhisk build", null) -} - - -include 'common:scala'; project(':common:scala').projectDir = new File(owDirectory, 'common/scala') -include 'core:controller'; project(':core:controller').projectDir = new File(owDirectory, 'core/controller') -include 'core:invoker'; project(':core:invoker').projectDir = new File(owDirectory, 'core/invoker') -include 'whisktests'; project(':whisktests').projectDir = new File(owDirectory, 'tests') - include 'tests' include 'core:javaAction' rootProject.name = 'runtime-java' +gradle.ext.openwhisk = [ +version: '1.0.0-SNAPSHOT' +] + gradle.ext.scala = [ version: '2.11.8', compileFlags: ['-feature', '-unchecked', '-deprecation', '-Xfatal-warnings', '-Ywarn-unused-import'] diff --git a/tests/build.gradle b/tests/
[incubator-openwhisk] branch master updated: Factor PoolingRestClient out of CouchDbRestClient. (#3347)
This is an automated email from the ASF dual-hosted git repository. markusthoemmes pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git The following commit(s) were added to refs/heads/master by this push: new 369517b Factor PoolingRestClient out of CouchDbRestClient. (#3347) 369517b is described below commit 369517b369453366c3aeb095fba79d1c4411f8ea Author: James Dubee AuthorDate: Tue Feb 27 14:00:35 2018 -0500 Factor PoolingRestClient out of CouchDbRestClient. (#3347) --- .../whisk/core/database/CloudantRestClient.scala | 2 +- .../whisk/core/database/CouchDbRestClient.scala| 160 +++-- .../main/scala/whisk/http/PoolingRestClient.scala | 154 .../database/test/ExtendedCouchDbRestClient.scala | 11 +- 4 files changed, 183 insertions(+), 144 deletions(-) diff --git a/common/scala/src/main/scala/whisk/core/database/CloudantRestClient.scala b/common/scala/src/main/scala/whisk/core/database/CloudantRestClient.scala index 29ec17e..682df26 100644 --- a/common/scala/src/main/scala/whisk/core/database/CloudantRestClient.scala +++ b/common/scala/src/main/scala/whisk/core/database/CloudantRestClient.scala @@ -37,6 +37,6 @@ class CloudantRestClient(host: String, port: Int, username: String, password: St // https://cloudant.com/blog/cloudant-query-grows-up-to-handle-ad-hoc-queries/#.VvllCD-0z2C def simpleQuery(doc: JsObject): Future[Either[StatusCode, JsObject]] = { -requestJson[JsObject](mkJsonRequest(HttpMethods.POST, uri(db, "_find"), doc)) +requestJson[JsObject](mkJsonRequest(HttpMethods.POST, uri(db, "_find"), doc, baseHeaders)) } } diff --git a/common/scala/src/main/scala/whisk/core/database/CouchDbRestClient.scala b/common/scala/src/main/scala/whisk/core/database/CouchDbRestClient.scala index 0f791b2..e38ce6f 100644 --- a/common/scala/src/main/scala/whisk/core/database/CouchDbRestClient.scala +++ b/common/scala/src/main/scala/whisk/core/database/CouchDbRestClient.scala @@ -17,28 +17,22 @@ package whisk.core.database +import scala.concurrent.Future + import java.net.URLEncoder import java.nio.charset.StandardCharsets -import scala.concurrent.Future -import scala.concurrent.Promise -import scala.util.{Failure, Success} - import akka.actor.ActorSystem -import akka.http.scaladsl.Http -import akka.http.scaladsl.Http.HostConnectionPool -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ -import akka.http.scaladsl.marshalling._ import akka.http.scaladsl.model._ import akka.http.scaladsl.model.headers._ -import akka.http.scaladsl.unmarshalling._ -import akka.stream.ActorMaterializer -import akka.stream.OverflowStrategy -import akka.stream.QueueOfferResult import akka.stream.scaladsl._ import akka.util.ByteString + import spray.json._ +import spray.json.DefaultJsonProtocol._ + import whisk.common.Logging +import whisk.http.PoolingRestClient /** * This class only handles the basic communication to the proper endpoints @@ -50,35 +44,14 @@ import whisk.common.Logging */ class CouchDbRestClient(protocol: String, host: String, port: Int, username: String, password: String, db: String)( implicit system: ActorSystem, - logging: Logging) { - require(protocol == "http" || protocol == "https", "Protocol must be one of { http, https }.") - - private implicit val context = system.dispatcher - private implicit val materializer = ActorMaterializer() + logging: Logging) +extends PoolingRestClient(protocol, host, port, 16 * 1024) { - // Creates or retrieves a connection pool for the host. - private val pool = if (protocol == "http") { -Http().cachedHostConnectionPool[Promise[HttpResponse]](host = host, port = port) - } else { -Http().cachedHostConnectionPoolHttps[Promise[HttpResponse]](host = host, port = port) - } - - private val poolPromise = Promise[HostConnectionPool] + // Headers common to all requests. + val baseHeaders: List[HttpHeader] = +List(Authorization(BasicHttpCredentials(username, password)), Accept(MediaTypes.`application/json`)) - // Additional queue in case all connections are busy. Should hardly ever be - // filled in practice but can be useful, e.g., in tests starting many - // asynchronous requests in a very short period of time. - private val QUEUE_SIZE = 16 * 1024; - private val requestQueue = Source -.queue(QUEUE_SIZE, OverflowStrategy.dropNew) -.via(pool.mapMaterializedValue { x => - poolPromise.success(x); x -}) -.toMat(Sink.foreach({ - case ((Success(response), p)) => p.success(response) - case ((Failure(error), p))=> p.failure(error) -}))(Keep.left) -.run + def revHeader(forRev: String) = List(`If-Match`(EntityTagRange(EntityTag(forRev // Properly encodes the potential slashes in each segment. protected def uri(segments: Any*): Uri = { @@ -86,103 +59,30 @@ class CouchDbRestClient(protocol: String, host: String, port: Int,
[incubator-openwhisk-release] branch master updated: Add the license header to all the source code files (#50)
This is an automated email from the ASF dual-hosted git repository. mrutkowski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-release.git The following commit(s) were added to refs/heads/master by this push: new 8920e92 Add the license header to all the source code files (#50) 8920e92 is described below commit 8920e92b9e0830bc5a7458c433684f5f6c229f7e Author: Vincent AuthorDate: Tue Feb 27 14:10:11 2018 -0500 Add the license header to all the source code files (#50) --- .travis.yml | 17 + README.md | 18 ++ docs/general_spec.md| 18 ++ docs/package_artifacts.md | 18 ++ docs/pick_up_source_code.md | 18 ++ docs/prepare_release.md | 18 ++ docs/prerequisites.md | 18 ++ docs/publish_apache_directory.md| 18 ++ docs/push_stage_url.md | 18 ++ docs/sign_artifacts.md | 18 ++ docs/tutorial.md| 18 ++ docs/upload_public_key.md | 18 ++ docs/work_items.md | 18 ++ tools/checkout_svn.sh | 16 tools/clean_remote_release_artifacts.sh | 16 tools/clean_remote_stage_artifacts.sh | 16 tools/download_source_code.sh | 16 tools/generate_pgp_key.sh | 16 tools/install_dependencies.sh | 16 tools/load_config.sh| 16 tools/move_stage_to_release.sh | 16 tools/package_source_code.sh| 16 tools/sign_artifacts.sh | 16 tools/travis/cleanup.sh | 16 tools/travis/import_pgp_key.sh | 16 tools/travis/package_source_code.sh | 16 tools/travis/setup.sh | 16 tools/travis/verify_source_code.sh | 16 tools/upload_artifacts.sh | 16 tools/util.sh | 16 tools/verify_local_artifacts.sh | 16 tools/verify_remote_artifacts.sh| 16 tools/verify_source_code.sh | 16 33 files changed, 553 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2f095b8..0e2910d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,20 @@ +# +# 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. +# + sudo: required group: deprecated-2017Q3 diff --git a/README.md b/README.md index 6f53514..1496f8e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,21 @@ + + # OpenWhisk Graduate and Release Management [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![Build Status](https://travis-ci.org/apache/incubator-openwhisk-release.svg?branch=master)](https://travis-ci.org/apache/incubator-openwhisk-release) diff --git a/docs/general_spec.md b/docs/general_spec.md index 3a782ee..3802b42 100644 --- a/docs/general_spec.md +++ b/docs/general_spec.md @@ -1,3 +1,21 @@ + + # General plan to implement the Apache release process for OpenWhisk The purpose of this repository is to provide a one-stop entry tool to manage the release process of OpenWhisk in an automated diff --git a/docs/package_artifacts.md b/docs/package_artifacts.md index 61c8f02..61e06ab 100644 --- a/docs/package_artifacts.md +++ b/docs/package_artifacts.md @@ -1,3 +1,21 @@ + + # Making the release artifacts The artifacts to be made in this step consists of the source code packages, binary packages and docker image packages. diff --git a/docs/pick_up_source_code.md b/docs/pick_up_source_code.md index 47ee8b7..b362769 100644 --- a/docs/pick_up_source_code.md +++ b/docs/pick_up_source_code.md @@ -1,3 +1,21 @@ + + # Picking up sou
svn commit: r25317 - /dev/incubator/openwhisk/openwhisk-incubator-rc1/
Author: houshengbo Date: Tue Feb 27 19:12:19 2018 New Revision: 25317 Log: Staging Apache OpenWhisk release incubator-rc1. Modified: dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-apigateway-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-apigateway-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-apigateway-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-apigateway-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-catalog-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-catalog-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-catalog-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-catalog-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-cli-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-cli-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-cli-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-cli-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-client-go-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-client-go-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-client-go-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-client-go-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-docker-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-docker-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-docker-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-docker-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-java-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-java-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-java-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-java-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-nodejs-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-nodejs-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-nodejs-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-nodejs-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-php-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-php-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-php-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-php-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-python-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-python-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-python-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-python-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-swift-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-swift-incubator-rc1-sources.tar.gz.asc dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-swift-incubator-rc1-sources.tar.gz.md5 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-runtime-swift-incubator-rc1-sources.tar.gz.sha512 dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-wskdeploy-incubator-rc1-sources.tar.gz dev/incubator/openwhisk/openwhisk-incubator-rc1/openwhisk-wskdeploy-incubato
[incubator-openwhisk-cli] branch master updated (9509fc0 -> 473873d)
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git. from 9509fc0 Add the LICENSE file and NOTICE file new 61df3c7 Fetch action code only when needed new 5b25427 Update tests new e00d408 Bump client-go hash new 473873d Constants The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: build.gradle | 2 +- commands/action.go | 66 -- .../test/scala/system/basic/WskActionTests.scala | 2 - .../test/scala/system/basic/WskBasicTests.scala| 2 +- 4 files changed, 37 insertions(+), 35 deletions(-) -- To stop receiving notification emails like this one, please contact csantan...@apache.org.
[incubator-openwhisk-cli] 04/04: Constants
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git commit 473873d94f622ac34512e70ef25f5c50660a9257 Author: dubeejw AuthorDate: Mon Feb 26 18:28:03 2018 -0500 Constants --- commands/action.go | 56 -- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/commands/action.go b/commands/action.go index ce53379..f834a9f 100644 --- a/commands/action.go +++ b/commands/action.go @@ -35,27 +35,29 @@ import ( ) const ( - MEMORY_LIMIT = 256 - TIMEOUT_LIMIT= 6 - LOGSIZE_LIMIT= 10 - ACTIVATION_ID= "activationId" - WEB_EXPORT_ANNOT = "web-export" - RAW_HTTP_ANNOT = "raw-http" - FINAL_ANNOT = "final" - NODE_JS_EXT = ".js" - PYTHON_EXT = ".py" - JAVA_EXT = ".jar" - SWIFT_EXT= ".swift" - ZIP_EXT = ".zip" - PHP_EXT = ".php" - NODE_JS = "nodejs" - PYTHON = "python" - JAVA = "java" - SWIFT= "swift" - PHP = "php" - DEFAULT = "default" - BLACKBOX = "blackbox" - SEQUENCE = "sequence" + MEMORY_LIMIT = 256 + TIMEOUT_LIMIT = 6 + LOGSIZE_LIMIT = 10 + ACTIVATION_ID = "activationId" + WEB_EXPORT_ANNOT = "web-export" + RAW_HTTP_ANNOT= "raw-http" + FINAL_ANNOT = "final" + NODE_JS_EXT = ".js" + PYTHON_EXT= ".py" + JAVA_EXT = ".jar" + SWIFT_EXT = ".swift" + ZIP_EXT = ".zip" + PHP_EXT = ".php" + NODE_JS = "nodejs" + PYTHON= "python" + JAVA = "java" + SWIFT = "swift" + PHP = "php" + DEFAULT = "default" + BLACKBOX = "blackbox" + SEQUENCE = "sequence" + FETCH_CODE= true + DO_NOT_FETCH_CODE = false ) var actionCmd = &cobra.Command{ @@ -415,8 +417,8 @@ func parseAction(cmd *cobra.Command, args []string, update bool) (*whisk.Action, Client.Namespace = copiedQualifiedName.GetNamespace() - if existingAction, _, err = Client.Actions.Get(copiedQualifiedName.GetEntityName(), true); err != nil { - return nil, actionGetError(copiedQualifiedName.GetEntityName(), true, err) + if existingAction, _, err = Client.Actions.Get(copiedQualifiedName.GetEntityName(), FETCH_CODE); err != nil { + return nil, actionGetError(copiedQualifiedName.GetEntityName(), FETCH_CODE, err) } Client.Namespace = qualifiedName.GetNamespace() @@ -630,11 +632,11 @@ func webActionAnnotations( var err error if preserveAnnotations { - if action, _, err = Client.Actions.Get(entityName, false); err != nil { + if action, _, err = Client.Actions.Get(entityName, DO_NOT_FETCH_CODE); err != nil { whiskErr, isWhiskError := err.(*whisk.WskError) if (isWhiskError && whiskErr.ExitCode != whisk.EXIT_CODE_NOT_FOUND) || !isWhiskError { - return nil, actionGetError(entityName, false, err) + return nil, actionGetError(entityName, DO_NOT_FETCH_CODE, err) } } else { annotations = whisk.KeyValueArr.AppendKeyValueArr(annotations, action.Annotations) @@ -1018,10 +1020,10 @@ func isWebAction(client *whisk.Client, qname QualifiedName) error { client.Namespace = qname.GetNamespace() fullActionName := "/" + qname.GetNamespace() + "/" + qname.GetEntityName() - action, _, err := client.Actions.Get(qname.GetEntityName(), false) + action, _, err := client.Actions.Get(qname.GetEntityName(), DO_NOT_FETCH_CODE) if err != nil { - whisk.Debug(whisk.DbgError, "client.Actions.Get(%s, %t) error: %s\n", fullActionName, false, err) + whisk.Debug(whisk.DbgError, "client.Actions.Get(%s, %t) error: %s\n", fullActionName, DO_NOT_FETCH_CODE, err) whisk.Debug(whisk.DbgError, "Unable to obtain action '%s' for web action validation\n", fullActionName) errMsg := wski18n.T("Unable to get action '{{.name}}': {{.err}}", map[string]interface{}{"name": fullActionName, "err": err}) -- To stop receiving notification emails like this one, please contact csantan...@apache.org.
[incubator-openwhisk-cli] 01/04: Fetch action code only when needed
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git commit 61df3c7e2c6cf2b31c7c6f70657504375d7ffcb8 Author: dubeejw AuthorDate: Sat Dec 9 18:28:54 2017 -0500 Fetch action code only when needed --- commands/action.go | 406 +++-- 1 file changed, 204 insertions(+), 202 deletions(-) diff --git a/commands/action.go b/commands/action.go index 4d3be58..1dafc30 100644 --- a/commands/action.go +++ b/commands/action.go @@ -214,65 +214,67 @@ func handleInvocationResponse( } var actionGetCmd = &cobra.Command{ - Use: "get ACTION_NAME [FIELD_FILTER | --summary | --url]", - Short: wski18n.T("get action"), - SilenceUsage: true, - SilenceErrors: true, - PreRunE: SetupClientConfig, - RunE: func(cmd *cobra.Command, args []string) error { - var err error - var field string - var action *whisk.Action - var qualifiedName = new(QualifiedName) - - if whiskErr := CheckArgs(args, 1, 2, "Action get", wski18n.T("An action name is required.")); whiskErr != nil { - return whiskErr - } - - if !Flags.action.url && !Flags.common.summary && len(args) > 1 { - field = args[1] - - if !fieldExists(&whisk.Action{}, field) { - return invalidFieldFilterError(field) - } - } - - if qualifiedName, err = NewQualifiedName(args[0]); err != nil { - return NewQualifiedNameError(args[0], err) - } - - Client.Namespace = qualifiedName.GetNamespace() - - if action, _, err = Client.Actions.Get(qualifiedName.GetEntityName()); err != nil { - return actionGetError(qualifiedName.GetEntityName(), err) - } - - if Flags.action.url { - actionURL, err := action.ActionURL(Properties.APIHost, - DefaultOpenWhiskApiPath, - Properties.APIVersion, - qualifiedName.GetPackageName()) - if err != nil { - errStr := wski18n.T("Invalid host address '{{.host}}': {{.err}}", - map[string]interface{}{"host": Properties.APIHost, "err": err}) - werr := whisk.MakeWskError(errors.New(errStr), whisk.EXIT_CODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.NO_DISPLAY_USAGE) - return werr - } - printActionGetWithURL(qualifiedName.GetEntity(), actionURL) - } else if Flags.common.summary { - printSummary(action) - } else if cmd.LocalFlags().Changed(SAVE_AS_FLAG) || cmd.LocalFlags().Changed(SAVE_FLAG) { - return saveCode(*action, Flags.action.saveAs) - } else { - if len(field) > 0 { - printActionGetWithField(qualifiedName.GetEntityName(), field, action) - } else { - printActionGet(qualifiedName.GetEntityName(), action) - } - } - - return nil - }, +Use: "get ACTION_NAME [FIELD_FILTER | --summary | --url]", +Short: wski18n.T("get action"), +SilenceUsage: true, +SilenceErrors: true, +PreRunE: SetupClientConfig, +RunE: func(cmd *cobra.Command, args []string) error { +var err error +var field string +var action *whisk.Action +var qualifiedName = new(QualifiedName) +var fetchCode bool + +if whiskErr := CheckArgs(args, 1, 2, "Action get", wski18n.T("An action name is required.")); whiskErr != nil { +return whiskErr +} + +if !Flags.action.url && !Flags.common.summary && len(args) > 1 { +field = args[1] + +if !fieldExists(&whisk.Action{}, field) { +return invalidFieldFilterError(field) +} +} + +if qualifiedName, err = NewQualifiedName(args[0]); err != nil { +return NewQualifiedNameError(args[0], err) +} + +Client.Namespace = qualifiedName.GetNamespace() +fetchCode = cmd.LocalFlags().Changed(SAVE_AS_FLAG) || cmd.LocalFlags().Changed(SAVE_FLAG) + +if action, _, err = Client.Actions.Get(qualifiedName.GetEntityName(), fetchCode); err != nil { +return actionGetError(qualifiedName.GetEntityName(), fetchCode, err) +} + +if Flags.action.url { +actionURL, err := action.ActionURL(Propert
[incubator-openwhisk-cli] 03/04: Bump client-go hash
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git commit e00d4088efbe3e39a36980133db73732a35f13e3 Author: dubeejw AuthorDate: Fri Feb 23 15:26:34 2018 -0500 Bump client-go hash --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 29bedf2..c071673 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ dependencies { build(['name':'golang.org/x/sys/unix', 'version':'7f918dd405547ecb864d14a8ecbbfe205b5f930f', 'transitive':false]) build(['name':'gopkg.in/yaml.v2', 'version':'cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b', 'transitive':false]) build(['name':'github.com/ghodss/yaml', 'version':'0ca9ea5df5451ffdf184b4428c902747c2c11cd7', 'transitive':false]) - build(['name':'github.com/apache/incubator-openwhisk-client-go/whisk','version':'a0864455f7c18db70d93d4dd2bc0b43d2334ed90','transitive':false]) + build(['name':'github.com/apache/incubator-openwhisk-client-go/whisk','version':'72bf7128873a77d9973af0018a5ffad940b4691e','transitive':false]) // END - Imported from Godeps test name:'github.com/stretchr/testify', version:'b91bfb9ebec76498946beb6af7c0230c7cc7ba6c', transitive:false //, tag: 'v1.2.0' test name:'github.com/spf13/viper', version:'aafc9e6bc7b7bb53ddaa75a5ef49a17d6e654be5', transitive:false -- To stop receiving notification emails like this one, please contact csantan...@apache.org.
[incubator-openwhisk-cli] 02/04: Update tests
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git commit 5b25427c1b659fae7ae2e8525b47bb2d9b3ed353 Author: dubeejw AuthorDate: Wed Dec 20 01:27:45 2017 -0500 Update tests --- commands/action.go | 408 ++--- .../test/scala/system/basic/WskActionTests.scala | 2 - .../test/scala/system/basic/WskBasicTests.scala| 2 +- 3 files changed, 205 insertions(+), 207 deletions(-) diff --git a/commands/action.go b/commands/action.go index 1dafc30..ce53379 100644 --- a/commands/action.go +++ b/commands/action.go @@ -214,67 +214,67 @@ func handleInvocationResponse( } var actionGetCmd = &cobra.Command{ -Use: "get ACTION_NAME [FIELD_FILTER | --summary | --url]", -Short: wski18n.T("get action"), -SilenceUsage: true, -SilenceErrors: true, -PreRunE: SetupClientConfig, -RunE: func(cmd *cobra.Command, args []string) error { -var err error -var field string -var action *whisk.Action -var qualifiedName = new(QualifiedName) -var fetchCode bool - -if whiskErr := CheckArgs(args, 1, 2, "Action get", wski18n.T("An action name is required.")); whiskErr != nil { -return whiskErr -} - -if !Flags.action.url && !Flags.common.summary && len(args) > 1 { -field = args[1] - -if !fieldExists(&whisk.Action{}, field) { -return invalidFieldFilterError(field) -} -} - -if qualifiedName, err = NewQualifiedName(args[0]); err != nil { -return NewQualifiedNameError(args[0], err) -} - -Client.Namespace = qualifiedName.GetNamespace() -fetchCode = cmd.LocalFlags().Changed(SAVE_AS_FLAG) || cmd.LocalFlags().Changed(SAVE_FLAG) - -if action, _, err = Client.Actions.Get(qualifiedName.GetEntityName(), fetchCode); err != nil { -return actionGetError(qualifiedName.GetEntityName(), fetchCode, err) -} - -if Flags.action.url { -actionURL, err := action.ActionURL(Properties.APIHost, -DefaultOpenWhiskApiPath, -Properties.APIVersion, -qualifiedName.GetPackageName()) -if err != nil { -errStr := wski18n.T("Invalid host address '{{.host}}': {{.err}}", -map[string]interface{}{"host": Properties.APIHost, "err": err}) -werr := whisk.MakeWskError(errors.New(errStr), whisk.EXIT_CODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.NO_DISPLAY_USAGE) -return werr -} -printActionGetWithURL(qualifiedName.GetEntity(), actionURL) -} else if Flags.common.summary { -printSummary(action) -} else if cmd.LocalFlags().Changed(SAVE_AS_FLAG) || cmd.LocalFlags().Changed(SAVE_FLAG) { -return saveCode(*action, Flags.action.saveAs) -} else { -if len(field) > 0 { -printActionGetWithField(qualifiedName.GetEntityName(), field, action) -} else { -printActionGet(qualifiedName.GetEntityName(), action) -} -} - -return nil -}, + Use: "get ACTION_NAME [FIELD_FILTER | --summary | --url]", + Short: wski18n.T("get action"), + SilenceUsage: true, + SilenceErrors: true, + PreRunE: SetupClientConfig, + RunE: func(cmd *cobra.Command, args []string) error { + var err error + var field string + var action *whisk.Action + var qualifiedName = new(QualifiedName) + var fetchCode bool + + if whiskErr := CheckArgs(args, 1, 2, "Action get", wski18n.T("An action name is required.")); whiskErr != nil { + return whiskErr + } + + if !Flags.action.url && !Flags.common.summary && len(args) > 1 { + field = args[1] + + if !fieldExists(&whisk.Action{}, field) { + return invalidFieldFilterError(field) + } + } + + if qualifiedName, err = NewQualifiedName(args[0]); err != nil { + return NewQualifiedNameError(args[0], err) + } + + Client.Namespace = qualifiedName.GetNamespace() + fetchCode = cmd.LocalFlags().Changed(SAVE_AS_FLAG) || cmd.LocalFlags().Changed(SAVE_FLAG) + + if action, _, err = Client.Actions.Get(qualifiedName.GetEntityName(), fetchCode); err != nil { + return actionGetError(qualifiedName.GetEntityName(), fetchCode, err) + } + + if Flags.action.url { + actionURL, err := action.ActionURL(Prope
[incubator-openwhisk] branch master updated: Make SplunkLogStore tests more resilient. (#3326)
This is an automated email from the ASF dual-hosted git repository. rabbah pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git The following commit(s) were added to refs/heads/master by this push: new 61a6021 Make SplunkLogStore tests more resilient. (#3326) 61a6021 is described below commit 61a602146f2622e54224f531afd019835379de74 Author: Markus Thömmes AuthorDate: Tue Feb 27 21:17:19 2018 +0100 Make SplunkLogStore tests more resilient. (#3326) Timeouts of 1 second are a bit narrow and that narrowness is not necessary here. Bumped to 10 seconds. Also refactored some bit for a more density. --- .../logging/SplunkLogStoreTests.scala | 83 ++ 1 file changed, 23 insertions(+), 60 deletions(-) diff --git a/tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala b/tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala index 5c12579..60213dc 100644 --- a/tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala +++ b/tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala @@ -17,63 +17,31 @@ package whisk.core.containerpool.logging +import java.time.ZonedDateTime + 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.model.StatusCodes import akka.http.scaladsl.model.HttpMethods.POST +import akka.http.scaladsl.model._ import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.model.MediaTypes import akka.http.scaladsl.unmarshalling.Unmarshal -import akka.stream.ActorMaterializer -import akka.stream.StreamTcpException import akka.stream.scaladsl.Flow +import akka.stream.{ActorMaterializer, StreamTcpException} import akka.testkit.TestKit - import common.StreamLogging - -import java.time.ZonedDateTime - -import pureconfig.error.ConfigReaderException - import org.junit.runner.RunWith -import org.scalatest.Matchers -import org.scalatest.concurrent.PatienceConfiguration.Timeout +import org.scalatest.{FlatSpecLike, Matchers} import org.scalatest.concurrent.ScalaFutures import org.scalatest.junit.JUnitRunner -import org.scalatest.FlatSpecLike +import pureconfig.error.ConfigReaderException +import spray.json.{JsNumber, JsObject, _} +import whisk.core.entity._ +import whisk.core.entity.size._ -import scala.concurrent.Await -import scala.concurrent.Promise import scala.concurrent.duration._ -import scala.util.Success -import scala.util.Try -import scala.util.Failure - -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._ -import whisk.core.entity.AuthKey -import whisk.core.entity.Identity -import whisk.core.entity.ActivationLogs +import scala.concurrent.{Await, ExecutionContext, Future, Promise} +import scala.util.{Failure, Success, Try} @RunWith(classOf[JUnitRunner]) class SplunkLogStoreTests @@ -82,6 +50,9 @@ class SplunkLogStoreTests with Matchers with ScalaFutures with StreamLogging { + + def await[T](awaitable: Future[T], timeout: FiniteDuration = 10.seconds) = Await.result(awaitable, timeout) + val testConfig = SplunkLogStoreConfig( "splunk-host", 8080, @@ -90,7 +61,7 @@ class SplunkLogStoreTests "splunk-index", "log_message", "activation_id", -false) +disableSNI = false) behavior of "Splunk LogStore" @@ -115,8 +86,8 @@ class SplunkLogStoreTests 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() + implicit val ec: ExecutionContext = system.dispatcher + implicit val materializer: ActorMaterializer = ActorMaterializer() val testFlow: Flow[(HttpRequest, Promise[HttpResponse]), (Try[HttpResponse], Promise[HttpResponse]), NotUsed] = Flow[(HttpRequest, Promise[HttpResponse])] @@ -165,34 +136,26 @@ class SplunkLogStoreTests } it should "fail when loading out of box configs (because whisk.logstore.splunk doesn't exist)" in { -assertThrows[ConfigReaderException[_]] { - val splunkStore = new SplunkLogStore(system) -} - +
[incubator-openwhisk-cli] annotated tag latest updated (5cb5c5f -> f63c97d)
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a change to annotated tag latest in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git. *** WARNING: tag latest was modified! *** from 5cb5c5f (tag) to f63c97d (tag) tagging 473873d94f622ac34512e70ef25f5c50660a9257 (commit) replaces 1.0.0 by Travis CI on Tue Feb 27 20:31:58 2018 + - Log - Generated tag from Travis CI build 835 --- from 9509fc0 Add the LICENSE file and NOTICE file add 61df3c7 Fetch action code only when needed add 5b25427 Update tests add e00d408 Bump client-go hash add 473873d Constants No new revisions were added by this update. Summary of changes: build.gradle | 2 +- commands/action.go | 66 -- .../test/scala/system/basic/WskActionTests.scala | 2 - .../test/scala/system/basic/WskBasicTests.scala| 2 +- 4 files changed, 37 insertions(+), 35 deletions(-) -- To stop receiving notification emails like this one, please contact csantan...@apache.org.
[incubator-openwhisk-package-deploy] branch master updated: Defect for delete of preinstalled directory (#20)
This is an automated email from the ASF dual-hosted git repository. dubeejw pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-deploy.git The following commit(s) were added to refs/heads/master by this push: new 7e5bbea Defect for delete of preinstalled directory (#20) 7e5bbea is described below commit 7e5bbeaa0c2e01c2b3a0bf66550f4d97fd1774eb Author: Belinda Vennam AuthorDate: Tue Feb 27 14:45:39 2018 -0600 Defect for delete of preinstalled directory (#20) * defect for delete of preinstalled directory * updating deployweb * updating repo split for deployjs * code cleanup updates --- packages/actions/deploy.js | 71 + packages/actions/deployWeb.js | 65 ++ packages/actions/lib/common.js | 34 ++-- tests/src/test/scala/packages/DeployTests.scala | 6 +-- 4 files changed, 87 insertions(+), 89 deletions(-) diff --git a/packages/actions/deploy.js b/packages/actions/deploy.js index 1c82dcc..0561cdc 100644 --- a/packages/actions/deploy.js +++ b/packages/actions/deploy.js @@ -1,20 +1,17 @@ const fs = require('fs'); -const path = require('path'); -const exec = require('child_process').exec; const git = require('simple-git'); -const yaml = require('js-yaml'); const common = require('./lib/common'); -let command = ''; /** * Action to deploy openwhisk elements from a compliant repository * @param {string} gitUrl - github url containing the manifest and elements to deploy * @param {string} manifestPath - (optional) the path to the manifest file, e.g. "openwhisk/src" - * @param {object} envData - (optional) some specific details such as cloudant username or cloudant password + * @param {object} envData - (optional) env details such as cloudant username or cloudant password * @return {object} Promise */ function main(params) { + const activationId = process.env.__OW_ACTIVATION_ID; return new Promise((resolve, reject) => { // Grab optional envData and manifestPath params for wskdeploy let { @@ -25,9 +22,7 @@ function main(params) { // confirm gitUrl was provided as a parameter if (!gitUrl) { - reject({ -error: 'Please enter the GitHub repo url in params', - }); + reject(new Error('Please enter the GitHub repo url in params')); } // if no manifestPath was provided, use current directory @@ -38,40 +33,50 @@ function main(params) { const { wskApiHost, wskAuth } = getWskApiAuth(params); // Extract the name of the repo for the tmp directory -const repoSplit = params.gitUrl.split('/'); -const repoName = repoSplit[repoSplit.length - 1]; -const localDirName = `${__dirname}/../tmp/${repoName}`; -return git() -.clone(gitUrl, localDirName, ['--depth', '1'], (err, data) => { - if (err) { -reject('There was a problem cloning from github. Does that github repo exist? Does it begin with http?'); - } +const tmpUrl = gitUrl.replace('https://', ''); +const repoSplit = tmpUrl.split('/'); +const repoOrg = repoSplit[1]; +const repoName = repoSplit[2]; +const localDirName = `${__dirname}/../tmp/${repoOrg}/${repoName}`; +const templatesDirName = `${__dirname}/preInstalled/${repoOrg}/${repoName}`; + +if (fs.existsSync(templatesDirName)) { resolve({ -repoDir: localDirName, +repoDir: templatesDirName, +usingTemp: false, manifestPath, manifestFileName: 'manifest.yaml', wskAuth, wskApiHost, envData, }); -}); - }) - .then((result) => { -return common.main(result); - }) - .then((success) => { -return new Promise((resolve, reject) => { - resolve({ -status: 'success', -success: true, +} else { + return git().clone(gitUrl, localDirName, ['--depth', '1'], (err) => { +if (err) { + reject(new Error('There was a problem cloning from github. Does that github repo exist? Does it begin with http?')); +} +resolve({ + repoDir: localDirName, + usingTemp: true, + manifestPath, + manifestFileName: 'manifest.yaml', + wskAuth, + wskApiHost, + envData, +}); }); -}); - }) - .catch( -(err) => { - return ({error: err}); } - ); + }) +.then(result => common.main(result)) +.then(success => + new Promise((resolve, reject) => { +resolve({ + status: success, + activationId, + success: true, +}); + })) +.catch(err => ({ error: err.message, activationId })); } /** diff --git a/packages/actions/deployWeb.js b/packages/actions/deployWeb.js index 4865549..282a9ae 100644 --- a/packages/actions/deployWeb.js +++ b/packages/actions/deployWeb.js @@ -1,17 +1,12 @@ const fs
[incubator-openwhisk] branch master updated: Allow container tests to run without a proxy. (#3335)
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git The following commit(s) were added to refs/heads/master by this push: new 7218a48 Allow container tests to run without a proxy. (#3335) 7218a48 is described below commit 7218a48d94846c23a853ece185b845bb59d4a628 Author: rodric rabbah AuthorDate: Tue Feb 27 16:11:49 2018 -0500 Allow container tests to run without a proxy. (#3335) --- ansible/README.md | 17 - .../scala/actionContainers/ActionContainer.scala | 28 +++--- .../DockerExampleContainerTests.scala | 2 +- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/ansible/README.md b/ansible/README.md index 7651e63..b4accdd 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -42,23 +42,6 @@ An expedient workaround is to add alias for `docker0` network to loopback interf sudo ifconfig lo0 alias 172.17.0.1/24 ``` -# Setup proxy container to run unit tests (optional) - -This step is only required to run tests with Docker for Mac. -If you do not run tests locally, you can just skip this step. - -``` -docker run -d -p 3128:3128 style95/squid:3.5.26-p1 -``` - -You need to configure gradle proxy settings. - -**~/.gradle/gradle.properties** -``` -systemProp.http.proxyHost=localhost -systemProp.http.proxyPort=3128 -``` - ### Using Ansible **Caveat:** All Ansible commands are meant to be executed from the `ansible` directory. This is important because that's where `ansible.cfg` is located which contains generic settings that are needed for the remaining steps. diff --git a/tests/src/test/scala/actionContainers/ActionContainer.scala b/tests/src/test/scala/actionContainers/ActionContainer.scala index 94f6763..4f6ef24 100644 --- a/tests/src/test/scala/actionContainers/ActionContainer.scala +++ b/tests/src/test/scala/actionContainers/ActionContainer.scala @@ -135,19 +135,31 @@ object ActionContainer { case (k, v) => s"-e ${k}=${v}" } mkString (" ") -// We create the container... -val runOut = awaitDocker(s"run --name $name $envArgs -d $imageName", 10 seconds) -assert(runOut._1 == 0, "'docker run' did not exit with 0: " + runOut) +// We create the container... and find out its IP address... +def createContainer(portFwd: Option[Int] = None): Unit = { + val runOut = awaitDocker( +s"run ${portFwd.map(p => s"-p $p:8080").getOrElse("")} --name $name $envArgs -d $imageName", +10 seconds) + assert(runOut._1 == 0, "'docker run' did not exit with 0: " + runOut) +} // ...find out its IP address... -val ipOut = awaitDocker(s"""inspect --format '{{.NetworkSettings.IPAddress}}' $name""", 10 seconds) -assert(ipOut._1 == 0, "'docker inspect did not exit with 0") -val ip = ipOut._2.replaceAll("""[^0-9.]""", "") +val (ip, port) = if (WhiskProperties.getProperty("whisk.version.name") == "local") { + val p = 8988 // port must be available or docker run will fail + createContainer(Some(p)) + Thread.sleep(1500) // let container/server come up cleanly + ("localhost", p) +} else { // "mac" + createContainer() + val ipOut = awaitDocker(s"""inspect --format '{{.NetworkSettings.IPAddress}}' $name""", 10 seconds) + assert(ipOut._1 == 0, "'docker inspect did not exit with 0") + (ipOut._2.replaceAll("""[^0-9.]""", ""), 8080) +} // ...we create an instance of the mock container interface... val mock = new ActionContainer { - def init(value: JsValue) = syncPost(ip, 8080, "/init", value) - def run(value: JsValue) = syncPost(ip, 8080, "/run", value) + def init(value: JsValue) = syncPost(ip, port, "/init", value) + def run(value: JsValue) = syncPost(ip, port, "/run", value) } try { diff --git a/tests/src/test/scala/actionContainers/DockerExampleContainerTests.scala b/tests/src/test/scala/actionContainers/DockerExampleContainerTests.scala index 5fd85d3..c5bfdba 100644 --- a/tests/src/test/scala/actionContainers/DockerExampleContainerTests.scala +++ b/tests/src/test/scala/actionContainers/DockerExampleContainerTests.scala @@ -137,7 +137,7 @@ class DockerExampleContainerTests extends ActionProxyContainerTestUtils with Wsk it should "timeout bad proxy with exception" in { val (out, err) = withContainer("badproxy") { c => - a[TimeoutException] should be thrownBy { + an[IllegalStateException] should be thrownBy { val (code, out) = c.init(JsObject()) println(code, out) } -- To stop receiving notification emails like this one, please contact csantan...@apache.org.
[incubator-openwhisk-cli] branch master updated: Support new trigger "rules" field (#227)
This is an automated email from the ASF dual-hosted git repository. dubeejw pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git The following commit(s) were added to refs/heads/master by this push: new c080279 Support new trigger "rules" field (#227) c080279 is described below commit c0802792e8047dd40bee6475a2dc9a9cdb0c4540 Author: Mark Deuser AuthorDate: Tue Feb 27 17:01:25 2018 -0500 Support new trigger "rules" field (#227) * validate the new trigger "rules" field * Bump client-go commit to pick up it's trigger "rules" support --- build.gradle | 2 +- .../test/scala/system/basic/WskBasicTests.scala| 39 ++ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index c071673..c596134 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ dependencies { build(['name':'golang.org/x/sys/unix', 'version':'7f918dd405547ecb864d14a8ecbbfe205b5f930f', 'transitive':false]) build(['name':'gopkg.in/yaml.v2', 'version':'cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b', 'transitive':false]) build(['name':'github.com/ghodss/yaml', 'version':'0ca9ea5df5451ffdf184b4428c902747c2c11cd7', 'transitive':false]) - build(['name':'github.com/apache/incubator-openwhisk-client-go/whisk','version':'72bf7128873a77d9973af0018a5ffad940b4691e','transitive':false]) + build(['name':'github.com/apache/incubator-openwhisk-client-go/whisk','version':'025300c38d0b790d161d3776d84e1da340e2b202','transitive':false]) // END - Imported from Godeps test name:'github.com/stretchr/testify', version:'b91bfb9ebec76498946beb6af7c0230c7cc7ba6c', transitive:false //, tag: 'v1.2.0' test name:'github.com/spf13/viper', version:'aafc9e6bc7b7bb53ddaa75a5ef49a17d6e654be5', transitive:false diff --git a/tests/src/test/scala/system/basic/WskBasicTests.scala b/tests/src/test/scala/system/basic/WskBasicTests.scala index bfcdcf5..04ad24d 100644 --- a/tests/src/test/scala/system/basic/WskBasicTests.scala +++ b/tests/src/test/scala/system/basic/WskBasicTests.scala @@ -498,8 +498,7 @@ class WskBasicTests extends TestHelpers with WskTestHelpers { ns + "/" + ruleName -> JsObject( "action" -> JsObject("name" -> JsString(actionName), "path" -> JsString(ns)), "status" -> JsString("active"))) - -// getJSONFromResponse(trigger.stdout, true).fields("rules") shouldBe expectedRules +getJSONFromResponse(trigger.stdout, true).fields("rules") shouldBe expectedRules val dynamicParams = Map("t" -> "T".toJson) val run = wsk.trigger.fire(triggerName, dynamicParams) @@ -596,31 +595,45 @@ class WskBasicTests extends TestHelpers with WskTestHelpers { } it should "create a trigger, and get its individual fields" in withAssetCleaner(wskprops) { -val name = "triggerFields" +val triggerName = "triggerFields" +val ruleName = "triggerFieldsRules" +val actionName = "triggerFieldsAction" val paramInput = Map("payload" -> "test".toJson) -val successMsg = s"ok: got trigger $name, displaying field" +val successMsg = s"ok: got trigger $triggerName, displaying field" (wp, assetHelper) => - assetHelper.withCleaner(wsk.trigger, name) { (trigger, _) => + assetHelper.withCleaner(wsk.trigger, triggerName) { (trigger, name) => trigger.create(name, parameters = paramInput) } + assetHelper.withCleaner(wsk.action, actionName) { (action, name) => +action.create(name, defaultAction) + } + assetHelper.withCleaner(wsk.rule, ruleName) { (rule, name) => +rule.create(name, trigger = triggerName, action = actionName) + } val expectedParam = JsObject("payload" -> JsString("test")) val ns = wsk.namespace.whois() wsk.trigger -.get(name, fieldFilter = Some("namespace")) +.get(triggerName, fieldFilter = Some("namespace")) .stdout should include regex (s"""(?i)$successMsg namespace\n"$ns) - wsk.trigger.get(name, fieldFilter = Some("name")).stdout should include(s"""$successMsg name\n"$name) - wsk.trigger.get(name, fieldFilter = Some("version")).stdout should include(s"""$successMsg version\n"0.0.1) - wsk.trigger.get(name, fieldFilter = Some("publish")).stdout should include(s"""$successMsg publish\nfalse""") - wsk.trigger.get(name, fieldFilter = Some("annotations")).stdout should include(s"""$successMsg annotations\n[]""") + wsk.trigger.get(triggerName, fieldFilter = Some("name")).stdout should include(s"""$successMsg name\n"$triggerName) + wsk.trigger.get(triggerName, fieldFilter = Some("version")).stdout should include(s"""$successMsg version\n"0.0.1) + wsk.trigger.get(triggerName, fieldFilter = Some("publish")).stdout should include(s"""$successMsg publish\nfalse""") + wsk.trigger.ge
[incubator-openwhisk-cli] annotated tag latest updated (f63c97d -> 36a43e1)
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a change to annotated tag latest in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git. *** WARNING: tag latest was modified! *** from f63c97d (tag) to 36a43e1 (tag) tagging c0802792e8047dd40bee6475a2dc9a9cdb0c4540 (commit) replaces 1.0.0 by Travis CI on Tue Feb 27 22:35:48 2018 + - Log - Generated tag from Travis CI build 838 --- from 473873d Constants add c080279 Support new trigger "rules" field (#227) No new revisions were added by this update. Summary of changes: build.gradle | 2 +- .../test/scala/system/basic/WskBasicTests.scala| 39 ++ 2 files changed, 27 insertions(+), 14 deletions(-) -- To stop receiving notification emails like this one, please contact csantan...@apache.org.
[incubator-openwhisk-devtools] branch master updated: Add information on some env variables to README (#101)
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-devtools.git The following commit(s) were added to refs/heads/master by this push: new e054c51 Add information on some env variables to README (#101) e054c51 is described below commit e054c51631deaf795149d03c45945a62e2adf063 Author: Rob Allen AuthorDate: Tue Feb 27 17:46:29 2018 -0500 Add information on some env variables to README (#101) --- docker-compose/README.md | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docker-compose/README.md b/docker-compose/README.md index 19d7af5..7d0d08d 100644 --- a/docker-compose/README.md +++ b/docker-compose/README.md @@ -40,10 +40,19 @@ At the end of the execution it prints the output of the function: } ``` -If `PROJECT_HOME` variable is set ( i.e. `PROJECT_HOME=/path/to/openwhisk make quick-start`) +If `OPENWHISK_PROJECT_HOME` variable is set ( i.e. `OPENWHISK_PROJECT_HOME=/path/to/openwhisk make quick-start`) then the command skips downloading the `master` branch and uses instead the source code found in the `PROJECT_HOME` folder. This is useful for working with a local clone, making changes to the code, and run it with `docker-compose`. +This is the set of environment variables that can be set: + +* `OPENWHISK_PROJECT_HOME` - a checkout of [openwhisk](https://github.com/apache/incubator-openwhisk) +* `OPENWHISK_CATALOG_HOME` - a checkout of [openwhisk-catalog](https://github.com/apache/incubator-openwhisk-catalog) +* `WSK_CLI` - the directory where the [`wsk` command line tool](https://github.com/apache/incubator-openwhisk-cli) can be found +* `DOCKER_IMAGE_PREFIX` - the prefix of the docker images used for actions. If you are building and testing checkouts of runtimes locally, then consider setting this to `whisk`. + +Note that these are all optional and only need to be set if you have a local checkout that you want to use. + ## Updating OpenWhisk Invoker or Controller To update the OpenWhisk Invoker or Controller without restarting everything, run: -- To stop receiving notification emails like this one, please contact csantan...@apache.org.
[incubator-openwhisk-wskdeploy] branch master updated: removing support for use-default flag (#759)
This is an automated email from the ASF dual-hosted git repository. mrutkowski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git The following commit(s) were added to refs/heads/master by this push: new 33a9616 removing support for use-default flag (#759) 33a9616 is described below commit 33a96160db5b873c394695d5c6c52cca051e39f5 Author: Priti Desai AuthorDate: Tue Feb 27 15:47:53 2018 -0800 removing support for use-default flag (#759) --- cmd/root.go | 5 - cmd/root_test.go | 6 - deployers/filesystemreader.go | 208 -- deployers/manifestreader.go | 22 +--- deployers/servicedeployer.go | 25 tests/src/integration/common/wskdeploy.go | 1 - utils/flags.go| 1 - 7 files changed, 5 insertions(+), 263 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 792a4b3..aeec488 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -124,7 +124,6 @@ func init() { RootCmd.Flags().StringVarP(&utils.Flags.DeploymentPath, "deployment", "d", "", wski18n.T(wski18n.ID_CMD_FLAG_DEPLOYMENT)) RootCmd.PersistentFlags().BoolVarP(&utils.Flags.Strict, "strict", "s", false, wski18n.T(wski18n.ID_CMD_FLAG_STRICT)) RootCmd.PersistentFlags().BoolVarP(&utils.Flags.UseInteractive, "allow-interactive", "i", false, wski18n.T(wski18n.ID_CMD_FLAG_INTERACTIVE)) - RootCmd.PersistentFlags().BoolVarP(&utils.Flags.UseDefaults, "allow-defaults", "a", false, wski18n.T(wski18n.ID_CMD_FLAG_DEFAULTS)) RootCmd.PersistentFlags().BoolVarP(&utils.Flags.Verbose, "verbose", "v", false, wski18n.T(wski18n.ID_CMD_FLAG_VERBOSE)) RootCmd.PersistentFlags().StringVarP(&utils.Flags.ApiHost, "apihost", "", "", wski18n.T(wski18n.ID_CMD_FLAG_API_HOST)) RootCmd.PersistentFlags().StringVarP(&utils.Flags.Namespace, "namespace", "n", "", wski18n.T(wski18n.ID_CMD_FLAG_NAMESPACE)) @@ -211,8 +210,6 @@ func Deploy() error { deployer.ProjectPath = projectPath deployer.ManifestPath = utils.Flags.ManifestPath deployer.DeploymentPath = utils.Flags.DeploymentPath - deployer.IsDefault = utils.Flags.UseDefaults - deployer.IsInteractive = utils.Flags.UseInteractive // master record of any dependency that has been downloaded @@ -314,9 +311,7 @@ func Undeploy() error { deployer.ProjectPath = utils.Flags.ProjectPath deployer.ManifestPath = utils.Flags.ManifestPath deployer.DeploymentPath = utils.Flags.DeploymentPath - deployer.IsInteractive = utils.Flags.UseInteractive - deployer.IsDefault = utils.Flags.UseDefaults clientConfig, error := deployers.NewWhiskConfig(utils.Flags.CfgFile, utils.Flags.DeploymentPath, utils.Flags.ManifestPath, deployer.IsInteractive) if error != nil { diff --git a/cmd/root_test.go b/cmd/root_test.go index 75c1469..c370e60 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -74,7 +74,6 @@ type Input struct { ProjectPathstring DeploymentPath string ManifestPath string - UseDefaultsbool UseInteractive bool } @@ -89,7 +88,6 @@ func initializeParameters() { expected_input.CfgFile = os.Getenv("GOPATH") + "/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/dat/wskprops" expected_input.Verbose = true - expected_input.UseDefaults = true expected_input.UseInteractive = true expected_input.ProjectPath = "fake_project_path" expected_input.DeploymentPath = "fake_deployment_path" @@ -105,7 +103,6 @@ func checkValidAuthInfo(t *testing.T, expected_auth_flags Auth_flags) { func checkValidInputInfo(t *testing.T, expected_input Input) { assert.Equal(t, expected_input.CfgFile, utils.Flags.CfgFile, "CfgFile does not match.") assert.Equal(t, expected_input.Verbose, utils.Flags.Verbose, "Verbose does not match.") - assert.Equal(t, expected_input.UseDefaults, utils.Flags.UseDefaults, "UseDefaults does not match.") assert.Equal(t, expected_input.UseInteractive, utils.Flags.UseInteractive, "ApiHoUseInteractivest does not match.") assert.Equal(t, expected_input.ProjectPath, utils.Flags.ProjectPath, "ProjectPath does not match.") assert.Equal(t, expected_input.DeploymentPath, utils.Flags.DeploymentPath, "DeploymentPath does not match.") @@ -138,9 +135,6 @@ func composeCommand(auth Auth_flags, input Input) string { if input.Verbose { cmd = cmd + "-v " } - if input.UseDefaults { - cmd = cmd + "-a " - } if input.UseInteractive { cmd = cmd + "-i " } diff --git a/deployers/filesystemreader.go b/deployers/filesystemreader.go deleted fil
[incubator-openwhisk-wskdeploy] annotated tag latest updated (bb30159 -> fd7a815)
This is an automated email from the ASF dual-hosted git repository. houshengbo pushed a change to annotated tag latest in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git. *** WARNING: tag latest was modified! *** from bb30159 (tag) to fd7a815 (tag) tagging 33a96160db5b873c394695d5c6c52cca051e39f5 (commit) replaces 0.9.0 by Travis CI on Tue Feb 27 23:55:03 2018 + - Log - Generated tag from Travis CI build 1717 --- from 2c03e05 Add the NOTICE for further development (#753) add 33a9616 removing support for use-default flag (#759) No new revisions were added by this update. Summary of changes: cmd/root.go | 5 - cmd/root_test.go | 6 - deployers/filesystemreader.go | 208 -- deployers/manifestreader.go | 22 +--- deployers/servicedeployer.go | 25 tests/src/integration/common/wskdeploy.go | 1 - utils/flags.go| 1 - 7 files changed, 5 insertions(+), 263 deletions(-) delete mode 100644 deployers/filesystemreader.go -- To stop receiving notification emails like this one, please contact houshen...@apache.org.
[incubator-openwhisk-wskdeploy] branch master updated: Adding support for default package (#754)
This is an automated email from the ASF dual-hosted git repository. mrutkowski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git The following commit(s) were added to refs/heads/master by this push: new fb07796 Adding support for default package (#754) fb07796 is described below commit fb07796d798d77eb5893b2f0722419a1123ef658 Author: Priti Desai AuthorDate: Tue Feb 27 16:45:07 2018 -0800 Adding support for default package (#754) * default package support - first draft * testing default package with api * adding default to alarm trigger * adding translable message * commenting API gateway test --- deployers/servicedeployer.go | 72 -- parsers/manifest_parser.go | 34 +-- tests/src/integration/alarmtrigger/deployment.yaml | 11 +++ tests/src/integration/alarmtrigger/manifest.yaml | 24 + tests/src/integration/common/wskdeploy.go | 4 + .../integration/defaultpackage/actions/hello.js| 25 + .../defaultpackage/defaultpackage_test.go | 47 + .../defaultpackage/manifest-with-project.yaml | 110 + tests/src/integration/defaultpackage/manifest.yaml | 108 wski18n/i18n_ids.go| 2 + wski18n/i18n_resources.go | 22 ++--- wski18n/resources/en_US.all.json | 4 + 12 files changed, 411 insertions(+), 52 deletions(-) diff --git a/deployers/servicedeployer.go b/deployers/servicedeployer.go index 579d038..7e96df2 100644 --- a/deployers/servicedeployer.go +++ b/deployers/servicedeployer.go @@ -90,11 +90,10 @@ type ServiceDeployer struct { ProjectPathstring DeploymentPath string // whether to deploy the action under the package - DeployActionInPackage bool - InteractiveChoice bool - ClientConfig *whisk.Config - DependencyMaster map[string]utils.DependencyRecord - ManagedAnnotation whisk.KeyValue + InteractiveChoice bool + ClientConfig *whisk.Config + DependencyMaster map[string]utils.DependencyRecord + ManagedAnnotation whisk.KeyValue } // NewServiceDeployer is a Factory to create a new ServiceDeployer @@ -102,7 +101,6 @@ func NewServiceDeployer() *ServiceDeployer { var dep ServiceDeployer dep.Deployment = NewDeploymentProject() dep.IsInteractive = true - dep.DeployActionInPackage = true dep.DependencyMaster = make(map[string]utils.DependencyRecord) return &dep @@ -678,9 +676,16 @@ func (deployer *ServiceDeployer) RefreshManagedPackages(ma map[string]interface{ func (deployer *ServiceDeployer) DeployPackages() error { for _, pack := range deployer.Deployment.Packages { - err := deployer.createPackage(pack.Package) - if err != nil { - return err + // "default" package is a reserved package name + // all openwhisk entities will be deployed under + // / instead of // and + // therefore skip creating a new package and set + // deployer.DeployActionInPackage to false which is set to true by default + if strings.ToLower(pack.Package.Name) != parsers.DEFAULT_PACKAGE { + err := deployer.createPackage(pack.Package) + if err != nil { + return err + } } } return nil @@ -892,15 +897,11 @@ func (deployer *ServiceDeployer) createRule(rule *whisk.Rule) error { displayPreprocessingInfo(parsers.YAML_KEY_RULE, rule.Name, true) // The rule's trigger should include the namespace with pattern /namespace/trigger - rule.Trigger = deployer.getQualifiedName(rule.Trigger.(string), deployer.ClientConfig.Namespace) - // The rule's action should include the namespace and package - // with pattern /namespace/package/action - // TODO(TBD): please refer https://github.com/openwhisk/openwhisk/issues/1577 - - // if it contains a slash, then the action is qualified by a package name - if strings.Contains(rule.Action.(string), "/") { - rule.Action = deployer.getQualifiedName(rule.Action.(string), deployer.ClientConfig.Namespace) - } + rule.Trigger = deployer.getQualifiedName(rule.Trigger.(string)) + // The rule's action should include the namespace and package with pattern + // /namespace/package/action if that action was created under a package + // otherwise action should include the namespace with pattern /namespace/action + rule.Action = deployer.getQualifiedName(rule.Action.(string)) var err error var response *http.Response @@ -920,7 +921
[incubator-openwhisk-wskdeploy] annotated tag latest updated (fd7a815 -> b17eacc)
This is an automated email from the ASF dual-hosted git repository. houshengbo pushed a change to annotated tag latest in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git. *** WARNING: tag latest was modified! *** from fd7a815 (tag) to b17eacc (tag) tagging fb07796d798d77eb5893b2f0722419a1123ef658 (commit) replaces 0.9.0 by Travis CI on Wed Feb 28 00:51:43 2018 + - Log - Generated tag from Travis CI build 1721 --- from 33a9616 removing support for use-default flag (#759) add fb07796 Adding support for default package (#754) No new revisions were added by this update. Summary of changes: deployers/servicedeployer.go | 72 -- parsers/manifest_parser.go | 34 +++--- tests/src/integration/alarmtrigger/deployment.yaml | 11 tests/src/integration/alarmtrigger/manifest.yaml | 24 tests/src/integration/common/wskdeploy.go | 4 ++ .../actions/hello.js | 1 - .../defaultpackage_test.go}| 18 -- .../manifest-with-project.yaml}| 61 ++ .../manifest.yaml | 68 ++-- wski18n/i18n_ids.go| 2 + wski18n/i18n_resources.go | 22 +++ wski18n/resources/en_US.all.json | 4 ++ 12 files changed, 208 insertions(+), 113 deletions(-) copy tests/src/integration/{validate-action-annotations => defaultpackage}/actions/hello.js (99%) copy tests/src/integration/{apigateway/apigateway_test.go => defaultpackage/defaultpackage_test.go} (67%) copy tests/src/integration/{managed-deployment/manifest.yaml => defaultpackage/manifest-with-project.yaml} (72%) copy tests/src/integration/{validate-action-annotations => defaultpackage}/manifest.yaml (65%) -- To stop receiving notification emails like this one, please contact houshen...@apache.org.
[incubator-openwhisk-catalog] branch master updated: Update CURL Tests (#259)
This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-catalog.git The following commit(s) were added to refs/heads/master by this push: new ee99391 Update CURL Tests (#259) ee99391 is described below commit ee993914e3fc039b2a524320914cb4803481fc46 Author: James Dubee AuthorDate: Tue Feb 27 20:37:31 2018 -0500 Update CURL Tests (#259) --- .../src/test/scala/packages/samples/CurlTest.scala | 29 -- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tests/src/test/scala/packages/samples/CurlTest.scala b/tests/src/test/scala/packages/samples/CurlTest.scala index eeb52f1..92b64ac 100644 --- a/tests/src/test/scala/packages/samples/CurlTest.scala +++ b/tests/src/test/scala/packages/samples/CurlTest.scala @@ -21,9 +21,12 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import common.{ TestHelpers, Wsk, WskProps, WskTestHelpers } + import spray.json._ import spray.json.DefaultJsonProtocol._ +import whisk.utils.retry + @RunWith(classOf[JUnitRunner]) class CurlTest extends TestHelpers with WskTestHelpers { implicit val wskprops = WskProps() @@ -34,17 +37,27 @@ class CurlTest extends TestHelpers with WskTestHelpers { it should "Return Could not resolve host when sending no parameter" in { val expectedError = "Could not resolve host" -val run = wsk.action.invoke(greetingAction, Map()) -withActivation(wsk.activation, run) { -_.response.result.get.toString should include(expectedError) -} + +retry( +{ +val run = wsk.action.invoke(greetingAction, Map()) +withActivation(wsk.activation, run) { +_.response.result.get.toString should include(expectedError) +} +}) } it should "Return the web content when sending the public google as the payload" in { val expectedBody = "" -val run = wsk.action.invoke(greetingAction, Map("payload" -> "google.com".toJson)) -withActivation(wsk.activation, run) { -_.response.result.get.toString should include(expectedBody) -} +val host = "google.com" + +retry( +{ +val run = wsk.action.invoke(greetingAction, Map("payload" -> host.toJson)) +withActivation(wsk.activation, run) { +_.response.result.get.toString should include(expectedBody) +} +} +) } } -- To stop receiving notification emails like this one, please contact csantan...@apache.org.