Uploaded image for project: 'Bigtop'
  1. Bigtop
  2. BIGTOP-2047

detect JAVA_HOME for JDK8, remove obsolete detection code (JDK6/oracle JDK)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: None
    • Labels:
      None
    1. BIGTOP-2047.1.patch
      3 kB
      Olaf Flebbe
    2. BIGTOP-2047.2.patch
      4 kB
      Olaf Flebbe
    3. BIGTOP-2047.patch.txt
      2 kB
      Roman Shaposhnik

      Issue Links

        Activity

        Hide
        oflebbe Olaf Flebbe added a comment -

        Works on debian, Have to double check, other platforms.

        Show
        oflebbe Olaf Flebbe added a comment - Works on debian, Have to double check, other platforms.
        Hide
        cos Konstantin Boudnik added a comment -

        Looks good (without doing any testing though). Last time this script was updated we had to revisit it a couple of times to iron out all the glitches. Let's keep an eye on it in case we spot some issues later.

        Show
        cos Konstantin Boudnik added a comment - Looks good (without doing any testing though). Last time this script was updated we had to revisit it a couple of times to iron out all the glitches. Let's keep an eye on it in case we spot some issues later.
        Hide
        oflebbe Olaf Flebbe added a comment -

        In the light of only supporting JAVA8 I prefer to remove even the JDK 7 logic? Comments?

        Show
        oflebbe Olaf Flebbe added a comment - In the light of only supporting JAVA8 I prefer to remove even the JDK 7 logic? Comments?
        Hide
        oflebbe Olaf Flebbe added a comment -

        Or maybe to prefer JDK8 if present

        Show
        oflebbe Olaf Flebbe added a comment - Or maybe to prefer JDK8 if present
        Hide
        oflebbe Olaf Flebbe added a comment -

        Updated patch. Added ppc64le path.

        Show
        oflebbe Olaf Flebbe added a comment - Updated patch. Added ppc64le path.
        Hide
        cos Konstantin Boudnik added a comment -

        is this ready?

        Show
        cos Konstantin Boudnik added a comment - is this ready?
        Hide
        rvs Roman Shaposhnik added a comment -

        Removing detection of Oracle JDK feels a little bit too radical. What do you guys think?

        Show
        rvs Roman Shaposhnik added a comment - Removing detection of Oracle JDK feels a little bit too radical. What do you guys think?
        Hide
        cos Konstantin Boudnik added a comment -

        Perhaps we can use OpenJDK by default, and resort to Oracle JDK only if nothing else is available?
        The logic is like this: what if a user has Oracle stuff installed in their corporate environment, but we chose not to notice it? Sounds like a suboptimal UX to me.

        Show
        cos Konstantin Boudnik added a comment - Perhaps we can use OpenJDK by default, and resort to Oracle JDK only if nothing else is available? The logic is like this: what if a user has Oracle stuff installed in their corporate environment, but we chose not to notice it? Sounds like a suboptimal UX to me.
        Hide
        oflebbe Olaf Flebbe added a comment -

        No, it is not radical, the code did not work before. Prove me wrong.

        Nothing prevents anyone from installing a custom JDK: Use JAVA_HOME.

        Show
        oflebbe Olaf Flebbe added a comment - No, it is not radical, the code did not work before. Prove me wrong. Nothing prevents anyone from installing a custom JDK: Use JAVA_HOME.
        Hide
        cos Konstantin Boudnik added a comment -

        Good point, fine by me!

        Show
        cos Konstantin Boudnik added a comment - Good point, fine by me!
        Hide
        rvs Roman Shaposhnik added a comment -

        Olaf Flebbe the code does work for Oracle JDK. I've just tried it in a clean CentOS environment by downloading jdk-7u79-linux-x64.rpm from Oracle website and installing it. Then the current bigtop-utils code correctly detects the JVM. With your patch applied here's what happens:

        bash -x ./bigtop-detect-javahome
        + BIGTOP_DEFAULTS_DIR=/etc/default
        + '[' -n /etc/default -a -r /etc/default/bigtop-utils ']'
        + . /etc/default/bigtop-utils
        + OPENJDK7_CANDIDATES=('/usr/lib/jvm/java-1.7.0-openjdk-amd64' '/usr/lib/jvm/java-1.7.0-openjdk' '/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0')
        + OPENJDK8_CANDIDATES=('/usr/lib/jvm/java-1.8.0-openjdk-amd64' '/usr/lib/jvm/java-1.8.0-openjdk-ppc64el' '/usr/lib/jvm/java-1.8.0-openjdk' '/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0')
        + '[' -z '' ']'
        + for candidate_regex in '${OPENJDK8_CANDIDATES[@]}'
        ++ ls -rvd '/usr/lib/jvm/java-1.8.0-openjdk-amd64*'
        + for candidate_regex in '${OPENJDK8_CANDIDATES[@]}'
        ++ ls -rvd '/usr/lib/jvm/java-1.8.0-openjdk-ppc64el*'
        + for candidate_regex in '${OPENJDK8_CANDIDATES[@]}'
        ++ ls -rvd '/usr/lib/jvm/java-1.8.0-openjdk*'
        + for candidate_regex in '${OPENJDK8_CANDIDATES[@]}'
        ++ ls -rvd '/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0*'
        + '[' -z '' ']'
        + for candidate_regex in '${OPENJDK7_CANDIDATES[@]}'
        ++ ls -rvd '/usr/lib/jvm/java-1.7.0-openjdk-amd64*'
        + for candidate_regex in '${OPENJDK7_CANDIDATES[@]}'
        ++ ls -rvd '/usr/lib/jvm/java-1.7.0-openjdk*'
        + for candidate_regex in '${OPENJDK7_CANDIDATES[@]}'
        ++ ls -rvd '/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0*'
        
        Show
        rvs Roman Shaposhnik added a comment - Olaf Flebbe the code does work for Oracle JDK. I've just tried it in a clean CentOS environment by downloading jdk-7u79-linux-x64.rpm from Oracle website and installing it. Then the current bigtop-utils code correctly detects the JVM. With your patch applied here's what happens: bash -x ./bigtop-detect-javahome + BIGTOP_DEFAULTS_DIR=/etc/default + '[' -n /etc/default -a -r /etc/default/bigtop-utils ']' + . /etc/default/bigtop-utils + OPENJDK7_CANDIDATES=('/usr/lib/jvm/java-1.7.0-openjdk-amd64' '/usr/lib/jvm/java-1.7.0-openjdk' '/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0') + OPENJDK8_CANDIDATES=('/usr/lib/jvm/java-1.8.0-openjdk-amd64' '/usr/lib/jvm/java-1.8.0-openjdk-ppc64el' '/usr/lib/jvm/java-1.8.0-openjdk' '/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0') + '[' -z '' ']' + for candidate_regex in '${OPENJDK8_CANDIDATES[@]}' ++ ls -rvd '/usr/lib/jvm/java-1.8.0-openjdk-amd64*' + for candidate_regex in '${OPENJDK8_CANDIDATES[@]}' ++ ls -rvd '/usr/lib/jvm/java-1.8.0-openjdk-ppc64el*' + for candidate_regex in '${OPENJDK8_CANDIDATES[@]}' ++ ls -rvd '/usr/lib/jvm/java-1.8.0-openjdk*' + for candidate_regex in '${OPENJDK8_CANDIDATES[@]}' ++ ls -rvd '/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0*' + '[' -z '' ']' + for candidate_regex in '${OPENJDK7_CANDIDATES[@]}' ++ ls -rvd '/usr/lib/jvm/java-1.7.0-openjdk-amd64*' + for candidate_regex in '${OPENJDK7_CANDIDATES[@]}' ++ ls -rvd '/usr/lib/jvm/java-1.7.0-openjdk*' + for candidate_regex in '${OPENJDK7_CANDIDATES[@]}' ++ ls -rvd '/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0*'
        Hide
        rvs Roman Shaposhnik added a comment -

        How about this (less radical) version?

        Show
        rvs Roman Shaposhnik added a comment - How about this (less radical) version?
        Hide
        rvs Roman Shaposhnik added a comment -

        Konstantin Boudnik & Olaf Flebbe can you guys please take a look?

        Show
        rvs Roman Shaposhnik added a comment - Konstantin Boudnik & Olaf Flebbe can you guys please take a look?
        Hide
        oflebbe Olaf Flebbe added a comment - - edited

        -1 : Java 7 isn't supported anymore ... We switched to jdk8 . IIRC our spark runtime is JDK8 only.

        Show
        oflebbe Olaf Flebbe added a comment - - edited -1 : Java 7 isn't supported anymore ... We switched to jdk8 . IIRC our spark runtime is JDK8 only.
        Hide
        rvs Roman Shaposhnik added a comment -

        Olaf Flebbe agreed. will updated tomorrow.

        Show
        rvs Roman Shaposhnik added a comment - Olaf Flebbe agreed. will updated tomorrow.

          People

          • Assignee:
            rvs Roman Shaposhnik
            Reporter:
            oflebbe Olaf Flebbe
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development