-
Notifications
You must be signed in to change notification settings - Fork 8
Setup remote JVM debugging for app/hub #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis pull request introduces a new debugging port in the Docker configuration and updates the start script for the Java application. In the compose file, the new port mapping "5005:5005" has been added to the 'app' service to expose the port. The start script now uses a multi-line format and includes the JDWP agent option to enable remote debugging on port 5005. No other functional changes were made. Changes
Sequence Diagram(s)sequenceDiagram
participant Host
participant Docker
participant App
participant Debugger
Host->>Docker: Start container with compose config
Docker->>App: Map port 5005 for debugging
App->>Debugger: Initialize JDWP agent on port 5005
Debugger->>App: Connect for remote debugging
Poem
Tip 🌐 Web search-backed reviews and chat
Warning Review ran into problems🔥 ProblemsGitHub Actions and Pipeline Checks: Resource not accessible by integration - https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository. Please grant the required permissions to the CodeRabbit GitHub App under the organization or repository settings. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (2)
docker-init/compose.yaml(1 hunks)docker-init/start.sh(1 hunks)
🔇 Additional comments (1)
docker-init/compose.yaml (1)
70-70: Port mapping OK: Exposes port 5005.
| exec java \ | ||
| -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 hub-0.1.0-SNAPSHOT.jar \ | ||
| run ai.chronon.hub.HubVerticle \ | ||
| -Dserver.port=9000 \ | ||
| -Dai.chronon.metrics.host=$STATSD_HOST \ | ||
| -conf config.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JDWP order issue: Place -agentlib before -jar.
Consider this diff:
- exec java \
- -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 hub-0.1.0-SNAPSHOT.jar \
- run ai.chronon.hub.HubVerticle \
- -Dserver.port=9000 \
- -Dai.chronon.metrics.host=$STATSD_HOST \
- -conf config.json
+ exec java \
+ -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 \
+ -jar hub-0.1.0-SNAPSHOT.jar \
+ run ai.chronon.hub.HubVerticle \
+ -Dserver.port=9000 \
+ -Dai.chronon.metrics.host=$STATSD_HOST \
+ -conf config.json📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| exec java \ | |
| -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 hub-0.1.0-SNAPSHOT.jar \ | |
| run ai.chronon.hub.HubVerticle \ | |
| -Dserver.port=9000 \ | |
| -Dai.chronon.metrics.host=$STATSD_HOST \ | |
| -conf config.json | |
| exec java \ | |
| -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 \ | |
| -jar hub-0.1.0-SNAPSHOT.jar \ | |
| run ai.chronon.hub.HubVerticle \ | |
| -Dserver.port=9000 \ | |
| -Dai.chronon.metrics.host=$STATSD_HOST \ | |
| -conf config.json |
nikhil-zlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
|
can you also copy the PR summary into documentation please? |
## Summary Allows connecting to `app` docker container on `localhost:5005` via IntelliJ. See [tutorial](https://www.jetbrains.com/help/idea/tutorial-remote-debug.html) for more details, but the summary is - Recreate the docker containers (`docker-init/build.sh --all`) - This will pass the `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005` CLI arguments and expose `5005` on the host (i.e. your laptop) - You will see `Listening for transport dt_socket at address: 5005` in the container logs  - In IntelliJ, add a new `Remote JVM Debug` config with default settings  - Set a breakpoint and then trigger it (from the frontend or calling endpoints directly)  This has been useful to understand the [java.lang.NullPointerException](https://app.asana.com/0/home/1208932362205799/1209321714844239) error when fetching summaries for some columns/features (ex. `dim_merchant_account_type`, `dim_merchant_country`)  ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- av pr metadata This information is embedded by the av CLI when creating PRs to track the status of stacks when using Aviator. Please do not delete or edit this section of the PR. ``` {"parent":"main","parentHead":"","trunk":"main"} ``` --> Co-authored-by: Sean Lynch <[email protected]>
Summary
Allows connecting to
appdocker container onlocalhost:5005via IntelliJ. See tutorial for more details, but the summary isdocker-init/build.sh --all)-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005CLI arguments and expose5005on the host (i.e. your laptop)Listening for transport dt_socket at address: 5005in the container logsRemote JVM Debugconfig with default settingsThis has been useful to understand the java.lang.NullPointerException error when fetching summaries for some columns/features (ex.
dim_merchant_account_type,dim_merchant_country)Checklist