5. Developer guide

This developer guide is meant for software developers who would like to understand REANA source code and contribute to it.

5.1. Debugging

In order to debug a REANA component, you first have to install REANA cluster in the development mode (see reana-cluster documentation). Once you have done this, you have to build the image of the component you are working on in development mode and we restart the corresponding pod:

$ cd src/reana-server
$ # if we are not connected to the minikube docker daemon we should do it
$ eval "$(minikube docker-env)"
$ docker build . --build-arg DEBUG=true -t reanahub/reana-server:latest
$ kubectl delete pod --selector=app="server"

Let us now introduce wdb breakpoint as the first instruction of the first instruction of the get_analyses() function located in reana_server/rest/analyses.py:


We can check that the code has been in fact updated and make a request to the component:

$ kubectl logs --selector=app="server"

 * Running on (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 310-304-952 - - [15/Feb/2018 12:43:49] "GET /api/ping HTTP/1.1" 200 -
 * Detected change in '/code/reana_server/rest/analyses.py', reloading
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 310-304-952
$ curl ""

After doing that we can go to the wdb dashboard (you can get wdb address using reana-cluster get wdb).


And finally select the debugging session.



It is not possible to get live code updates in workflow engine components since celery option –autoreload doesn’t work and it is deprecated. To debug celery right now:

  • Set breakpoint: import wdb; wdb.set_trace()
  • Kill the workflow engine container: kubectl delete pod cwl-default-worker-2461563162-r4hgg