[incubator-openwhisk-cli] branch master updated: allow api context override (#367)
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 e01606d allow api context override (#367) e01606d is described below commit e01606d4b4b9b45fd72ae2cc8bbb37c0ae2b8597 Author: Mark Deuser AuthorDate: Tue Sep 18 16:56:47 2018 -0400 allow api context override (#367) * allow api context override --- commands/api.go | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/commands/api.go b/commands/api.go index c7b4157..41dd919 100644 --- a/commands/api.go +++ b/commands/api.go @@ -54,6 +54,9 @@ var apiCmd = { var fmtString = "%-30s %7s %20s %s\n" +// When set, this overrides the default authkey based api context id +var ContextId string + func IsValidApiVerb(verb string) (error, bool) { // Is the API verb valid? if _, ok := whisk.ApiVerbs[strings.ToUpper(verb)]; !ok { @@ -1025,19 +1028,24 @@ func getUserContextId() (string, error) { var guid string var err error - props, err := ReadProps(Properties.PropsFile) - if err == nil { - if len(props["AUTH"]) > 0 { - guid = strings.Split(props["AUTH"], ":")[0] + // If the context id override has been set, use it instead of the default + if len(ContextId) > 0 { + guid = ContextId + } else { + props, errprops := ReadProps(Properties.PropsFile) + if errprops == nil { + if len(props["AUTH"]) > 0 { + guid = strings.Split(props["AUTH"], ":")[0] + } else { + whisk.Debug(whisk.DbgError, "AUTH property not set in properties file: '%s'\n", Properties.PropsFile) + errStr := wski18n.T("Authorization key is not configured (--auth is required)") + err = whisk.MakeWskError(errors.New(errStr), whisk.EXIT_CODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.NO_DISPLAY_USAGE) + } } else { - whisk.Debug(whisk.DbgError, "AUTH property not set in properties file: '%s'\n", Properties.PropsFile) - errStr := wski18n.T("Authorization key is not configured (--auth is required)") + whisk.Debug(whisk.DbgError, "readProps(%s) failed: %s\n", Properties.PropsFile, err) + errStr := wski18n.T("Unable to obtain the auth key from the properties file: {{.err}}", map[string]interface{}{"err": err}) err = whisk.MakeWskError(errors.New(errStr), whisk.EXIT_CODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.NO_DISPLAY_USAGE) } - } else { - whisk.Debug(whisk.DbgError, "readProps(%s) failed: %s\n", Properties.PropsFile, err) - errStr := wski18n.T("Unable to obtain the auth key from the properties file: {{.err}}", map[string]interface{}{"err": err}) - err = whisk.MakeWskError(errors.New(errStr), whisk.EXIT_CODE_ERR_GENERAL, whisk.DISPLAY_MSG, whisk.NO_DISPLAY_USAGE) } return guid, err
[incubator-openwhisk-website] branch asf-site updated: Automatic Site Publish by Jenkins
This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-website.git The following commit(s) were added to refs/heads/asf-site by this push: new 51be42b Automatic Site Publish by Jenkins 51be42b is described below commit 51be42bd1fe4b77254527cc820ea9632f6ab6061 Author: jenkins AuthorDate: Tue Sep 18 19:54:10 2018 + Automatic Site Publish by Jenkins --- feed.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feed.xml b/feed.xml index 10cb84c..a05d1c8 100644 --- a/feed.xml +++ b/feed.xml @@ -1,2 +1,2 @@ -http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.3.0">Jekyll2018-09-18T19:53:21+00:00/feed.xmlApache OpenWhisk is a serverless, open source cloud platformAn open source platform for serverless, event-driven code at any [...] +http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.3.0">Jekyll2018-09-18T19:54:05+00:00/feed.xmlApache OpenWhisk is a serverless, open source cloud platformAn open source platform for serverless, event-driven code at any [...] \ No newline at end of file
[incubator-openwhisk-website] branch asf-site updated: Automatic Site Publish by Jenkins
This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-website.git The following commit(s) were added to refs/heads/asf-site by this push: new 4f63359 Automatic Site Publish by Jenkins 4f63359 is described below commit 4f63359e694814e1a7ff499ecd5d38c5ddff3e52 Author: jenkins AuthorDate: Tue Sep 18 19:53:26 2018 + Automatic Site Publish by Jenkins --- downloads.html | 48 +++- feed.xml | 2 +- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/downloads.html b/downloads.html index ee702c8..26eb2f7 100644 --- a/downloads.html +++ b/downloads.html @@ -304,7 +304,7 @@ function addListenersToSections() OpenWhisk Wskdeploy -OpenWhisk utility to configure OpenWhisk entities with a Manifest file written in YAML, ang deploy them in a single command. +OpenWhisk utility to configure OpenWhisk entities with a Manifest file written in YAML, and deploy them in a single command. https://www.apache.org/dyn/closer.lua?filename=incubator/openwhisk/apache-openwhisk-0.9.8-incubating/openwhisk-wskdeploy-0.9.8-incubating-sources.tar.gz=download;> @@ -324,6 +324,52 @@ function addListenersToSections() + + +OpenWhisk Catalog +Package catalogs of OpenWhisk, which provides an easy way to enhance your application with useful capabilities, and to access external services in the ecosystem. + + https://www.apache.org/dyn/closer.lua?filename=incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-catalog-0.9.0-incubating-sources.tar.gz=download;> +Source code + + + + https://www.apache.org/dist/incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-catalog-0.9.0-incubating-sources.tar.gz.sha512;> +SHA-512 checksum + + + + https://www.apache.org/dist/incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-catalog-0.9.0-incubating-sources.tar.gz.asc;> +PGP signature + + + + + +OpenWhisk Apigateway +A performant API Gateway based on Openresty and NGINX. + + https://www.apache.org/dyn/closer.lua?filename=incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-apigateway-0.9.0-incubating-sources.tar.gz=download;> +Source code + + + + https://www.apache.org/dist/incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-apigateway-0.9.0-incubating-sources.tar.gz.sha512;> +SHA-512 checksum + + + + https://www.apache.org/dist/incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-apigateway-0.9.0-incubating-sources.tar.gz.asc;> +PGP signature + + + diff --git a/feed.xml b/feed.xml index dff776f..10cb84c 100644 --- a/feed.xml +++ b/feed.xml @@ -1,2 +1,2 @@ -http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.3.0">Jekyll2018-09-18T17:18:15+00:00/feed.xmlApache OpenWhisk is a serverless, open source cloud platformAn open source platform for serverless, event-driven code at any [...] +http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.3.0">Jekyll2018-09-18T19:53:21+00:00/feed.xmlApache OpenWhisk is a serverless, open source cloud platformAn open source platform for serverless, event-driven code at any [...] \ No newline at end of file
[incubator-openwhisk-website] branch master updated: Add the download links for OpenWhisk catalog and apigateway 0.9.0-incubating (#338)
This is an automated email from the ASF dual-hosted git repository. houshengbo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-website.git The following commit(s) were added to refs/heads/master by this push: new 9697d30 Add the download links for OpenWhisk catalog and apigateway 0.9.0-incubating (#338) 9697d30 is described below commit 9697d309eaee1ac7aae1525f69b4829bcfb9e752 Author: Vincent AuthorDate: Tue Sep 18 15:51:23 2018 -0400 Add the download links for OpenWhisk catalog and apigateway 0.9.0-incubating (#338) --- _layouts/downloads.html | 48 +++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/_layouts/downloads.html b/_layouts/downloads.html index 2f957b2..26afd8c 100644 --- a/_layouts/downloads.html +++ b/_layouts/downloads.html @@ -146,7 +146,7 @@ layout: default OpenWhisk Wskdeploy -OpenWhisk utility to configure OpenWhisk entities with a Manifest file written in YAML, ang deploy them in a single command. +OpenWhisk utility to configure OpenWhisk entities with a Manifest file written in YAML, and deploy them in a single command. https://www.apache.org/dyn/closer.lua?filename=incubator/openwhisk/apache-openwhisk-0.9.8-incubating/openwhisk-wskdeploy-0.9.8-incubating-sources.tar.gz=download;> @@ -166,6 +166,52 @@ layout: default + + +OpenWhisk Catalog +Package catalogs of OpenWhisk, which provides an easy way to enhance your application with useful capabilities, and to access external services in the ecosystem. + + https://www.apache.org/dyn/closer.lua?filename=incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-catalog-0.9.0-incubating-sources.tar.gz=download;> +Source code + + + + https://www.apache.org/dist/incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-catalog-0.9.0-incubating-sources.tar.gz.sha512;> +SHA-512 checksum + + + + https://www.apache.org/dist/incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-catalog-0.9.0-incubating-sources.tar.gz.asc;> +PGP signature + + + + + +OpenWhisk Apigateway +A performant API Gateway based on Openresty and NGINX. + + https://www.apache.org/dyn/closer.lua?filename=incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-apigateway-0.9.0-incubating-sources.tar.gz=download;> +Source code + + + + https://www.apache.org/dist/incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-apigateway-0.9.0-incubating-sources.tar.gz.sha512;> +SHA-512 checksum + + + + https://www.apache.org/dist/incubator/openwhisk/apache-openwhisk-0.9.0-incubating/openwhisk-apigateway-0.9.0-incubating-sources.tar.gz.asc;> +PGP signature + + +
[incubator-openwhisk-package-kafka] tag 1.4.12 created (now 2dc039b)
This is an automated email from the ASF dual-hosted git repository. dubeejw pushed a change to tag 1.4.12 in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-kafka.git. at 2dc039b (commit) No new revisions were added by this update.
[incubator-openwhisk-package-kafka] branch master updated: Message Hub IAM Integration (#284)
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-kafka.git The following commit(s) were added to refs/heads/master by this push: new 2dc039b Message Hub IAM Integration (#284) 2dc039b is described below commit 2dc039bff25f662748abf2ef99efa409c29721fa Author: Adnan Baruni AuthorDate: Tue Sep 18 14:39:09 2018 -0500 Message Hub IAM Integration (#284) * add authHandler for managing iam token * ensure iam url is added to validated params in web action * validated params * updates to iam integration * package node_modules in web zip * remove logging import from auth handler --- .gitignore| 3 ++ action/kafkaFeedWeb.js| 19 --- action/lib/common.js | 11 ++-- action/messageHubFeed.js | 8 +++ action/messageHubFeedWeb.js | 34 +--- action/messageHubFeedWeb_package.json | 5 +- installCatalog.sh | 3 +- provider/authHandler.py | 99 +++ provider/consumer.py | 10 +++- 9 files changed, 170 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index bc22306..15822ad 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ launchConfigurations/ action/*.zip action/package.json tests/build +action/node_modules/ +action/package-lock.json +package-lock.json .idea/ out/ \ No newline at end of file diff --git a/action/kafkaFeedWeb.js b/action/kafkaFeedWeb.js index 7d1350b..2c8a386 100644 --- a/action/kafkaFeedWeb.js +++ b/action/kafkaFeedWeb.js @@ -30,7 +30,7 @@ function main(params) { // do these in parallel! return Promise.all([ db.ensureTriggerIsUnique(validatedParams.triggerName), -common.verifyTriggerAuth(validatedParams.triggerURL) +verifyTriggerAuth(validatedParams.triggerURL, params.authKey) ]); }) .then(() => { @@ -63,9 +63,9 @@ function main(params) { resolve(common.webResponse(statusCode, body)); }); } else if (params.__ow_method === "get") { -const triggerURL = common.getTriggerURL(params.authKey, params.endpoint, params.triggerName); +const triggerURL = common.getTriggerURL(params.endpoint, params.triggerName); -return common.verifyTriggerAuth(triggerURL) +return verifyTriggerAuth(triggerURL, params.authKey) .then(() => { db = new Database(params.DB_URL, params.DB_NAME); return db.getTrigger(params.triggerName); @@ -93,9 +93,9 @@ function main(params) { resolve(common.webResponse(500, error.toString())); }); } else if (params.__ow_method === "put") { -const triggerURL = common.getTriggerURL(params.authKey, params.endpoint, params.triggerName); +const triggerURL = common.getTriggerURL(params.endpoint, params.triggerName); -return common.verifyTriggerAuth(triggerURL) +return verifyTriggerAuth(triggerURL, params.authKey) .then(() => { db = new Database(params.DB_URL, params.DB_NAME); return db.getTrigger(params.triggerName); @@ -123,9 +123,9 @@ function main(params) { resolve(common.webResponse(statusCode, body)); }); } else if (params.__ow_method === "delete") { -const triggerURL = common.getTriggerURL(params.authKey, params.endpoint, params.triggerName); +const triggerURL = common.getTriggerURL(params.endpoint, params.triggerName); -return common.verifyTriggerAuth(triggerURL) +return verifyTriggerAuth(triggerURL, params.authKey) .then(() => { db = new Database(params.DB_URL, params.DB_NAME); return db.deleteTrigger(params.triggerName); @@ -178,4 +178,9 @@ function validateParameters(rawParams) { return promise; } +function verifyTriggerAuth(triggerURL, apiKey) { +var auth = apiKey.split(':'); +return common.verifyTriggerAuth(triggerURL, { user: auth[0], pass: auth[1] }); +} + exports.main = main; diff --git a/action/lib/common.js b/action/lib/common.js index a24f9b5..5220c90 100644 --- a/action/lib/common.js +++ b/action/lib/common.js @@ -9,19 +9,19 @@ function triggerComponents(triggerName) { }; } -function getTriggerURL(authKey, endpoint, triggerName) { +function getTriggerURL(endpoint, triggerName) { var massagedAPIHost = endpoint.replace(/https?:\/\/(.*)/, "$1"); var components = triggerComponents(triggerName); var
[incubator-openwhisk] branch master updated: Add User-Agent to list of allowed CORS headers. (#4010)
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 2b3f586 Add User-Agent to list of allowed CORS headers. (#4010) 2b3f586 is described below commit 2b3f586193ffcc081eb8df19219c80f48d2fa6e9 Author: Nick Mitchell AuthorDate: Tue Sep 18 13:18:27 2018 -0400 Add User-Agent to list of allowed CORS headers. (#4010) Fixes #4009 --- .../controller/src/main/scala/whisk/core/controller/RestAPIs.scala | 7 +-- .../src/main/scala/whisk/core/controller/WebActions.scala | 2 +- docs/rest_api.md | 2 +- docs/webactions.md | 2 +- tests/src/test/scala/services/HeadersTests.scala | 2 +- tests/src/test/scala/whisk/core/cli/test/WskWebActionsTests.scala | 2 +- .../test/scala/whisk/core/controller/test/WebActionsApiTests.scala | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala b/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala index 3f69c83..5199889 100644 --- a/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala +++ b/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala @@ -19,6 +19,7 @@ package whisk.core.controller import akka.actor.ActorSystem import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ +import akka.http.scaladsl.model.HttpMethods.{DELETE, GET, HEAD, POST, PUT} import akka.http.scaladsl.model.StatusCodes._ import akka.http.scaladsl.model.Uri import akka.http.scaladsl.model.headers._ @@ -150,8 +151,10 @@ protected[controller] object RestApiCommons { */ protected[controller] trait RespondWithHeaders extends Directives { val allowOrigin = `Access-Control-Allow-Origin`.* - val allowHeaders = `Access-Control-Allow-Headers`("Authorization", "Content-Type") - val sendCorsHeaders = respondWithHeaders(allowOrigin, allowHeaders) + val allowHeaders = `Access-Control-Allow-Headers`("*") + val allowMethods = +`Access-Control-Allow-Methods`(GET, DELETE, POST, PUT, HEAD) + val sendCorsHeaders = respondWithHeaders(allowOrigin, allowHeaders, allowMethods) } case class WhiskInformation(buildNo: String, date: String) diff --git a/core/controller/src/main/scala/whisk/core/controller/WebActions.scala b/core/controller/src/main/scala/whisk/core/controller/WebActions.scala index 6f52657..e03bdc8 100644 --- a/core/controller/src/main/scala/whisk/core/controller/WebActions.scala +++ b/core/controller/src/main/scala/whisk/core/controller/WebActions.scala @@ -383,7 +383,7 @@ trait WhiskWebActionsApi extends Directives with ValidateRequestSize with PostAc List(`Access-Control-Allow-Origin`.*, `Access-Control-Allow-Methods`(OPTIONS, GET, DELETE, POST, PUT, HEAD, PATCH)) private val defaultCorsWithAllowHeader = { -defaultCorsBaseResponse :+ `Access-Control-Allow-Headers`(`Authorization`.name, `Content-Type`.name) +defaultCorsBaseResponse :+ `Access-Control-Allow-Headers`("*") } private def defaultCorsResponse(headers: Seq[HttpHeader]): List[HttpHeader] = { diff --git a/docs/rest_api.md b/docs/rest_api.md index b6c04a2..28932be 100644 --- a/docs/rest_api.md +++ b/docs/rest_api.md @@ -82,7 +82,7 @@ curl -u USERNAME:PASSWORD https://openwhisk.ng.bluemix.net/api/v1/namespaces/whi In this example the authentication was passed using the `-u` flag, you can pass this value also as part of the URL as `https://$AUTH@{APIHOST}` -The OpenWhisk API supports request-response calls from web clients. OpenWhisk responds to `OPTIONS` requests with Cross-Origin Resource Sharing headers. Currently, all origins are allowed (that is, Access-Control-Allow-Origin is "`*`") and Access-Control-Allow-Headers yield Authorization and Content-Type. +The OpenWhisk API supports request-response calls from web clients. OpenWhisk responds to `OPTIONS` requests with Cross-Origin Resource Sharing headers. Currently, all origins are allowed (that is, Access-Control-Allow-Origin is "`*`"), the standard set of methods are allowed (that is, Access-Control-Allow-Methods is "`GET, DELETE, POST, PUT, HEAD`"), and Access-Control-Allow-Headers yields "`*`". **Attention:** Because OpenWhisk currently supports only one key per namespace, it is not recommended to use CORS beyond simple experiments. Use [Web Actions](webactions.md) or [API Gateway](apigateway.md) to expose your actions to the public and not use the OpenWhisk authorization key for client applications that require CORS. diff --git a/docs/webactions.md b/docs/webactions.md index 3e98fe0..547fcba 100644 --- a/docs/webactions.md +++ b/docs/webactions.md @@ -450,7 +450,7 @@ if it is present in the HTTP request. Otherwise, a
[incubator-openwhisk-website] branch asf-site updated: Automatic Site Publish by Jenkins
This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-website.git The following commit(s) were added to refs/heads/asf-site by this push: new 8197926 Automatic Site Publish by Jenkins 8197926 is described below commit 81979261f820ce79a19930d237ec9379cb66ad2f Author: jenkins AuthorDate: Tue Sep 18 17:18:19 2018 + Automatic Site Publish by Jenkins --- feed.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feed.xml b/feed.xml index d4f75f1..dff776f 100644 --- a/feed.xml +++ b/feed.xml @@ -1,2 +1,2 @@ -http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.3.0">Jekyll2018-09-18T17:17:35+00:00/feed.xmlApache OpenWhisk is a serverless, open source cloud platformAn open source platform for serverless, event-driven code at any [...] +http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.3.0">Jekyll2018-09-18T17:18:15+00:00/feed.xmlApache OpenWhisk is a serverless, open source cloud platformAn open source platform for serverless, event-driven code at any [...] \ No newline at end of file
[incubator-openwhisk-website] branch asf-site updated: Automatic Site Publish by Jenkins
This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-website.git The following commit(s) were added to refs/heads/asf-site by this push: new 2431a51 Automatic Site Publish by Jenkins 2431a51 is described below commit 2431a512767c05129e938a146466288f2cc6fea9 Author: jenkins AuthorDate: Tue Sep 18 17:17:39 2018 + Automatic Site Publish by Jenkins --- feed.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feed.xml b/feed.xml index 7bd34d0..d4f75f1 100644 --- a/feed.xml +++ b/feed.xml @@ -1,2 +1,2 @@ -http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.3.0">Jekyll2018-09-18T17:16:41+00:00/feed.xmlApache OpenWhisk is a serverless, open source cloud platformAn open source platform for serverless, event-driven code at any [...] +http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.3.0">Jekyll2018-09-18T17:17:35+00:00/feed.xmlApache OpenWhisk is a serverless, open source cloud platformAn open source platform for serverless, event-driven code at any [...] \ No newline at end of file
[incubator-openwhisk-website] branch asf-site updated: Automatic Site Publish by Jenkins
This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-website.git The following commit(s) were added to refs/heads/asf-site by this push: new 0e3c6ae Automatic Site Publish by Jenkins 0e3c6ae is described below commit 0e3c6ae1afb6d28d13eaf198b735931158b04a4c Author: jenkins AuthorDate: Tue Sep 18 17:16:46 2018 + Automatic Site Publish by Jenkins --- documentation.html | 155 + feed.xml | 2 +- index.html | 3 +- 3 files changed, 158 insertions(+), 2 deletions(-) diff --git a/documentation.html b/documentation.html index 2f77b2b..b00acef 100644 --- a/documentation.html +++ b/documentation.html @@ -241,6 +241,12 @@ function addListenersToSections() PHP Runtime Additional Resources +Ruby + +Creating and Invoking Action +Ruby Runtime +Additional Resources + + + + +OpenWhisk Runtime for Ruby + +OpenWhisk supports Ruby 2.5 runtime. +If you wish to learn more about Ruby runtime, please visit +https://github.com/apache/incubator-openwhisk-runtime-ruby/blob/master/README.md;>Ruby Runtime GitHub Repository. + + +Additional Resources + +Coming soon... + + + +
[incubator-openwhisk-website] branch master updated: Add Ruby to list of runtimes (#336)
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-website.git The following commit(s) were added to refs/heads/master by this push: new 92dee13 Add Ruby to list of runtimes (#336) 92dee13 is described below commit 92dee13ac2b0260272c7216617a14905f41bf621 Author: Justin Halsall AuthorDate: Tue Sep 18 13:14:42 2018 -0400 Add Ruby to list of runtimes (#336) * Add Ruby to list of runtimes * add ruby action documentation * mention Ruby on the homepage * Sentence tweak * Add more comments around the pending pull request --- _includes/code/hello.rb | 5 ++ _includes/code/manifest-for-helloRuby-1.yaml | 5 ++ _includes/code/manifest-for-helloRuby-2.yaml | 11 +++ _layouts/documentation.html | 108 +++ _layouts/home.html | 3 +- 5 files changed, 131 insertions(+), 1 deletion(-) diff --git a/_includes/code/hello.rb b/_includes/code/hello.rb new file mode 100644 index 000..c53d1e6 --- /dev/null +++ b/_includes/code/hello.rb @@ -0,0 +1,5 @@ +def main(params = {}) + name = params["name"] || "stranger" + greeting = "Hello #{name}!" + { "greeting": greeting } +end diff --git a/_includes/code/manifest-for-helloRuby-1.yaml b/_includes/code/manifest-for-helloRuby-1.yaml new file mode 100644 index 000..7f29ca2 --- /dev/null +++ b/_includes/code/manifest-for-helloRuby-1.yaml @@ -0,0 +1,5 @@ +packages: +default: +actions: +hello_ruby: +function: hello.rb diff --git a/_includes/code/manifest-for-helloRuby-2.yaml b/_includes/code/manifest-for-helloRuby-2.yaml new file mode 100644 index 000..97cfffc --- /dev/null +++ b/_includes/code/manifest-for-helloRuby-2.yaml @@ -0,0 +1,11 @@ +packages: +default: +actions: +hello_ruby: +code: | +def main(params = {}) + name = params["name"] || "stranger" + greeting = "Hello #{name}!" + { "greeting": greeting } +end +runtime: ruby:2.5 diff --git a/_layouts/documentation.html b/_layouts/documentation.html index f31ff68..7afb146 100644 --- a/_layouts/documentation.html +++ b/_layouts/documentation.html @@ -83,6 +83,12 @@ layout: default PHP Runtime Additional Resources +Ruby + +Creating and Invoking Action +Ruby Runtime +Additional Resources + + + + +OpenWhisk Runtime for Ruby + +OpenWhisk supports Ruby 2.5 runtime. +If you wish to learn more about Ruby runtime, please visit +https://github.com/apache/incubator-openwhisk-runtime-ruby/blob/master/README.md;>Ruby Runtime GitHub Repository. + + +Additional Resources + +Coming soon... + + + +
[incubator-openwhisk-catalog] annotated tag 0.9.0-incubating updated (5c4f2a8 -> 0b86511)
This is an automated email from the ASF dual-hosted git repository. houshengbo pushed a change to annotated tag 0.9.0-incubating in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-catalog.git. *** WARNING: tag 0.9.0-incubating was modified! *** from 5c4f2a8 (commit) to 0b86511 (tag) tagging 5c4f2a86218a90fc2d27e8587b94f96de36903a7 (commit) by Vincent Hou on Tue Sep 18 10:29:29 2018 -0400 - Log - Release OpenWhisk Catalog 0.9.0-incubating under Apache. --- No new revisions were added by this update. Summary of changes:
[incubator-openwhisk-catalog] branch 0.9.0-incubating created (now 5c4f2a8)
This is an automated email from the ASF dual-hosted git repository. houshengbo pushed a change to branch 0.9.0-incubating in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-catalog.git. at 5c4f2a8 Revert the copyright to the content in the template No new revisions were added by this update.
[incubator-openwhisk-apigateway] annotated tag 0.9.0-incubating updated (eb22ac6 -> 1bf32c7)
This is an automated email from the ASF dual-hosted git repository. houshengbo pushed a change to annotated tag 0.9.0-incubating in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-apigateway.git. *** WARNING: tag 0.9.0-incubating was modified! *** from eb22ac6 (commit) to 1bf32c7 (tag) tagging eb22ac6258ea8561551aeb02982215ded167ea70 (commit) by Vincent Hou on Tue Sep 18 10:25:17 2018 -0400 - Log - Release OpenWhisk Apigateway 0.9.0-incubating under Apache. --- No new revisions were added by this update. Summary of changes:
[incubator-openwhisk-release] annotated tag 0.9.0-catalog-apigateway updated (23d6c05 -> 41b22ee)
This is an automated email from the ASF dual-hosted git repository. houshengbo pushed a change to annotated tag 0.9.0-catalog-apigateway in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-release.git. *** WARNING: tag 0.9.0-catalog-apigateway was modified! *** from 23d6c05 (commit) to 41b22ee (tag) tagging 23d6c0546afc8cd25d54c685c3e5f2a8ac776fe9 (commit) replaces 0.9.8-incubating-wskdeploy by Vincent Hou on Tue Sep 18 10:15:41 2018 -0400 - Log - Release the OpenWhisk Catalog and Apigateway 0.9.0-incubating under Apache. --- No new revisions were added by this update. Summary of changes:
[incubator-openwhisk] branch master updated (832e0c7 -> 084e5d3)
This is an automated email from the ASF dual-hosted git repository. markusthoemmes pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git. from 832e0c7 Add test to verify, that action with high memory usage can be invoked. (#4025) add 084e5d3 Fix limits command docs. (#4027) No new revisions were added by this update. Summary of changes: tools/admin/README-NEXT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[incubator-openwhisk] branch master updated: Add test to verify, that action with high memory usage can be invoked. (#4025)
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 832e0c7 Add test to verify, that action with high memory usage can be invoked. (#4025) 832e0c7 is described below commit 832e0c7455acf58c6a5d443e98dadbdba126decf Author: Christian Bickel AuthorDate: Tue Sep 18 15:23:09 2018 +0200 Add test to verify, that action with high memory usage can be invoked. (#4025) --- .../test/scala/whisk/core/limits/ActionLimitsTests.scala | 16 1 file changed, 16 insertions(+) diff --git a/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala b/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala index f2a759b..78fe0ba 100644 --- a/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala +++ b/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala @@ -399,6 +399,22 @@ class ActionLimitsTests extends TestHelpers with WskTestHelpers with WskActorSys } } + it should "be able to run a memory intensive actions" in withAssetCleaner(wskprops) { (wp, assetHelper) => +val name = "TestNodeJsInvokeHighMemory" +val allowedMemory = MemoryLimit.maxMemory +assetHelper.withCleaner(wsk.action, name, confirmDelete = true) { + val actionName = TestUtils.getTestActionFilename("memoryWithGC.js") + (action, _) => +action.create(name, Some(actionName), memory = Some(allowedMemory)) +} +// Don't try to allocate all the memory on invoking the action, as the maximum memory is set for the whole container +// and not only for the user action. +val run = wsk.action.invoke(name, Map("payload" -> (allowedMemory.toMB - 56).toJson)) +withActivation(wsk.activation, run) { response => + response.response.status shouldBe "success" +} + } + it should "be aborted when exceeding its memory limits" in withAssetCleaner(wskprops) { (wp, assetHelper) => val name = "TestNodeJsMemoryExceeding" assetHelper.withCleaner(wsk.action, name, confirmDelete = true) {
[incubator-openwhisk] branch master updated: Enable running basic system tests without requiring whisk.properties. (#4004)
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 b00a3be Enable running basic system tests without requiring whisk.properties. (#4004) b00a3be is described below commit b00a3be2b62743a74773c86fb3b14fa7184fce58 Author: Chetan Mehrotra AuthorDate: Tue Sep 18 18:31:19 2018 +0530 Enable running basic system tests without requiring whisk.properties. (#4004) --- .travis.yml| 7 ++- tests/README.md| 14 + tests/build.gradle | 23 ++-- tests/src/test/scala/common/WhiskProperties.java | 62 +++--- tests/src/test/scala/common/WskOperations.scala| 2 +- .../scala/system/basic/WskConductorTests.scala | 3 +- tests/src/test/scala/system/rest/RestUtil.scala| 32 +++ 7 files changed, 114 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index b9056cd..5f06f6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,11 +68,11 @@ jobs: - script: - ./tools/travis/runUnitTests.sh - ./tools/travis/checkAndUploadLogs.sh unit db - env: DESCRIPTION="Unit Tests" + name: "Unit Tests" - script: - ./tools/travis/runSystemTests.sh - ./tools/travis/checkAndUploadLogs.sh system - env: DESCRIPTION="System Tests" + name: "System Tests" - script: - ./tests/performance/preparation/deploy.sh - TERM=dumb ./tests/performance/wrk_tests/latency.sh "https://172.17.0.1:10001; "$(cat ansible/files/auth.guest)" 2m @@ -82,5 +82,4 @@ jobs: - OPENWHISK_HOST="172.17.0.1" API_KEY="$(cat ansible/files/auth.guest)" CONNECTIONS="100" REQUESTS_PER_SEC="1" ./gradlew gatlingRun-BlockingInvokeOneActionSimulation # The following configuration does not make much sense. But we do not have enough users. But it's good to verify, that the test is still working. - OPENWHISK_HOST="172.17.0.1" USERS="1" REQUESTS_PER_SEC="1" ./gradlew gatlingRun-ColdBlockingInvokeSimulation - env: -- DESCRIPTION="Execute wrk-performance test suite." + name: "Performance Tests" diff --git a/tests/README.md b/tests/README.md index e2c37eb..a6fbb91 100644 --- a/tests/README.md +++ b/tests/README.md @@ -34,3 +34,17 @@ To just run the unit tests $ ansible-playbook -i ansible/environments/local ansible/properties.yml $ ./gradlew tests:testUnit + +## Running System Basic Tests + +To just run system basic test against an existing running setup you can pass on the server details and auth via system properties + +$ ./gradlew :tests:testSystemBasic -Dwhisk.auth="23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP" -Dwhisk.server=https://localhost -Dopenwhisk.home=`pwd` + +Here + +* `whisk.auth` - Auth key for a test user account. For a setup using default credentials it can be `guest` key. (env `WHISK_AUTH`) +* `whisk.server` - Edge Host Url of the OpenWhisk setup. (env `WHISK_SERVER`) +* `opnewhisk.home` - Base directory of your OpenWhisk source tree. (env `OPENWHISK_HOME`) + +If required you can relax the SSL check by passing `-Dwhisk.ssl.relax=true`. All these properties can also be provided via env variables. diff --git a/tests/build.gradle b/tests/build.gradle index 15dd333..4be83ca 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -83,6 +83,11 @@ ext.testSets = [ ], "LEAN" : [ "excludes" : leanExcludes +], +"REQUIRE_SYSTEM_BASIC" : [ +"includes" : [ +"system/basic/**" +] ] ] @@ -117,6 +122,11 @@ task testLean(type: Test) { include getPattern(testSetName, "includes") } +task testSystemBasic(type: Test) { +exclude getPattern("REQUIRE_SYSTEM_BASIC", "excludes") +include getPattern("REQUIRE_SYSTEM_BASIC", "includes") +} + task testUnit(type: Test) { systemProperty("whisk.spi.ArtifactStoreProvider", "whisk.core.database.memory.MemoryArtifactStoreProvider") exclude getPattern("REQUIRE_ONLY_DB", "excludes") @@ -177,11 +187,14 @@ task deleteKeystore(type: Delete) { } task createKeystore(dependsOn: deleteKeystore) { doLast { -Properties props = new Properties() -props.load(new FileInputStream(file('../whisk.properties'))) -keystorePath.parentFile.mkdirs() -def cmd = ['keytool', '-import', '-alias', 'Whisk', '-noprompt', '-trustcacerts', '-file', file(props['whisk.ssl.cert']), '-keystore', keystorePath, '-storepass', 'openwhisk'] -cmd.execute().waitForProcessOutput(System.out, System.err) +def propsFile = file('../whisk.properties') +if (propsFile.exists()) { +Properties props = new Properties() +props.load(new
[incubator-openwhisk] branch master updated: Docs fixes for action invocations. (#3951)
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 392afb2 Docs fixes for action invocations. (#3951) 392afb2 is described below commit 392afb27b30c249255fa210581a3f4aa20c218e1 Author: Martin Gencur AuthorDate: Tue Sep 18 14:49:07 2018 +0200 Docs fixes for action invocations. (#3951) More accurate description of the behaviour: * after exceeding the limit Activation ID is not returned (it is the whole activation record or the error result * user can't check the result later, it is still an error * Application error now thrown in different cases * Differentiate actions time limit and blocking wait limit * Update the errors for timeout situations --- docs/actions.md | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/actions.md b/docs/actions.md index 9954911..6580687 100644 --- a/docs/actions.md +++ b/docs/actions.md @@ -214,12 +214,16 @@ ok: invoked /whisk.system/samples/greeting with id 5975c24de0114ef2b5c24de0118ef ### Blocking invocations and timeouts A blocking invocation request will _wait_ for the activation result to be available. The wait period -is the lesser of 60 seconds or the action's configured +is the lesser of 60 seconds (this is the default for blocking invocations) or the action's configured [time limit](reference.md#per-action-timeout-ms-default-60s). -The result of the activation is returned if it is available within the wait period. + +The result of the activation is returned if it is available within the blocking wait period. Otherwise, the activation continues processing in the system and an activation ID is returned so that one may check for the result later, as with non-blocking requests (see [here](#watching-action-output) for tips on monitoring activations). +When an action exceeds its configured time limit, the activation record will indicate this error. +See [understanding the activation record](#understanding-the-activation-record) for more details. + ### Understanding the activation record @@ -233,8 +237,12 @@ Each action invocation results in an activation record which contains the follow - `response`: A dictionary that defines the following keys - `status`: The activation result, which might be one of the following values: - *"success"*: the action invocation completed successfully. -- *"application error"*: the action invocation was successful, but the action returned an error value on purpose, for instance because a precondition on the arguments was not met. -- *"action developer error"*: the action was invoked, but it completed abnormally, for instance the action did not detect an exception, or a syntax error existed. +- *"application error"*: the action was invoked, but returned an error value on purpose, for instance because a precondition on the arguments was not met. +- *"action developer error"*: the action was invoked, but it completed abnormally, for instance the action did not detect an exception, or a syntax error existed. This status code is also returned under specific conditions such as: + - the action failed to initialize for any reason + - the action exceeded its time limit during the init or run phase + - the action specified a wrong docker container name + - the action did not properly implement the expected [runtime protocol](actions-new.md) - *"whisk internal error"*: the system was unable to invoke the action. - `success`: Is *true* if and only if the status is *"success"*. - `result`: A dictionary as a JSON object which contains the activation result. If the activation was successful, this contains the value that is returned by the action. If the activation was unsuccessful, `result` contains the `error` key, generally with an explanation of the failure. @@ -340,7 +348,7 @@ is skipped if an action is dispatched to a previously initialized container --- You can tell if an [invocation was a warm activation or a cold one requiring initialization](annotations.md#annotations-specific-to-activations) by inspecting the activation record. - An action runs for a bounded amount of time. This limit can be configured per action, and applies to both the -initialization and the execution separately. +initialization and the execution separately. If the action time limit is exceeded during the initialization or run phase, the activation's response status is _action developer error_. - Functions should follow best practices to reduce [vulnerabilities](security.md) by treating input as untrusted, and be aware of vulnerabilities they may inherit from third-party dependencies.
[incubator-openwhisk] branch master updated: Default invoker protocol to http. (#4026)
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 acf59c4 Default invoker protocol to http. (#4026) acf59c4 is described below commit acf59c411565b4c73409eaf3936b6a0748c296df Author: David Grove AuthorDate: Tue Sep 18 04:24:38 2018 -0400 Default invoker protocol to http. (#4026) 068bb26 made whisk.invoker.protocol a mandatory property, but failed to provide a default value for it. --- core/invoker/src/main/resources/application.conf | 4 1 file changed, 4 insertions(+) diff --git a/core/invoker/src/main/resources/application.conf b/core/invoker/src/main/resources/application.conf index 57989a8..d6f1a1d 100644 --- a/core/invoker/src/main/resources/application.conf +++ b/core/invoker/src/main/resources/application.conf @@ -84,4 +84,8 @@ whisk { tracing { component = "Invoker" } + + invoker { +protocol: http + } }
[incubator-openwhisk] branch master updated: Emit CosmosDB request usage metric. (#4023)
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 e0d562e Emit CosmosDB request usage metric. (#4023) e0d562e is described below commit e0d562e19fe22aed49236b7ba32f94b157d459d4 Author: Chetan Mehrotra AuthorDate: Tue Sep 18 13:52:55 2018 +0530 Emit CosmosDB request usage metric. (#4023) --- .../src/main/scala/whisk/common/Logging.scala | 10 +++ .../database/cosmosdb/CosmosDBArtifactStore.scala | 31 +++--- docs/metrics.md| 12 + 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/common/scala/src/main/scala/whisk/common/Logging.scala b/common/scala/src/main/scala/whisk/common/Logging.scala index 8149774..19642f9 100644 --- a/common/scala/src/main/scala/whisk/common/Logging.scala +++ b/common/scala/src/main/scala/whisk/common/Logging.scala @@ -182,8 +182,8 @@ case class LogMarkerToken(component: String, subAction: Option[String] = None, tags: Map[String, String] = Map.empty) { - override def toString = component + "_" + action + "_" + state - def toStringWithSubAction = + override val toString = component + "_" + action + "_" + state + val toStringWithSubAction = subAction.map(sa => component + "_" + action + "." + sa + "_" + state).getOrElse(toString) def asFinish = copy(state = LoggingMarkers.finish) @@ -212,14 +212,14 @@ object MetricEmitter { val metrics = Kamon.metrics - def emitCounterMetric(token: LogMarkerToken): Unit = { + def emitCounterMetric(token: LogMarkerToken, times: Long = 1): Unit = { if (TransactionId.metricsKamon) { if (TransactionId.metricsKamonTags) { metrics .counter(token.toString, token.tags) - .increment(1) + .increment(times) } else { -metrics.counter(token.toStringWithSubAction).increment(1) +metrics.counter(token.toStringWithSubAction).increment(times) } } } diff --git a/common/scala/src/main/scala/whisk/core/database/cosmosdb/CosmosDBArtifactStore.scala b/common/scala/src/main/scala/whisk/core/database/cosmosdb/CosmosDBArtifactStore.scala index 116995e..9292d17 100644 --- a/common/scala/src/main/scala/whisk/core/database/cosmosdb/CosmosDBArtifactStore.scala +++ b/common/scala/src/main/scala/whisk/core/database/cosmosdb/CosmosDBArtifactStore.scala @@ -28,7 +28,7 @@ import akka.util.{ByteString, ByteStringBuilder} import com.microsoft.azure.cosmosdb._ import com.microsoft.azure.cosmosdb.rx.AsyncDocumentClient import spray.json.{DefaultJsonProtocol, JsObject, JsString, JsValue, RootJsonFormat, _} -import whisk.common.{Logging, LoggingMarkers, TransactionId} +import whisk.common.{LogMarkerToken, Logging, LoggingMarkers, MetricEmitter, TransactionId} import whisk.core.database.StoreUtils.{checkDocHasRevision, deserialize, reportFailure} import whisk.core.database._ import whisk.core.database.cosmosdb.CosmosDBArtifactStoreProvider.DocumentClientRef @@ -67,6 +67,13 @@ class CosmosDBArtifactStore[DocumentAbstraction <: DocumentSerializer](protected private val _id = "_id" private val _rev = "_rev" + private val putToken = createToken("put", read = false) + private val delToken = createToken("del", read = false) + private val getToken = createToken("get") + private val queryToken = createToken("query") + private val countToken = createToken("count") + private val putAttachmentToken = createToken("putAttachment", read = false) + override protected[core] implicit val executionContext: ExecutionContext = system.dispatcher override protected[database] def put(d: DocumentAbstraction)(implicit transid: TransactionId): Future[DocInfo] = { @@ -88,6 +95,7 @@ class CosmosDBArtifactStore[DocumentAbstraction <: DocumentSerializer](protected .transform( { r => transid.finished(this, start, s"[PUT] '$collName' completed document: '$docinfoStr'") + collectMetrics(putToken, r.getRequestCharge) toDocInfo(r.getResource) }, { case e: DocumentClientException if isConflict(e) => @@ -106,8 +114,9 @@ class CosmosDBArtifactStore[DocumentAbstraction <: DocumentSerializer](protected .deleteDocument(selfLinkOf(doc.id), matchRevOption(doc)) .head() .transform( -{ _ => +{ r => transid.finished(this, start, s"[DEL] '$collName' completed document: '$doc'") + collectMetrics(delToken, r.getRequestCharge) true }, { case e: DocumentClientException if isNotFound(e) => @@ -139,6 +148,7 @@ class CosmosDBArtifactStore[DocumentAbstraction <: DocumentSerializer](protected { rr => val js = getResultToWhiskJsonDoc(rr.getResource)