Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: update debug mode build using consolidated multistage dockerfile #21

Merged
merged 4 commits into from
Jan 22, 2024

Conversation

heronimus
Copy link
Contributor

@heronimus heronimus commented Jan 15, 2024

Closes: #WORLD-716

What is the purpose of the change

Update debug mode (--debug) using consolidated multistage dockerfile.
See WORLD-716 and Argus-Labs/starter-game-template#34 for complete context.

  • Adjust the --debug mode to run the cardinal-debug container instead normal cardinal container.

Testing and Verifying

  • Run & build with debug mode: world cardinal start --build --debug

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor
    • Enhanced the Docker Compose functionality to dynamically adjust configurations based on debug mode settings.
    • Modified the restart logic to select different Docker services based on the debug mode.

Copy link

coderabbitai bot commented Jan 15, 2024

Warning

Rate Limit Exceeded

@heronimus has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 23 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 02b7bfc and 0451e48.

Walkthrough

The recent changes involve consolidating Docker files for development and debugging into a single Dockerfile with multi-stage builds, and adjusting the Docker Compose configuration to select the appropriate build target based on a debug flag. This streamlines the development environment setup by using conditional logic to toggle between standard and debug configurations.

Changes

File Path Change Summary
common/tea_cmd/docker.go Modified to set yml variable and update args slice based on cfg.Debug flag
cmd/world/cardinal/restart.go Introduces conditional logic to select different Docker services to restart based on cfg.Debug flag
.ide-debug/Dockerfile and docker-compose.yml Consolidated into primary Dockerfile with multi-stage builds for image and image-debug targets

Assessment against linked issues

Objective Addressed Explanation
Consolidate ide-debug Docker files (WORLD-716) The consolidation of Docker files into a multi-stage build setup in the primary Dockerfile, along with the corresponding Docker Compose adjustments, directly addresses this objective.

Poem

In the codebase, deep and wide,
A rabbit hopped with savvy stride.
Docker files, once far and wide,
Now together, side by side. 🐇✨

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 598a34f and e400fce.
Files selected for processing (1)
  • common/tea_cmd/docker.go (1 hunks)
Additional comments: 3
common/tea_cmd/docker.go (3)
  • 30-30: The assignment of yml to the standard Docker Compose file path is correct and follows best practices for path handling in Go.
  • 33-33: Appending the standard compose file to the args slice when not in debug mode is a clean and straightforward approach.
  • 35-36: The handling of the debug mode by appending the debug override YAML file to the args slice is appropriate and aligns with the PR objectives.

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (598a34f) 61.29% compared to head (e400fce) 61.29%.
Report is 2 commits behind head on main.

❗ Current head e400fce differs from pull request most recent head 0451e48. Consider uploading reports for the commit 0451e48 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #21   +/-   ##
=======================================
  Coverage   61.29%   61.29%           
=======================================
  Files           4        4           
  Lines         124      124           
=======================================
  Hits           76       76           
  Misses         45       45           
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 e400fce and 16fa6ef.
Files selected for processing (1)
  • common/tea_cmd/docker.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • common/tea_cmd/docker.go

Copy link
Collaborator

@zulkhair zulkhair left a comment

Choose a reason for hiding this comment

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

Consider to include DockerServiceCardinalDebug in func

  • DockerRestart
  • DockerStopAll

and may have to add a check whether cardinal was previously run in debug mode

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 16fa6ef and 02b7bfc.
Files selected for processing (2)
  • cmd/world/cardinal/restart.go (1 hunks)
  • common/tea_cmd/docker.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • common/tea_cmd/docker.go
Additional comments: 1
cmd/world/cardinal/restart.go (1)
  • 30-40: The conditional logic to restart different Docker services based on the cfg.Debug flag is implemented correctly. However, ensure that tea_cmd.DockerServiceCardinalDebug and tea_cmd.DockerServiceCardinal are defined and correctly configured in the respective Docker Compose files.

@heronimus
Copy link
Contributor Author

Consider to include DockerServiceCardinalDebug in func

  • DockerRestart
  • DockerStopAll

and may have to add a check whether cardinal was previously run in debug mode

Consider to include DockerServiceCardinalDebug in func

  • DockerRestart
  • DockerStopAll

and may have to add a check whether cardinal was previously run in debug mode

@zulkhair done, PTAL again 👍
Also, do u know about the failing Test CI? I noticed it fails on the main branch as well, but I couldn't pinpoint exactly which unit test is failing.

@heronimus
Copy link
Contributor Author

@zulkhair Also if this PR looks good, please approve this one as well Argus-Labs/starter-game-template#34 thanks :D

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

Successfully merging this pull request may close these issues.

2 participants