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

Allow to use the bundled JDK in Elasticsearch #853

Merged

Conversation

danielmitterdorfer
Copy link
Member

With this commit we add special handling for Elasticsearch versions that
bundle the JDK when the command line parameter --runtime-jdk=bundled
is set. In that case, Rally will use the bundled JDK (i.e. not set
JAVA_HOME when starting Elasticsearch).

With this commit we add special handling for Elasticsearch versions that
bundle the JDK when the command line parameter `--runtime-jdk=bundled`
is set. In that case, Rally will use the bundled JDK (i.e. not set
`JAVA_HOME` when starting Elasticsearch).
@danielmitterdorfer danielmitterdorfer added enhancement Improves the status quo :Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch labels Jan 8, 2020
@danielmitterdorfer danielmitterdorfer added this to the 1.4.0 milestone Jan 8, 2020
@danielmitterdorfer danielmitterdorfer self-assigned this Jan 8, 2020
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@@ -510,6 +510,8 @@ Example::
# Force to run with JDK 7
esrally --distribution-version=2.4.0 --runtime-jdk=7

There is also limited support to specify the JDK that is bundled with Elasticsearch with the special value ``bundled``. At the moment this only works on Linux. The JDK is bundled from Elasticsearch 7.0.0 onwards.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to link: https://www.elastic.co/blog/elasticsearch-7-0-0-released re: The JDK is bundled from Elasticsearch 7.0.0 onwards.?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd consider a reference documentation more stable than a blog and would thus rather avoid pointing to a blog post?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Addessed in 6662420

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!


# assumes most recent JDK
self.assertEqual(major, 12)
# does not extract JAVA_HOME for the bundled JDK
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: does not set JAVA_HOME?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I'll push a change

With this commit we use the proper Elasticsearch artifact per platform
(if there is one). Therefore, it is possible to use the bundled JDK not
only on Linux but also on MacOS.
@danielmitterdorfer
Copy link
Member Author

Together with elastic/rally-teams#38, Rally can now:

  • Use system specific artifacts (automatically)
  • Users can override the default behavior for the download subcommand with the new command line flags --target-os and --target-arch.

@dliappis can you please have another look?

As we already rely on new properties that will be introduced in elastic/rally-teams#38, that PR needs to be merged first.

Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

Thanks! I left two questions.


def render(self, template):
substitutions = {
"{{VERSION}}": self.version,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason -- apart from simplicity -- we can't use j2 template rendering to substitute those (and at the same time be more lenient with spaces like {{ VERSION }} and allow filters)? Many other files in rally-teams are treated as j2 hence the question.

Copy link
Member Author

Choose a reason for hiding this comment

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

For other templates (like elasticsearch.yml or jvm.options) I think Jinja makes sense because their purpose is to serve as templates. config.ini is a high-level file meant to control how Rally behaves and I would not expect much templating happening here. As discussed elsewhere, I'll raise a separate enhancement issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've raised #856.

@@ -859,6 +870,9 @@ def main():
console.println("--target-hosts and --client-options must define the same keys for multi cluster setups.")
exit(1)
# split by component?
if sub_command == "download":
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to support --target-arch and --target-os also for the the install subcommand?

Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to restrict this to the download subcommand for the moment because we should not support installing an artifact for a different platform IMHO as the successive startup is likely to fail in some scenarios and I also don't see why one would use this approach.

@danielmitterdorfer
Copy link
Member Author

@elasticmachine test this please

@danielmitterdorfer danielmitterdorfer merged commit eeba60a into elastic:master Jan 9, 2020
@danielmitterdorfer danielmitterdorfer deleted the use-bundled-jdk branch January 9, 2020 09:34
@hub-cap hub-cap added the highlight A substantial improvement that is worth mentioning separately in release notes label Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch enhancement Improves the status quo highlight A substantial improvement that is worth mentioning separately in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants