Skip to content
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

docker-compose file refers to non-existant image #3036

Open
JKHSDTV opened this issue Nov 25, 2024 · 15 comments
Open

docker-compose file refers to non-existant image #3036

JKHSDTV opened this issue Nov 25, 2024 · 15 comments

Comments

@JKHSDTV
Copy link

JKHSDTV commented Nov 25, 2024

The docker-compose.yml file does not seem to work, it refers to an image named sameersbn/gitlab:17.6.0 which does not seem to resolve nor can I find it on Docker hub. Did something possibly go wrong with a release or tag ?

If it takes more time to release that's fine, don't want to rush anyone, but as the compose file is upgraded I figured it might not be intentional.

@kkimurak
Copy link
Contributor

kkimurak commented Nov 25, 2024

The release process (CI triggered by pushing a tag with a specific version number) is failing before publishing the image to Docker Hub due to a timeout (exceed 1h limitation). Either build it yourself or wait for a fix. The CI status is displayed to the right of the latest commit (it turns into a green check mark when successful).

image

@kkimurak
Copy link
Contributor

Also, you can check if the release succeed by checking https://github.com/sameersbn/docker-gitlab/releases

@JKHSDTV
Copy link
Author

JKHSDTV commented Nov 25, 2024

Oh, I'm not worried about getting it myself, just wanted to notify that the current repo as it is isn't usable; meaning a new user who would check it out would not be able to run it (without knowing how to build it themselves). Like I said, I'm not in a rush.

@sachilles
Copy link
Collaborator

@kkimurak Unfortunately since GitLab version 17.6.0 our build time larger than 1 hour and overcomes to built time limit of 1 hour. Honestly, I tried to restart the CI several times and the result is always the same.

I guess, we should refactorize the entire build process or change the baseimage in order to reduce the build time. Do you have any thougts on this?

@kkimurak
Copy link
Contributor

@sachilles yeah Yes, I received the CI timeout notification email. I'm really thankful for your usual work but it may be a time to do unusual work.

Some middleware (gitlab-shell, gitlab-workhorse, gitlab-pages, gitaly) are written in golang and uses only a single binary and configuration file. I believe these can be built using golang:${GOLANG_VERSION} image. This should eliminate the time it takes to compile golang itself (we need to pull the image but I believe it is much faster than compilation).
I'm also trying to split them up to form multi-stage builds. If all goes well, the middleware build should be able to be parallelized. But I'm not sure when can I complete it..

@sachilles
Copy link
Collaborator

Another way could be to use the ruby image. I don't know, which build process (go or ruby) takes more time.

@kkimurak
Copy link
Contributor

kkimurak commented Nov 28, 2024

I think we can use both - I mean build middlewares on golang image and do asset compile of gitlab itself on ruby image, then COPY binaries from each middleware builder to final image.
However, the fact that the codebase for the middleware that needs to be built in golang (gitlab-workhorse) is integrated into the gitlab mainframe is what is bugging me. the gitlab codebase is huge and it would be inefficient to clone it twice. I'm trying to figure out how to reuse the gitlab codebase for the one that builds workhorse and the one that runs gitlab.

@kkimurak
Copy link
Contributor

kkimurak commented Dec 2, 2024

By the way, I realized that bundle install for gitlab-shell may not be necessary, at least for compilation (it seems to be used only for testing).

exec_as_git bundle config set --local deployment 'true'
exec_as_git bundle config set --local with 'development test'
exec_as_git bundle install -j"$(nproc)"

When I deleted these 3 lines, I was able to reduce the build time by about 2 minutes in my environment.
I have not yet confirmed whether gitlab-shell works properly in runtime, but if this change does not cause any problems, we may be able to reduce the CI of the release process to an hour with this small change.

@JKHSDTV
Copy link
Author

JKHSDTV commented Dec 9, 2024

Is the limit combined or per job ? If it's per job, why not split up the install.sh script into multiple parts ? I would think reducing the build time by 2 minutes would at best be a stop gap until the next upstream change makes it take a bit longer again. Cut the install script in half (at the elapsed time half, not the line half), persist the results of the first run as an intermediate image, then run the second half with that as base image, wouldn't that work ?

@kkimurak
Copy link
Contributor

kkimurak commented Dec 9, 2024

@JKHSDTV

why not split up the install.sh script into multiple parts ?

Yes, that's what I'm suggesting above.
Do you plan to submit a PR soon? I'm going to be busy until this weekend and I don't think I'll have time to do the splitting work or build the image locally. I'd really appreciate it if someone could do that.

@JKHSDTV
Copy link
Author

JKHSDTV commented Dec 9, 2024

Not me, I've never worked with CircleCI before nor do I have any way to test it. It's not impossible I'll find some time over the holidays (it's a 'simple' Docker build, so I should be able to do the gross of the work with just local Docker, right ?) but no promises

@kkimurak
Copy link
Contributor

@sachilles

Is it possible to add me as an administrator on sameersbn/docker-gitlab on CircleCI, so that I can transfer my paid plan to it?

I have done several validation builds and have no effective time-saving results at this time.
I have also noticed that the rake task gitlab:assets:compile takes roughly 75% of the build time.
So, I see no quick fix for this problem.

An interim solution is to upgrade the CircleCI plan to Performance. This will increase the build time limit to 3 hours. It seems that plan can be transfered to an organization which I have admin access (see https://circleci.com/docs/credits/#share-plans-across-organizations-billed-centrally).

@avvertix
Copy link
Contributor

avvertix commented Jan 6, 2025

@kkimurak @sachilles did you consider the option to move the build on GitHub Actions, seems that the job timeout is generous. I'm unsure if maintainer access is required to run a GitHub Actions workflow for the first time as I only used in repos where I have maintainer rights.

If you think this path valuable I might find some time to test creating a GitHub Action workflow to run the build step.

@kkimurak
Copy link
Contributor

kkimurak commented Jan 6, 2025

@avvertix Yeah GitHub actions is alternative way. However, the token for uploading to docker hub should be registered as a CircleCI environment secret, so it should be impossible to publish it to the sameersbn namespace (Since we are talking about namespace migration, I don't think this will be a problem).

@avvertix
Copy link
Contributor

avvertix commented Jan 7, 2025

@kkimurak I'm testing the build workflow in avvertix#1 it seems that the build alone takes roughly 45 minutes

Probably once I'll open the pr someone with rights should confirm so that actions are triggered. Let's see if I can get the whole Circle CI script conversion right and then we will see if runs. The point, as you mentioned, would be to ensure that the push can happen on Docker Hub. Maybe there we can use GitHub Packages as a possible alternative, the container registry should be free to use, the only point is that a maintainer must approve the first push to the registry and allow workflows to publish there.

I saw in #3042 (comment) that options to move to a multi-stage build are in progress. I guess that work could be valuable to figure out ways to reduce the build time (and possibly the weight of those images).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants