elastic / rally

Macrobenchmarking framework for Elasticsearch
Apache License 2.0
35 stars 313 forks source link

Unclear JDK requirements - Cannot race. Install a JDK with one of the versions... #1376

Closed toby-sutor closed 2 years ago

toby-sutor commented 3 years ago

Trying a race on CentOS 8.3 leads to an error about a missing JDK: Cannot race. Install a JDK with one of the versions [17, 16, 15, 14, 13, 12, 11] and point to it with one of ['JAVA17_HOME', 'JAVA16_HOME', 'JAVA15_HOME', 'JAVA14_HOME', 'JAVA13_HOME', 'JAVA12_HOME', 'JAVA11_HOME', 'JAVA_HOME'].

I installed the requested package via yum install java-11-openjdk-devel and set the JAVA_HOME and JAVA11_HOME to the paths accordingly: export JAVA11_HOME=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.el8_4.x86_64/.

$ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.el8_4.x86_64/
$ export JAVA11_HOME=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.el8_4.x86_64/
$ echo $JAVA11_HOME
/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.el8_4.x86_64/
$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.el8_4.x86_64/

When I then try to run rally, I get the following message:

Hence, the JDK requirement is not clear from the initial message as per the below two examples.

Trying it with export JAVA_HOME=/usr/lib/jvm/java-16-openjdk-16.0.1.0.9-3.rolling.el8.x86_64/ seems to work tho.

$ esrally race --track=eventdata --target-hosts=127.0.0.1:9200 --track-repository=eventdata

    ____        ____
   / __ \____ _/ / /_  __
  / /_/ / __ `/ / / / / /
 / _, _/ /_/ / / / /_/ /
/_/ |_|\__,_/_/_/\__, /
                /____/

[INFO] Race id is [4732c9ce-79ca-4432-8923-ef29408f6525]
[INFO] Preparing for race ...
[ERROR] Cannot race. Install a JDK with one of the versions [17, 16, 15, 14, 13, 12, 11] and point to it with one of ['JAVA17_HOME', 'JAVA16_HOME', 'JAVA15_HOME', 'JAVA14_HOME', 'JAVA13_HOME', 'JAVA12_HOME', 'JAVA11_HOME', 'JAVA_HOME'].
    Traceback (most recent call last):
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/mechanic.py", line 578, in receiveMsg_StartNodes
    self.mechanic = create(
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/mechanic.py", line 663, in create
    p.append(provisioner.local(cfg, car, plugins, node_ip, node_http_port, all_node_ips, all_node_names, race_root_path, node_name))
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/provisioner.py", line 39, in local
    _, java_home = java_resolver.java_home(runtime_jdk, cfg.opts("mechanic", "runtime.jdk"), runtime_jdk_bundled)
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/java_resolver.py", line 49, in java_home
    major, java_home = jvm.resolve_path(runtime_jdk_versions)
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/utils/jvm.py", line 121, in resolve_path
    raise exceptions.SystemSetupError(
esrally.exceptions.SystemSetupError: Install a JDK with one of the versions [17, 16, 15, 14, 13, 12, 11] and point to it with one of ['JAVA17_HOME', 'JAVA16_HOME', 'JAVA15_HOME', 'JAVA14_HOME', 'JAVA13_HOME', 'JAVA12_HOME', 'JAVA11_HOME', 'JAVA_HOME'].
$ export JAVA11_HOME=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.el8_4.x86_64/
$ esrally race --track=eventdata --target-hosts=127.0.0.1:9200 --track-repository=eventdata

    ____        ____
   / __ \____ _/ / /_  __
  / /_/ / __ `/ / / / / /
 / _, _/ /_/ / / / /_/ /
/_/ |_|\__,_/_/_/\__, /
                /____/

[INFO] Race id is [bb45d081-98e5-437d-ae32-3feddc2e400c]
[INFO] Preparing for race ...
[ERROR] Cannot race. Neither JAVA16_HOME nor JAVA_HOME point to a JDK 16 installation.
    Traceback (most recent call last):
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/mechanic.py", line 590, in receiveMsg_StartNodes
    self.mechanic.start_engine()
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/mechanic.py", line 703, in start_engine
    binaries = self.supply()
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/supplier.py", line 265, in __call__
    supplier.prepare()
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/supplier.py", line 338, in prepare
    self.source_supplier.prepare()
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/supplier.py", line 375, in prepare
    self.builder.build(
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/supplier.py", line 671, in build
    self.run(command, override_src_dir)
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/supplier.py", line 680, in run
    build_cmd = "export JAVA_HOME={}; cd {}; {} > {} 2>&1".format(self.java_home, src_dir, command, log_file)
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/mechanic/supplier.py", line 666, in java_home
    _, self._java_home = jvm.resolve_path(self.build_jdk)
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/utils/jvm.py", line 115, in resolve_path
    return majors, _resolve_single_path(majors, sysprop_reader=sysprop_reader)
  File "/home/toby/.venv/lib64/python3.9/site-packages/esrally/utils/jvm.py", line 161, in _resolve_single_path
    raise exceptions.SystemSetupError(
esrally.exceptions.SystemSetupError: Neither JAVA16_HOME nor JAVA_HOME point to a JDK 16 installation.
dliappis commented 3 years ago

@toby-sutor Which version of Elasticsearch do you want to benchmark against?

Based on your invocation (and assuming an unmodified ~/.rally/rally.ini), Rally will attempt to build Elasticsearch from source (master branch) and run it. Both steps have their own set of requirements:

If you don't wish to benchmark against the latest commit of https://github.com/elastic/elasticsearch, you should take a look at the Rally docs for:

Given these clarifications I am not sure if this is a bug, especially as these are Elasticsearch build/run requirements.

Would it make more sense that the default behavior of Rally is not to attempt to build Elasticsearch but assume --pipeline=benchmark-only and expect the user to provide connection details to a remote cluster? This also prevents people from making wrong methodological decisions (e.g. run the loaddriver on the same machine as Elasticsearch).

DJRickyB commented 2 years ago

Closing this one, working as designed