> Unfortunately wskdebug assumes I can contact the debugging server in 
> localhost:9229. This is the case if I am running wskdebug OUTSIDE docker but 
> not if I am running INSIDE.

wskdebug needs to be able to run docker containers. If you are inside a 
container, you might be able to solve this using

    docker run -v /var/run/docker.sock:/var/run/docker.sock ...

when you run the outer docker container. That creates a loopback to the docker 
daemon on the host. I am not sure if that would solve any port visibility 
issues automatically, you might still have to expose them first.

> Also I have another use case where I have to run it: a production with 
> kubernetes cluster with actions. Some actions are using redis, kafka and 
> buckets. Unfortunately the debugger runs the action in the local docker, and 
> the local action cannot reach the services inside the cluster.

That sounds like a very special Openwhisk environment?

[1] https://stackoverflow.com/a/33003273/2709

Cheers,
Alex

________________________________
From: Michele Sciabarra <mich...@sciabarra.com>
Sent: Thursday, February 20, 2020 09:56
To: dev@openwhisk.apache.org <dev@openwhisk.apache.org>
Subject: Re: Wskdebug, does it work in a docker image?

I reply to myself to say that I solved this problem (it is actually mentioned 
in the documentation) with a chown of /usr/lib/node_modules and /usr/bin. So I 
was able to install wskdebug.

However wskdebug in current shape does not work in my two use cases.

One use case is the one I mentioned: I am running an editor with theia in a 
docker image, so I installed it inside a docker image.

Unfortunately wskdebug assumes I can contact the debugging server in 
localhost:9229. This is the case if I am running wskdebug OUTSIDE docker but 
not if I am running INSIDE.

Also I have another use case where I have to run it: a production with 
kubernetes cluster with actions. Some actions are using redis, kafka and 
buckets. Unfortunately the debugger runs the action in the local docker, and 
the local action cannot reach the services inside the cluster.

--
  Michele Sciabarra
  mich...@sciabarra.com

----- Original message -----
From: Michele Sciabarra <mich...@sciabarra.com>
To: dev@openwhisk.apache.org
Subject: Wskdebug, does it work in a docker image?
Date: Wednesday, February 19, 2020 7:25 PM

Hello,

I am trying to build an openwhisk IDE, using eclipse theia as a starting point.
I already packages standalone openwhisk as a docker image, and I contributed 
the effort.
Theia runs from another docker image.

I am now trying to run wskdebug in the theia docker container.

Note I am able to run  "wsk" from theia  and I have also docker in the image 
and the docker socket mounted, so I can also do docker ps, docker create etc.

But if I try to install wskdebug in the image it fails.

You can easily replicate the issue with `docker run -ti node:10 bash` and then 
run `npm install -g @adobe/wskdebug`

I see errors like:

````
ngrok - error storing binary to local file { [Error: EACCES: permission denied, 
open 
'/usr/local/lib/node_modules/@adobe/wskdebug/node_modules/ngrok/bin/aHR0cHM6Ly9iaW4uZXF1aW5veC5pby9jLzRWbUR6QTdpYUhiL25ncm9rLXN0YWJsZS1saW51eC1hbWQ2NC56aXA=.zip']
  errno: -13,
  code: 'EACCES',
````



--
  Michele Sciabarra
  mich...@sciabarra.com

Reply via email to