8000 Remove Oracle Database JDBC driver from the Keycloak distribution by ahus1 · Pull Request #22453 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
22453
Closed
ahus1 wants to merge 1 commit into
keycloak:mainfrom
ahus1:is-22452-remove-oracle-driver-from-distribution
Closed

ahus1 wants to merge 1 commit into
keycloak:mainfrom
ahus1:is-22452-remove-oracle-driver-from-distribution

Conversation

@ahus1
@ahus1 ahus1 commented Aug 15, 2023
Copy link
Copy Markdown
Member

Closes #22452

@ahus1 ahus1 self-assigned this Aug 15, 2023
@ahus1
ahus1 commented Aug 15, 2023 •
Copy link
Copy Markdown
Member Author

Tests are green.

There is now a warning when re-augmentating Keycloak independent of the database being chosen:

WARN [io.quarkus.deployment.steps.ClassTransformingBuildStep] (build-19) Could not remove configured resources from the following artifacts as they were not found in the model: {com.oracle.database.jdbc:ojdbc11::jar=[oracle/nativeimage/CharacterSetFeature.class, oracle/nativeimage/Target_java_io_ObjectStreamClass.class]}

After #22443, this warning is only shown when the Oracle Database is selected - even when ojdbc11-23.2.0.0.jar is present in the providers folder.

@ahus1
ahus1 commented Aug 15, 2023
Copy link
Copy Markdown
Member Author

@mabartos - in this PR we want to skip distributing the Oracle JDBC driver as part of Keycloak. Rebasing this PR on top of your PR #22443 removes the warning in all cases except when using the Oracle driver. When the Oracle driver is chosen, it still prints:

WARN [io.quarkus.deployment.steps.ClassTransformingBuildStep] (build-19) Could not remove configured resources from the following artifacts as they were not found in the model: {com.oracle.database.jdbc:ojdbc11::jar=[oracle/nativeimage/CharacterSetFeature.class, oracle/nativeimage/Target_java_io_ObjectStreamClass.class]}

Do you know a way to avoid this warning? All tests are green.

cc: @vmuzikar, @pedroigor

@vmuzikar
Copy link
Copy Markdown
Contributor

jFTR - I think we don't want to backport #22443 (and other related PRs) to 22 to be on the safe side with regressions. It's basically a feature/enhancement, not really a bug fix or critical enhancement. @mabartos WDYT?

@mabartos
Copy link
Copy Markdown
Member

After #22443, this warning is only shown when the Oracle Database is selected - even when ojdbc11-23.2.0.0.jar is present in the providers folder.

@ahus1 If the Oracle DB is not selected, all the Oracle stuff is ignored. Ignored in terms of all related artifacts are not loaded by class loader and shouldn't be packed in the distribution at all. This warning is probably shown there because the Quarkus Oracle extension is still present and the related build steps still see it available and handle it in some way.
I'll try to find some solution for that.

jFTR - I think we don't want to backport #22443 (and other related PRs) to 22 to be on the safe side with regressions. It's basically a feature/enhancement, not really a bug fix or critical enhancement. @mabartos WDYT?

@vmuzikar Yep, that's the plan; we don't want to backport that stuff.

@vmuzikar
vmuzikar commented Aug 15, 2023 •
Copy link
Copy Markdown
Contributor

@mabartos I think we might need to remove the whole extension and write instructions how to re-add it manually.

@mabartos
mabartos commented Aug 15, 2023 •
Copy link
Copy Markdown
Member

AFAIK, the problem is on the Quarkus side. I'll create an issue and send a PR for the Oracle JDBC extension. I've experimented with the fix, and I don't see the warning anymore.

@vmuzikar
Copy link
Copy Markdown
Contributor

@mabartos Thanks for investigating! Not sure how's that an issue on Quarkus side if we're removing a direct dependency of the extension. :) But let's see...

In any case, if there's a fix on Quarkus side, we'd need to make sure it gets backported to 3.2 which might be too late to do.

@mabartos
Copy link
Copy Markdown
Member

Not sure how's that an issue on Quarkus side if we're removing a direct dependency of the extension.

IMO, I'd like to avoid removing the Oracle JDBC Quarkus extension. We'd simplify the whole process around connecting to the Oracle DB as customers do not have to add the extension itself + the JDBC driver. We'll save time for them and even for us when writing documentation for that. There should not be any problem with the productization of the Quarkus Oracle JDBC extension, right? :)

In any case, if there's a fix on Quarkus side, we'd need to make sure it gets backported to 3.2 which might be too late to do.

Yep, I understand your concerns. These warnings should be related only to the native images. I'd suggest ignoring the warnings from the io.quarkus.deployment.steps.ClassTransformingBuildStep class for the 22 backport (set the log level to ERROR). From the long-term perspective, discuss the possible approach with the Quarkus team.

@vmuzikar @ahus1 WDYT?

@vmuzikar
Copy link
Copy Markdown
Contributor

@mabartos Decreasing the log level works for me.

@ahus1
ahus1 force-pushed the is-22452-remove-oracle-driver-from-distribution branch from 3b77b6e to d862810 Compare August 17, 2023 17:51
@mabartos
Copy link
Copy Markdown
Member

Related Quarkus issue: quarkusio/quarkus#35402

@ahus1
ahus1 commented Aug 17, 2023 •
Copy link
Copy Markdown
Member Author

@vmuzikar / @mabartos - I've updated the PR and the warning has been suppressed. I also added some docs.

Please have a look.

When backporting this for KC22, the docs would need to be tuned so they show up only for RHBK, and Keycloak 22 upstream still builds it.

I saw that there is a very long error message message when the driver is not available with lots of io.quarkus.runtime.configuration.ConfigurationException and java.lang.ClassNotFoundException: oracle.jdbc.xa.client.OracleXADataSource during the build command. I want to handle this as a follow-up pull request if you agree. Ideally it would still make it for a KC22 backport.

@ahus1
ahus1 marked this pull request as ready for review August 17, 2023 20:02
@ahus1
ahus1 requested review from a team as code owners August 17, 2023 20:02
@ahus1
ahus1 requested a review from a team August 17, 2023 20:02
@vmuzikar vmuzikar left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ahus1 LGTM, thank you.

@mabartos Do you want to review as well?

I saw that there is a very long error message message when the driver is not available with lots of io.quarkus.runtime.configuration.ConfigurationException and java.lang.ClassNotFoundException: oracle.jdbc.xa.client.OracleXADataSource during the build command. I want to handle this as a follow-up pull request if you agree. Ideally it would still make it for a KC22 backport.

+1
But I see it just as a non-blocking UX enhancement. We could perhaps even prohibit the db=oracle value (incl. help command) if the driver is not found on the classpath.

@vmuzikar
vmuzikar requested a review from mabartos August 21, 2023 10:25
@mabartos
Copy link
Copy Markdown
Member

@vmuzikar Yes, I'd like to review it. Did you follow these steps for the docker image? Can you confirm everything works as expected?

@vmuzikar vmuzikar left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Based on #22452 (comment), I discussed this a bit more with @stianst. Seems we should take a little bit different approach here.

main branch

  • Remove the driver completely, i.e. no need for includeProprietaryDependencies profile.
  • For testing (to better reflect real world scenario) include the driver in providers directory instead of building KC with the driver included.

Backport to 22

  • The driver would remain in upstream included by default as it's a breaking change to do in a micro.
  • Introduce -DskipProprietary property to remove the driver. This would be used only by RHBK 22 pipelines. (CC @ASzc)
  • Docs and testsuite would need to be adapted to reflect the different behaviour (driver included vs removed) between Keycloak and RHBK.

@mabartos Would you be please able to take over as @ahus1 is on PTO?

@mabartos
Copy link
Copy Markdown
Member

@vmuzikar Makes sense.

@mabartos Would you be please able to take over as @ahus1 is on PTO?

Sure, I'll do it.

@mabartos
mabartos commented Aug 21, 2023 •
Copy link
Copy Markdown
Member

Thanks @ahus1 for the PR. Some minor changes need to be added.

Superseded by #22577 due to your absence.

@mabartos mabartos closed this Aug 21, 2023
@ahus1
ahus1 deleted the is-22452-remove-oracle-driver-from-distribution branch September 21, 2023 17:02
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.

Ask admins to install the Oracle Database driver separately

3 participants

0