MitchTalmadge / AMP-dockerized

CubeCoders AMP in a Docker Image. Easily create game servers for games like Minecraft, GMod, TF2, Factorio, and StarBound!
https://hub.docker.com/r/mitchtalmadge/amp-dockerized
Other
91 stars 22 forks source link

Proposal: Release AMP Updates as Docker Images; Remove Auto-Update #40

Closed MitchTalmadge closed 3 years ago

MitchTalmadge commented 3 years ago

Problem:

Right now this image automatically pulls updates to AMP and ampinstmgr on startup. This can make startup take ~10 minutes every time AMP releases an update because of how they throttle download speeds.

Proposed Solution:

I propose that we use GitHub Actions continuous integration to detect AMP updates on a cron schedule to automatically release new AMP-Dockerized images on a rolling basis as updates are released.

These auto-generated images would come with the latest AMP version (including ampinstmgr) pre-installed so that updating containers is as easy as running docker pull mitchtalmadge/amp-dockerized:latest or docker-compose pull.

This would be accomplished by the GitHub Actions CI making a commit to the master branch with the latest version number hard-coded into the Dockerfile. Then it would tag the commit so that a release is generated in a format similar to this:

mitchtalmadge/amp-dockerized:v6-amp2.0.8.6

which will also be deployed to the :latest image tag.

AMP versions can be obtained from https://cubecoders.com/AMPVersions.json

Concerns:

Proposal Changelog:

  1. Changed download method of ampinstmgr based on @Joly0's suggestion to use the CubeCoders Debian repo.

Please let me know what you think of this and of any pitfalls I may have not thought of. I am open to ideas!

/cc @Joly0

Joly0 commented 3 years ago

Just a quick side-note: Amp has a package for Debian and Ubuntu, so adding cubecoders repo and running apt update + apt install ampinstmgr would work perfectly, without adding unneeded layers to the dockerfile which would increase image size. Additionally, afaik, the repo is not as hard affected by the slower download speed as the normal zip download is.

MitchTalmadge commented 3 years ago

That's a great idea! Their repo also saves old copies if in case we wanted to select by version. This would make the image more deterministic than simply downloading the latest ampinstmgr at the right time. I've changed the proposal.

MitchTalmadge commented 3 years ago

@CorneliousJD You know a lot more about Unraid than I do. How are images updated there? Does it happen automatically? What about container restarts? I am curious what your current update process is for this image. I appreciate any shared experiences!

Joly0 commented 3 years ago

I can answer this question aswell, as i work with Unraid alot. In unraid docker containers are very easy to restart and update as you have a good graphical interface. Its as easy as right-clicking the container -> update or right-clicking the container -> restart. But updating like that would only work, if the tag remains the same, if it doesnt, its right-clicking the container -> edit -> changing the tag -> hit apply and it pulls the new image and updates

Joly0 commented 3 years ago

https://github.com/marketplace/actions/build-and-push-docker-images this might be a good github action we could try and use

CorneliousJD commented 3 years ago

So for normal updates most users have it set to auto-check their tag for updates, In this case it would be mitchtalmadge/amp-dockerized:latest

So they should get the latest tag every time it checks, there's a plugin to auto-check and auto-update on a scheudle of your choosing. e,.g. every night.

Also, if it's the type of container that checks for AMP updates every time it launches, then most users should also be doing weekly backups of their container volumes (we call it appdata on unraid) and part of that is restarting all containers, so it would grab that update as well regularly. :)

I just saw an update push through last night, I got this notification.

image

MitchTalmadge commented 3 years ago

Thanks both of you for the feedback! It sounds like most people use the :latest tag, and with the automatic updates, this will probably be an improvement in terms of getting AMP updates out faster considering how containers are unlikely to be restarted until a backup.

CorneliousJD commented 3 years ago

I think that would be a good idea as well. In the unRaid community we see a lot of it both ways, but its very user friendly when the :latest tag updates and then users who run nightly update checks will wake up to their AMP updated the next morning :)

Of course it's still up to them to configure the updates but overall I think that would result in users getting the latest version MUCH faster.

Ping me if you need anything else. 👍

MitchTalmadge commented 3 years ago

Of course it's still up to them to configure the updates

Well in terms of upgrading from one AMP version to the next, all they have to do is get the newest :latest image. The entrypoint script does the upgrading automatically :)

Thanks again! Really appreciate the experience.

MitchTalmadge commented 3 years ago

I'm remembering again why I didn't use the CubeCoders apt repo in the past. I tried but it would throw errors on the postinst step when trying to configure systemctl, which is not a feature of Docker containers (and I'd rather not try to install it). I didn't find a way to disable this step, I believe it is hard coded by CubeCoders.

However, we could just directly download and extract the deb package, then copy the ampinstmgr out of it. That would work fine.

MitchTalmadge commented 3 years ago

However, we could just directly download and extract the deb package, then copy the ampinstmgr out of it. That would work fine.

I've started experimenting with this in the branch staging-auto-update, and what I've quoted above is working great.

MitchTalmadge commented 3 years ago

I was also able to get AMP Core downloaded and copied into the instances directory on startup, tested and working, which means everything AMP needs to run is now downloaded at build time! I now need to set up a cron job w/ GH Actions to check for updates and produce tags which trigger builds.

Joly0 commented 3 years ago

Btw, if you want a more updated version of java, https://github.com/ameisen/jdk-mc might be a good idea. Its a modified currently pre-release version of java 14 or 15 based on the original openjdk, but modified to work with older versions of minecraft aswell. I use it on my own server to run minecraft versions from 1.7.10 all the way up to current 1.16.4 and dont have any problems, for my pc aswell. Just an idea if you really want to update java to a newer version (which in my opinion would be a good idea) then this should work.

MitchTalmadge commented 3 years ago

I have created a GitHub Actions job in the branch linked above. It successfully detects new versions of AMP and creates tags from them, which Docker Hub builds into an image using the latest ampinstmgr and AMP Core downloads. It will run daily at 9PM UTC, since most AMP releases have been announced around 6-8PM UTC. Here's an example tag.

I don't hard-code the version numbers into the image because it's generally just too much complexity and not necessary.

I am doing a bunch of testing before merging to master, but so far things are working great.

Btw, if you want a more updated version of java, https://github.com/ameisen/jdk-mc might be a good idea. Its a modified currently pre-release version of java 14 or 15 based on the original openjdk, but modified to work with older versions of minecraft aswell. I use it on my own server to run minecraft versions from 1.7.10 all the way up to current 1.16.4 and dont have any problems, for my pc aswell. Just an idea if you really want to update java to a newer version (which in my opinion would be a good idea) then this should work.

I'll take a look! Thanks!

MitchTalmadge commented 3 years ago

Ok, this is done now. I'll keep monitoring it as updates come out, but with all my testing it has been running really well.