Skip to content

Add optional eclipselink dependency to build and include as build arg in Dockerfile #114

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

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

collado-mike
Copy link
Contributor

Description

#53 removed the eclipselink subproject as a dependency of the polaris-service build. As an optional dependency, it makes sense to not include it automatically. However, users will need a way to include the subproject in the service jar and in the output Dockerfile.

This updates the gradle build to accept an optional eclipseLink property that includes the subproject in the shadow jar. Additionally, there's a corresponding ECLIPSELINK arg in the docker build.

While testing this, I also updated the Dockerfile to specify an ENTRYPOINT and a CMD so that it's easy to point to a different polaris-server.yml file and/or execute a different command (such as the bootstrap or upcoming purge command) from the same docker image.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Ran

docker build . --build-arg ECLIPSELINK=true -t polaris:latest

then I updated my local polaris-server.yml file to specify eclipse-link as the metaStoreManager and ran with

docker run -p 8181:8181 -v ${PWD}:/conf polaris:latest server /conf/polaris-server.yml

Confirmed the following was in the server output at startup:

INFO  [2024-08-07 22:45:32,934 - 640   ] [main] [] i.p.service.PolarisApplication: Initializing PolarisCallContextCatalogFactory for baseCatalogType polaris, metaStoreManagerType io.polaris.extension.persistence.impl.eclipselink.EclipseLinkPolarisMetaStoreManagerFactory@22590e3e
  • Test A
  • Test B

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

Please delete options that are not relevant.

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • If adding new functionality, I have discussed my implementation with the community using the linked GitHub issue
  • I have signed and submitted the ICLA and if needed, the CCLA. See Contributing for details.

@collado-mike collado-mike requested a review from a team as a code owner August 7, 2024 22:50
@@ -108,6 +108,12 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

if (project.properties.get("eclipseLink") == "true") {
dependencies {
implementation(project(":polaris-eclipselink"))
Copy link
Member

Choose a reason for hiding this comment

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

Would it harm to unconditionally include it as a runtimeOnly dependency?

For integration-testing, we could also add a separate test-suite to :polaris-service that has :polaris-eclipselink as well.

Copy link
Member

Choose a reason for hiding this comment

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

It's relatively easy to add such a test-suite:

testing {
  suites {
    register("intTestEclipselink", JvmTestSuite::class.java) {
      useJUnitJupiter()

      dependencies {
        implementation(project())
        implementation(project(":polaris-eclipselink") // this would be an implementation-dependency for the suite
      }

      targets {
        all {
          tasks.named("check").configure { dependsOn(testTask) }
        }
      }
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened #125 to discuss whether we should include the dependency by default

@MonkeyCanCode
Copy link
Contributor

Raised similar PR for this: #118

I think we still needed to add h2 lib for default persistent backend for extension/persistence/eclipselink/build.gradle.kts.

Copy link
Contributor

@sfc-gh-aixu sfc-gh-aixu left a comment

Choose a reason for hiding this comment

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

LGTM.

@collado-mike collado-mike force-pushed the mcollado-add-optional-eclipselink branch from e296a3a to da8772a Compare August 8, 2024 21:10
@MonkeyCanCode MonkeyCanCode mentioned this pull request Aug 15, 2024
13 tasks
@collado-mike
Copy link
Contributor Author

Merging this after discussion in #125

@collado-mike collado-mike enabled auto-merge (squash) August 20, 2024 16:21
Copy link
Contributor

@aihuaxu aihuaxu left a comment

Choose a reason for hiding this comment

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

LGTM.

@collado-mike collado-mike merged commit 52b7a27 into main Aug 20, 2024
3 checks passed
@collado-mike collado-mike deleted the mcollado-add-optional-eclipselink branch October 28, 2024 23:03
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.

7 participants