-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix: add nakama-debug on docker-compose to fix debug mode #51
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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? 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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.
what if we use two docker compose files, e.g. docker-compose.dev.yaml
and docker-compose.prod.yaml
, instead of putting all containers here? The dev compose file contains the debug containers, and it'll be run only in dev or with the --debug
world CLI flag.
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.
Instead of adding nakama-debug
, a trick here is to just pass in the depends_on container name using environment variable https://stackoverflow.com/questions/29377853/how-can-i-use-environment-variables-in-docker-compose
If the --debug
flag in the CLI is used, inject an environment variable that would change the depended container name to cardinal-debug
, otherwise it would use the default value cardinal
Tried this but error.
I will try to find another solutions. |
ba043c9
to
7682f27
Compare
Updated using two docker-compose file. |
The whole goal is to reduce the number of duplication. If you are creating a separate docker compose then you end up with even more duplication |
this follows docker compose's extend rules. (summary of rules here). it's a bit error-prone if you don't know how the override works on different options, but imo it's an ok approach to this, similar to a plugin system. you just include it for debug mode. setting probably we can try using compose profiles? run the debug containers when in the |
7682f27
to
82d82ed
Compare
Updated to short syntax, it works but need to remove the condition specifies that a dependency is expected to be "healthy" |
You can overwrite the entrypoint/cmd in docker compose for the Nakama service to run the healthcheck from within the container. Just make it run CockroachdB healthcheck API: https://www.cockroachlabs.com/docs/api/cluster/v2.html#operation/health with retries: https://stackoverflow.com/questions/42873285/curl-retry-mechanism |
After i'm testing it, i think we don't need to do health check for nakama-db, using sort syntax should be enough. I tried to run docker compose without nakama-db, nakama will automatically retry to run |
Closes: WORLD-1154 ## Overview Re enable debug mode with delve on `world cardinal start` with `--debug` flag ## Brief Changelog - Re activate `--debug` flag - Add `nakama-debug` container to fix nakama cannot run because `cardinal` is not running ## Testing and Verifying - Tested manually using `world cardinal start --debug` command and delve with vs code Notes : Unit test failed because Argus-Labs/starter-game-template#51 need to be merged first and create new tag
Adding nakama-debug on docker-compose.yml to fix running cardinal on debug mode
--debug
flag.Previously
cardinal-debug
container neednakama
butnakama
depends-oncardinal
notcardinal-debug
so this results an error when running cardinal with debug mode.**
Updated using two docker-compose file.CLI will run with args -f docker-compose.yml -f docker-compose.debug.yml up in --debug mode and it will override the first docker-compose file with the second one.
Updated using short syntax with envar passed from world-cli