Commit graph

22 commits

Author SHA1 Message Date
Mark Vieira
520e118561
Don't apply IntelliJ illegal module dependency inspection to test code (#101977)
We don't enforce Java modularity when executing tests, so we shouldn't
bother highlighting issues in test framework code. This PR adds a new
IntelliJ scope that excludes everything under `:test` and configures the
illegal module dependency inspection to use this new scope.
2023-11-09 12:46:18 -05:00
Mark Vieira
7527d6f046 Add intellij run configurations for multi-node clusters 2023-03-22 14:40:10 -07:00
Rory Hunter
d72f3e439a
Stop versioning Checkstyle IDE config (#87285)
Closes #86945.

The IntelliJ Checkstyle plugin likes to modify its configuration file
unecessarily, which creates friction for developers because they have
the revert these changes.

Instead, stop versioning the config file and instead update the
`configureIdeCheckstyle` task to copy the required content into place.
2022-06-02 08:58:11 +01:00
Chris Hegarty
3071c6a055
Modularize Elasticsearch (#81066)
This PR represents the initial phase of Modularizing Elasticsearch (with
Java Modules).

This initial phase modularizes the core of the Elasticsearch server
with Java Modules, which is then used to load and configure extension
components atop the server. Only a subset of extension components are
modularized at this stage (other components come in a later phase).
Components are loaded dynamically at runtime with custom class loaders
(same as is currently done). Components with a module-info.class are
defined to a module layer.

This architecture is somewhat akin to the Modular JDK, where
applications run on the classpath. In the analogy, the Elasticsearch
server modules are the platform (thus are always resolved and present),
while components without a module-info.class are non-modular code
running atop the Elasticsearch server modules. The extension components
cannot access types from non-exported packages of the server modules, in
the same way that classpath applications cannot access types from
non-exported packages of modules from the JDK. Broadly, the core
Elasticseach java modules simply "wrap" the existing packages and export
them. There are opportunites to export less, which is best done in more
narrowly focused follow-up PRs.

The Elasticsearch distribution startup scripts are updated to put jars
on the module path (the class path is empty), so the distribution will
run the core of the server as java modules. A number of key components
have been retrofitted with module-info.java's too, and the remaining
components can follow later. Unit and functional tests run as
non-modular (since they commonly require package-private access), while
higher-level integration tests, that run the distribution, run as
modular.

Co-authored-by: Chris Hegarty <christopher.hegarty@elastic.co>
Co-authored-by: Ryan Ernst <ryan@iernst.net>
Co-authored-by: Rene Groeschke <rene@elastic.co>
2022-05-20 13:11:42 +01:00
Rory Hunter
223c2e45b9
Configure required IDEA plugins (#84674)
Closes #53812.

The CheckStyle-IDEA and EcliseCodeFormatter IDEA plugins are to all
intents and purposes required when using IntelliJ to work on
Elasticsearch, so add configuration that marks then as required.
2022-03-07 10:35:28 +00:00
Mark Vieira
3c987bc728 Revert required IDEA plugins 2022-03-04 11:21:03 -08:00
Mark Vieira
a34c0b44d6
Consume separate ML artifacts for native dependencies (#84536)
Utilize the separate artifacts for the native ML code and any platform
native dependencies. This improves dependency cachability since these
native dependencies rarely change with updates to native code and
amount to about 90% of the total artifact size.
2022-03-04 10:11:17 -08:00
Rory Hunter
2282cf75d0
Upgrade Checkstyle to 9.3 (#83314)
Checkstyle 9.3 has been released, and contains a fix for the memory
problems we saw in previous versions. Upgrade to this version.

Note that the IDEA config has also been updated, but the plugin
doesn't yet have 9.3 as an option according to the release notes.
This shouldn't be a problem.
2022-02-07 10:34:43 +00:00
Mark Vieira
f68a577b79 Revert accidental commit of absolute path in Idea checkstyle config 2022-01-12 17:29:44 -08:00
Mark Vieira
098a5f4046 Mute SearchableSnapshotsBlobStoreCacheIntegTests.testBlobStoreCache 2022-01-12 08:22:29 -08:00
Mark Vieira
cff383f22b
Allow for debugging of rest test clusters during test execution (#79085) 2021-10-14 12:48:45 -07:00
Rory Hunter
62d2df4f6a
Format build-tools and build-tools-internal (#78910)
Our spotless configuration wasn't being applied to `build-tools`
and `build-tools-internal`. Move the Spotless configuration to a
Java plugin in `build-conventions`, and apply it everywhere.

This resulted in a lot more Java files being subject to formatting,
so I added more exclusions to the list.

Also remove the `paddedCell` stuff, we've never needed it.
2021-10-14 09:38:06 +01:00
Benjamin Trent
b11c15b7e0
[ML] Adding new trained model allocation service (#75778)
Adds a new service for trained model allocation to nodes. 

Initially, this only supports PyTorch models and simply allocates
to nodes with the ML roles. 

Design is fairly simple:

 - A master node service runs allowing for new allocations to be created/updated/deleted from cluster state
 - A node service runs listening to updates referencing the local node + any models it may have allocated and updates accordingly.

This type of service sort of splits the difference between the logic of shard allocation and persistent tasks. Neither really fully addressed the need here.
2021-08-03 13:06:14 -04:00
Rory Hunter
a5d2251064
Order imports when reformatting (#74059)
Change the formatter config to sort / order imports, and reformat the
codebase. We already had a config file for Eclipse users, so Spotless now
uses that.

The "Eclipse Code Formatter" plugin ought to be able to use this file as
well for import ordering, but in my experiments the results were poor.
Instead, use IntelliJ's `.editorconfig` support to configure import
ordering.

I've also added a config file for the formatter plugin.

Other changes:
   * I've quietly enabled the `toggleOnOff` option for Spotless. It was
     already possible to disable formatting for sections using the markers
     for docs snippets, so enabling this option just accepts this reality
     and makes it possible via `formatter:off` and `formatter:on` without
     the restrictions around line length. It should still only be used as
     a very last resort and with good reason.
   * I've removed mention of the `paddedCell` option from the contributing
     guide, since I haven't had to use that option for a very long time. I
     moved the docs to the spotless config.
2021-06-16 09:22:22 +01:00
Mark Vieira
1f1c8b0019
Move custom checkstyle rule implementations to build-conventions project (#74017) 2021-06-10 16:06:44 -07:00
Mark Vieira
71c0821ffc
Keep low level rest client under Apache 2 software license (#68694) 2021-02-08 11:13:31 -08:00
Dan Hermann
34175b9785
Revert inadvertent change to debug profile (#58992) 2020-07-03 10:55:56 -05:00
Dan Hermann
50ed781c9f
Mirror privileges over data streams to their backing indices (#58381) 2020-07-02 21:56:16 -05:00
Igor Motov
7e3a1f416f
Add runner settings to remote debug configuration in IntelliJ (#54912)
When remote run configuration is executed in IntelliJ Community edition, it
automatically adds the RunnedSettings section. This section doesn't seem to have
any negative effect on the Ultimate Edition.
2020-04-08 08:17:51 -04:00
Mark Vieira
76ea779309
Enable auto restart on debug elasticsearch run configuration 2020-03-24 16:35:22 -07:00
Mark Vieira
20736b21b9
Add remote debug run configuration for IntelliJ 2020-03-23 21:32:11 -07:00
Mark Vieira
2e617c3b10
Improve IntelliJ IDE integration (#53747)
This commit makes a number of improvements when importing the
Elasticsearch project into IntelliJ IDEA. Specifically:

 - Contributing documentation has been updated to reflect that the
   'idea' task should no long be used and Gradle project import is
   instead the officially supported way of setting up the project.
 - Attempts to run the 'idea' task will result in a failure with a
   message directing folks to our CONTRIBUTING.md document.
 - The project JDK is explicit set rather that using whatever JAVA_HOME
   is.
 - Gradle build operation delegation is disabled, and test execution is
   configured to 'choose per test'.
 - Gradle is configured to inherit the project JDK.
 - Some code style conventions are automatically configured.
 - File encoding is explicitly set to UTF-8.
 - Parallel module compilation is enabled and deprecated feature
   warnings are disabled.
 - A remote debug run configuration using listen mode is created.
 - JUnit runner is configured with required system properties.
 - License headers are configured such that Apache 2 is the default
   notice added to all source files with exception of source in /x-pack
   which will use the Elastic license.
2020-03-19 11:23:15 -07:00