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

Add dependency checksums to quarkus caching extension #1076

Merged

Conversation

jprinet
Copy link
Member

@jprinet jprinet commented Feb 29, 2024

Context

This change is the last one before v1.0.
The Quarkus Maven plugin dynamically adds some dependencies to the classpath, which must be declared as additional inputs.
This change on Quarkus enables the creation of a file containing this list of dependencies.
This file is the one to add as goal input.
This dynamic classpath change is also happening for the tests (surefire / failsafe), and this PR takes care of adding the extra input based on a property addQuarkusInputs.

Changes

  • Dynamic dependencies added as extra input to the build and test goals
  • README improved with some schema to detail the flow
  • Clarify implementation by extracting Configuration and Utility methods in dedicated classes
  • Add a prefix to log message for easier runtime troubleshooting

@jprinet jprinet requested a review from runningcode February 29, 2024 17:59
@jprinet
Copy link
Member Author

jprinet commented Feb 29, 2024

FYI @aloubyansky @gsmet

A key component of the caching mechanism is the Quarkus configuration dump file `.quarkus/quarkus-prod-config-dump`.
This file is generated by the Quarkus `build` goal when the Maven property `quarkus.config-tracking.enabled` is `true`.
It contains all the Quarkus properties used during the Quarkus `build` process.
Some properties are discovered late in the `build` phase and can't be determined advance, thus the need for a first full execution to generate the file.

Choose a reason for hiding this comment

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

Suggested change
Some properties are discovered late in the `build` phase and can't be determined advance, thus the need for a first full execution to generate the file.
Some properties are discovered late in the `build` phase and can't be determined in advance, thus the need for a first full execution to generate the file.

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, I fixed it

Copy link
Contributor

@runningcode runningcode left a comment

Choose a reason for hiding this comment

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

Gave it a review mostly on the documentation/readme.
Great work!

quarkus-build-caching-extension/README.md Outdated Show resolved Hide resolved
quarkus-build-caching-extension/README.md Outdated Show resolved Hide resolved
The file `.quarkus/quarkus-prod-config-dump` generated by the Quarkus build `goal` must be present to allow a cache hit.

In order to increase the cache hit rate, it is possible to check-in the file in the source code repository.
in continuous integration environment, an alternative is to have a cache restoring the file.
Copy link
Contributor

Choose a reason for hiding this comment

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

an alternative is to have a cache restoring the file.

The word cache here can be misleading. I assume you mean some sort of CI store/restore functionality? Not the build cache?

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct, I'll update with

in continuous integration environment, an alternative is to have the file restored (see this option for GitHub actions as an example).

Copy link
Contributor

Choose a reason for hiding this comment

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

i like this

quarkus-build-caching-extension/README.md Outdated Show resolved Hide resolved
=> The `build` goal is not cacheable
- `build` executes and creates `.quarkus/quarkus-prod-config-dump`

![Run1](./doc/run-1.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice to add these diagrams!

jprinet and others added 3 commits March 1, 2024 16:16
@jprinet jprinet merged commit 1266f71 into main Mar 4, 2024
21 checks passed
@jprinet jprinet deleted the jprinet/add-dependency-checksums-to-quarkus-caching-extension branch March 4, 2024 09:04
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.

3 participants