Hi Michele,

see also [1]. It depends on how debugging works for the different languages. 
There are 3 high-level steps (A, B, C):

A.

On the action container side, the basic requirement is that there needs to a 
flag on the docker image(s) to

  *   enable debugging
  *   define the debug port (if selected by IDE)

Ideally this could be a standard environment variable, OPENWHISK_DEBUG_PORT or 
the like, that the various standard OW actions take into account and adjust the 
command accordingly.

Currently, for the nodejs case, wskdebug simply overwrites the node command 
used on the docker run [2]. There was nothing that had to be changed on the 
image (and it works with slightly different nodejs container images we use at 
Adobe for example).

B.

To get IDE breakpoint debugging to work, wskdebug allows to manually set env 
vars (--docker-args) or the command (--command) [3], which can be used to 
leverage A. But if we standardize e.g. on OPENWHISK_DEBUG_PORT, we can adjust 
wskdebug to do that automatically. It currently detects the debug type/kind 
based on the kind [4]. Which might not be perfect if you could have different 
images behind those kinds depending on the specific openwhisk deployment.

C.

To get automatic code reloading, a bit more has to be done on the wskdebug 
side, as it needs to understand how to build and mount or redeploy (on the 
local container) an action for a particular language. So far that only exists 
for nodejs [5], and manually can be controlled a bit using "--on-build".


[1] https://github.com/apache/openwhisk-wskdebug/issues/26
[2] 
https://github.com/apache/openwhisk-wskdebug/blob/master/src/kinds/nodejs/nodejs.js#L34
[3] https://github.com/apache/openwhisk-wskdebug#help-output
[4] https://github.com/apache/openwhisk-wskdebug/blob/master/src/invoker.js#L139
[5] https://github.com/apache/openwhisk-wskdebug/tree/master/src/kinds/nodejs

Cheers,
Alex

________________________________
From: Michele Sciabarra <mich...@sciabarra.com>
Sent: Saturday, July 25, 2020 02:18
To: dev@openwhisk.apache.org <dev@openwhisk.apache.org>
Subject: What I need to do to add support for wskdebug?

I want to update the go runtime to add support for go 1.14 and modules.

So I have to review some of the examples and makefiles.

In the process I would like to add support for wskdebug.

In the current shape, what is required to do that?

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

Reply via email to