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

Gradle Enterprise Trial #4705

Merged
merged 20 commits into from
Dec 9, 2021
Merged

Gradle Enterprise Trial #4705

merged 20 commits into from
Dec 9, 2021

Conversation

kiview
Copy link
Member

@kiview kiview commented Nov 29, 2021

This branch is following along with the Gradle Enterprise trial.

Keeping it in draft mode for now, but ideally, we will have a mergeable PR in the end, improving our GE integration and overall Gradle build.

@kiview kiview marked this pull request as ready for review November 29, 2021 09:34
@kiview kiview marked this pull request as draft November 29, 2021 09:35
Comment on lines +53 to +55
// TODO: named input and relative path for `srcDir` to make task more cacheable
inputs.dir(srcDir)
args(srcDir, "-d", outputDir)
// TODO: `outputDir` as relative path to make task more cacheable
Copy link
Member Author

Choose a reason for hiding this comment

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

We can improve this as a follow-up, to make caching between local-ci better.

@@ -1,3 +1,3 @@
org.gradle.parallel=false
org.gradle.parallel=true
Copy link
Member Author

Choose a reason for hiding this comment

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

No strong opinion on this, but was recommended by the Gradle colleagues.

Copy link
Member

Choose a reason for hiding this comment

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

IIRC this also runs tests in parallel, and if someone attempts to build the whole project locally, they would be running a lot of heavy tests in parallel - this needs verification tho

Copy link
Member Author

Choose a reason for hiding this comment

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

When I discussed this with Gradle, they gave me the information, that this won't run the tests itself in one project in parallel, however, I agree that we maybe should again measure the effect on this on a full build (e.g. running all subprojects in parallel).

The way I tested it (on our CI and running only core build) it had no negative effect.

We can also rollback this individual change for now.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, it won't change how tests are running in a single module, but tests from multiple modules (core, kafka, db2, ...) will run in parallel IIRC, so I would recommend reverting it (unless we verify that it isn't the case, or find a way to prevent it

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed those tests could be run in parallel. It is not a real issue with the way we currently fan out CI jobs, but it still seems potentially bad for users running the whole project. So let's roll back and only activate after conscious evluation.

Copy link
Member

Choose a reason for hiding this comment

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

Just to add a data point, I've had dev machines that were unable to run our build in parallel without also limiting the number of workers. The docker VM can often be undersized compared to the number of host machine cores, and some of the containers we run are too greedy to run side-by-side when other modules are trying to run their tests too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for sharing, definitely better to keep this off then 👍
The experiments we run did not really consider this, since the CI is set up in a way where this does not apply.

It is also interesting how more stable and reliable task caching will influence this.

Copy link
Member

Choose a reason for hiding this comment

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

alternative: turn it on on CIs only

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's leave it off, have our CI generate more data, and then we can measure the impact (i.e. improvement, if any) better of turning it on on CI.

org.gradle.caching=true

org.gradle.configureondemand=true
Copy link
Member Author

Choose a reason for hiding this comment

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

This was also recommended.

'x-amz-acl': 'public-read'
]
remote(HttpBuildCache) {
push = isCI
Copy link
Member Author

Choose a reason for hiding this comment

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

Gradle colleagues recommended to always push to cache, to get a better populated cache.

@kiview kiview marked this pull request as ready for review December 7, 2021 10:55
@kiview
Copy link
Member Author

kiview commented Dec 7, 2021

We finished the trial and this could get merged to master now. Completely replaces our S3 cache with the Gradle Enterprise cache. This will also get us rid of the S3 cache exception in the logs for local builds.

build.gradle Show resolved Hide resolved
Copy link
Member

@bsideup bsideup left a comment

Choose a reason for hiding this comment

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

💯 Great job!

Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

LGTM!

@kiview kiview added this to the next milestone Dec 9, 2021
@kiview kiview merged commit b4fcec8 into master Dec 9, 2021
@delete-merged-branch delete-merged-branch bot deleted the gradle-enterprise-trial branch December 9, 2021 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants