Commit graph

1378 commits

Author SHA1 Message Date
Evgenia Badyanova
b29423f6a0
Use different G1GC options for small heaps (#59667)
Our benchmarks have demonstrated that Elasticsearch performs better with `-XX:G1HeapRegionSize=4M` and `-XX:G1ReservePercent=15` options for the small heap sizes. With this commit we ergonomically choose different G1GC options for heap sizes smaller than (not including) 8GB.

Co-authored-by: Daniel Mitterdorfer daniel.mitterdorfer@elastic.co
2020-10-06 14:59:09 -04:00
Ioannis Kakavas
95508c8fd1
Update bcfips in plugin-cli (#63149)
In 63099 we updated the bcfips version we use in tests to 1.0.2.
We however, bundle bcfips and bcpg-fips in plugin-cli and we should
update this too.
2020-10-02 06:31:27 +03:00
Rene Groeschke
4c2b3a0294
Cleanup on integtest distribution setup (#62937)
- Simplify build task and archive base name calculation
- Move integ test zip project only setup into integ test zip build script
2020-10-01 10:48:48 +02:00
Rene Groeschke
aa5d3159de
Use services for archive and file operations in tasks (#62968)
Referencing a project instance during task execution is discouraged by
Gradle and should be avoided. E.g. It is incompatible with Gradles
incubating configuration cache. Instead there are services available to handle
archive and filesystem operations in task actions.

Brings us one step closer to #57918
2020-10-01 10:47:41 +02:00
Rene Groeschke
2a8885ae91
Wire local unreleased bwc versions more efficient for tests (#62473)
For testing against the local distribution we already avoid the packaging/unpackaging 
cycle of es distributions when setting up test clusters. This PR adopts the usage of the
expanded created distributions for unreleased bwc versions (versions that are checkout 
from a branch and build from source in the :distribution:bwc:minor / :distribution:bwc:bugfix). 
This makes the setup of bwc based cross version tests a bit faster by avoiding 
the unpackaging overhead. We still assemble both in the bwcBuild tasks atm 
which will be addressed in a later issue.

This reworks the :distribution:bwc project:

- Convert all the custom logic from build script logic (groovy) into gradle binary plugins (java)
- Tried to make the bwc setup logic a bit more readable
- Add basic functional test coverage for the bwc logic this PR tweaked.
- Extracted a general internal BWC Git plugin out of the bwc setup plugin to improve maintenance 
and testability
- Changed the InternalDistributionPlugin to resolve the extracted distro instead on relying 
on unpacking the distribution archive
2020-10-01 10:45:21 +02:00
Rory Hunter
b18832cf47
Add RHEL UBI to dependency report (#62888)
Add information about RHEL UBI to the dependency report task.
2020-09-29 08:16:43 +01:00
Rene Groeschke
7e5936d58c
Avoid packaging / unpacking cycle when using local current distributions (#61592)
- Extract distribution archives defaults into plugin
- Added basic test coverage
- avoid packaging/unpackaging cycle when relying on locally build distributions
- Provide DSL for setting up distribution archives
- Cleanup archives build script
2020-09-09 14:44:27 +02:00
Jake Landis
1367bd0c92
Remove integTest task from PluginBuildPlugin (#61879)
This commit removes `integTest` task from all es-plugins.  
Most relevant projects have been converted to use yamlRestTest, javaRestTest, 
or internalClusterTest in prior PRs. 

A few projects needed to be adjusted to allow complete removal of this task
* x-pack/plugin - converted to use yamlRestTest and javaRestTest 
* plugins/repository-hdfs - kept the integTest task, but use `rest-test` plugin to define the task
* qa/die-with-dignity - convert to javaRestTest
* x-pack/qa/security-example-spi-extension - convert to javaRestTest
* multiple projects - remove the integTest.enabled = false (yay!)

related: #61802
related: #60630
related: #59444
related: #59089
related: #56841
related: #59939
related: #55896
2020-09-08 16:41:54 -05:00
Ryan Ernst
a56952a299
Add snapshot only test modules (#61954)
This commit adds external test modules. These are modules meant for
external systems to test edge cases in elasticsearch, but only within
snapshots. They are not meant to be used in production, so protections
are also added from their accidental inclusion in release builds.

Note that this commit does not actually add any new modules, it only
adds the infrastructure for the new modules, under
`test/external-modules`.
2020-09-04 16:34:55 -07:00
Rory Hunter
90d520c3fe
Fix deprecation logging config in Docker (#61840)
PR #61474 reworked deprecation logging to rely more heavily on log4j. Unfortunately,
the changes required to log4j's configuration were not applied to the version we ship
with the Docker image.
2020-09-02 12:02:45 +01:00
Rene Groeschke
72ff11d080
Simplify distribution download and extraction (Take two) (#61276)
We leverage artifact transforms now when downloading and unpacking elasticsearch distributions.

This has the benefit of

- handcrafted extract tasks on the root project are not required. The general tight coupling to the root project 
has been removed.
- The overall required configurations required to handle a distribution have been reduced
- ElasticsearchDistribution has been simplified by making Extracted an ordinary Configuration
downloaded and unpacked external distributions are reused in later builds by been cached
in the gradle user home.

DistributionDownloadPlugin functional tests have been extended and ported
to DistributionDownloadPluginFuncTest.
2020-08-27 14:21:41 +02:00
Rene Groeschke
fe638584c1
Extract distribution archive checks into plugin (#61533)
- Added test coverage
- Removes build script cluttering
- Splits archive building and archive checking logic
- only rely on boost for now for ML licenses(tbd)
- Use Gradle build-in untar and unzip support
2020-08-26 09:22:57 +02:00
Rory Hunter
f0aa24e9cc
Implement deprecation logging using log4j (#61474)
Part of #46106. Simplify the implementation of deprecation logging by
relying of log4j more completely, and implementing additional behaviour
through custom appenders and filters.
2020-08-25 09:49:33 +01:00
Rory Hunter
95b8218d51
Allow running the Docker image with a non-default group (#61194)
Closes #60864. Tweak the JDK directories' permissions in the ES
Docker image so that ES can run under a different user and group.

These changes assume that the image is being run with bind-mounted
config, data and logs directories, and reads and writes to these
locations will still fail when both the UID and GID are not the
default. Everything should be OK when running with the default GID
of zero, however.
2020-08-24 11:04:38 +01:00
Rory Hunter
2e3ed6171e
Add UBI docker builds (#60742)
This PR resurrects support for building Docker images based on one of Red Hat's UBI images. It also adds support for
running the existing Docker tests against the image. The image is named `elasticsearch-ubi8:<version>`.

I also changed the Docker build file uses enums instead strings in a lot of places, for added rigour.
2020-08-18 09:27:23 +01:00
Mark Vieira
ad9bc452a8
Revert "Simplify distribution download and extraction (#60969)"
This reverts commit b61f71875d.
2020-08-17 08:53:00 -07:00
Rene Groeschke
b61f71875d
Simplify distribution download and extraction (#60969)
We leverage artifact transforms now when downloading and unpacking elasticsearch distributions.

This has the benefit of

- handcrafted extract tasks on the root project are not required. The general tight coupling to the root project 
has been removed.
- The overall required configurations required to handle a distribution have been reduced
- ElasticsearchDistribution has been simplified by making Extracted an ordinary Configuration
downloaded and unpacked external distributions are reused in later builds by been cached
in the gradle user home.

DistributionDownloadPlugin functional tests have been extended and ported
to DistributionDownloadPluginFuncTest.
2020-08-17 08:27:47 +02:00
Steven Goossens
2861d9045d
Upgrade Centos version in Dockerfile to 8 (#59019) 2020-08-06 13:42:34 +01:00
Rene Groeschke
dd74be0f83
Merge test runner task into RestIntegTest (#60261)
* Merge test runner task into RestIntegTest
* Reorganizing Standalone runner and RestIntegTest task
* Rework general test task configuration and extension
2020-08-03 12:07:41 +02:00
Rene Groeschke
a72760e55b
Replace immediate task creations by using task avoidance api (#60071)
- Replace immediate task creations by using task avoidance api
- One step closer to #56610
- Still many tasks are created during configuration phase. Tackled in separate steps
2020-07-31 11:29:14 +02:00
Mark Vieira
d17c8cfa58
Add compatibility testing for JDBC driver (#60430)
This commit adds compatibility testing of our JDBC driver against
different Elasticsearch versions. Although we are really testing the
forwards compatibility nature of the JDBC driver we model the testing
the same as we do existing BWC tests, that is, with the current branch
fetching the earlier versions of the artifact that is to be tested. In
this case, that's the JDBC driver itself.

Because the tests include the JDBC driver jar on it's classpath we had
to change the packaging of the driver jar in order to avoid jarhell and
other conflicting dependency issues when using an old JDBC driver with
later branches. For this we simply relocate all driver dependencies in
the shadow jar under a "shadowed" package. This allows the JDBC driver
to use the correct version of Elasticsearch libs classes, while the
tests themselves use their versions. Since this required a change to the
driver jar compatibility testing can only go back as far as that version
which at the time of this commit is 7.8.1.
2020-07-29 14:11:16 -07:00
Ryan Ernst
5937316d72
Set the systemd initial timeout to 75 seconds (#60345)
For systemd, while we are starting up, we notify the system every 15
seconds that we are still in the middle of starting up. However, if
initial startup before plugin initialization is slower than 15 seconds,
we won't ever get the chance to run the first timeout extension. This
commit sets the initial timeout to 75 seconds, up from the default 30
seconds used by systemd.

closes #60140
2020-07-28 16:57:13 -07:00
Rene Groeschke
e289e7c4e7
Split internal distribution handling into separate internal plugin (#57869)
* Split internal distribution logic into separate plugin
* Remove moved func test from DistributionDownloadPluginIT
* Assert internal plugin is only appied on internal build
* Extract common abstract test specification for plugin func tests
* Provide proper failure if unexpected non jdk bundled bwc version is requested
2020-07-27 16:37:12 +02:00
Rene Groeschke
8d457a238b
Remove remaining deprecated api usages (#59231)
- Fix duplicate path deprecation by removing duplicate test resources
- fix deprecated non annotated input property in LazyPropertyList
- fix deprecated usage of AbstractArchiveTask.version
- Resolve correct test resources
2020-07-14 09:11:24 +02:00
Rene Groeschke
c0c8bb5764
Fix deprecated unsave project outputs resolution (#59088)
- Fixes how libs in distribution are resolved
- Related to #57920
- Required minor rework on common repository setup to allow distribution projects
to resolve thirdparty artifacts
- Use Default configurations when resolving tools for distribution packaging
2020-07-10 15:34:31 +02:00
Rene Groeschke
3d40b35b97
Verify distro archives do not contain plain class files (#59073)
This is a test to ensure we do not run into a regression like we did in
https://github.com/elastic/elasticsearch/issues/59031
2020-07-08 15:30:37 +02:00
Jason Tedor
30147fd699
Use https for JDK sources (#59111)
This commit switches to using https to refer to the JDK sources.
2020-07-07 13:38:53 -04:00
Rene Groeschke
2bf44f5e7c
Fix implicit duplicate duplicatesStrategy in processResources (#58929)
* Fix implicit duplicate duplicatesStrategy in processResources
* Fix duplicates strategy in docker distribution setup
2020-07-07 11:39:48 +02:00
Jake Landis
333a5d8cdf
Create plugin for yamlTest task (#56841)
This commit creates a new Gradle plugin to provide a separate task name
and source set for running YAML based REST tests. The only project
converted to use the new plugin in this PR is distribution/archives/integ-test-zip.
For which the testing has been moved to :rest-api-spec since it makes the most
sense and it avoids a small but awkward change to the distribution plugin.

The remaining cases in modules, plugins, and x-pack will be handled in followups.

This plugin is distinctly different from the plugin introduced in #55896 since
the YAML REST tests are intended to be black box tests over HTTP. As such they
should not (by default) have access to the classpath for that which they are testing.

The YAML based REST tests will be moved to separate source sets (yamlRestTest).
The which source is the target for the test resources is dependent on if this
new plugin is applied. If it is not applied, it will default to the test source
set.

Further, this introduces a breaking change for plugin developers that
use the YAML testing framework. They will now need to either use the new source set
and matching task, or configure the rest resources to use the old "test" source set that
matches the old integTest task. (The former should be preferred).

As part of this change (which is also breaking for plugin developers) the
rest resources plugin has been removed from the build plugin and now requires
either explicit application or application via the new YAML REST test plugin.

Plugin developers should be able to fix the breaking changes to the YAML tests
by adding apply plugin: 'elasticsearch.yaml-rest-test' and moving the YAML tests
under a yamlRestTest folder (instead of test)
2020-07-06 12:13:01 -05:00
Rene Groeschke
ac7aafe824
Fix security-cli distribution packaging (#59048)
- This fixes https://github.com/elastic/elasticsearch/issues/59031
- do not use compileclasspath in distribution packaging as it uses by default
plain class files
2020-07-06 09:42:32 +02:00
Rene Groeschke
f42d55de22
Remove deprecated AbstractArchiveTask Gradle API usages (#58657)
* Fix deprecated ArchiveTask configurations

* Fix destinationDirectory property reference
2020-07-02 11:53:35 +02:00
Rene Groeschke
9526c7a4b3
Replace compile configuration usage with api (#58451)
- Use java-library instead of plugin to allow api configuration usage
- Remove explicit references to runtime configurations in dependency declarations
- Make test runtime classpath input for testing convention
  - required as java library will by default not have build jar file
  - jar file is now explicit input of the task and gradle will ensure its properly build
2020-06-30 09:37:09 +02:00
Ryan Ernst
dad9ebff15
Add plugin installer test for plugin jar contents (#58287)
The plugin installer currently checks the fake plugins installed contain
a single jar file. This commit adds another test for a plugin which
contains multiple jar files, ensuring all jars exist in the installed
plugin.
2020-06-24 09:49:09 -07:00
Rene Groeschke
fa10cf574e
Fix deprecated property usage in archive tasks (#58269) 2020-06-18 08:18:09 +02:00
Rene Groeschke
5f9d1f1d7c
Unify dependency licenses task configuration (#58116)
- Remove duplicate dependency configuration
- Use task avoidance api accross the build
- Remove redundant licensesCheck config
2020-06-17 18:27:16 +02:00
Mark Vieira
9437e32c2f
Add OpenJDK distribution to external dependency report (#58187) 2020-06-16 15:07:28 -07:00
William Brafford
d8123b3a56
Avoid extra whitespace in parsed JVM options (#57769)
The windows service script does a little munging of the parsed JVM
option string, converting whitespaces to semicolons. We recently added
an optional Java 14 JDK flag to our system JVM flags. On earlier JDKs,
the windows service batch script would encounter a double whitespace
when this option was missing and convert it into double semicolons.
Double semicolons, in turn, don't work in the arguments to the windows
service command, and led to a lot of JVM options being dropped,
including "es.path.conf", which is required for startup.

This commit puts in a double defense. First, it removes any empty-string
options from the system options list in the Java Options Parser code.
Second, it munges out double semicolons if they do appear in the parsed
option output.
2020-06-16 17:12:48 -04:00
Rene Groeschke
680ea07f7f
Remove deprecated usage of testCompile configuration (#57921)
* Remove usage of deprecated testCompile configuration
* Replace testCompile usage by testImplementation
* Make testImplementation non transitive by default (as we did for testCompile)
* Update CONTRIBUTING about using testImplementation for test dependencies
* Fail on testCompile configuration usage
2020-06-12 13:34:53 +02:00
Rene Groeschke
a57dd54306
Update Gradle wrapper to 6.5 (#57580)
* Update Gradle wrapper to 6.5
* Fix groovy incompatibility issue after gradle update
* Fix Gstring String incompatibility
2020-06-04 10:32:47 +02:00
Rene Groeschke
9e6b2a667d
Move classes from build scripts to buildSrc (#57197)
* Move classes from build scripts to buildSrc

- move Run task
- move duplicate SanEvaluator

* Remove :run workaround

* Some little cleanup on build scripts on the way
2020-06-02 10:33:14 +02:00
Ryan Ernst
2558699f99
Remove DEBUG-level logging from actions in docker (#57389)
In #51459 DEBUG-level logging was removed from the default log4j
configuration. However, our docker build has its own log4j configuration
which was missed in that change. This commit removes the same from the
docker log4j configuration.

relates #51459
relates #51198
2020-06-01 18:00:40 -07:00
Mark Vieira
627ef279fd
Include vendored code notices in distribution notice files (#57017) 2020-06-01 15:23:41 -07:00
Ryan Ernst
2899e03217
Remove SysV init support (#51716)
With the removal of support for older OSes, we no longer have any
supported systems which use SysV init. This commit removes support for
that legacy init system.

relates #51480
2020-05-27 07:19:28 -07:00
Rene Groeschke
731b282c9f
Improvement usage of gradle task avoidance api (#56627)
Use gradle task avoidance api wherever it is possible as a drop in replacement in the es build
2020-05-19 20:01:49 +02:00
Mark Vieira
3555a9424b
Ensure dependency report task depends on upstream reporting tasks (#56853) 2020-05-18 07:19:40 -07:00
Ryan Ernst
c0ee68b0a0
Move publishing configuration to a separate plugin (#56727)
This is another part of the breakup of the massive BuildPlugin. This PR
moves the code for configuring publications to a separate plugin. Most
of the time these publications are jar files, but this also supports the
zip publication we have for integ tests.
2020-05-14 18:56:59 -07:00
Mark Vieira
f9847f3b71
Enforce strict license distribution requirements (#56642)
This commit tightens certain dependency license checks in our build.
Firstly, the build will not fail if it cannot accurately identify the
type of license in one of our LICENSE.txt files. Secondly, dependencies
for licenses identified as requiring source redistribution will fail if
a corresponding SOURCES.txt file does not exist. This file should
include a hyperlink to a source artifact for the given dependency to be
used for redistribution during the release process.
2020-05-14 13:25:32 -07:00
Rory Hunter
c9e811c4fe
Push arch-specific logic from Gradle into Docker (#56503)
Docker informed us that for official multi-arch Docker builds, there
needs to be a single Dockerfile and build context that can be used for
each supported architecture. Therefore, rework the build to move the
relevant architecture logic into the Dockerfile, and merge the aarch64
/ x64 docker context builds.
2020-05-12 11:10:05 +01:00
Rene Groeschke
fb86184dbb
Move bwcVersions extension property to BuildParams (#56206)
- resolved in GlobalBuildInfoPlugin
- propagate exception if version file cannot be resolved
- add null check when setting bwcVersions
2020-05-07 12:08:17 +02:00
Mark Vieira
161e3ebcab
Update Gradle wrapper to 6.4 (#55338) 2020-05-06 14:52:45 -07:00