riptano / ccm

A script to easily create and destroy an Apache Cassandra cluster on localhost
Apache License 2.0
1.21k stars 299 forks source link

Fix Java version selection #766

Closed jacek-lewandowski closed 1 month ago

jacek-lewandowski commented 2 months ago

Problem: for Cassandra 5 not built from the sources, Java version is not selected properly - it is assumed it works with either current version or Java 8.

Fixes:

michaelsembwever commented 2 months ago

lgtm, aside from one comment.

this needs to be tested thoroughly with all the different dtest test types (especially the upgrade variants), on all CI systems (as we filter out how we select jdks differently on each).

michaelsembwever commented 2 months ago

Thinking more about this…

if path_jvm_version in supported_versions
  use path_jvm_version
if java_home_jvm_version in supported_versions
  use java_home_jvm_version
else
  find JAVA[supported version]_HOME env variable and use that version if env variable found

Wouldn't it be a much simpler PR if we just put in an assert that PATH is correct according to JAVA_HOME ?

What do we gain from adding the complexity that we can honour either PATH or JAVA_HOME ?

jacek-lewandowski commented 2 months ago

The dtest branch for verification: https://github.com/jacek-lewandowski/cassandra-dtest/commit/13ac8ac168ffb78c26a11d389bda4c3085fba02a

The cassandra branch for verification: https://github.com/jacek-lewandowski/cassandra/commit/0356018e00e41d13147e345b362f269e934b2d14 in CircleCI

Jenkins tests are running at http://34.88.161.37:8080/blue/organizations/jenkins/cassandra/detail/cassandra/63/pipeline

jacek-lewandowski commented 1 month ago

https://app.circleci.com/pipelines/github/jacek-lewandowski/cassandra/1354/workflows/82c94bfc-3095-416e-b494-cb956a8989e0/jobs/72770

jacek-lewandowski commented 1 month ago

http://34.88.161.37:8080/blue/organizations/jenkins/cassandra/detail/cassandra/65/pipeline/

michaelsembwever commented 1 month ago

http://34.88.161.37:8080/blue/organizations/jenkins/cassandra/detail/cassandra/65/pipeline/

this isn't a permanent or accessible-to-all url. it's result files are in ccm_pull_766_65_ci.zip

michaelsembwever commented 1 month ago

+1