Closed MitchTalmadge closed 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.
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.
@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!
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
https://github.com/marketplace/actions/build-and-push-docker-images this might be a good github action we could try and use
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.
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.
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. 👍
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.
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.
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.
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.
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 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!
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.
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
ordocker-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:
which will also be deployed to the
:latest
image tag.ampinstmgr
from the CubeCoders Debian repository (see https://cubecoders.com/AMPInstall)AMPCache-2086.zip
), store it in/opt
somewhere, and on startup the entrypoint script should copy that downloaded file into/home/amp/.ampdata/instances/
./home/amp/.ampdata/instances/
is because this is part of a volume which can only be accessed once the image is started on the machine where the volume is created. We will not have access during CI.AMP versions can be obtained from https://cubecoders.com/AMPVersions.json
Concerns:
pull
new images to keep getting updates for future versions of the container. However, since auto-update will continue working for the images that already exist before these changes, these users will be un-affected until they update. If they do update, then they should hopefully check the changelog and understand that image updates are important from then on.Proposal Changelog:
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