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

Building the cuebot image is extremely long (24h) #1217

Closed
romainf-ubi opened this issue Nov 10, 2022 · 6 comments
Closed

Building the cuebot image is extremely long (24h) #1217

romainf-ubi opened this issue Nov 10, 2022 · 6 comments
Labels
enhancement Improvement to an existing feature

Comments

@romainf-ubi
Copy link
Contributor

romainf-ubi commented Nov 10, 2022

Describe the enhancement
Would there be a solution to improve build time?

Version Number
Freshly cloned yesterday (2022/11/09) from master, so I guess it's somewhere after v0.15.22.

Additional context
It's the first time I try OpenCue, I went to the quick start documentation and it is taking ages to build the cuebot image. I mean it's been almost 18 hours and it is still building.

The command taking so much time is this one: RUN gradle build --info --stacktrace

Am I doing something wrong here?

Note: I'm on Windows, but I guess since everything runs in Docker containers, it should not be a problem here.

@romainf-ubi romainf-ubi added the enhancement Improvement to an existing feature label Nov 10, 2022
@bcipriano
Copy link
Collaborator

Typically the build process should take a few minutes if you're doing it from scratch, so there's definitely a problem here.

I've seen this in my personal environment before, same issue with that gradle command. Prior to #1198, when I tried to build the image on my M1 Mac it would hang at the same step. My theory is that because the base image (gradle:6.0.1-jdk11 at that time) did not publish a version that was native to my machine's architecture, there was some incompatibility there. And rather than fail outright, Gradle would just hang.

Once I upgraded the base image to gradle:6.0.1-jdk13, it started working for me. If you look at Docker Hub for those images, you'll see that arm64/v8 is supported for jdk13 but not jdk11. So switching to an image with the correct architecture resolved the problem for me.

It seems possible you're having the same issue since you're on Windows. You could try playing around with the base image in that Dockerfile. gradle:6.0.1-jdk13 is still quite old, I only chose it to minimize changes. Maybe a newer Gradle 6 image? Or even older ones.

Just some initial info to help you get started. We can dig into this more later.

@romainf-ubi
Copy link
Contributor Author

It eventually finished, but it took 86035 seconds (so that's 23 hours 53 minutes and 55 seconds)

On the other side, I tested with my Linux at home and it took 3 minutes. That's a pretty big difference 😂

Thanks @bcipriano for your workaround, I'll try that right now and post the results here after.

@romainf-ubi
Copy link
Contributor Author

romainf-ubi commented Nov 11, 2022

So the gradle image is already at 6.0.1-jdk13 presently and there are no other jdk for this version. So I'm testing the next minor versions. So far I'm at 6.4 and still having the issue.

I've also seen a difference, but I don't know gradle/java enough to know if it's an issue or not: when building on Windows, it fetches the modules through https://jcenter.bintray.com, but when building on Linux it uses a different domain https://repo.maven.apache.org. Is it normal?

Edit: compilation started to fail when I reached gradle:6.9, every previous versions had the same slowness issue.

@romainf-ubi
Copy link
Contributor Author

I found a promising answer in StackOverflow: https://stackoverflow.com/a/36533928

The problem is gradle can not connect to center repository in some country. When you create a new project or import, your center repository is jcenter() by default and whenever you want to build or sync or add new external dependency, gradle is going to connect to https://bintray.com/ but it can not and the building process is going to wait till connect to jcenter(), so this process might take long time ( +30 min ) , even you can not add new dependency .

But the issue is that I have no knowledge of gradle at all, so I tried to remove the jcenter() lines in cuebot/build.gradle, but it simply fails during build now :/

@romainf-ubi romainf-ubi changed the title Building the cuebot image is extremely long Building the cuebot image is extremely long (24h) Nov 11, 2022
@romainf-ubi
Copy link
Contributor Author

Someone suggested me to pass the HTTP proxy config to gradle. I did set them in the Dockerfile, using the http_proxy, https_proxy (and the same ones in capital letters), but it seems that gradle doesn't check these environment variables and apparently we need to pass them through. I guess it's a matter of adding a few command line options...

@romainf-ubi
Copy link
Contributor Author

As this is not really an issue with OpenCue but more with gradle, I'll close this issue.

Also, the solution is simply to not build the image locally and use the one already available on Docker Hub (i.e. a simple docker compose up -d at the root of OpenCue's repo does everything).

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

No branches or pull requests

2 participants