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

[Question] Bundle vs Dependency JDK in OpenSearch RPM #1682

Closed
peterzhuamazon opened this issue Mar 1, 2022 · 11 comments
Closed

[Question] Bundle vs Dependency JDK in OpenSearch RPM #1682

peterzhuamazon opened this issue Mar 1, 2022 · 11 comments
Labels
question Further information is requested

Comments

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Mar 1, 2022

There are several different benefits of bundling a jdk inside RPM vs treat jdk as dependency during installation time.

  • Bundle:

    • Pros:
      • No need to configure JDK env, opensearch will use the bundled jdk as default
    • Cons:
      • Problem is, every time when you upgrade/downgrade opensearch, jdk is upgraded alongside the opensearch
      • Many companies likes to use a specific version of JDK themselves
  • Dependency:

    • Pros:
      • When upgrade opensearch, JDK will stay unless there are changes in new version dependency
    • Cons:
      • During installation time, if our repo does not contain that jdk (corretto? adoptopenjdk/Adoptium?), installation fail, unless user manually install the specific version we demand, or they add the required repo to their yum.repo.d folder
      • User needs to define OPENSEARCH_JAVA_HOME to change to other jdk and rpm will need to hardcode define it by default to ensure OpenSearch can start
      • This seems not too much different compares to bundled jdk, as it not only complicated things, but also requires manual setups from users if they dont like the default version we bundled.

I want to see if there is any more thoughts on this from you guys.

PS:
Additional Question: Should we include corretto jdk in RPM or use adoptopenjdk/Adoptium like in tarball? If latter, can we directly have their .rpm pkg in our yum repo when released?

Thanks.

@dblock @spotaws

@peterzhuamazon
Copy link
Member Author

Related to opensearch-project/OpenSearch#2302.

@dblock
Copy link
Member

dblock commented Mar 1, 2022

I prefer a non-bundled JDK in RPM, but I would only take a dependency on the same version as tested in the suite. See opensearch-project/project-website#670 for a breakdown across versions (note the actual list is in flux).

@spotrh
Copy link

spotrh commented Mar 1, 2022

Strong preference towards not bundling and locking to a specific jdk version. You should also provide corretto packages in your repo to meet the dependency.

Additionally, OPENSEARCH_JAVA_HOME can be set in the systemd config, which is how the majority of users consuming opensearch via RPM will use it (it is also where they can override it to use a different JDK).

I disagree with your assertion that this is "not too much different compares to bundled jdk". It dramatically decreases the size of the opensearch RPM (which is what will be updating in the majority of transactions). We have Corretto packages at our disposal which are already supported by AWS (and prebuilt) to ensure a running JDK is present at all times and a simple mechanism (1 line change) to have the service use a different JDK.

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Mar 1, 2022

Strong preference towards not bundling and locking to a specific jdk version. You should also provide corretto packages in your repo to meet the dependency.

Additionally, OPENSEARCH_JAVA_HOME can be set in the systemd config, which is how the majority of users consuming opensearch via RPM will use it (it is also where they can override it to use a different JDK).

I disagree with your assertion that this is "not too much different compares to bundled jdk". It dramatically decreases the size of the opensearch RPM (which is what will be updating in the majority of transactions). We have Corretto packages at our disposal which are already supported by AWS (and prebuilt) to ensure a running JDK is present at all times and a simple mechanism (1 line change) to have the service use a different JDK.

Hi @spotrh my question is what about adopt/adoptium jdk distro? As we already bundle them in tarball. Using corretto is nice from the rpm generation perspective and repo maintenance, but it is not the version opensearch core and other component owners have tested with. Can we take an existing adopt* jdk rpm and put it in our repo for distribution? Or we shall also include their repo link and ask user to install them alongside our repo?

Thanks.

@dblock
Copy link
Member

dblock commented Mar 1, 2022

@spotrh Maybe the coretto vs. adoptium is a separate discussion? Shall we open an issue and also benchmark it as part of opensearch-project/OpenSearch#1276?

@peterzhuamazon
Copy link
Member Author

Strong preference towards not bundling and locking to a specific jdk version. You should also provide corretto packages in your repo to meet the dependency.

Additionally, OPENSEARCH_JAVA_HOME can be set in the systemd config, which is how the majority of users consuming opensearch via RPM will use it (it is also where they can override it to use a different JDK).

I disagree with your assertion that this is "not too much different compares to bundled jdk". It dramatically decreases the size of the opensearch RPM (which is what will be updating in the majority of transactions). We have Corretto packages at our disposal which are already supported by AWS (and prebuilt) to ensure a running JDK is present at all times and a simple mechanism (1 line change) to have the service use a different JDK.

Also, similar to JDK, we have discussed nodejs10 last week, which seems pretty hard to do the same as JDK, which means either bundle nodejs, or ask use to install nvm themselves.

Would be quite interesting to see JDK is a dependency but nodejs is not.

@spotrh
Copy link

spotrh commented Mar 1, 2022

@spotrh Maybe the coretto vs. adoptium is a separate discussion? Shall we open an issue and also benchmark it as part of opensearch-project/OpenSearch#1276?

I think the choice of default JDK dependency is a separate discussion, however, I happen to know that Corretto is not patched and should be identical to OpenJDK. One big benefit of Corretto is that it is built by AWS (and distributed by AWS already), so there is no real additional risk to AWS/OpenSearch distributing it. Any other JDK does not provide that measure of trust and for AWS/OpenSearch to distribute it involves additional risk (unless we audit it and build it ourselves).

But yes, separate discussion. :D

@spotrh
Copy link

spotrh commented Mar 1, 2022

Also, similar to JDK, we have discussed nodejs10 last week, which seems pretty hard to do the same as JDK, which means either bundle nodejs, or ask use to install nvm themselves.

Would be quite interesting to see JDK is a dependency but nodejs is not.

As discussed, Java is architected to permit multiple copies (and multiple versions) of the JDK to reside simultaneously on a system without conflict, and it is packaged in RPM in a way to permit this. You can have the Corretto RPM installed next to the OpenJDK without conflict. This is not the case for nodejs, which is not to say that it is impossible to package up nodejs 10 in such a way that it is used by OpenSearch but does not conflict with the system nodejs (which is almost certainly much much newer), but the work involved is notable (especially if you are making a proper built from source nodejs10 package).

@dblock
Copy link
Member

dblock commented Mar 2, 2022

I opened opensearch-project/OpenSearch#2312 to track the proposal to switch for Coretto. Please add your comments/pros/cons.

@peterzhuamazon
Copy link
Member Author

Having a bundled JDK would also allow user to directly download an rpm package, and install, without the need to setup repos on their host.

This is particularly useful and less complicated if we want to use AdoptOpenJDK.

I welcome more conversation on this and will approach with bundled JDK for now.

@bbarani
Copy link
Member

bbarani commented May 23, 2022

Closing this issue as we have released the RPM with bundled JDK. Feel free to re-open if required.

@bbarani bbarani closed this as completed May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants