-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Improve image build speed (Discussion,Ideas) #2860
Comments
@sameersbn @solidnerd question is the reason for compiling ruby the --enable-shared parameter? Is this not default, second question can we not use the latest ruby 3.2.2? Im looking to speed up the build process so I'm looking why the image compiles ruby itself |
I authored the change (Install ruby from source - #2429) to fill gitlab operation requirement on 14.3.0 (ruby 2.7.4). Through a few years brightbox/ruby-ng was used as ruby package installation source but it has stopped updating, Early releases of sameersbn/gitlab just put binaries (release tarballs, rubygem caches and so on) but it have been revised by sameersbn - see #30 (comment) I once tried porting the ruby installation process to a Dockerfile in the hopes that the cache would be utilized. But for local builds, the speedup was only a few minutes. I also had an idea to replace the base image from ubuntu to a ruby image, but I haven't tried it yet. For --enable-shared option - I forgot the details about this. I feel like it was needed at runtime, but I'm not sure. I will test to build / run image later, For ruby 3.2.x - As far as I checked https://gitlab.com/gitlab-org/gitlab/-/issues/404750 , we can test it, |
@kkimurak thank you very much this helps a lot. A few minutes gain on several different processes can become a significant improvement. |
Im also looking at more automation for the repository. |
Yes, automation is one of justice. Totally agree. However, I recently came across an example of a reasonably well-known repository operated with almost complete automation that was forced to fork due to the administrator being unreachable (https://github.com/TheRandomLabs/scoop-nonportable ). I'm afraid of ending up the same way. There are limits to the amount of work we (the community) can do. If a bug is introduced through automation, it may take some time for it to be noticed (even now, when updates are done manually, bugs are often discovered late). The maintainers are doing a great job, but I'm a worrier.. |
By the way, built image without --enable-shared and with ruby 3.2.2 both worked. At least I have confirmed image build, updating password, creating new blank project and pull from / push to the repository succeed. |
@kkimurak Thank you for the update on Ruby. Furthermore, I have quite some experience with automation of repositories, have been running GitLab for years, and also using GitLab with my employer. When it comes to writing a script to sync repositories, why are you not using |
@kkimurak should we have a separate repository for assets? Like what I proposed earlier? I'm thinking what would be a good workflow. For example, I have a gitlab-runner project that can detect if there is a new version online and then create a commit and start a new pipeline that builds the image. very handy, did not have to do anything since version 15.9.1, it spits out a new image as soon as there is a release and it checks for a new release about 3 times a week on a scheduled pipeline. This is what I want to create with this repository. The problem I'm facing I'm not very good with circleci. Another issue is that this repository has no strict rules for commits. I'm a solution architect, and automation also requires strict rules on process and workflow. If we enforce strict rules on the commits for example, the convention git-conventional-commits, then it would allow us to auto-generate the CHANGELOG etc, which means another item is automated. However, that does require enforcing strict rules and rewriting the entire history of the repository. But it comes with the benefit of automation. What do you think? |
First, if I understand correctly, I found similar cli tools
It looks good, but I would like to ask just out of curiosity, would it be difficult to maintain a mono-repo?
Additionally you (and me, of course) may have no permission to change configuration of
This also looks good. Anyway, I'm not very knowledgeable in this area, but for example, is it possible to keep the current commits as they are and set strict commit rules for future commits? I raised a variety of concerns, but I took them in a positive manner. It's good to have faster builds and maintain regular releases. |
The best future I see is trying to automate most of it, even for example template generation and auto scripting, might break a few things like currently used variables however would be cool to have autoconfiguration for new variables and features as soon as they are release, and you only have to approve the MR. Its all possible just require some work. |
Note: I tested the impact of --enable-shared flag during ruby build (that is currently used) on image build time. When building gitlab 17.2.0 without using the flag, the total build time in my environment increased by 3 minutes to a total of about 45 minutes. Of course I have pruned docker build cache and images before each build. |
This is a discussion for a concept I'm working on; it is also preliminary work on hopefully support for arm64.
I'm working on a concept to improve the build speed of the image.
The concept I'm using within my work and in my private repositories has a base image automatically updated with a CI cron job at least once a week. This image is written to the registry with the tag
base.
The next stage of the build is simply using this image tag.Furthermore, I want several time-consuming build stages of this image to be extracted to speed up the building process.
For example, ruby 3.0.6 is used throughout several versions. However, building this every time is time-consuming.
Therefor, I'm looking towards having this specific ruby bing built by a CI process, which then writes it to the repository as an asset as a *.deb file stored in the repository under git-lfs. The install stage has to checkout the repository, perform git-lfs checkout, start the build context, and then only install the *.deb package. This can also be done with the other compilation parts.
This is a rough draft; I'm looking forward to input and comments.
Please let me know what you think.
Disclaimer: Due to my profession, I'm a hefty GitLab user; I can quickly build all of this in GitLab; however, building it within GitHub actions will be a challenge and probably require help and input from others.
The text was updated successfully, but these errors were encountered: