tools/dockerfile: Cache Java downloads to reduce flakiness#22902
tools/dockerfile: Cache Java downloads to reduce flakiness#22902ejona86 wants to merge 2 commits intogrpc:masterfrom
Conversation
Pre-running the build will save artifacts in ~/.gradle which can be reused for the real build. This reduces our reliance on build-time downloads which hopefully reduces flakiness rate. This increases the container size by ~300 MB. Fixes grpc#18892
| apt-get clean | ||
|
|
||
| # Trigger download of as many artifacts as possible, to reduce download | ||
| # flakiness rate. https://github.com/grpc/grpc/issues/18892 |
There was a problem hiding this comment.
Thought I commented earlier but I didn't see it.
Suggest just adding comment to describe behavior here with respect to:
Will any of the dependencies installed here ever be refreshed during Java' per-interop-run build_interop.sh? And if any, which ones?
There was a problem hiding this comment.
"all the ones that are different" have to be downloaded. It is because the version of grpc-java here and the version during the actual build_interop.sh are unrelated. So it's sort of ¯_(ツ)_/¯ and hope that it helps. It's not clear what the form of that comment would look like to be helpful.
There was a problem hiding this comment.
Got it. In that case, maybe add an actionable error message to Java's build_interop.sh?
Something like:
function die {
echo $1
exit 1
}
./gradlew --no-daemon :grpc-interop-testing:installDist -PskipCodegen=true -PskipAndroid=true || die "if gradle failed due to a download failure, re-building the base docker image might help by refreshing cached dependencies"
…n/generate_projects.sh is too hard to run
|
I realize now that this will impact the interop images that are published for historical testing. I don't want those to have this baggage. I think I will swap to running gradle twice Since I've gotten practice using Google Cloud Build, and am reasonably happy with it, I could make a Build that would create a cache on GCS. That would be possible in the medium-term. We would use it for our Kokoro builds as well. |
Pre-running the build will save artifacts in ~/.gradle which can be
reused for the real build. This reduces our reliance on build-time
downloads which hopefully reduces flakiness rate.
This increases the container size by ~300 MB.
Fixes #18892