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

Isolate Dropwizard and HK2 dependencies #523

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

adutra
Copy link
Contributor

@adutra adutra commented Dec 10, 2024

Fixes #521.

This PR simply splits polaris-service in two modules: polaris-service-common and polaris-service-dropwizard, the former bearing no dependency to Dropwizard.

99% of the changes are file moves, the rest being minor cleanup.

The tests were all moved to polaris-service-dropwizard for now. We need a way to factorize them, but let's tackle that later as it's a complex task.

A Quarkus runtime will be provided shortly. It will require some more adjustments to polaris-service-common, but again, let's proceed step by step.

Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

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

Big, but "boring" PR ;)

Generally LGTM!

Just would like to have the dropwizard specific stuff in its own top-level directory outside of service:

$POLARIS_ROOT/
   dropwizard/service/build.gradle.kts
   service/common/build.gradle.kts

This allows us to have modules per concern for the frameworks and for the services. I think that keeps things cleaner in the long run.

@@ -19,7 +19,8 @@
#

polaris-core=polaris-core
polaris-service=polaris-service
polaris-service-common=polaris-service/common
Copy link
Member

Choose a reason for hiding this comment

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

My thought on "common":

Generally I'm not a fan of any "common module" (it's in almost all projects I know a sink hole for all kinds of different things). I'd be in favor of refactoring this and split it out into separate modules by concern.

But granted that it's currently very hard to split things by concern, we have to do it later.

gradle/projects.main.properties Outdated Show resolved Hide resolved
polaris-service/common/build.gradle.kts Outdated Show resolved Hide resolved
polaris-core/build.gradle.kts Show resolved Hide resolved
@adutra adutra force-pushed the polaris-service-dropwizard branch from 73dd313 to 91766e7 Compare December 10, 2024 15:54
val startScripts =
tasks.named<CreateStartScripts>("startScripts") {
classpath = files(provider { shadowJar.get().archiveFileName })
applicationName = "polaris-service"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is required to keep the script name to polaris-service and the environment variable to $POLARIS_SERVICE_OPTS

Copy link
Member

Choose a reason for hiding this comment

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

Do we want to keep it as polaris-service or change it to polaris-dropwizard-service as well?
IMO the latter is likely better to not confuse people w/ Quarkus later.

.dockerignore Show resolved Hide resolved
val startScripts =
tasks.named<CreateStartScripts>("startScripts") {
classpath = files(provider { shadowJar.get().archiveFileName })
applicationName = "polaris-service"
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to keep it as polaris-service or change it to polaris-dropwizard-service as well?
IMO the latter is likely better to not confuse people w/ Quarkus later.

site/content/in-dev/unreleased/metastores.md Outdated Show resolved Hide resolved
site/content/in-dev/unreleased/metastores.md Outdated Show resolved Hide resolved
@@ -108,5 +108,5 @@ The following shows a sample configuration for integrating Polaris with Postgres
To build Polaris with the necessary Postgres dependency and start the Polaris service, run the following:
```bash
polaris> ./gradlew --no-daemon --info -PeclipseLink=true -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 clean shadowJar
polaris> java -jar polaris-service/build/libs/polaris-service-*.jar server ./polaris-server.yml
polaris> java -jar dropwizard/service/build/libs/polaris-service-*.jar server ./polaris-server.yml
Copy link
Member

Choose a reason for hiding this comment

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

Related: should the config file be renamed to polaris-dropwizard-service.yml, too?

@eric-maynard eric-maynard merged commit 9453770 into apache:main Dec 10, 2024
5 checks passed
@collado-mike
Copy link
Contributor

I was hoping to avoid doing this altogether as I thought we had agreed on moving forward with the Quarkus approach in the very near future. At most, I hope this PR is short-lived so that we can continue to have the service implementation and all of its tests in the same gradle package.

@dimas-b
Copy link
Contributor

dimas-b commented Dec 11, 2024

@collado-mike : I think it is valuable to isolate services code from runtime-specific code in any case (Quarkus or DW or both). Integration tests have to depend on the runtime, but could also be reused by downstream project where people want to package additional code into the server (by reusing the services module, yet providing custom "application" code), but make sure the functionality is not broken.

adutra added a commit to adutra/polaris that referenced this pull request Dec 13, 2024
With apache#523, we forgot to update the root package name in the
test folder of polaris-dropwizard-service.

It's important to do this update to avoid the "split packages"
issue (packages appearing in more than one module).

This PR has no functional change, however it does make a few
methods public in polaris-service-common, in order for them
to remain accessible to the moved tests.
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.

Isolate dependencies on Dropwizard + hk2
5 participants