Skip to content

airbyte-ci: disable gradle cache cleanup #31811

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

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented Oct 25, 2023

What

This relates to #31439

  • Gradle has a builtin cache clean-up mechanism that we likely want to disable.
  • The artificial CACHEBUSTER we've introduced to not cache CI step execution to get reproducible CI duration metrics remained a bit upstream in the gradle execution logic: we likely burst the layers that warm the gradle cache...

@vercel
Copy link

vercel bot commented Oct 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 8:32am

Copy link
Contributor Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@alafanechere alafanechere force-pushed the augustin/10-25-airbyte-ci_disable_gradle_cache_cleanup branch from b9af29f to 3ea639e Compare October 25, 2023 08:32
@alafanechere alafanechere requested a review from postamar October 25, 2023 08:42
@alafanechere alafanechere marked this pull request as ready for review October 25, 2023 08:42
@alafanechere alafanechere requested a review from a team October 25, 2023 08:42
gradle_container = (
gradle_container
# TODO: remove this once we finish the project to boost source-postgres CI performance.
.with_env_variable("CACHEBUSTER", hacks.get_cachebuster(self.context, self.logger)).with_exec(
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing newline before .with_exec.

# https://github.com/gradle/gradle/issues/7018#issuecomment-473817849
# If we ever upgrade to Gradle 8 a different approach must be taken
# https://docs.gradle.org/current/userguide/directory_layout.html#dir:gradle_user_home:cache_cleanup
user_gradle_properties = "org.gradle.cache.cleanup=false"
Copy link
Contributor

Choose a reason for hiding this comment

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

We should, at some point NOT in the far future, do this upgrade.

In any case, I would prefer passing the property as a command-line argument inside DEFAULT_GRADLE_TASK_OPTIONS as -Dorg.gradle.cache.cleanup=false that way you know it's not going to be overwritten by rsync with any existing gradle.properties file in the cache volume. Alternatively, add it not in DEFAULT_GRADLE_TASK_OPTIONS but in _get_gradle_command.

# Set the current working directory.
.with_workdir("/airbyte")
# TODO: remove this once we finish the project to boost source-postgres CI performance.
.with_env_variable("CACHEBUSTER", hacks.get_cachebuster(self.context, self.logger))
Copy link
Contributor

Choose a reason for hiding this comment

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

I put this there so that two consecutive source-postgres builds on an unchanged master branch would not skip doing the dependency update. I have no problems moving this variable further down, I didn't think about this too much.

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

Successfully merging this pull request may close these issues.

2 participants