nchammas / flintrock

A command-line tool for launching Apache Spark clusters.
Apache License 2.0
638 stars 116 forks source link

Custom built Java version not detected #310

Closed tfoldi closed 4 years ago

tfoldi commented 4 years ago

Usually, I roll my own OpenJDK for performance testing from Panama or Valhalla branches. In these cases, this is how the java -version output looks like:

$ java -version
openjdk version "15-internal" 2020-09-15
OpenJDK Runtime Environment (build 15-internal+0-adhoc.ec2user.dev-442a69af7bad)
OpenJDK 64-Bit Server VM (build 15-internal+0-adhoc.ec2user.dev-442a69af7bad, mixed mode, sharing)

As you can guess, flintlock does not detect this version string properly ( https://github.com/nchammas/flintrock/blob/2f700bb0ff8a7e19706599a8012b9351e7fc0e21/flintrock/core.py#L497 ) and overwrites my precious custom java

[] Installing Java 1.8...

any ideas on how to avoid this? I can shoot a PR to cover newer JDKs if you want

nchammas commented 4 years ago

Hmm, I suppose the quickest fix would be to update how your custom JDK reports its version.

e.g.

$ java -version
openjdk version "15.0.internal" 2020-09-15
...

Is that possible?

Flintrock expects the version to be reported as something something "major.minor.patch" whatever. I suppose we could expand the pattens it tries to parse, but I'd only want to add new patterns if they were in wide use.

Do any non-custom releases of the JDK report their version as "15-release", or something like that?

tfoldi commented 4 years ago

Let me check if I can change the version string easily (this is the default build, so I did not set it). Also, I will check how newer (14/15) openjdk version strings look like.

tfoldi commented 4 years ago

I implemented the change on my local branch, so it is not that important as of now

nchammas commented 4 years ago

Okie doke, glad you are unblocked.

Just for the record, I checked a couple of newer versions of Java and they spit out a version string in the format that Flintrock expects:

$ /usr/local/opt/openjdk@11/bin/java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10)
OpenJDK 64-Bit Server VM (build 11.0.7+10, mixed mode)
$ /usr/local/opt/openjdk@13/bin/java -version
openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
tfoldi commented 4 years ago

Thank you for checking, yes, it seems only the custom builds are the ones that look different.

And just as we are here, having a discussion, time to confess: dude, your tool saves me so much time and money. I love it.

nchammas commented 4 years ago

Glad to hear it! Appreciate you leaving a comment to say so.