joshenders / enderscraft

Enderscraft is Minecraft™ repackaged for on-demand "serverless" computing
1 stars 0 forks source link

Container volume snapshot backup and restore #4

Open joshenders opened 3 years ago

joshenders commented 3 years ago
joshenders commented 3 years ago

After some research in EFS/EBS/S3. EBS volumes seem like the right approach here. They support snapshots (aiming to do like 6-12/hour?) and the snapshots themselves can be backed up to S3, for portability. S3 is a fall back but EFS doesn't seem like a great fit.

joshenders commented 3 years ago
  • Backup server state (/srv/minecraft/world) every N minutes (5min?) to ... S3? Ensure data is safe to snapshot via rcon?

/auto-save's every 5 mins by default to EFS. Want durable S3 backups after every session. Wrote lambdas to idle check and safe shutdown but now thinking this may be bettered handled as a healthcheck script since there's a timelimit on lambdas. If so, may use micropython and rewrite entrypoint.sh in python.

  • On-startup, if backup exists, restore backup instead of re-initializing. Offer forced re-initialization via env variable

Done. ENV variable is FORCE_CREATE_NEW_WORLD

  • Tickrate FF on resume

Not possible without a mod. Skip for now.

joshenders commented 3 years ago

Need to solve several problems here:

  1. Detect when server is idle. (solution?: lambda supervisor)
  2. If server is idle, save, stop server, compress backup and upload /data to S3. (Solution: Can be done in entrypoint script.)

Implement process supervisor as a lambda function

Pros

Cons