-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide officially distributed docker images for SIO2 #126
Comments
I'm not an expert, but I think the image pushing part could be done with a github action. As for bringing down the image size, I achieved 3.38GB with the changes listed below:
Apart from this, I think the image should be split for workers and web. The only issue with that would be the need to remove Additionally, I think sox and flite (the debian packages' names are the same) should be included in the Dockerfile as to get rid of the warnings. They aren't big packages. |
Looking at this, I'm not sure if sandboxes/compilers should even be downloaded as a part of the image build:
Personally I'd recommend not putting sandboxes/compilers in the image, and instead telling users to run For general image size reduction, we should completely remove both pip and apt caches (as in, Alternatively, we could use the multi-stage builds from Docker, in which case the build/compile would happen in one stage, and then in final stage we'd only install the production dependencies, and copy the built app from the first stage. This would ensure we've got no leftover caches and the like. |
The removal of sandboxes is a great idea! Regarding the caches, I see 15MB in python bytecode (.pyc) and 3.7MB of leftovers in .cache/pip. Apt seems to leave 34MB in /var/lib/apt/lists, which can safely by removed (you will need to run If you want to see for yourself, you can use for example gdu - a TUI disk usage analyzer. |
Though for periodic short-term deployments without access to the internet (most of the ones I run), the sandboxes contained in the image are desirable, unless one wants to put the files on a local webserver and modify the url. If we stick to this approach, some viable solutions would be:
What do you think? |
Alternatively, we could build a separate Docker image that has them embedded, and offer two versions - one with sandboxes, one without. |
I think the bind-mount solution and a mention in the README (possibly with a commented line in docker-compose.yml) will suffice. |
I've spent some time on preparing a new Dockerfile, while also cleaning up some stuff (removing unnecessary things, cleaning up the development images, etc.). I can now build Docker images that will work both in production, and with all the development and testing tooling available in the repo ( The clean production ready image takes up 2.76 GB, while the development image - 4.59GB (however this includes all sandboxes as I didn't get around to removing them yet for the development images - though it might be a good idea to not remove them in this case). I'll clean this up a little further, and will try getting out a PR tomorrow or on Monday. I've also prepared a sioworkers Dockerfile, which I will PR separately. |
For some context: I run an instance of SIO2 (https://wilk.radom.pl), and have been traditionally doing that using my own Dockerfiles (see: docker-oioioi, docker-sio2). However due to lack of time, and generally not being a high school student anymore, these repos have largely been left unmaintained, and the version of SIO being use is really old.
I wanted to ask if it would be possible to provide automatically built images of oioioi (possibly also filetracker and sioworkers) on Docker Hub or GitHub container registry? I can provide help with bringing any necessary Dockerfiles up to a decent state, and overall maintenance/reducing image size (the image of oioioi that I've built from master today is almost 5GB in size, though that's probably in large part because of texlive).
The text was updated successfully, but these errors were encountered: