Skip to content

tools/dockerfile: Cache Java downloads to reduce flakiness#22902

Closed
ejona86 wants to merge 2 commits intogrpc:masterfrom
ejona86:java-interop-cache
Closed

tools/dockerfile: Cache Java downloads to reduce flakiness#22902
ejona86 wants to merge 2 commits intogrpc:masterfrom
ejona86:java-interop-cache

Conversation

@ejona86
Copy link
Copy Markdown
Member

@ejona86 ejona86 commented May 7, 2020

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

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
@ejona86 ejona86 added the release notes: no Indicates if PR should not be in release notes label May 7, 2020
@ejona86 ejona86 requested a review from apolcyn May 7, 2020 23:55
apt-get clean

# Trigger download of as many artifacts as possible, to reduce download
# flakiness rate. https://github.com/grpc/grpc/issues/18892
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

@ejona86
Copy link
Copy Markdown
Member Author

ejona86 commented May 11, 2020

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 gradlew || gradlew sort of fashion. "Poor man's retry."

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.

@ejona86 ejona86 closed this May 11, 2020
@ejona86 ejona86 deleted the java-interop-cache branch May 11, 2020 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FAILURE: build_docker_java

2 participants