[GitHub] codecov-io commented on issue #4094: increase default invoker memory available for user actions to 2GB
codecov-io commented on issue #4094: increase default invoker memory available for user actions to 2GB URL: https://github.com/apache/incubator-openwhisk/pull/4094#issuecomment-435261413 # [Codecov](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094?src=pr=h1) Report > Merging [#4094](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-openwhisk/commit/7668cc5ecad99de95ae246df52b47ac1947d13a0?src=pr=desc) will **decrease** coverage by `4.89%`. > The diff coverage is `n/a`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094/graphs/tree.svg?width=650=l0YmsiSAso=150=pr)](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094?src=pr=tree) ```diff @@Coverage Diff@@ ## master#4094 +/- ## = - Coverage 86.12% 81.22% -4.9% = Files 148 148 Lines7249 7249 Branches 445 445 = - Hits 6243 5888-355 - Misses 1006 1361+355 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094?src=pr=tree) | Coverage Δ | | |---|---|---| | [...core/database/cosmosdb/RxObservableImplicits.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvUnhPYnNlcnZhYmxlSW1wbGljaXRzLnNjYWxh) | `0% <0%> (-100%)` | :arrow_down: | | [...core/database/cosmosdb/CosmosDBArtifactStore.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJBcnRpZmFjdFN0b3JlLnNjYWxh) | `0% <0%> (-95.54%)` | :arrow_down: | | [...sk/core/database/cosmosdb/CosmosDBViewMapper.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJWaWV3TWFwcGVyLnNjYWxh) | `0% <0%> (-92.6%)` | :arrow_down: | | [...whisk/core/database/cosmosdb/CosmosDBSupport.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJTdXBwb3J0LnNjYWxh) | `0% <0%> (-83.34%)` | :arrow_down: | | [...abase/cosmosdb/CosmosDBArtifactStoreProvider.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJBcnRpZmFjdFN0b3JlUHJvdmlkZXIuc2NhbGE=) | `0% <0%> (-58.83%)` | :arrow_down: | | [...rc/main/scala/whisk/common/ForcibleSemaphore.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvbW1vbi9Gb3JjaWJsZVNlbWFwaG9yZS5zY2FsYQ==) | `88.46% <0%> (-7.7%)` | :arrow_down: | | [...la/whisk/core/database/cosmosdb/CosmosDBUtil.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJVdGlsLnNjYWxh) | `92% <0%> (-4%)` | :arrow_down: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094?src=pr=footer). Last update [7668cc5...9ac3134](https://codecov.io/gh/apache/incubator-openwhisk/pull/4094?src=pr=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr opened a new pull request #4094: increase default invoker memory available for user actions to 2GB
csantanapr opened a new pull request #4094: increase default invoker memory available for user actions to 2GB URL: https://github.com/apache/incubator-openwhisk/pull/4094 ## Description the performance test stage has being failing lately in travis, intermittently running locally with default setting the rps on many runs is always 1 request per second. increasing the memory I got around 7rps ``` OPENWHISK_HOST="172.17.0.1" USERS="1" REQUESTS_PER_SEC="1" ./gradlew gatlingRun-ColdBlockingInvokeSimulation ``` ## Related issue and scope - [ ] I opened an issue to propose and discuss this change (#) ## My changes affect the following components - [ ] API - [ ] Controller - [ ] Message Bus (e.g., Kafka) - [ ] Loadbalancer - [ ] Invoker - [ ] Intrinsic actions (e.g., sequences, conductors) - [ ] Data stores (e.g., CouchDB) - [ ] Tests - [ ] Deployment - [ ] CLI - [ ] General tooling - [ ] Documentation ## Types of changes - [ ] Bug fix (generally a non-breaking change which closes an issue). - [ ] Enhancement or new feature (adds new functionality). - [ ] Breaking change (a bug fix or enhancement which changes existing behavior). ## Checklist: - [ ] I signed an [Apache CLA](https://github.com/apache/incubator-openwhisk/blob/master/CONTRIBUTING.md). - [ ] I reviewed the [style guides](https://github.com/apache/incubator-openwhisk/wiki/Contributing:-Git-guidelines#code-readiness) and followed the recommendations (Travis CI will check :). - [ ] I added tests to cover my changes. - [ ] My changes require further changes to the documentation. - [ ] I updated the documentation where necessary. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #4093: changes to include gloang runtime
rabbah commented on a change in pull request #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#discussion_r230253195 ## File path: docs/actions-go.md ## @@ -17,67 +17,185 @@ # --> -## Creating and invoking Go actions - -Using OpenWhisk [native actions](actions-docker.md#creating-native-actions), -you can package any executable as an action. This works for Go as an example. -As with [Docker actions](actions-docker.md), the Go executable receives a single argument -from the command line. -It is a string serialization of the JSON object representing the arguments to the action. -The program may log to `stdout` or `stderr`. -By convention, the last line of output _must_ be a stringified JSON object which represents -the result of the action. - -Here is an example Go action. + + +# Creating and Invoking Go Actions + +The runtime `actionloop-golang-v1.11` runtime can execute actions written in the Go programming language in OpenWhisk, either as precompiled binary or compiling sources on the fly. Review comment: Double “runtime” This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #4093: changes to include gloang runtime
rabbah commented on a change in pull request #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#discussion_r230254362 ## File path: docs/actions-go.md ## @@ -17,67 +17,185 @@ # --> -## Creating and invoking Go actions - -Using OpenWhisk [native actions](actions-docker.md#creating-native-actions), -you can package any executable as an action. This works for Go as an example. -As with [Docker actions](actions-docker.md), the Go executable receives a single argument -from the command line. -It is a string serialization of the JSON object representing the arguments to the action. -The program may log to `stdout` or `stderr`. -By convention, the last line of output _must_ be a stringified JSON object which represents -the result of the action. - -Here is an example Go action. + + +# Creating and Invoking Go Actions + +The runtime `actionloop-golang-v1.11` runtime can execute actions written in the Go programming language in OpenWhisk, either as precompiled binary or compiling sources on the fly. + +## Entry Point + +The source code of an action is one or more Go source file. The entry point of the action is a function, placed in the `main` package. The default name for the main function is `Main`, but you can change it to any name you want using the `--main` switch in `wsk`. The name is however always capitalized. The function must have a specific signature, as described next. + +*NOTE* The runtime does *not* support different packages from `main` for the entry point. If you specify `hello.main` the runtime will try to use `Hello.main`, that will be almost certainly incorrect. You can however have other packages in your sources, as described below. + +## Signature + +The expected signature for a `main` function is: + +`func Main(event map[string]interface{}) map[string]interface{}` + +So a very simple single file `hello.go` action would be: + ```go package main -import "encoding/json" -import "fmt" -import "os" +import "log" + +// Main is the function implementing the action +func Main(obj map[string]interface{}) map[string]interface{} { + // do your work + name, ok := obj["name"].(string) + if !ok { +name = "world" + } + msg := make(map[string]interface{}) + msg["message"] = "Hello, " + name + "!" + // log in stdout or in stderr + log.Printf("name=%s\n", name) + // encode the result back in json + return msg +} +``` -func main() { -//program receives one argument: the JSON object as a string -arg := os.Args[1] +You can deploy it with just: -// unmarshal the string to a JSON object -var obj map[string]interface{} -json.Unmarshal([]byte(arg), ) +``` +wsk action create hello-go hello.go +``` -// can optionally log to stdout (or stderr) -fmt.Println("hello Go action") +You can also have multiple source files in an action, packages and vendor folders. -name, ok := obj["name"].(string) -if !ok { name = "Stranger" } +## Deployment + +The runtime `actionloop-golang-v1.11` accepts: + +- executable binaries in Linux ELF executable compiled for the AMD64 architecture +- zip files containing a binary executable named `exec` at the top level, again a Linux ELF executable compiled for the AMD64 architecture +- a single file source code in Go language, that will be compiled +- a zip file not containing in the top level a binary file `exec`, it will be interpreted as a collection of zip files, and compiled + +## Using packages and vendor folder + +When you deploy a zip file, you can: + +- have all your functions in the `main` package +- have some functions placed in some packages, like `hello` +- have some third party dependencies you want to include in your sources + +If all your functions are in the main package, just place all your sources in the top level of your zip file. + +### Use a package folder + +If some functions belongs to a package, like `hello/`, you need to be careful with the layout of your sources, especially if you use editors like [VcCode](#vscode), and make. The layout recommended is the following: -// last line of stdout is the result JSON object as a string -msg := map[string]string{"msg": ("Hello, " + name + "!")} -res, _ := json.Marshal(msg) -fmt.Println(string(res)) -} ``` +golang-main-package/ +- Makefile +- src/ + - main.go + - main_test.go + - hello/ + - hello.go + - hello_test.go +``` + +For running tests, editing without errors with package resolution, you need to use a `src` folder, place the sources that belongs to the main package in the `src` and place sources of your package in the `src/hello` folder. + +You should import it your subpackage with `import "hello"`. +Note this means if you want to compile locally you have to set your `GOPATH` to parent directory of your `src` directory. If you use VSCode, you need to enable the `go.inferGopath` option. + +When you send the sources, you will
[GitHub] rabbah commented on a change in pull request #4093: changes to include gloang runtime
rabbah commented on a change in pull request #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#discussion_r230253540 ## File path: docs/actions-go.md ## @@ -17,67 +17,185 @@ # --> -## Creating and invoking Go actions - -Using OpenWhisk [native actions](actions-docker.md#creating-native-actions), -you can package any executable as an action. This works for Go as an example. -As with [Docker actions](actions-docker.md), the Go executable receives a single argument -from the command line. -It is a string serialization of the JSON object representing the arguments to the action. -The program may log to `stdout` or `stderr`. -By convention, the last line of output _must_ be a stringified JSON object which represents -the result of the action. - -Here is an example Go action. + + +# Creating and Invoking Go Actions + +The runtime `actionloop-golang-v1.11` runtime can execute actions written in the Go programming language in OpenWhisk, either as precompiled binary or compiling sources on the fly. + +## Entry Point + +The source code of an action is one or more Go source file. The entry point of the action is a function, placed in the `main` package. The default name for the main function is `Main`, but you can change it to any name you want using the `--main` switch in `wsk`. The name is however always capitalized. The function must have a specific signature, as described next. + +*NOTE* The runtime does *not* support different packages from `main` for the entry point. If you specify `hello.main` the runtime will try to use `Hello.main`, that will be almost certainly incorrect. You can however have other packages in your sources, as described below. + +## Signature + +The expected signature for a `main` function is: + +`func Main(event map[string]interface{}) map[string]interface{}` + +So a very simple single file `hello.go` action would be: + ```go package main -import "encoding/json" -import "fmt" -import "os" +import "log" + +// Main is the function implementing the action +func Main(obj map[string]interface{}) map[string]interface{} { + // do your work + name, ok := obj["name"].(string) + if !ok { +name = "world" + } + msg := make(map[string]interface{}) + msg["message"] = "Hello, " + name + "!" + // log in stdout or in stderr + log.Printf("name=%s\n", name) + // encode the result back in json + return msg +} +``` -func main() { -//program receives one argument: the JSON object as a string -arg := os.Args[1] +You can deploy it with just: -// unmarshal the string to a JSON object -var obj map[string]interface{} -json.Unmarshal([]byte(arg), ) +``` +wsk action create hello-go hello.go +``` -// can optionally log to stdout (or stderr) -fmt.Println("hello Go action") +You can also have multiple source files in an action, packages and vendor folders. -name, ok := obj["name"].(string) -if !ok { name = "Stranger" } +## Deployment + +The runtime `actionloop-golang-v1.11` accepts: + +- executable binaries in Linux ELF executable compiled for the AMD64 architecture +- zip files containing a binary executable named `exec` at the top level, again a Linux ELF executable compiled for the AMD64 architecture +- a single file source code in Go language, that will be compiled Review comment: A single source file in Go, that will be compiled This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #4093: changes to include gloang runtime
rabbah commented on a change in pull request #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#discussion_r230253455 ## File path: docs/actions-go.md ## @@ -17,67 +17,185 @@ # --> -## Creating and invoking Go actions - -Using OpenWhisk [native actions](actions-docker.md#creating-native-actions), -you can package any executable as an action. This works for Go as an example. -As with [Docker actions](actions-docker.md), the Go executable receives a single argument -from the command line. -It is a string serialization of the JSON object representing the arguments to the action. -The program may log to `stdout` or `stderr`. -By convention, the last line of output _must_ be a stringified JSON object which represents -the result of the action. - -Here is an example Go action. + + +# Creating and Invoking Go Actions + +The runtime `actionloop-golang-v1.11` runtime can execute actions written in the Go programming language in OpenWhisk, either as precompiled binary or compiling sources on the fly. + +## Entry Point + +The source code of an action is one or more Go source file. The entry point of the action is a function, placed in the `main` package. The default name for the main function is `Main`, but you can change it to any name you want using the `--main` switch in `wsk`. The name is however always capitalized. The function must have a specific signature, as described next. + +*NOTE* The runtime does *not* support different packages from `main` for the entry point. If you specify `hello.main` the runtime will try to use `Hello.main`, that will be almost certainly incorrect. You can however have other packages in your sources, as described below. + +## Signature + +The expected signature for a `main` function is: + +`func Main(event map[string]interface{}) map[string]interface{}` + +So a very simple single file `hello.go` action would be: + ```go package main -import "encoding/json" -import "fmt" -import "os" +import "log" + +// Main is the function implementing the action +func Main(obj map[string]interface{}) map[string]interface{} { + // do your work + name, ok := obj["name"].(string) + if !ok { +name = "world" + } + msg := make(map[string]interface{}) + msg["message"] = "Hello, " + name + "!" + // log in stdout or in stderr + log.Printf("name=%s\n", name) + // encode the result back in json + return msg +} +``` -func main() { -//program receives one argument: the JSON object as a string -arg := os.Args[1] +You can deploy it with just: -// unmarshal the string to a JSON object -var obj map[string]interface{} -json.Unmarshal([]byte(arg), ) +``` +wsk action create hello-go hello.go +``` -// can optionally log to stdout (or stderr) -fmt.Println("hello Go action") +You can also have multiple source files in an action, packages and vendor folders. -name, ok := obj["name"].(string) -if !ok { name = "Stranger" } +## Deployment + +The runtime `actionloop-golang-v1.11` accepts: + +- executable binaries in Linux ELF executable compiled for the AMD64 architecture Review comment: Can show cross compile setting? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #4093: changes to include gloang runtime
rabbah commented on a change in pull request #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#discussion_r230253245 ## File path: docs/actions-go.md ## @@ -17,67 +17,185 @@ # --> -## Creating and invoking Go actions - -Using OpenWhisk [native actions](actions-docker.md#creating-native-actions), -you can package any executable as an action. This works for Go as an example. -As with [Docker actions](actions-docker.md), the Go executable receives a single argument -from the command line. -It is a string serialization of the JSON object representing the arguments to the action. -The program may log to `stdout` or `stderr`. -By convention, the last line of output _must_ be a stringified JSON object which represents -the result of the action. - -Here is an example Go action. + + +# Creating and Invoking Go Actions + +The runtime `actionloop-golang-v1.11` runtime can execute actions written in the Go programming language in OpenWhisk, either as precompiled binary or compiling sources on the fly. + +## Entry Point + +The source code of an action is one or more Go source file. The entry point of the action is a function, placed in the `main` package. The default name for the main function is `Main`, but you can change it to any name you want using the `--main` switch in `wsk`. The name is however always capitalized. The function must have a specific signature, as described next. Review comment: source fileS. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #4093: changes to include gloang runtime
rabbah commented on a change in pull request #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#discussion_r230253717 ## File path: docs/actions-go.md ## @@ -17,67 +17,185 @@ # --> -## Creating and invoking Go actions - -Using OpenWhisk [native actions](actions-docker.md#creating-native-actions), -you can package any executable as an action. This works for Go as an example. -As with [Docker actions](actions-docker.md), the Go executable receives a single argument -from the command line. -It is a string serialization of the JSON object representing the arguments to the action. -The program may log to `stdout` or `stderr`. -By convention, the last line of output _must_ be a stringified JSON object which represents -the result of the action. - -Here is an example Go action. + + +# Creating and Invoking Go Actions + +The runtime `actionloop-golang-v1.11` runtime can execute actions written in the Go programming language in OpenWhisk, either as precompiled binary or compiling sources on the fly. + +## Entry Point + +The source code of an action is one or more Go source file. The entry point of the action is a function, placed in the `main` package. The default name for the main function is `Main`, but you can change it to any name you want using the `--main` switch in `wsk`. The name is however always capitalized. The function must have a specific signature, as described next. + +*NOTE* The runtime does *not* support different packages from `main` for the entry point. If you specify `hello.main` the runtime will try to use `Hello.main`, that will be almost certainly incorrect. You can however have other packages in your sources, as described below. + +## Signature + +The expected signature for a `main` function is: + +`func Main(event map[string]interface{}) map[string]interface{}` + +So a very simple single file `hello.go` action would be: + ```go package main -import "encoding/json" -import "fmt" -import "os" +import "log" + +// Main is the function implementing the action +func Main(obj map[string]interface{}) map[string]interface{} { + // do your work + name, ok := obj["name"].(string) + if !ok { +name = "world" + } + msg := make(map[string]interface{}) + msg["message"] = "Hello, " + name + "!" + // log in stdout or in stderr + log.Printf("name=%s\n", name) + // encode the result back in json + return msg +} +``` -func main() { -//program receives one argument: the JSON object as a string -arg := os.Args[1] +You can deploy it with just: -// unmarshal the string to a JSON object -var obj map[string]interface{} -json.Unmarshal([]byte(arg), ) +``` +wsk action create hello-go hello.go +``` -// can optionally log to stdout (or stderr) -fmt.Println("hello Go action") +You can also have multiple source files in an action, packages and vendor folders. -name, ok := obj["name"].(string) -if !ok { name = "Stranger" } +## Deployment + +The runtime `actionloop-golang-v1.11` accepts: + +- executable binaries in Linux ELF executable compiled for the AMD64 architecture +- zip files containing a binary executable named `exec` at the top level, again a Linux ELF executable compiled for the AMD64 architecture +- a single file source code in Go language, that will be compiled +- a zip file not containing in the top level a binary file `exec`, it will be interpreted as a collection of zip files, and compiled + +## Using packages and vendor folder + +When you deploy a zip file, you can: + +- have all your functions in the `main` package +- have some functions placed in some packages, like `hello` +- have some third party dependencies you want to include in your sources + +If all your functions are in the main package, just place all your sources in the top level of your zip file. + +### Use a package folder + +If some functions belongs to a package, like `hello/`, you need to be careful with the layout of your sources, especially if you use editors like [VcCode](#vscode), and make. The layout recommended is the following: -// last line of stdout is the result JSON object as a string -msg := map[string]string{"msg": ("Hello, " + name + "!")} -res, _ := json.Marshal(msg) -fmt.Println(string(res)) -} ``` +golang-main-package/ +- Makefile +- src/ + - main.go + - main_test.go + - hello/ + - hello.go + - hello_test.go +``` + +For running tests, editing without errors with package resolution, you need to use a `src` folder, place the sources that belongs to the main package in the `src` and place sources of your package in the `src/hello` folder. + +You should import it your subpackage with `import "hello"`. +Note this means if you want to compile locally you have to set your `GOPATH` to parent directory of your `src` directory. If you use VSCode, you need to enable the `go.inferGopath` option. Review comment: to the parent ...
[GitHub] rabbah commented on a change in pull request #4093: changes to include gloang runtime
rabbah commented on a change in pull request #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#discussion_r230253870 ## File path: docs/actions-go.md ## @@ -17,67 +17,185 @@ # --> -## Creating and invoking Go actions - -Using OpenWhisk [native actions](actions-docker.md#creating-native-actions), -you can package any executable as an action. This works for Go as an example. -As with [Docker actions](actions-docker.md), the Go executable receives a single argument -from the command line. -It is a string serialization of the JSON object representing the arguments to the action. -The program may log to `stdout` or `stderr`. -By convention, the last line of output _must_ be a stringified JSON object which represents -the result of the action. - -Here is an example Go action. + + +# Creating and Invoking Go Actions + +The runtime `actionloop-golang-v1.11` runtime can execute actions written in the Go programming language in OpenWhisk, either as precompiled binary or compiling sources on the fly. + +## Entry Point + +The source code of an action is one or more Go source file. The entry point of the action is a function, placed in the `main` package. The default name for the main function is `Main`, but you can change it to any name you want using the `--main` switch in `wsk`. The name is however always capitalized. The function must have a specific signature, as described next. + +*NOTE* The runtime does *not* support different packages from `main` for the entry point. If you specify `hello.main` the runtime will try to use `Hello.main`, that will be almost certainly incorrect. You can however have other packages in your sources, as described below. + +## Signature + +The expected signature for a `main` function is: + +`func Main(event map[string]interface{}) map[string]interface{}` + +So a very simple single file `hello.go` action would be: + ```go package main -import "encoding/json" -import "fmt" -import "os" +import "log" + +// Main is the function implementing the action +func Main(obj map[string]interface{}) map[string]interface{} { + // do your work + name, ok := obj["name"].(string) + if !ok { +name = "world" + } + msg := make(map[string]interface{}) + msg["message"] = "Hello, " + name + "!" + // log in stdout or in stderr + log.Printf("name=%s\n", name) + // encode the result back in json + return msg +} +``` -func main() { -//program receives one argument: the JSON object as a string -arg := os.Args[1] +You can deploy it with just: -// unmarshal the string to a JSON object -var obj map[string]interface{} -json.Unmarshal([]byte(arg), ) +``` +wsk action create hello-go hello.go +``` -// can optionally log to stdout (or stderr) -fmt.Println("hello Go action") +You can also have multiple source files in an action, packages and vendor folders. -name, ok := obj["name"].(string) -if !ok { name = "Stranger" } +## Deployment + +The runtime `actionloop-golang-v1.11` accepts: + +- executable binaries in Linux ELF executable compiled for the AMD64 architecture +- zip files containing a binary executable named `exec` at the top level, again a Linux ELF executable compiled for the AMD64 architecture +- a single file source code in Go language, that will be compiled +- a zip file not containing in the top level a binary file `exec`, it will be interpreted as a collection of zip files, and compiled + +## Using packages and vendor folder + +When you deploy a zip file, you can: + +- have all your functions in the `main` package +- have some functions placed in some packages, like `hello` +- have some third party dependencies you want to include in your sources + +If all your functions are in the main package, just place all your sources in the top level of your zip file. + +### Use a package folder + +If some functions belongs to a package, like `hello/`, you need to be careful with the layout of your sources, especially if you use editors like [VcCode](#vscode), and make. The layout recommended is the following: -// last line of stdout is the result JSON object as a string -msg := map[string]string{"msg": ("Hello, " + name + "!")} -res, _ := json.Marshal(msg) -fmt.Println(string(res)) -} ``` +golang-main-package/ +- Makefile +- src/ + - main.go + - main_test.go + - hello/ + - hello.go + - hello_test.go +``` + +For running tests, editing without errors with package resolution, you need to use a `src` folder, place the sources that belongs to the main package in the `src` and place sources of your package in the `src/hello` folder. + +You should import it your subpackage with `import "hello"`. +Note this means if you want to compile locally you have to set your `GOPATH` to parent directory of your `src` directory. If you use VSCode, you need to enable the `go.inferGopath` option. + +When you send the sources, you will
[GitHub] daisy-ycguo closed pull request #326: restore `set -x` that was removed by mistake
daisy-ycguo closed pull request #326: restore `set -x` that was removed by mistake URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/326 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/tools/travis/build-helm.sh b/tools/travis/build-helm.sh index ad752e2..2dcd8b0 100755 --- a/tools/travis/build-helm.sh +++ b/tools/travis/build-helm.sh @@ -170,6 +170,8 @@ verifyHealthyInvoker () { # Main body of script -- deploy OpenWhisk # +set -x + SCRIPTDIR=$(cd $(dirname "$0") && pwd) ROOTDIR="$SCRIPTDIR/../../" This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #4093: changes to include gloang runtime
csantanapr commented on issue #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#issuecomment-435248202 @rabbah your had a chance to review the docs? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] codecov-io commented on issue #4093: changes to include gloang runtime
codecov-io commented on issue #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#issuecomment-435240160 # [Codecov](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093?src=pr=h1) Report > Merging [#4093](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-openwhisk/commit/7668cc5ecad99de95ae246df52b47ac1947d13a0?src=pr=desc) will **decrease** coverage by `4.88%`. > The diff coverage is `n/a`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093/graphs/tree.svg?width=650=l0YmsiSAso=150=pr)](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093?src=pr=tree) ```diff @@Coverage Diff @@ ## master#4093 +/- ## == - Coverage 86.12% 81.23% -4.89% == Files 148 148 Lines7249 7249 Branches 445 445 == - Hits 6243 5889 -354 - Misses 1006 1360 +354 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093?src=pr=tree) | Coverage Δ | | |---|---|---| | [...core/database/cosmosdb/RxObservableImplicits.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvUnhPYnNlcnZhYmxlSW1wbGljaXRzLnNjYWxh) | `0% <0%> (-100%)` | :arrow_down: | | [...core/database/cosmosdb/CosmosDBArtifactStore.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJBcnRpZmFjdFN0b3JlLnNjYWxh) | `0% <0%> (-95.54%)` | :arrow_down: | | [...sk/core/database/cosmosdb/CosmosDBViewMapper.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJWaWV3TWFwcGVyLnNjYWxh) | `0% <0%> (-92.6%)` | :arrow_down: | | [...whisk/core/database/cosmosdb/CosmosDBSupport.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJTdXBwb3J0LnNjYWxh) | `0% <0%> (-83.34%)` | :arrow_down: | | [...abase/cosmosdb/CosmosDBArtifactStoreProvider.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJBcnRpZmFjdFN0b3JlUHJvdmlkZXIuc2NhbGE=) | `0% <0%> (-58.83%)` | :arrow_down: | | [...la/whisk/core/database/cosmosdb/CosmosDBUtil.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvcmUvZGF0YWJhc2UvY29zbW9zZGIvQ29zbW9zREJVdGlsLnNjYWxh) | `92% <0%> (-4%)` | :arrow_down: | | [...rc/main/scala/whisk/common/ForcibleSemaphore.scala](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093/diff?src=pr=tree#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL3doaXNrL2NvbW1vbi9Gb3JjaWJsZVNlbWFwaG9yZS5zY2FsYQ==) | `92.3% <0%> (-3.85%)` | :arrow_down: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093?src=pr=footer). Last update [7668cc5...e2ce23e](https://codecov.io/gh/apache/incubator-openwhisk/pull/4093?src=pr=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] upgle commented on issue #3880: Modify that web action in the bound package can be accessed.
upgle commented on issue #3880: Modify that web action in the bound package can be accessed. URL: https://github.com/apache/incubator-openwhisk/pull/3880#issuecomment-435238002 @rabbah ok, thank you This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jasonpet closed pull request #16: publish docker image with git hash with latest
jasonpet closed pull request #16: publish docker image with git hash with latest URL: https://github.com/apache/incubator-openwhisk-runtime-ruby/pull/16 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/tools/travis/publish.sh b/tools/travis/publish.sh index 78398f9..9e66d40 100755 --- a/tools/travis/publish.sh +++ b/tools/travis/publish.sh @@ -40,4 +40,15 @@ TERM=dumb ./gradlew \ -PdockerRegistry=docker.io \ -PdockerImagePrefix=${IMAGE_PREFIX} \ -PdockerImageTag=${IMAGE_TAG} + + # if doing latest also push a tag with the hash commit + if [ ${IMAGE_TAG} == "latest" ]; then + SHORT_COMMIT=`git rev-parse --short HEAD` + TERM=dumb ./gradlew \ + :core:${RUNTIME}:distDocker \ + -PdockerRegistry=docker.io \ + -PdockerImagePrefix=${IMAGE_PREFIX} \ + -PdockerImageTag=${SHORT_COMMIT} + fi + fi This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #5: fix travis yml
csantanapr commented on issue #5: fix travis yml URL: https://github.com/apache/incubator-openwhisk-runtime-ruby/issues/5#issuecomment-435222991 I guess this is fix now. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr closed issue #5: fix travis yml
csantanapr closed issue #5: fix travis yml URL: https://github.com/apache/incubator-openwhisk-runtime-ruby/issues/5 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #9: reduce system log output inside function
csantanapr commented on issue #9: reduce system log output inside function URL: https://github.com/apache/incubator-openwhisk-runtime-ruby/issues/9#issuecomment-435222883 @remore any update on this. @jthomas any ideas? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr opened a new pull request #16: publish docker image with git hash with latest
csantanapr opened a new pull request #16: publish docker image with git hash with latest URL: https://github.com/apache/incubator-openwhisk-runtime-ruby/pull/16 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dgrove-oss closed pull request #327: fixes to include golang runtime
dgrove-oss closed pull request #327: fixes to include golang runtime URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/327 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/helm/openwhisk/runtimes.json b/helm/openwhisk/runtimes.json index 6ec1057..58fccd0 100644 --- a/helm/openwhisk/runtimes.json +++ b/helm/openwhisk/runtimes.json @@ -127,6 +127,18 @@ "tag": "latest" } } +], +"go": [ +{ +"kind": "go:1.11", +"default": true, +"deprecated": false, +"image": { +"prefix": "openwhisk", +"name": "actionloop-golang-v1.11", +"tag": "latest" +} +} ] }, "blackboxes": [ This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah closed pull request #329: Fix hostpath for /containers mount for dind cluster
rabbah closed pull request #329: Fix hostpath for /containers mount for dind cluster URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/329 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/helm/openwhisk/templates/_invokerHelpers.tpl b/helm/openwhisk/templates/_invokerHelpers.tpl index 216a440..cca7f7f 100644 --- a/helm/openwhisk/templates/_invokerHelpers.tpl +++ b/helm/openwhisk/templates/_invokerHelpers.tpl @@ -10,7 +10,11 @@ path: "/run/runc" - name: dockerrootdir hostPath: +{{- if .Values.invoker.containerFactory.dind }} +path: "/dind/docker/containers" +{{- else }} path: "/var/lib/docker/containers" +{{- end }} - name: dockersock hostPath: path: "/var/run/docker.sock" diff --git a/helm/openwhisk/values.yaml b/helm/openwhisk/values.yaml index 34cb6e1..43e17c0 100644 --- a/helm/openwhisk/values.yaml +++ b/helm/openwhisk/values.yaml @@ -173,6 +173,7 @@ invoker: jvmHeapMB: "512" jvmOptions: "" containerFactory: +dind: false useRunc: false impl: "docker" kubernetes: diff --git a/tools/travis/build-helm.sh b/tools/travis/build-helm.sh index 0ab4c0e..ad752e2 100755 --- a/tools/travis/build-helm.sh +++ b/tools/travis/build-helm.sh @@ -213,6 +213,7 @@ whisk: invoker: containerFactory: +dind: true impl: $OW_CONTAINER_FACTORY kubernetes: agent: This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dgrove-oss commented on issue #127: Run OpenWhisk test suite against kube-based deployment
dgrove-oss commented on issue #127: Run OpenWhisk test suite against kube-based deployment URL: https://github.com/apache/incubator-openwhisk-deploy-kube/issues/127#issuecomment-435173469 #329 is probably why I could never get a clean run of the tests with the DockerContainerFactory under kubeadm-dind-cluster. Once we merge that fix, try again at enabling system tests on travisCI This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dgrove-oss opened a new issue #330: Better documentation for running with dind
dgrove-oss opened a new issue #330: Better documentation for running with dind URL: https://github.com/apache/incubator-openwhisk-deploy-kube/issues/330 Need to document setting `invoker.containerFactory.dind` to true to enable the fix in #329. Will need a restructure of the docs to avoid making this even more confusing (this really isn't an Ingress issue, but that's where it would go in the current structure). In the process, should do a better job of describing the odd networking setup of Docker on Mac (per Slack conversation earlier this week). Maybe need to have docs for each of the main Kubernetes choices (minikube, Docker on Mac/Windows, kubeadm-dind, and "real" Kubernetes clusters). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dgrove-oss opened a new pull request #329: Fix hostpath for /containers mount for dind cluster
dgrove-oss opened a new pull request #329: Fix hostpath for /containers mount for dind cluster URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/329 Fixes #328 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dgrove-oss commented on issue #328: DockerContainerFactory - no healthy invokers under TravisCI tests
dgrove-oss commented on issue #328: DockerContainerFactory - no healthy invokers under TravisCI tests URL: https://github.com/apache/incubator-openwhisk-deploy-kube/issues/328#issuecomment-435155076 Yep, specific to docker-in-docker kubernetes clusters. We need to mount /dind/docker/containers instead of /var/lib/docker/containers in the invoker pod. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dgrove-oss commented on issue #4041: Send active-ack after log collection for nonblocking activations.
dgrove-oss commented on issue #4041: Send active-ack after log collection for nonblocking activations. URL: https://github.com/apache/incubator-openwhisk/pull/4041#issuecomment-435151443 I think this change is fine in and of itself, but it caused downstream problems for kube-deploy. https://github.com/apache/incubator-openwhisk-deploy-kube/issues/328. Documenting here in case it impacts other downstream deployment projects like Mesos. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dgrove-oss opened a new issue #328: DockerContainerFactory - no healthy invokers under TravisCI tests
dgrove-oss opened a new issue #328: DockerContainerFactory - no healthy invokers under TravisCI tests URL: https://github.com/apache/incubator-openwhisk-deploy-kube/issues/328 After the upstream change https://github.com/apache/incubator-openwhisk/pull/4041, the DockerContainerFactory in Kubernetes started failing in TravisCI . In particular, the `/invokers/healthy/count` route on the controller always returns 0 because the invoker never transitions from Unhealthy to Healthy. The problem appears to be that log collection of the InvokerHealth action fails, resulting in the container being removed without a response being sent back to the controller. The failure with log collection _may_ be limited to kubeadm-dind clusters on ubuntu 16.04 (log collection does not fail using Kubernetes on Docker for Mac). This is likely an existing bug that was masked because before 4041, and activeack was returned before log collection failed. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] tysonnorris commented on a change in pull request #2795: enable concurrent activation processing
tysonnorris commented on a change in pull request #2795: enable concurrent activation processing URL: https://github.com/apache/incubator-openwhisk/pull/2795#discussion_r230128885 ## File path: common/scala/src/main/scala/whisk/core/entity/Limits.scala ## @@ -72,8 +75,9 @@ protected[core] object ActionLimits extends ArgNormalizer[ActionLimits] with Def val time = TimeLimit.serdes.read(obj.get("timeout") getOrElse deserializationError("'timeout' is missing")) val memory = MemoryLimit.serdes.read(obj.get("memory") getOrElse deserializationError("'memory' is missing")) val logs = obj.get("logs") map { LogLimit.serdes.read(_) } getOrElse LogLimit() + val concurrency = obj.get("concurrency") map { ConcurrencyLimit.serdes.read(_) } getOrElse ConcurrencyLimit() - ActionLimits(time, memory, logs) + ActionLimits(time, memory, logs, concurrency) Review comment: indeed; starting with client-go: https://github.com/apache/incubator-openwhisk-client-go/pull/94 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on issue #288: JIRA feed package for Openwhisk catalog
rabbah commented on issue #288: JIRA feed package for Openwhisk catalog URL: https://github.com/apache/incubator-openwhisk-catalog/pull/288#issuecomment-435113139 @prabhashthere yes, it makes sense to move your contribution to https://github.com/apache/incubator-openwhisk-package-jira. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on issue #3880: Modify that web action in the bound package can be accessed.
rabbah commented on issue #3880: Modify that web action in the bound package can be accessed. URL: https://github.com/apache/incubator-openwhisk/pull/3880#issuecomment-435110176 Thanks - will check this out today or tomorrow. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser edited a comment on issue #325: Support for invocations based on websocket messages
mdeuser edited a comment on issue #325: Support for invocations based on websocket messages URL: https://github.com/apache/incubator-openwhisk-apigateway/issues/325#issuecomment-435098430 @mhamann - taking the real-time stock ticker as an example.. are you thinking that the api gw would handle the connection and connection keep alives to the client and periodically invoke the backend action to obtain the latest stock quote and then sending that result to the client inside a websocket message? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on issue #325: Support for invocations based on websocket messages
mdeuser commented on issue #325: Support for invocations based on websocket messages URL: https://github.com/apache/incubator-openwhisk-apigateway/issues/325#issuecomment-435098430 @mhamann - taking the real-time stock ticker as an example.. are you thinking that the api gw would handle the connection and connection keep alives to the client and periodically invoke the backend action to obtain the latest stock quote and then sending that result inside a websocket message? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #4093: changes to include gloang runtime
csantanapr commented on issue #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#issuecomment-435086091 @sciabarracom the systems tests pass in your local computer with the go changes? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #4093: changes to include gloang runtime
csantanapr commented on issue #4093: changes to include gloang runtime URL: https://github.com/apache/incubator-openwhisk/pull/4093#issuecomment-435085934 weird that Travis is failing on systems tests unrelated to go This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jthomas commented on issue #325: Support for invocations based on websocket messages
jthomas commented on issue #325: Support for invocations based on websocket messages URL: https://github.com/apache/incubator-openwhisk-apigateway/issues/325#issuecomment-435068723 > One option would be to define a precise error format This seems like the most sensible option. Returning the message with an error identifer and message to indicate they need to re-send? If we can support both in-bound and out-bound messages this would be a huge feature that the other platforms do not support. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jthomas closed issue #14: Zip files without explicit directories entries fails to extract.
jthomas closed issue #14: Zip files without explicit directories entries fails to extract. URL: https://github.com/apache/incubator-openwhisk-runtime-ruby/issues/14 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jthomas closed pull request #15: Fixes #14 - Support zip files without dir entries
jthomas closed pull request #15: Fixes #14 - Support zip files without dir entries URL: https://github.com/apache/incubator-openwhisk-runtime-ruby/pull/15 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/.gitignore b/.gitignore index ed2c749..0c3444f 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,5 @@ ansible/roles/nginx/files/*cert.pem !tests/dat/actions/python3_virtualenv.zip !tests/dat/actions/python_virtualenv_dir.zip !tests/dat/actions/python_virtualenv_name.zip -!tests/dat/actions/zippedaction.zip \ No newline at end of file +!tests/dat/actions/zippedaction.zip +!tests/dat/without_dir_entries.zip diff --git a/core/ruby2.5Action/rackapp/init.rb b/core/ruby2.5Action/rackapp/init.rb index eee1767..caefe52 100644 --- a/core/ruby2.5Action/rackapp/init.rb +++ b/core/ruby2.5Action/rackapp/init.rb @@ -84,7 +84,9 @@ def valid_code?(path) def unzip(zipfile_path, destination_folder) Zip::File.open(zipfile_path) do |zip| zip.each do |file| - zip.extract(file, destination_folder + file.name) + f_path = destination_folder + file.name + FileUtils.mkdir_p(File.dirname(f_path)) + zip.extract(file, f_path) end end true diff --git a/tests/dat/without_dir_entries.zip b/tests/dat/without_dir_entries.zip new file mode 100644 index 000..224a5f9 Binary files /dev/null and b/tests/dat/without_dir_entries.zip differ diff --git a/tests/src/test/scala/actionContainers/Ruby25ActionContainerTests.scala b/tests/src/test/scala/actionContainers/Ruby25ActionContainerTests.scala index 1090c14..68146bd 100644 --- a/tests/src/test/scala/actionContainers/Ruby25ActionContainerTests.scala +++ b/tests/src/test/scala/actionContainers/Ruby25ActionContainerTests.scala @@ -23,6 +23,8 @@ import common.WskActorSystem import actionContainers.{ActionContainer, BasicActionRunnerTests} import actionContainers.ActionContainer.withContainer import actionContainers.ResourceHelpers.ZipBuilder +import actionContainers.ResourceHelpers +import java.nio.file.FileSystems; import spray.json._ @RunWith(classOf[JUnitRunner]) @@ -329,6 +331,21 @@ class Ruby25ActionContainerTests extends BasicActionRunnerTests with WskActorSys } } + it should "support zip-encoded packages without directory entries" in { +val path = FileSystems.getDefault().getPath("dat", "without_dir_entries.zip"); +val code = ResourceHelpers.readAsBase64(path) + +val (out, err) = withRuby25Container { c => + c.init(initPayload(code))._1 should be(200) + + val (runCode, runRes) = c.run(runPayload(JsObject())) + + runCode should be(200) + runRes.get.fields.get("greeting") shouldBe defined + runRes.get.fields.get("greeting") shouldBe Some(JsString("Hello stranger!")) +} + } + it should "fail gracefully on invalid zip files" in { // Some text-file encoded to base64. val code = "Q2VjaSBuJ2VzdCBwYXMgdW4gemlwLgo=" This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] karun19 opened a new issue #173: failing with "dial tcp: lookup minio.docker on 127.0.0.11:53: no such host"
karun19 opened a new issue #173: failing with "dial tcp: lookup minio.docker on 127.0.0.11:53: no such host" URL: https://github.com/apache/incubator-openwhisk-devtools/issues/173 Always fails at this point. I am new to it, please help. Downloading source tar ball master % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 100 1340 1340 0104 0 --:--:-- 0:00:01 --:--:-- 104 100 10.4M 100 10.4M0 0 357k 0 0:00:29 0:00:29 --:--:-- 294k Unpacking tarball. downloading the CLI tool ... downloading cli for linux % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 100 6260 6260 0478 0 --:--:-- 0:00:01 --:--:-- 478 100 3391k 100 3391k0 0 315k 0 0:00:10 0:00:10 --:--:-- 487k pulling the docker images short list... Using default tag: latest latest: Pulling from openwhisk/controller Digest: sha256:aa2498cb3c7b7ae08271019c88f7832b4daf28b1da72fe96d8f6cd59e594eba5 Status: Image is up to date for openwhisk/controller:latest Using default tag: latest latest: Pulling from openwhisk/invoker Digest: sha256:b5e1c96450df2d3bb4645bf322bcf84041b0d65d93746818a9314e5e6b939118 Status: Image is up to date for openwhisk/invoker:latest Using default tag: latest latest: Pulling from openwhisk/nodejs6action Digest: sha256:c4afd017e382ba52e789fb63a8801998a758745e22746afcdbcb7441d85acf04 Status: Image is up to date for openwhisk/nodejs6action:latest Using default tag: latest latest: Pulling from openwhisk/dockerskeleton Digest: sha256:833a76ab0e61b6ff32cff8baee0cab18791ce49f0e66d03e3303eb4abbe95951 Status: Image is up to date for openwhisk/dockerskeleton:latest host ip address: 10.0.2.15 checking required ports ... ... OK ... preparing api-gateway configuration pinging minio... .Creating network "openwhisk_default" with the default driver Pulling minio (minio/minio:RELEASE.2018-07-13T00-09-07Z)... Creating openwhisk_minio_1_1c9d6f246d33 ... done ... OK Unable to find image 'openwhisk/apigateway:latest' locally latest: Pulling from openwhisk/apigateway 4fe2ade4980c: Already exists 19f5156bba76: Pull complete f896f91d72d0: Pull complete 301746a9771e: Pull complete 8db5b9e441b9: Pull complete b716bb09fe55: Pull complete 7f60dc362c8c: Pull complete 5d90600c1954: Pull complete c275bf414e8a: Pull complete 943f4a5dd4d8: Pull complete 51d717412fa1: Pull complete 334b7f89b58e: Pull complete Digest: sha256:f3b0e93a844964f11cb9160f84b4c3266648c82cc6234ebba4c2a1d72b3dbef9 Status: Downloaded newer image for openwhisk/apigateway:latest 2018/11/01 07:21:08 ERROR : Attempt 1/3 failed with 1 errors and: RequestError: send request failed caused by: Head http://minio.docker:9000/api-gateway: dial tcp: lookup minio.docker on 127.0.0.11:53: no such host 2018/11/01 07:21:58 ERROR : Attempt 2/3 failed with 1 errors and: RequestError: send request failed caused by: Head http://minio.docker:9000/api-gateway: dial tcp: lookup minio.docker on 127.0.0.11:53: no such host 2018/11/01 07:22:43 ERROR : Attempt 3/3 failed with 1 errors and: RequestError: send request failed caused by: Head http://minio.docker:9000/api-gateway: dial tcp: lookup minio.docker on 127.0.0.11:53: no such host 2018/11/01 07:22:43 Failed to mkdir: RequestError: send request failed caused by: Head http://minio.docker:9000/api-gateway: dial tcp: lookup minio.docker on 127.0.0.11:53: no such host Makefile:202: recipe for target 'setup' failed make: *** [setup] Error 1 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services