Yukkuricraft / Yukkuricraft

Da server
2 stars 0 forks source link

Come up with "production deployment" setup #19

Open remiscarlet opened 1 year ago

remiscarlet commented 1 year ago

Still using hacky 'load dev env as prod' crap. Start actually thinking of a proper deployment scheme under the minecraft user.

More generally this gives us the benefit of being able to take live traffic. Wouldn't want to do that with an env that's being dev'd on.

remiscarlet commented 1 year ago

In the future:

remiscarlet commented 1 year ago

YC user setup is finished.

Thoughts on deployments:

Further Questions:

Ultimately this is neat because we keep all business logic within our py api and don't rely on github actions for deployment.

remiscarlet commented 1 year ago

Random thoughts:

remiscarlet commented 11 months ago

At this point we have:

Mostly there at this point in terms of infra.

remiscarlet commented 10 months ago

Use https://hub.docker.com/r/databack/mysql-backup for mysql data backups. This will likely require a slight refactor to fs structure.

MC backups may be non-trivial. How to separate out backup plugins from prod vs dev envs? Want to backup prod, not dev, but ideally shared (or possible to be shared) configs.

Could have a bindmount for backup location on prod, and maybe ephem volume for dev? Should clean itself up on docker compose down.

remiscarlet commented 10 months ago

MC data

Mysql data

First layer backups (Local host):

Second layer backups (NAS):

Third layer (Cloud):

General

remiscarlet commented 10 months ago

https://github.com/Yukkuricraft/Yukkuricraft/commit/af3759393f652cb2dcecc2d203695eb6e5679002 implements MC backups using itzg/mc-backup with restic as the backend.

For mysql data, may want to create a new image using databack/mysql-backup as a base, install restic, and utilize /scripts.d/post-backup to move the mysql backups to the restic repo accordingly.

remiscarlet commented 10 months ago

https://github.com/Yukkuricraft/Yukkuricraft/commit/eab7fdf0f79bba17ec742223d3cd8148dbe67449 implements MySQL backups using databack/mysql-backup along with restic

Both MC and MySQL now use a custom image that chown's the restic directory first before continuing with the original entrypoints.

Remaining:

remiscarlet commented 10 months ago

Not super important for now but should implement a sidecar to run restic check https://github.com/Yukkuricraft/Yukkuricraft/issues/33

remiscarlet commented 10 months ago

Consider: Eventually have every worldgroup backed up at the same time. Will probably have to reimplement some portion of itzg/mc-backup to accomplish this.

https://github.com/Yukkuricraft/Yukkuricraft/issues/34