-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
CI: Manage separate docker image for our own compiler #113
Comments
Yep - what should we name it |
I'm fine with anything. @ErikSchierboom Do you know if it will speed up the build process? @ee7 Any thoughts? |
@ynfle It would, but the main question is: why do we even build the compiler ourselves? There are official Nim Docker images that can be used. These images also include Alpine versions. |
It lists the following benefits:
These are all true, although IMHO I'd still go with the official Docker images, but 🤷 I noticed that there are three different Nim Docker images: regular, slim and onbuild. It might be worth investigating how much of a size difference there is with the slim version (and if it still works). |
This repo was previously using the Alpine slim flavor. The slim image is still about 250 MB, because the official images have to support things like compiling Nim to C++ and JS (and supporting Our image is about 10x smaller.
Part of the point was to try Please see these commit messages: This image is nice and minimal, so I'd like to keep it if the only downsides are as stated. To speed up CI, maintaining our own Docker image would work. Is it sufficient/easier to cache the Docker layers properly instead? I didn't look into it, but this was my original idea for speeding up CI. Currently I think we do cache, but we only hit it when we already built with that commit ref: nim-test-runner/.github/workflows/docker.yml Lines 22 to 28 in 308e296
See also these docs:
Note that
So if using GitHub's caching and this approach, you'd have to deal with a 5 minute build if there's a week of inactivity (or add a job that does nothing but access the cache every 6 days). |
I propose |
Thanks for explaining @ee7. As base image might be best then. |
Thanks I'll have a look |
@ee7 Can't we just "steal" the nim compiler from It's real pain to wait 5+ minutes every time I push to see if there is an error and what it is. I am currently not able to install docker locally to test the commands, and that long for feedback is anyways frustrating as my environment doesn't precisely match the CI's |
Is the end rust a single binary (or directory)? If so, you could do a mult-stage build and copy things. |
Build and push times decreased to ~1 from 5-7.5 minutes! 🚀 💨 🚤 🐎 |
I'm gonna close this as we have a working base image |
The CI takes over 5 minutes to build because we rebuild the compiler for each docker build.
We do this, so we can have a significantly smaller image which hopefully means faster throughput.
Would it help to maintain a sperate docker image that we use as our base to be able to build on top of? Would that rebuild the compiler each time? (I don't think so, but I'm curious to hear what everyone else thinks)
@iHiD would we be able to have a separate repo for that? We could use it for all the nim tooling repos
The text was updated successfully, but these errors were encountered: