Skip to content

Consonance Debugging

Walter Shands edited this page Jul 28, 2017 · 6 revisions

Setting up a remote debugging session

Some of the information here was found at: https://dzone.com/articles/how-debug-remote-java-applicat

These instructions describe how to use Eclipse for remote debugging Consonance inside our Provisioner Docker container but could be applied to other containers such as the Coordinator or Webservice that run Consonance also.

  1. in dcc-ops/consonance/docker-compose.yml add a port to the provisioner through which the debugger will connect

... provisioner: build: context: . dockerfile: Dockerfile_provisioner ports: - "8000:8000" links: ...

  1. Edit init_provisioner.sh and add -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n to the java command. This will allow the debugger to connect to Consonance but will allow it to run before the debugger connects (suspend=n):

java -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n -cp "/root/:./*" io.consonance.arch.containerProvisioner.ContainerProvisionerThreads --config config --endless | tee /consonance_logs/container_provisioner_nohup.out

  1. Build and start running the provisioner by running install_bootstrap.sh

  2. Using the AWS console in the security group of the machine where the provisioner container is running open the same port number you added to the provisioner in docker-compose.yml to your ip address from which you will be using the debugger.

  3. Clone the Consonance project onto the machine where you will debug

git clone https://github.com/Consonance/consonance.git

  1. Start Eclipse on the machine where you want to remotely debug

  2. Create a project for the consonance-arch source code

  3. Go to Run -> Debug Configurations

  4. Create a new Remote Java Application configuration

  5. Click on the Connect tab

  6. Configure the remote application's details:

*Connection Type: Standard (Socket Attach) *Project: 'consonance-arch' (name you gave to the Java project for consonance-arch) *Host: ip address of the machine where the provisioner Docker container is running *Port: 8000 *check 'Allow Termination of remote VM'

  1. If you would like to have this launch configuration in your favorites menu click on the Common tab and check the configuration in the 'Display in favorites menu' box
  2. Click on the down arrow next to the bug and select your debug configuration with the yellow arrow
Clone this wiki locally