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

Select java package version based on Puppet Platform Version #611

Merged
merged 2 commits into from
Apr 6, 2023

Conversation

austb
Copy link
Contributor

@austb austb commented Apr 4, 2023

When not building a PE package, select the java dependency based on operating system and Puppet Platform version, which is assumed to be the major version of the package you are building.

This will allow us to maintain the same java versions between puppetserver and puppetdb, maintain a given dependency for an entire major version, and move that version forward between major versions.

  • Please add all notable changes to the "Unreleased" section of the CHANGELOG.

@austb
Copy link
Contributor Author

austb commented Apr 4, 2023

This PR uses version sniffing to determine the appropriate java version for puppetdb/puppetserver, which is a bit of a hack. But we have made the major versions of the Agent/Server/DB match for many years now, so it seems OK.

It does not attempt to filter puppetlabs vs external projects because we already have other puppet-specific things hardcoded into the packages. And PE projects get an entirely different java setting, so this would only affect FOSS projects.

It also does not attempt to limit itself to PuppetDB/Puppetserver for FOSS projects because I don't know of any other non-PE clojure projects using ezbake so it seemed like unnecessary complexity, but if someone else knows of one I can add that.

@austb
Copy link
Contributor Author

austb commented Apr 4, 2023

This will also limit Platform 8's SLES support. Earlier SLES 12 releases did not ship Java 11 (the original 12 release doesn't even appear to have had Java 8), but the current supported SP, SP 5, ships java 11 so it should continue to work there.

@donoghuc
Copy link

donoghuc commented Apr 4, 2023

I dont understand why we need to intuit this from the version and not explicitly set it as a configuration?

@austb austb changed the title Select java package version based on package major version Select java package version based on Puppet Platform Version Apr 5, 2023
@austb austb force-pushed the puppet8-java11 branch 2 times, most recently from 07176dd to 1a96af8 Compare April 5, 2023 20:02
Does not change PE package builds.

Add a puppet-platform-version argument to EZBake defaulting to 7 (which
maintains the current dependency list) when building for Puppet Platform
8 select newer more appropriate JDK's for each platform. Fails for
unrecognized Platform versions so that we remember to select appropriate
JDKs.

Selecting JDK 11 for SLES 12 means that we will only be compatible with
the most recent (and supported) SP 5.
@@ -15,6 +15,7 @@
options.sles = 0
options.java = 'java-1.8.0-openjdk-headless'
options.release = 1
options.platform_version = 0
Copy link
Member

Choose a reason for hiding this comment

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

should this be 7?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default is provided by the local->ruby call in core.clj and the --platform-version flag is always passed through controller.sh.erb, so this value is unused.

end
when 6..7
'java-8-openjdk-headless'
end
Copy link
Member

Choose a reason for hiding this comment

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

The other OS branches will fail if it doesn't match the listed conditions, should we do that here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, I must've lost the explicit failure in the refactor.

Copy link

@donoghuc donoghuc left a comment

Choose a reason for hiding this comment

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

This looks extraordinarily complicated. If this will unblock us I think this is fine. Thanks for working through all this.

On Redhat 8 and Debian platforms, take advantage of boolean dependencies
to allow Java 11 or Java 17. Platform 8 will go into PE 2023, which uses
Java 17, so the dependencies prefer Java 17.

Redhat 7 may not understand the or dependencies, or have java 17, so
just depend on 11.
@austb austb marked this pull request as ready for review April 6, 2023 02:00
@austb austb requested a review from a team as a code owner April 6, 2023 02:00
@austb austb merged commit d3a74b0 into puppetlabs:main Apr 6, 2023
@austb austb deleted the puppet8-java11 branch April 6, 2023 17:24
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.

4 participants