#Experience with gradle dagger pipelines

1 messages · Page 1 of 1 (latest)

paper echo
#

Hello Everyone,

I am currently trying to migrate some of our corporate pipelines using gradle as build tool. What I am experiencing is that the builds are very very slow. One of our services (which I can not share here for compliance reasons) takes about 4 minutes till the start of the first relevant gradle task (here spotlessInternalRegisterDependencies). I have attached a part of the output with the execution times here:

...
19: exec gradle --console=plain --no-daemon test
19: [0.54s] 
19: [0.54s] Welcome to Gradle 8.3!
...
19: [0.54s] To honour the JVM settings for this build a single-use Daemon process will be forked. ...
19: [1.24s] Daemon will be stopped at the end of the build 
19: [233.1s] > Task :spotlessInternalRegisterDependencies
19: [235.8s] > Task :spotlessKotlin
19: [235.8s] > Task :spotlessKotlinApply
19: [236.0s] > Task :spotlessKotlinGradle
19: [236.0s] > Task :spotlessKotlinGradleApply
19: [236.0s] > Task :spotlessApply
19: [236.0s] > Task :spotlessCheckOrFormat
19: [266.0s] > Task :compileKotlin
19: [325.5s] > Task :processResources
19: [325.5s] > Task :processTestResources NO-SOURCE
19: [332.6s] > Task :compileJava NO-SOURCE
19: [332.6s] > Task :classes
19: [344.9s] > Task :compileTestKotlin
19: [344.9s] > Task :compileTestJava NO-SOURCE
19: [344.9s] > Task :testClasses UP-TO-DATE
19: [356.4s] 
19: [356.4s] > Task :test
...

I prepared a much smaller example project here (https://github.com/sbszcz/chuck-norris-international/blob/main/dagger-pipeline/main.go) with almost the same dagger code. The overall execution time is much less but also too much in comparison with a complete local-machine gradle run (without gradle daemon).

Does anyone experience the same behavior and have some best practices with dagger and gradle?

Does it make sense to use the gradle daemon (which I have disabled in the aforementioned pipelines)?

Thanks,
Sebastian

GitHub

Contribute to sbszcz/chuck-norris-international development by creating an account on GitHub.

worn ember
#

👋 @paper echo skimming through the pipeine, seems like the main reason why it's taking so long is because it doesn't seem to be using any sort of caching (https://docs.dagger.io/quickstart/635927/caching). I have some bandwidth this afternoon my time to help you out setting up the gradle caching so you can get better build times

paper echo
#

Hey @worn ember thank you very much for your response. It was indeed due to the missing cache. There is now a cache volume at /home/gradle/.gradle. The long execution time was caused by the fact that all gradle dependencies were being downloaded again each time. I've updated the dagger code in the linked example project.