-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit removes the need to specify the [build] section for the gradle path when compiling from source. Building Elasticsearch and core plugins from source defaults to compiling using gradlew. Since there are two modes of building plugins, one alongside a source distribution and one against a release Elasticsearch version, and in the latter compilation is usually done from within the plugin source, we can't assume what's the build tool e.g. `./gradlew`. Instead of guessing what build.task should become as build.command for plugins, just display a warning instead. Closes #412 Relates #457
- Loading branch information
1 parent
6b042ff
commit 5fb646a
Showing
13 changed files
with
252 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,16 +96,19 @@ To make this work, you need to manually edit Rally's configuration file in ``~/. | |
|
||
plugin.my-plugin.remote.repo.url = [email protected]:example-org/my-plugin.git | ||
plugin.my-plugin.src.subdir = elasticsearch-extra/my-plugin | ||
plugin.my-plugin.build.task = :my-plugin:plugin:assemble | ||
plugin.my-plugin.build.command = ./gradlew :my-plugin:plugin:assemble | ||
plugin.my-plugin.build.artifact.subdir = plugin/build/distributions | ||
|
||
Let's discuss these properties one by one: | ||
|
||
* ``plugin.my-plugin.remote.repo.url`` (optional): This is needed to let Rally checkout the source code of the plugin. If this is a private repo, credentials need to be setup properly. If the source code is already locally available you may not need to define this property. The remote's name is assumed to be "origin" and this is not configurable. Also, only git is supported as revision control system. | ||
* ``plugin.my-plugin.src.subdir`` (mandatory): This is the directory to which the plugin will be checked out relative to ``src.root.dir``. In order to allow to build the plugin alongside Elasticsearch, the plugin needs to reside in a subdirectory of ``elasticsearch-extra`` (see also the `Elasticsearch testing documentation <https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc#building-with-extra-plugins>`_. | ||
* ``plugin.my-plugin.build.task`` (mandatory): The Gradle task to run in order to build the plugin artifact. Note that this command is run from the Elasticsearch source directory as Rally assumes that you want to build your plugin alongside Elasticsearch (otherwise, see the next section). | ||
* ``plugin.my-plugin.build.command`` (mandatory): The full build command to run in order to build the plugin artifact. Note that this command is run from the Elasticsearch source directory as Rally assumes that you want to build your plugin alongside Elasticsearch (otherwise, see the next section). | ||
* ``plugin.my-plugin.build.artifact.subdir`` (mandatory): This is the subdirectory relative to ``plugin.my-plugin.src.subdir`` in which the final plugin artifact is located. | ||
|
||
.. warning:: | ||
``plugin.my-plugin.build.command`` has replaced ``plugin.my-plugin.build.task`` in earlier Rally versions. It now requires the **full** build command. | ||
|
||
In order to run a benchmark with ``my-plugin``, you'd invoke Rally as follows: ``esrally --revision="elasticsearch:some-elasticsearch-revision,my-plugin:some-plugin-revision" --elasticsearch-plugins="my-plugin"`` where you need to replace ``some-elasticsearch-revision`` and ``some-plugin-revision`` with the appropriate :ref:`git revisions <clr_revision>`. Adjust other command line parameters (like track or car) accordingly. In order for this to work, you need to ensure that: | ||
|
||
* All prerequisites for source builds are installed. | ||
|
@@ -122,16 +125,19 @@ To make this work, you need to manually edit Rally's configuration file in ``~/. | |
|
||
plugin.my-plugin.remote.repo.url = [email protected]:example-org/my-plugin.git | ||
plugin.my-plugin.src.dir = /path/to/your/plugin/sources | ||
plugin.my-plugin.build.task = :my-plugin:plugin:assemble | ||
plugin.my-plugin.build.command = /usr/local/bin/gradle :my-plugin:plugin:assemble | ||
plugin.my-plugin.build.artifact.subdir = build/distributions | ||
|
||
Let's discuss these properties one by one: | ||
|
||
* ``plugin.my-plugin.remote.repo.url`` (optional): This is needed to let Rally checkout the source code of the plugin. If this is a private repo, credentials need to be setup properly. If the source code is already locally available you may not need to define this property. The remote's name is assumed to be "origin" and this is not configurable. Also, only git is supported as revision control system. | ||
* ``plugin.my-plugin.src.dir`` (mandatory): This is the absolute directory to which the source code will be checked out. | ||
* ``plugin.my-plugin.build.task`` (mandatory): The Gradle task to run in order to build the plugin artifact. This command is run from the plugin project's root directory. | ||
* ``plugin.my-plugin.build.command`` (mandatory): The full build command to run in order to build the plugin artifact. This command is run from the plugin project's root directory. | ||
* ``plugin.my-plugin.build.artifact.subdir`` (mandatory): This is the subdirectory relative to ``plugin.my-plugin.src.dir`` in which the final plugin artifact is located. | ||
|
||
.. warning:: | ||
``plugin.my-plugin.build.command`` has replaced ``plugin.my-plugin.build.task`` in earlier Rally versions. It now requires the **full** build command. | ||
|
||
In order to run a benchmark with ``my-plugin``, you'd invoke Rally as follows: ``esrally --distribution-version="elasticsearch-version" --revision="my-plugin:some-plugin-revision" --elasticsearch-plugins="my-plugin"`` where you need to replace ``elasticsearch-version`` with the correct release (e.g. 6.0.0) and ``some-plugin-revision`` with the appropriate :ref:`git revisions <clr_revision>`. Adjust other command line parameters (like track or car) accordingly. In order for this to work, you need to ensure that: | ||
|
||
* All prerequisites for source builds are installed. | ||
|
@@ -238,4 +244,3 @@ For this to work you need ensure two things: | |
|
||
1. The plugin needs to be available for the version that you want to benchmark (5.5.0 in the example above). | ||
2. Rally will choose the most appropriate branch in the team repository before starting the benchmark. In practice, this will most likely be branch "5" for this example. Therefore you need to ensure that your plugin configuration is also available on that branch. See the `README in the team repository <https://github.com/elastic/rally-teams#versioning-scheme>`_ to learn how the versioning scheme works. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.