CI/CD For Game Modules? (dealing with server restarts to apply module updates)

Hi there,

I’m curious what the best practice is, or how people generally work with the fact that the server needs to be restarted into order to load changes to a module.

This makes bug fixing, support, and just general enhancement of module code pretty hazardous since it will interrupt all user sessions. I can’t think of other modern games or online services that frequently kill user sessions to update serverside code. For my project, I’m thinking about a platform that allows the user community to submit their own modules. This will be painful to implement if we have to kick all users out for module updates to take place.

Is it possible to build some sort of CI/CD process that will migrate user sessions from Server A to Server B, and once Server A is empty restart it? Then we could have some kind of rolling server restart so users aren’t affected when modules are updated.

I’m curious if how other developers have dealt with this, or if Heroic Labs has any recommendations. Thanks!

What you are describing is exactly what we’ve built into Heroic Cloud; A modern CI pipeline where your code is bundled specifically for Nakama, and built into a Docker image that you can deploy forward and backward.

Alongside Nakama Enterprise, you can build your game logic to “hand over”/migrate game play to other Nakama instances in your dedicated cluster and transparently transfer the match logic over to nodes that are not restarting. Heroic Cloud will then speak with Nakama to schedule reboot and wait for Nakama instances to transfer state.

As you can tell, this is not trivial to build; All this functionality, alongside dedicated deployment, logging, monitoring and metrics are what’s included in Heroic Cloud.

Got it! This all makes perfect sense now. Thanks!