Commit graph

1388 commits

Author SHA1 Message Date
Mariusz Józala
55fce5db33
[CI] Use official UBI9 image for testing (#126455) (#126507)
Internal UBI images from `docker.elastic.co` are planned to be removed.
2025-04-09 18:44:21 +10:00
Ryan Ernst
d94f06670a
Cleanup command line setting errors (#124963) (#125133)
This commit improves the error cases when command line settings are
found that are duplicates or conflict with special system properties.
2025-03-19 04:57:35 +11:00
Rene Groeschke
d1b6c36a94
Fix IronBank hardening_manifest CI test (#124579) (#124588)
This commit fix the IronBank hardening_manifest CI test that expect the
hardening_manifest.yaml values to match `'^(?!\\s*$)[ -~|]*$'` regex:

```
| hardening_manifest           | ERROR    | Hardening Manifest failed jsonschema validation
| hardening_manifest           | ERROR    | Verify Hardening Manifest content
| hardening_manifest           | ERROR    | 'Rene Gröschke' does not match '^(?!\\s*$)[ -~|]*$'
```

43219286

cc @breskeby

<!-- Thank you for your interest in and contributing to Elasticsearch!
There are a few simple things to check before submitting your pull
request that can help with the review process. You should delete these
items from your submission, but they are here to help bring them to your
attention. -->

- Have you signed the [contributor license agreement](https://www.elastic.co/contributor-agreement)?
- Have you followed the [contributor guidelines](https://github.com/elastic/elasticsearch/blob/main/CONTRIBUTING.md)?
- If submitting code, have you built your formula locally prior to submission with `gradle check`?
- If submitting code, is your pull request against main? Unless there is a good reason otherwise, we prefer pull requests against main and will backport as needed.
- If submitting code, have you checked that your submission is for an [OS and architecture that we support](https://www.elastic.co/support/matrix#show_os)?
- If you are submitting this code for a class then read our [policy](https://github.com/elastic/elasticsearch/blob/main/CONTRIBUTING.md#contributing-as-part-of-a-class) for that.

(cherry picked from commit e5cf597782)

# Conflicts:
#	distribution/docker/src/docker/iron_bank/hardening_manifest.yaml

Co-authored-by: Julien Mailleret <8582351+jmlrt@users.noreply.github.com>
2025-03-12 08:00:55 +11:00
Rene Groeschke
f4e505e635
Update Gradle wrapper to 8.13 (#122421) (#123875)
* Fix Gradle Deprecation warning as declaring an is- property with a Boolean type has been deprecated.
* Make use of new layout.settingsFolder api to address some cross project references
* Fix buildParams snapshot check for multiprojet projects

(cherry picked from commit e19b2264af)

# Conflicts:
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BaseInternalPluginBuildPlugin.java
#	docs/build.gradle
#	qa/entitlements/build.gradle
#	x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle
#	x-pack/qa/multi-project/xpack-rest-tests-with-multiple-projects/build.gradle
2025-03-05 15:57:55 +01:00
Ryan Ernst
f06b450e25
Block running ES 8.17 with JDK 24+. (#122517)
JDK 24+ will not work due to SecurityManager being disabled. This commit
makes the error explicit instead of runtime errors in SecurityManager
code.
2025-02-13 19:16:50 +01:00
Rene Groeschke
d2e79fbc98
[Gradle] Fix deprecation warning in release tests after 8.12 update (#119608) (#119624) 2025-01-07 20:19:04 +11:00
Mark Vieira
1b39798845
Fix vcs revision label in docker images (#119531) (#119538) 2025-01-04 06:17:36 +11:00
Rene Groeschke
49c0f5cf71
Update Gradle wrapper to 8.12 (#118683) (#119356)
This updates the gradle wrapper to 8.12

We addressed deprecation warnings due to the update that includes:

- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions

(cherry picked from commit ba61f8c7f7)

# Conflicts:
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerUbiElasticsearchDistributionType.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/Fixture.java
#	plugins/repository-hdfs/hadoop-client-api/build.gradle
#	qa/entitlements/build.gradle
#	server/src/main/java/org/elasticsearch/indices/IndicesFeatures.java
#	x-pack/plugin/migrate/build.gradle
#	x-pack/plugin/security/qa/security-basic/build.gradle
2024-12-31 08:37:12 +01:00
Rene Groeschke
a528cc97d5
Fix dummy entrypoint for cloud ess docker image (#119242) 2024-12-26 09:24:52 -08:00
Mark Vieira
d90dd4b6ae
chore: deps(ironbank): Bump ubi version to 9.5 (#119203) (#119225)
(cherry picked from commit 2c736f49b0)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-24 05:29:58 +11:00
Mark Vieira
3352b82191
chore: deps(ironbank): Bump ubi version to 9.5 (#119039) (#119142) 2024-12-23 08:20:44 -08:00
Rene Groeschke
5f82e202b5
Build ubuntu based cloud ess image (#119150) 2024-12-20 00:43:40 +01:00
Rene Groeschke
81f725d3d8
[8.17] Revert cloud wolfi migration (#119068)
This reverts the wolfi migration for cloud ess docker images.
2024-12-20 02:04:47 +11:00
Mark Vieira
181908c03b
Update jvm.options (#118716) (#119004)
Co-authored-by: Blake Niemyjski <bniemyjski@gmail.com>
2024-12-19 06:55:24 +11:00
Mark Vieira
f5c8762ce1
Update BWC version logic to support multiple bugfix versions (#117943) (#118116) (#118118)
(cherry picked from commit 7070e95fa7)

# Conflicts:
#	.buildkite/pipelines/intake.yml
#	.buildkite/pipelines/periodic.yml
#	.ci/snapshotBwcVersions
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPluginFuncTest.groovy
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/LegacyYamlRestCompatTestPluginFuncTest.groovy
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java
#	build-tools-internal/src/test/groovy/org/elasticsearch/gradle/internal/BwcVersionsSpec.groovy
(cherry picked from commit c5d3799af1)

# Conflicts:
#	.buildkite/pipelines/intake.yml
#	.buildkite/pipelines/periodic.yml
2024-12-06 12:12:36 +11:00
Rene Groeschke
20a78a18e9
[8.17] [Gradle] Remove static use of BuildParams (#115122) (#117433)
* [Gradle] Remove static use of BuildParams (#115122)

Static fields dont do well in Gradle with configuration cache enabled.

- Use buildParams extension in build scripts
- Keep BuildParams.ci for now for easy serverless migration
-  Tweak testing doc

(cherry picked from commit 13c8aaeffa)

# Conflicts:
#	TESTING.asciidoc
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestBasePlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/AbstractYamlRestCompatTestPlugin.java
#	build.gradle
#	modules/ingest-geoip/qa/full-cluster-restart/build.gradle
#	qa/mixed-cluster/build.gradle
#	x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle
#	x-pack/plugin/eql/qa/rest/build.gradle
#	x-pack/plugin/fleet/qa/rest/build.gradle
#	x-pack/plugin/kql/build.gradle
#	x-pack/plugin/mapper-unsigned-long/build.gradle
#	x-pack/plugin/ml/qa/multi-cluster-tests-with-security/build.gradle
#	x-pack/plugin/security/qa/multi-cluster/build.gradle
#	x-pack/plugin/sql/qa/jdbc/build.gradle
#	x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle

* Some cleanup

* Update build.gradle

fix buildparams access
2024-11-25 18:29:26 +01:00
Rene Groeschke
b38283728a
[Build] Reapply updating to Gradle 8.11.1 (#117394) (#117428)
This reverts commit b5c6d927c1.
* Simplify and fix dynamic project dependency handling

(cherry picked from commit d2b3dc51d1)
2024-11-25 03:54:00 +11:00
Slobodan Adamović
210d6ad5fd
Upgrade Bouncy Castle FIPS dependencies (#112989) (#117320)
This PR updates `bc-fips` and `bctls-fips` dependencies to the latest
minor versions.
2024-11-23 00:03:07 +11:00
Patrick Doyle
37edf70bda
Backport entitlement work up to #116473 to 8.x (#116613)
* Add initial entitlement policy parsing (#114448)

This change adds entitlement policy parsing with the following design:
* YAML file for readability and re-use of our x-content parsers
* hierarchical structure to group entitlements under a single scope
* no general entitlements without a scope or for the entire project

* Avoid double instrumentation via class annotation (#115398)

* Move entitlement jars to libs (#115883)

The distribution tools are meant to be CLIs. This commit moves the
entitlements jar projects to the libs dir, under a single
libs/entitlement root directory to keep the related jars together.

* Entitlement tools: SecurityManager scanner (#116020)

* Dynamic entitlement agent (#116125)

* Refactor: treat "maybe" JVM options uniformly

* WIP

* Get entitlement running with bridge all the way through, with qualified
exports

* Cosmetic changes to SystemJvmOptions

* Disable entitlements by default

* Bridge module comments

* Fixup forbidden APIs

* spotless

* Rename EntitlementChecker

* Fixup InstrumenterTests

* exclude recursive dep

* Fix some compliance stuff

* Rename asm-provider

* Stop using bridge in InstrumenterTests

* Generalize readme for asm-provider

* InstrumenterTests doesn't need EntitlementCheckerHandle

* Better javadoc

* Call parseBoolean

* Add entitlement to internal module list

* Docs as requested by Lorenzo

* Changes from Jack

* Rename ElasticsearchEntitlementChecker

* Remove logging javadoc

* exportInitializationToAgent should reference EntitlementInitialization, not EntitlementBootstrap.

They're currently in the same module, but if that ever changes, this code would have become wrong.

* Some suggestions from Mark

---------

Co-authored-by: Ryan Ernst <ryan@iernst.net>

* Remove unused EntitlementInternals (#116473)

* Revert "Entitlement tools: SecurityManager scanner (#116020)"

This reverts commit 023fb663de.

---------

Co-authored-by: Jack Conradson <osjdconrad@gmail.com>
Co-authored-by: Lorenzo Dematté <lorenzo.dematte@elastic.co>
Co-authored-by: Ryan Ernst <ryan@iernst.net>
2024-11-13 05:36:55 +11:00
Mariusz Józala
11fa0520b1
[8.x] [TEST] Migrated REST tests extending JsonLogsIntegTestCase (#115188) (#116025)
* [TEST] Migrated REST tests extending JsonLogsIntegTestCase (#115188)

REST tests extending JsonLogsIntegTestCase migrated to the new REST
testing framework, using 'elasticsearch.internal-java-rest-test' Gradle
plugin
Explicit handling of test single-cluster config by checking if cluster
is explicitly configured as single-node to avoid an incorrect configuration
which may cause split brain.

Replaced `ElasticsearchJavaPlugin` with `ElasticsearchJavaBasePlugin` in
 `RestTestBasePlugin` for better granularity.
Additionally, updated the `DistributionDownloadPlugin` to set configurations as
non-consumable and the `InternalDistributionArchiveSetupPlugin` to mark
certain configurations as consumable. This ensures that configurations
are correctly utilized during build setup and execution phases.

(cherry picked from commit 130cc74d8a)

* Fixed DefaultSettingsProvider to use Java 17 (#116029)

It is needed to be able to backport the change to the 8.x.
Having same code for both versions can help us to avoid some merge
conflicts in the future.
2024-11-04 20:59:59 +11:00
Ryan Ernst
dedf9fd6d7
Use directory name as project name for libs (#115720) (#115984)
* Use directory name as project name for libs (#115720)

The libs projects are configured to all begin with `elasticsearch-`.
While this is desireable for the artifacts to contain this consistent
prefix, it means the project names don't match up with their
directories. Additionally, it creates complexities for subproject naming
that must be manually adjusted.

This commit adjusts the project names for those under libs to be their
directory names. The resulting artifacts for these libs are kept the
same, all beginning with `elasticsearch-`.

* fixes
2024-10-31 07:52:10 +11:00
Patrick Doyle
0fabcf27eb
Backport entitlements work to date from main to 8.x (#115950)
* Initial trivial hello-world entitlements agent (#113112)

* Initial hello-world entitlements agent

* Respond to Ryan's comments

* License header

* Fix forbidden APIs setup

* Rename EntitlementAgent

* Automated refactor missed one

* Automated rename really let me down here

* Very serious test name

* README files for the new modules

* Use "tasks.named('jar')"

Co-authored-by: Rene Groeschke <rene@breskeby.com>

* Use 'tasks.named('test')'

Co-authored-by: Rene Groeschke <rene@breskeby.com>

* More deferral of gradle tasks

Co-authored-by: Rene Groeschke <rene@breskeby.com>

* Even more deferral

Co-authored-by: Rene Groeschke <rene@breskeby.com>

* FIx gradle syntax for javaagent arg

---------

Co-authored-by: Rene Groeschke <rene@breskeby.com>

* Entitlements for System.exit (#114015)

* Entitlements for System.exit

* Respond to Simon's comments

* Rename trampoline -> bridge

* Require exactly one bridge jar

* Use Type helpers to generate descriptor strings

* Various cleanup from PR comments

* Remove null "receiver" for static methods

* Use List<Type> instead of voidDescriptor

* Clarifying comment

* Whoops, getMethod

* SuppressForbidden System.exit

* Spotless

* Use embedded provider plugin to keep ASM off classpath

* Oops... forgot the punchline

* Move ASM license to impl

* Use ProviderLocator and simplify bridgeJar logic

* Avoid eager resolution of configurations during task configuration

* Remove compile-time dependency agent->bridge

---------

Co-authored-by: Mark Vieira <portugee@gmail.com>

* Initial InstrumenterTests (#114422)

* Initial InstrumenterTests

* Assert on instrumentation method arguments

---------

Co-authored-by: Rene Groeschke <rene@breskeby.com>
Co-authored-by: Mark Vieira <portugee@gmail.com>
2024-10-30 12:33:21 -04:00
Lorenzo Dematté
a97de9951d
Fix NPE on plugin sync (#115640) (#115734)
(cherry picked from commit c4c33ff359)
2024-10-28 21:34:07 +11:00
Rene Groeschke
2f3f6daea5
Remove unused elasticsearch cloud docker image (#115357) (#115572) 2024-10-25 04:01:25 +11:00
Rene Groeschke
6192818528
Replace cloud-ess docker image with wolfi-ess (#114413) (#114684)
* Replace cloud-ess docker image with wolfi-ess
   We just replaced the existing implementation of cloud-ess with what was wolfi-ess which is a wolfi based ess image.
   The cloud image itself will be removed in a future commit it was not used anywhere

* Switch to test cloud docker image instead of default docker in packaging pr tests.
  This adds way more coverage than the default docker image which is also barely touched

(cherry picked from commit f1f5ee06a3)

# Conflicts:
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/DockerBase.java
2024-10-14 16:07:11 +02:00
Rene Groeschke
45f57f11a2
[8.x] Update wolfi image and fix breaking change (#114390) (#114489)
* Update wolfi image and fix breaking change (#114390)

(cherry picked from commit 190513dce7)

# Conflicts:
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/DockerBase.java

* Fix spotlight
2024-10-11 21:08:33 +11:00
Rene Groeschke
54ecb2c666
Add wolfi ess docker image (#113810) (#114111)
(cherry picked from commit 54c83d7fa7)
2024-10-04 13:44:42 +02:00
Chris Hegarty
27fe7df700 Add JIT compiler directives to workaround performance regression in memory segment access in JDK 23 (#113817)
This commit adds a couple of JIT compiler directives to avoid a performance pitfall in JDK 23.

Ultimately this is a workaround for a JDK 23 bug, which has been reported and will be fixed in a future version of the JDK.

The nested rally track uncovered the JDK performance regression. Running JDK 23 with the compiler directives in this PR restores performance, and in fact improves it in several cases.
2024-10-01 14:11:18 +01:00
Brian Seeders
c0be2e2c1b
Fix packaging tests after addition of new wolfi-based image (#112831) (#113715) 2024-09-27 16:01:14 -04:00
Simon Cooper
31d5967d35
Remove use of SPI locale for JDK 23+ (#113182)
On JDK 23 we're just going with what CLDR specifies for week-date calculations - the built-in locales are available for ISO weekdate uses.
2024-09-20 16:48:17 +01:00
Tim Brooks
69c4a4f7e9
Backport incremental bulk execution (#113215)
This commit back ports all of the work introduced in:
https://github.com/elastic/elasticsearch/pull/113044

* #111438 - 5e1f655
* #111865 - 478baf1
* #112179 - 1b77421
* #112227 - cbcbc34
* #112267 - c00768a
* #112154 - a03fb12
* #112479 - 95b42a7
* #112608 - ce2d648
* #112629 - 0d55dc6
* #112767 - 2dbbd7d
* #112724 - 58e3a39
* dce8a0b
* #112974 - 92daeeb
* 529d349
* #113161 - e3424bd
2024-09-19 21:35:18 -06:00
Ryan Ernst
ec1785b3f7
Simplify java version checker (#112955) (#112960)
* Simplify java version checker (#112955)

The version checker ensures custom JDKs used to run Elasticsearch meet
the minimum Java version. It uses a multi-release jar to pass through
the "ok" versions, falling back to a java 8 version to print an error.
However, a multi-release jar is not necessary, we can instead do simple
string version parsing for the check, special casing Java 1.8.

* adjust for java 17
2024-09-19 06:29:43 +10:00
Joe Gallo
2cf435ac34
There's no need to BufferedInputStream within a GZIPInputStream (#113052) (#113068) 2024-09-19 01:00:42 +10:00
Mark Vieira
0279c0a909
Add AGPLv3 as a supported license 2024-09-13 14:30:33 -07:00
Brian Seeders
5c9710caf5
Fix wolfi docker tasks (#112721) 2024-09-10 17:39:53 -04:00
Rene Groeschke
4dee614707
Add chainguard docker image (#112103) 2024-09-06 10:32:42 -07:00
Simon Cooper
a36d90cf34
Use CLDR locale provider on JDK 23+ (#110222)
JDK 23 removes the COMPAT locale provider, leaving CLDR as the only option. This commit configures Elasticsearch
to use the CLDR provider when on JDK 23, but still use the existing COMPAT provider when on JDK 22 and below.

This causes some differences in locale behaviour; this also adapts various tests to still work whether run on COMPAT or CLDR.
2024-09-04 13:42:40 +01:00
Ryan Ernst
84bd31eb8e
Fix shutdown race condition in server start (#112300)
When the server CLI is preparing to start Elasticsearch, it may receive
a SIGTERM. That signal causes the close method of the CLI to be invoked,
which checks for a non-null server process, and stops it if it exists.
Since shutdown occurs in a different thread, it is possible close is
invoked, sees the server process is null, so skips calling close, but
then before close finishes the server process is started.

Normally the above case is ok; the close method will cause Java to exit,
and the child process will be sent a SIGTERM. However, in the case of
serverless, close is wrapped so that the CLI can wait on uploading
possible heapdumps. This presents the possibility that close thinks the
child process has been stopped, but it hasn't, so the wrapped close
waits indefinitely on the child process that was started up during the
race.

This commit guards against the startup race by locking the critical
sections that create the child process and stop it. Either the child
process is created first, and will then be stopped immediately, or close
is invoked first, marking that the CLI is shutting down, and creating
the child process will be skipped.
2024-08-29 10:20:43 -07:00
Victor Martinez
e7c0ba953a
Update IronBank docker image base to ubi:9.4 (#111743) 2024-08-28 19:18:58 +02:00
Ryan Ernst
0aa4758f02
Stop setting java.library.path (#112119)
Native libraries in Java are loaded by calling System.loadLibrary. This
method inspects paths in the java.library.path to find the requested
library. Elasticsearch previously used this to find libsystemd, but now
the only remaining use is to set the additional platform directory in
which Elasticsearch keeps its own native libraries.

One issue with setting java.library.path is that its not set for the cli
process, which makes loading the native library infrastructure from clis
difficult. This commit reworks how Elasticsearch native libraries are
found in order to avoid needing to set java.library.path. There are two
cases. The simplest is production, where the working directory is the
Elasticsearch installation directory, so the platform specific directory
can be constructed. The second case is for tests where we don't have an
installtion. We already pass in java.library.path there, so this change
renames the system property to be a test specific property that the new
loading infrastructure looks for.
2024-08-23 11:16:18 -07:00
Ryan Ernst
8417d3f141
Move preallocate functionality to native access (#110678)
This commit moves the file preallocation functionality into
NativeAccess. The code is basically the same. One small tweak is that
instead of breaking Java access boundaries in order to get an open file
handle, the new code uses posix open directly.

relates #104876
2024-07-11 09:42:44 -07:00
Patrick Doyle
43b2e877e0
Revert "Move PluginsService to its own internal package (#109872)" (#109946)
This reverts commit b9e7965184.
2024-06-19 18:10:50 -04:00
Patrick Doyle
b9e7965184
Move PluginsService to its own internal package (#109872)
* Mechanical package change in IntelliJ
* A couple of manual fixups
* Export plugins.loading to deprecation
* Put plugin-cli in a module so can export PluginsUtils to it.
2024-06-19 15:23:47 -04:00
Benjamin Trent
29288d6590 Merge remote-tracking branch 'upstream/main' into lucene_snapshot_9_11 2024-06-11 06:54:23 -04:00
Ry Biesemeyer
f75afb0098
Update year in NOTICE.txt (#109548) 2024-06-10 15:12:38 -07:00
Benjamin Trent
ac53d6020b Merge remote-tracking branch 'upstream/main' into lucene_snapshot_9_11 2024-06-05 12:38:23 -04:00
Rene Groeschke
7226100458
Make :distribution:docker:check Gradle configuration cache compatible (#109083)
fix cache compatibility issue in TestFixturesPlugin and support
yamlRestTest in `:distribution:docker:yamlRestTest`
2024-06-05 19:23:04 +10:00
Benjamin Trent
cf84416fc5 Merge remote-tracking branch 'upstream/main' into lucene_snapshot_9_11 2024-06-04 12:50:52 -04:00
Rene Groeschke
8ac3e3dd90
Update Gradle wrapper to 8.8 (#108021)
Fix incompatibility with 8.8 and our internal api usages

- Update ospackage to a version that contains a fix we provided
- Tweak build logic to avoid deprecation warnings
- Use newer permission api
- Use custom shadowplugin
- Rework ElasticsearchDistribution dependencies resolution
- Update Gradle wrapper to 8.8
2024-06-04 12:43:02 +02:00
elasticsearchmachine
83f51b477e Merge remote-tracking branch 'origin/main' into lucene_snapshot 2024-05-28 10:01:58 +00:00