You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2020/12/11 07:19:49 UTC

[GitHub] [openwhisk-composer] javelino-machship opened a new issue #74: issue using composer.parallel

javelino-machship opened a new issue #74:
URL: https://github.com/apache/openwhisk-composer/issues/74


   Hi Guys - have been trying to use the combinator composer.parallel() but I always get the following error when executing the action,
   
   - maybe im missing a step? or openwhisk-composer is not compatible with redis inside a docker container?
   
   - I've setup my redis server and have tested it using the redis explorer in vscode and is working, I can add, delete keys etc.
   
   **Note**: my redis-server is setup using docker
   
   ``` json
           "logs": [
               "2020-12-11T06:49:29.0983145Z   stdout: Entering composition[2]",
               "2020-12-11T06:49:29.09834Z     stdout: barrierId: 374ac5cc-44b1-49e5-8605-5398904d62cc, spawning: 2",
               "2020-12-11T06:49:29.0989087Z   stdout: { AbortError: LPUSH can't be processed. The connection is already closed.",
               "2020-12-11T06:49:29.0989191Z   stdout:     at handle_offline_command (/node_modules/redis/index.js:851:15)",
               "2020-12-11T06:49:29.0989227Z   stdout:     at RedisClient.internal_send_command (/node_modules/redis/index.js:885:9)",
               "2020-12-11T06:49:29.0989261Z   stdout:     at RedisClient.lpush (/node_modules/redis/lib/commands.js:58:25)",
               "2020-12-11T06:49:29.0989294Z   stdout:     at Promise (eval at initializeActionHandler (/nodejsAction/runner.js:56:23), <anonymous>:77:12)",
               "2020-12-11T06:49:29.0989328Z   stdout:     at new Promise (<anonymous>)",
               "2020-12-11T06:49:29.098936Z    stdout:     at RedisClient.t.(anonymous function) [as lpushAsync] (eval at initializeActionHandler (/nodejsAction/runner.js:56:23), <anonymous>:76:86)",
               "2020-12-11T06:49:29.098939Z    stdout:     at m (eval at initializeActionHandler (/nodejsAction/runner.js:56:23), <anonymous>:85:39)",
               "2020-12-11T06:49:29.0989422Z   stdout:     at Object.parallel (eval at initializeActionHandler (/nodejsAction/runner.js:56:23), <anonymous>:130:105)",
               "2020-12-11T06:49:29.0989483Z   stdout:     at $ (eval at initializeActionHandler (/nodejsAction/runner.js:56:23), <anonymous>:149:78)",
               "2020-12-11T06:49:29.0989534Z   stdout:     at Promise.resolve.then (eval at initializeActionHandler (/nodejsAction/runner.js:56:23), <anonymous>:154:59)",
               "2020-12-11T06:49:29.0989568Z   stdout:   command: 'LPUSH',",
               "2020-12-11T06:49:29.0989598Z   stdout:   code: 'NR_CLOSED',",
               "2020-12-11T06:49:29.0989631Z   stdout:   args: [ 'composer/fork/374ac5cc-44b1-49e5-8605-5398904d62cc', 42 ] }"
           ]
   ```
   
   **compose file**
   
   ``` js
   const composer = require('openwhisk-composer');
   
   // complexwf.js
   module.exports = composer.retain(
       composer.action('step-a', { action: function (params) {
           console.log('log-step-a', params);
           return { value: 'from-step-a' } 
       } }),
       composer.action('step-b', { action: function (params) { 
           console.log('log-step-b', params);
           return { value: 'from-step-b' } 
       } }),
       composer.parallel(
           composer.action('step-c', { action: function (params) { 
               console.log('log-step-c', params);
               return { value: 'from-step-c' } 
           } }),
           composer.action('step-d', { action: function (params) { 
               console.log('log-step-d', params);
               return { value: 'from-step-d' } 
           } }),
       )
   );
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk-composer] javelino-machship commented on issue #74: issue using composer.parallel

Posted by GitBox <gi...@apache.org>.
javelino-machship commented on issue #74:
URL: https://github.com/apache/openwhisk-composer/issues/74#issuecomment-744197062


   @tardieu, Thanks for answering, I deployed openwhisk using kubernetes.
   
    I'm currently trying to setup a common network between redis and openwhisk.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk-composer] javelino-machship closed issue #74: issue using composer.parallel

Posted by GitBox <gi...@apache.org>.
javelino-machship closed issue #74:
URL: https://github.com/apache/openwhisk-composer/issues/74


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk-composer] javelino-machship commented on issue #74: issue using composer.parallel

Posted by GitBox <gi...@apache.org>.
javelino-machship commented on issue #74:
URL: https://github.com/apache/openwhisk-composer/issues/74#issuecomment-744227270


   I think its not working? I tried connecting the redis-server(using docker) in the openwhisk network which in this case is "host", but still getting the same error,
   
   do you guys install a separate redis server or use the redis-server included in the openwhisk kubernetes setup? 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk-composer] tardieu commented on issue #74: issue using composer.parallel

Posted by GitBox <gi...@apache.org>.
tardieu commented on issue #74:
URL: https://github.com/apache/openwhisk-composer/issues/74#issuecomment-743180094


   I think this error simply means that redis is not reachable from OpenWhisk actions.
   
   How are you deploying OpenWhisk? You should not be using `127.0.0.1` for the redis host. This ip is meant to be resolved from the context of a running action. Depending on how you run OpenWhisk you may need a public redis with a public ip, or you may need to establish a common network between your redis deployment and OpenWhisk and use a proper ip for this network. To start with you may try using using a "real" ip for your host (not loopback).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk-composer] javelino-machship commented on issue #74: issue using composer.parallel

Posted by GitBox <gi...@apache.org>.
javelino-machship commented on issue #74:
URL: https://github.com/apache/openwhisk-composer/issues/74#issuecomment-744712702


   got it working, i changed the url to the container ip so the parameter looks like this, im closing this one
   
   ``` json
   {
       "name": "complexwf",
       "params": {
           "$composer": {
               "openwhisk": {
                   "ignore_certs": true
               },
               "redis": {
                   "uri": "redis://172.17.0.2:6379"
               }
           },   
           "value": "from-input" 
       }
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org