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

Build: Move java home checks to pre-execution phase #29548

Merged
merged 7 commits into from
Apr 19, 2018

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Apr 16, 2018

This commit moves the checks on JAVAX_HOME (where X is the java version
number) existing to the end of gradle's configuration phase, and based
on whether the tasks needing the java home are configured to execute.

relates #29519

This commit moves the checks on JAVAX_HOME (where X is the java version
number) existing to the end of gradle's configuration phase, and based
on whether the tasks needing the java home are configured to execute.

relates elastic#29519
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@rjernst
Copy link
Member Author

rjernst commented Apr 16, 2018

With this change, the output for running ./gradlew :qa:full-cluster-restart:bwcTest on master now looks like:

* What went wrong:
Failed to notify task execution graph listener.
> JAVA9_HOME required to run task :distribution:bwc:next-bugfix-snapshot:buildBwcVersion
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.0.0#oldClusterTestCluster#node0.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.0.0#oldClusterTestCluster#node1.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.0.1#oldClusterTestCluster#node0.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.0.1#oldClusterTestCluster#node1.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.0#oldClusterTestCluster#node0.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.0#oldClusterTestCluster#node1.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.1#oldClusterTestCluster#node0.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.1#oldClusterTestCluster#node1.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.2#oldClusterTestCluster#node0.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.2#oldClusterTestCluster#node1.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.3#oldClusterTestCluster#node0.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.3#oldClusterTestCluster#node1.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.4#oldClusterTestCluster#node0.start
> JAVA8_HOME required to run task :qa:full-cluster-restart:v6.1.4#oldClusterTestCluster#node1.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.0#oldClusterTestCluster#node0.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.0#oldClusterTestCluster#node1.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.1#oldClusterTestCluster#node0.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.1#oldClusterTestCluster#node1.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.2#oldClusterTestCluster#node0.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.2#oldClusterTestCluster#node1.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.3#oldClusterTestCluster#node0.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.3#oldClusterTestCluster#node1.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.4-SNAPSHOT#oldClusterTestCluster#node0.start
> JAVA9_HOME required to run task :qa:full-cluster-restart:v6.2.4-SNAPSHOT#oldClusterTestCluster#node1.start

And for ./gradlew :qa:reindex-from-old:check:

* What went wrong:
Failed to notify task execution graph listener.
> JAVA7_HOME required to run task :qa:reindex-from-old:oldEs2Fixture
> JAVA7_HOME required to run task :qa:reindex-from-old:oldEs1Fixture
> JAVA7_HOME required to run task :qa:reindex-from-old:oldEs090Fixture

@rjernst rjernst requested a review from jasontedor April 16, 2018 22:37
if (project.javaVersions.get(version) == null) {
throw new GradleException(message)
/** Add a check before gradle execution phase which ensures java home for the given java version is set. */
static void requireJavaHome(Project project, Task task, int version) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you look up the Project from the Task?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, changed in a98747a.

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

LGTM. Great change.

@rjernst
Copy link
Member Author

rjernst commented Apr 17, 2018

Thanks for the reviews. Just FYI, I iterated on the output a little bit, and now have the following:

* What went wrong:
JAVA8_HOME required to run tasks:
  :qa:full-cluster-restart:v6.0.0#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.0.0#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.0.1#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.0.1#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.1.0#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.1.0#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.1.1#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.1.1#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.1.2#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.1.2#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.1.3#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.1.3#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.1.4#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.1.4#oldClusterTestCluster#node1.start
JAVA9_HOME required to run tasks:
  :distribution:bwc:next-bugfix-snapshot:buildBwcVersion
  :qa:full-cluster-restart:v6.2.0#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.2.0#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.2.1#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.2.1#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.2.2#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.2.2#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.2.3#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.2.3#oldClusterTestCluster#node1.start
  :qa:full-cluster-restart:v6.2.4-SNAPSHOT#oldClusterTestCluster#node0.start
  :qa:full-cluster-restart:v6.2.4-SNAPSHOT#oldClusterTestCluster#node1.start

@nik9000
Copy link
Member

nik9000 commented Apr 17, 2018

I iterated on the output a little bit, and now have the following

I like it better!

@rjernst
Copy link
Member Author

rjernst commented Apr 18, 2018

@elasticmachine test this please

@rjernst rjernst merged commit 4f282e9 into elastic:master Apr 19, 2018
@rjernst rjernst deleted the java_home_check branch April 19, 2018 16:52
rjernst added a commit that referenced this pull request Apr 19, 2018
This commit moves the checks on JAVAX_HOME (where X is the java version
number) existing to the end of gradle's configuration phase, and based
on whether the tasks needing the java home are configured to execute.

relates #29519
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Apr 19, 2018
* master:
  Remove extra spaces from changelog
  Add support to match_phrase query for zero_terms_query. (elastic#29598)
  Fix incorrect references to 'zero_terms_docs' in query parsing error messages. (elastic#29599)
  Build: Move java home checks to pre-execution phase (elastic#29548)
  Avoid side-effect in VersionMap when assertion enabled (elastic#29585)
  [Tests] Remove accidental logger usage
  Add tests for ranking evaluation with aliases (elastic#29452)
  Deprecate use of `htmlStrip` as name for HtmlStripCharFilter (elastic#27429)
  Update plan for the removal of mapping types. (elastic#29586)
  [Docs] Add rankEval method for Jva HL client
  Make ranking evaluation details accessible for client
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Apr 19, 2018
* master: (21 commits)
  Remove bulk fallback for write thread pool (elastic#29609)
  Fix an incorrect reference to 'zero_terms_docs' in match_phrase queries.
  Update the version compatibility for zero_terms_query in match_phrase.
  Account translog location to ram usage in version map
  Remove extra spaces from changelog
  Add support to match_phrase query for zero_terms_query. (elastic#29598)
  Fix incorrect references to 'zero_terms_docs' in query parsing error messages. (elastic#29599)
  Build: Move java home checks to pre-execution phase (elastic#29548)
  Avoid side-effect in VersionMap when assertion enabled (elastic#29585)
  [Tests] Remove accidental logger usage
  Add tests for ranking evaluation with aliases (elastic#29452)
  Deprecate use of `htmlStrip` as name for HtmlStripCharFilter (elastic#27429)
  Update plan for the removal of mapping types. (elastic#29586)
  [Docs] Add rankEval method for Jva HL client
  Make ranking evaluation details accessible for client
  Rename the bulk thread pool to write thread pool (elastic#29593)
  [Test] Minor changes to rank_eval tests (elastic#29577)
  Fix missing node id prefix in startup logs (elastic#29534)
  Added painless execute api. (elastic#29164)
  test: also assert deprecation warning after clusters have been closed.
  ...
martijnvg added a commit that referenced this pull request Apr 20, 2018
* es/master: (32 commits)
  TEST: Unmute testPrimaryRelocationWhileIndexing
  Remove remaining tribe node references (#29574)
  Never leave stale delete tombstones in version map (#29619)
  Do not serialize common stats flags using ordinal (#29600)
  Remove stale comment from JVM stats (#29625)
  TEST: Mute testPrimaryRelocationWhileIndexing
  Remove bulk fallback for write thread pool (#29609)
  Fix an incorrect reference to 'zero_terms_docs' in match_phrase queries.
  Update the version compatibility for zero_terms_query in match_phrase.
  Account translog location to ram usage in version map
  Remove extra spaces from changelog
  Add support to match_phrase query for zero_terms_query. (#29598)
  Fix incorrect references to 'zero_terms_docs' in query parsing error messages. (#29599)
  Build: Move java home checks to pre-execution phase (#29548)
  Avoid side-effect in VersionMap when assertion enabled (#29585)
  [Tests] Remove accidental logger usage
  Add tests for ranking evaluation with aliases (#29452)
  Deprecate use of `htmlStrip` as name for HtmlStripCharFilter (#27429)
  Update plan for the removal of mapping types. (#29586)
  [Docs] Add rankEval method for Jva HL client
  ...
martijnvg added a commit that referenced this pull request Apr 20, 2018
* es/6.x: (28 commits)
  TEST: Unmute testPrimaryRelocationWhileIndexing
  Never leave stale delete tombstones in version map (#29619)
  Do not serialize common stats flags using ordinal (#29600)
  Remove stale comment from JVM stats (#29625)
  TEST: Mute testPrimaryRelocationWhileIndexing
  Remove 7.0.0 from 6.x changelog (#29621)
  Add support to match_phrase query for zero_terms_query. (#29598)
  Account translog location to ram usage in version map
  Avoid side-effect in VersionMap when assertion enabled (#29585)
  Build: Move java home checks to pre-execution phase (#29548)
  Add tests for ranking evaluation with aliases (#29452)
  [Test] Fix assertion in SearchDocumentationIT
  Deprecate use of `htmlStrip` as name for HtmlStripCharFilter (#27429)
  test: Assert deprecated http.enebled setting warning
  Update plan for the removal of mapping types. (#29586)
  [Docs] Add rankEval method for Jva HL client
  Make ranking evaluation details accessible for client
  Rename the bulk thread pool to write thread pool (#29593)
  [Test] Minor changes to rank_eval tests (#29577)
  test: Assert deprecated http.enebled setting warning
  ...
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure >refactoring Team:Delivery Meta label for Delivery team v6.3.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants