Skip to content
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

build: consolidate debug Dockerfile with multi-stage build #34

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

heronimus
Copy link
Contributor

@heronimus heronimus commented Jan 15, 2024

Overview

  • Consolidate Dockerfile using a multi-stage build with debug target.

Changes

  • Remove .ide-debug/Dockerfile.debug, and replace it with a multi-stage build on the main cardinal/Dockerfile file.
  • Remove fully defined .ide-debug/docker-compose.debug.yml Docker Compose file.
  • Add "cardinal-debug" services into docker compose file.

PR Dependency

Testing

world cardinal start --build --debug

Output (Cardinal showing delve debug mode logs):

[+] Building 3.3s (16/16) ....
 => [cardinal builder 1/6] FROM docker.io......
 => [cardinal runtime-debug 1/3] FROM docker.io.......
 ....
 ....
 Attaching to cardinal, nakama, nakama_db, starter-game-template-redis-1
cardinal                       | API server listening at: [::]:40000
cardinal                       | 2024-01-15T18:57:42Z warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
 ....
 ....

Summary by CodeRabbit

  • New Features
    • Introduced Docker service overrides for enhanced debugging capabilities.
    • Integrated Delve debugger for improved runtime debugging of the application.

@heronimus heronimus changed the title chore: consolidate debug Dockerfile with multi-stage build build: consolidate debug Dockerfile with multi-stage build Jan 15, 2024
@heronimus heronimus marked this pull request as ready for review January 15, 2024 19:29
Copy link

coderabbitai bot commented Jan 15, 2024

Walkthrough

The recent changes introduce a streamlined Docker setup for a game development environment, which includes a new multi-stage Dockerfile allowing for both standard and debug builds, and an updated Docker Compose override file for debugging. This setup enables developers to easily switch between normal and debug Docker images, enhancing the debugging process for the Cardinal services within the development environment.

Changes

File Path Change Summary
.ide-debug/compose.debug.override.yml Added a new file for Docker Compose overrides
cardinal/Dockerfile Modified to include a new stage for runtime debugging

Assessment against linked issues

Objective Addressed Explanation
Consolidate ide-debug Docker files (WORLD-716)

Poem

In the realm of code, where dockers glide,
A rabbit hopped, with debug pride.
Multi-stages built, with layers so wide,
Now devs dance, with bugs nowhere to hide. 🐰🎉

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 71de882 and c0d1c6e.
Files ignored due to path filters (1)
  • docker-compose.yml is excluded by: !**/*.yml
Files selected for processing (2)
  • .ide-debug/compose.debug.override.yml (1 hunks)
  • cardinal/Dockerfile (1 hunks)
Additional comments: 7
.ide-debug/compose.debug.override.yml (1)
  • 1-12: The compose.debug.override.yml file correctly defines the necessary overrides for debugging purposes, including setting the build target to runtime-debug and adding the required capabilities and security options for the Delve debugger.
cardinal/Dockerfile (6)
  • 4-4: The command to install the Delve debugger is correctly placed in the builder stage of the Dockerfile.
  • 6-7: Setting the working directory and copying the application source code are standard and necessary steps in the Dockerfile.
  • 10-10: The command to build the application with debugging flags is correct and follows best practices for creating a debuggable binary.
  • 13-13: The new stage runtime-debug is correctly defined to create a separate layer for the debug environment.
  • 15-16: The COPY commands are correctly used to bring the Delve binary and the debuggable application binary into the debug stage.
  • 18-18: The CMD directive correctly sets up the Delve debugger to run in headless mode, listen on the appropriate port, and execute the debuggable binary.

@heronimus heronimus merged commit b73fb8b into main Jan 22, 2024
4 checks passed
@heronimus heronimus deleted the heronimus/WORLD-716-consolidate-debug-config branch January 22, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants