Commit Graph

1707 Commits

Author SHA1 Message Date
Martijn van Groningen b2e0cfb111 Cut ml over to `PersistentTaskPlugin` and drop its own initialization of the persistent tasks framework.
Original commit: elastic/x-pack-elasticsearch@484b53c2a8
2018-01-31 11:08:45 +01:00
Martijn van Groningen 6f101d71d5 Removed persistent tasks framework from xpack-elasticsearch repository, because it now part of the elasticsearch repository.
Original commit: elastic/x-pack-elasticsearch@7a90ffc4f6
2018-01-31 11:05:54 +01:00
Tim Vernum d0f6d273d0 [TEST] Add additional logging to test
Attempt to diagnose elastic/x-pack-elasticsearch#3292 if it occurs again.

Original commit: elastic/x-pack-elasticsearch@eb262540f0
2018-01-31 18:26:57 +11:00
Nik Everett 99081adfbf XContent: Adapt to new method on parser (elastic/x-pack-elasticsearch#3797)
Properly delegates `XContentParser#getDeprecationHandler`.

Original commit: elastic/x-pack-elasticsearch@45356d600a
2018-01-30 18:21:21 -05:00
Simon Willnauer 570411c2dc Remove all tribe related code, comments and documentation (elastic/x-pack-elasticsearch#3784)
Relates to elastic/elasticsearch#28443

Original commit: elastic/x-pack-elasticsearch@5c4e7fccc7
2018-01-30 20:40:46 +01:00
Dimitris Athanasiou 5b7c38da7f [ML] UpdateProcessNotifier should drain the update queue (elastic/x-pack-elasticsearch#3774)
The notifier is scheduled to run once per second. Currently,
it simply polls for the next update in the queue. However,
when there are multiple updates queued up, there is no
reason to wait for subsequent runs in order to execute the
rest of the updates.

This commit changes the notifier to drain the queue each time
it runs. It then serially executes the updates.

relates elastic/x-pack-elasticsearch#3769

Original commit: elastic/x-pack-elasticsearch@7a433c17f2
2018-01-30 16:35:02 +00:00
David Roberts ce77a3dd6d [TEST] Make test more tolerant to slow VMs (elastic/x-pack-elasticsearch#3783)
The test this change applies to has failed a couple of times on
Windows VMs.

Original commit: elastic/x-pack-elasticsearch@94e94d3ffd
2018-01-30 16:34:16 +00:00
Jay Modi 71788671ad Test: fix skip check for EllipticCurveSSLTests (elastic/x-pack-elasticsearch#3771)
This change fixes the skip check for the EllipticCurveSSLTests. The skip check that is in the test
was added to proctect against failures on JVMs that do not support EC ciphers such as the packaged
openjdk in some linux distributions. The old skip check did not execute until the cluster was up
so the test would still fail with errors such as no cipher suites in common. This change moves the
check into a before class method that checks availability.

Original commit: elastic/x-pack-elasticsearch@5550ca4e1e
2018-01-30 08:21:15 -07:00
David Kyle 36ff4185a7 [ML] Move ML classes from core (elastic/x-pack-elasticsearch#3780)
* Move ML query builders

* Move autodetect params

* Remove unused MLClientActionPlugin

Original commit: elastic/x-pack-elasticsearch@23168c70dc
2018-01-30 11:55:30 +00:00
David Kyle edba6e329a [ML] Move ML action unit tests into same package as the classes (elastic/x-pack-elasticsearch#3772)
* Move ML action unit tests into same package as the classes

Original commit: elastic/x-pack-elasticsearch@9556d3c98a
2018-01-30 11:11:28 +00:00
David Kyle 10fae5e58f [ML][TEST] Scheduled events integration test (elastic/x-pack-elasticsearch#3555)
* Scheduled events integration test

Original commit: elastic/x-pack-elasticsearch@8181645fe5
2018-01-30 10:38:13 +00:00
Alexander Reelsen c65528b9f6 Watcher: Ensure state is cleaned properly in watcher life cycle service (elastic/x-pack-elasticsearch#3770)
The WatcherLifeCycleService is responsible for deciding if watches need
to be reloaded while running. In order to do this, the service stores
the currently local shard allocation ids in a List.

This data structure however was not properly updated all the time, when
it should have been - for example when a master node is not available.

This lead to unintended reloads, even though there was no change in the
allocated shards. This in turn lead to unwanted executions and unwanted
loading of triggered watches.

This commit should also fix one of the more nasty ongoing test failures,
where the test returns with an exception that only parts of watcher have
been started. The AbstractWatcherIntegrationTestCase now properly waits
until watcher is started before starting the test case itself.

Original commit: elastic/x-pack-elasticsearch@097f12a900
2018-01-30 10:28:48 +01:00
Tim Vernum da7560a079 [Security] Correct DN matches in role-mapping rules (elastic/x-pack-elasticsearch#3704)
Changes the behaviour of the role mapping API to perform a "DistinguishedNameMatch"
when the field is a DN. This is achieved by moving the responsibility for defining
the matching rules from the expression to the data (ExpressionModel)

Because the role mapping API is used within the SAML realm, which may or may not be
using DNs, this implementation assumes that the "dn" and "groups" should be
compared as DNs if they parse as a DN.
For SAML this behaviour will generally do the right thing, as members of the "groups"
field might be DNs (if the data is sourced from an LDAP directory) but often will not be.

Original commit: elastic/x-pack-elasticsearch@3a4dfbba79
2018-01-30 15:47:17 +11:00
jaymode 4271fd7cc3 Test: use System.lineseperator instead of `\n` in SamlSpMetadataBuilderTests
This commit fixes SamlSpMetadataBuilderTests#testBuildFullMetadata failures on windows due to
differing newline endings.

Original commit: elastic/x-pack-elasticsearch@3181c96e46
2018-01-29 13:47:42 -07:00
Simon Willnauer 32d4e7f9d0 [TEST] Use `ensureYellowAndNoInitializingShards` in monitoring test (elastic/x-pack-elasticsearch#3768)
Monitoring creates indices concurrently to the test execution. In that
case ensureYellow might not be enough and will cause test-failures when shards
are not active etc. This change uses a new method added in core to ensure shards
are not initializing anymore.

relates elastic/x-pack-elasticsearch#2672
Relates to elastic/elasticsearch#28416

Original commit: elastic/x-pack-elasticsearch@661e87f2ee
2018-01-29 20:46:35 +01:00
Simon Willnauer e7b2102126 Remove extension executables
Relates to elastic/x-pack-elasticsearch#3734

Original commit: elastic/x-pack-elasticsearch@da75402bc9
2018-01-29 10:52:27 +01:00
Ryan Ernst 5a86450df7 Build: Replace references to x-pack-elasticsearch paths with helper methods (elastic/x-pack-elasticsearch#3748)
In order to more easily integrate xpack once it moves into the
elasticsearch repo, references to the existing x-pack-elasticsearch need
to be reduced. This commit introduces a few helper "methods" available
to any project within xpack (through gradle project extension
properties, as closures). All refeerences to project paths now use these
helper methods, except for those pertaining to bwc, which will be
handled in a followup.

Original commit: elastic/x-pack-elasticsearch@850668744c
2018-01-26 21:48:30 -08:00
Ryan Ernst e583b72c8d Build: Move and simplify ml cpp snapshot (elastic/x-pack-elasticsearch#3762)
Now that ML binaries are public, there is no longer a need to use the s3
client to access the bucket, since creds are not needed. This commit
also moves the cpp snapshot project under the ml module, since it is
specific to that and does not need to clutter the plugin dir.

Original commit: elastic/x-pack-elasticsearch@51e77da4ac
2018-01-26 20:14:07 -08:00
Ryan Ernst 0001cadbb5 Remove leftover license files (elastic/x-pack-elasticsearch#3746)
These were remaining from prior to the split into modules.

Original commit: elastic/x-pack-elasticsearch@97e05b5709
2018-01-26 10:22:18 -08:00
David Roberts 9351b984ac [ML] Remove C++/Java handshake code (elastic/x-pack-elasticsearch#3757)
This is no longer needed following elastic/machine-learning-cpp#532

Original commit: elastic/x-pack-elasticsearch@76064b1539
2018-01-26 18:04:11 +00:00
David Kyle 50ea5f9cf8 [ML] Update Javadoc for expected behaviour in NameResolver (elastic/x-pack-elasticsearch#3733)
Update Javadoc

Original commit: elastic/x-pack-elasticsearch@e47f38b2ce
2018-01-26 16:03:31 +00:00
Dimitris Athanasiou 867b4fe9fc [ML] Ensure BWC between old and new rules syntax (elastic/x-pack-elasticsearch#3738)
relates elastic/x-pack-elasticsearch#3325

Original commit: elastic/x-pack-elasticsearch@74cccbccf0
2018-01-26 15:52:01 +00:00
Simon Willnauer 730e7075ab Remove XPackExtension in favor of SecurityExtensions (elastic/x-pack-elasticsearch#3734)
This change removes the XPackExtension mechanism in favor of
SecurityExtension that can be loaded via SPI and doesn't need
another (duplicate) plugin infrastructure

Original commit: elastic/x-pack-elasticsearch@f39e62a040
2018-01-26 16:14:11 +01:00
markharwood 620fe16ec4 [TEST] Remove unreliable scoring check on Graph API (elastic/x-pack-elasticsearch#918)
Original commit: elastic/x-pack-elasticsearch@3ba1340c70
2018-01-26 14:44:02 +00:00
Alexander Reelsen 49ecd23eb9 Tests: Ensure watcher is stopped before restarting
The EmailSecretsIntegrationTests did not properly wait for watcher to be
stopped before starting it again.

This test failed a few times per week across master and 6.x branches.

Original commit: elastic/x-pack-elasticsearch@cf20d58b0b
2018-01-26 11:17:08 +01:00
Ryan Ernst 9caebebe65 Build: Remove vault/s3 auth for ml artifacts (elastic/x-pack-elasticsearch#3742)
The ML snapshot artifacts bucket is now public, so we no longer need to
grab generated s3 creds from vault. This makes the download task run
noticably faster.

Original commit: elastic/x-pack-elasticsearch@e680e55f3d
2018-01-25 16:17:41 -08:00
Jay Modi f07a850ba2 [SAML] add security permission to get the classloader (elastic/x-pack-elasticsearch#3720)
This adds the security permission to get the thread context classloader to the security
plugin after it was inadvertently removed in elastic/x-pack-elasticsearch#3651. This was not caught as there is a
dependency on monitoring for security and monitoring has the getClassLoader permission.

relates elastic/x-pack-elasticsearch#3719

Original commit: elastic/x-pack-elasticsearch@61ad950f5b
2018-01-25 13:01:48 -07:00
Michael Basnight e59bcd8f8e Enable the licenseHeaders task for plugins (elastic/x-pack-elasticsearch#3673)
Original commit: elastic/x-pack-elasticsearch@c9949b8ca5
2018-01-25 11:34:02 -06:00
Michael Basnight 39b4587d02 Remove requiresKeystore when not actually required (elastic/x-pack-elasticsearch#3697)
Original commit: elastic/x-pack-elasticsearch@6bdd4ae2dc
2018-01-25 07:33:30 -06:00
Jim Ferenczi 3316c964c8 Move watcher's Cron into x-pack core (elastic/x-pack-elasticsearch#3716)
This change moves watcher's Cron class in the schedule package of xpack-core so that it can be used by other projects (rollup).

Original commit: elastic/x-pack-elasticsearch@f0aa32ccc2
2018-01-25 11:57:44 +01:00
Ryan Ernst 3e24ea3ed2 Test: Add internalClusterTest to xpack modules (elastic/x-pack-elasticsearch#3730)
This commit reenables running ITs in xpack by adding an internalClusterTest to xpack modules that contain ESIntegTestCase tests. The new task allows us to run these independently of rest integ tests, which are disabled for xpack modules because installing the bundled plugins directly is not quite the same as installing via the meta plugin. Some tests (ML) are moved to their own qa module to accommodate the need for a real cluster. A couple tests (monitoring and upgrade) have been marked as AwaitsFix.

Commits that have been folded into this commit:
* Move ML IT tests to qa/ml-native-tests
* Add internalClusterTest task and disable rest integ tests for xpack
modules. Also tweak ML tests and get upgrade tests working
* Adding the keystore and security back to the ml native tests
* Fixing native integ test
* Fix last ML test, add awaits fix to monitoring and upgrade tests
* cleanup PR
* fix checkstyle

Original commit: elastic/x-pack-elasticsearch@3c0ed6fd3b
2018-01-25 10:38:34 +01:00
Jay Modi 3baf6f3a7a Remove production from the message about license installation without TLS (elastic/x-pack-elasticsearch#3666)
This change simply changes the wording of the message that is returned to the user when
installation of a license is attempted with security enabled and TLS disabled. The term
"production" has been removed as it means something different to users.

See elastic/x-pack-elasticsearch#2636

Original commit: elastic/x-pack-elasticsearch@9739c72d66
2018-01-24 12:44:25 -07:00
jaymode a547049303 Security: switch to IllegalArgumentException if request cannot be serialized
The commit switches the CreateTokenRequest and InvalidateTokenRequest to throw an
IllegalArgumentException when the version the request is being serialized to does not support the
request. This fixes test failures due to the use of the AssertingTransportInterceptor testing
serialization with versions prior to 6.2. The IAE is an indication to the
AssertingTranpsortInterceptor that the request does not support the version.

Original commit: elastic/x-pack-elasticsearch@c73abf1bc0
2018-01-24 12:19:09 -07:00
David Roberts ae1a90eba6 [ML] Move JobProvider and the Batched*Iterators out of core (elastic/x-pack-elasticsearch#3712)
By moving these into the ML module:

1. The classes are in the same module as their unit tests
2. We can extend the JobProvider in the future with functionality
   that is not in core

Original commit: elastic/x-pack-elasticsearch@610a89a3d9
2018-01-24 18:56:30 +00:00
Jay Modi 0baa45d9b3 [SAML] Find all tokens for a realm, not just the first 10 (elastic/x-pack-elasticsearch#3689)
This commit changes the token service to use a scroll based approach when finding all tokens by
the realm. Without this, we may only find a few tokens and leave some active that need to be
invalidated.

relates elastic/x-pack-elasticsearch#3688

Original commit: elastic/x-pack-elasticsearch@20e97b6aae
2018-01-24 11:07:51 -07:00
Alexander Reelsen cee33c0bc8 ML: Remove unneeded and empty lifecycle listener (elastic/x-pack-elasticsearch#3710)
Original commit: elastic/x-pack-elasticsearch@d8d77f4e74
2018-01-24 16:55:59 +01:00
David Kyle 29ece3c79f [ML] Refactor update calendar params (elastic/x-pack-elasticsearch#3714)
Original commit: elastic/x-pack-elasticsearch@a7ef33b58a
2018-01-24 15:16:21 +00:00
Jason Tedor e385b7dab4 Elevate privileges fetching metadata for SAML
We have to elevate privileges here as these invocations happen in a run
loop that will not have the correct privileges for socket connections.

Relates elastic/x-pack-elasticsearch#3671

Original commit: elastic/x-pack-elasticsearch@eab9f47583
2018-01-24 08:59:01 -05:00
Jason Tedor 3932635f98 Simplify security manager permissions
The security manager permissions were copied wholesale from pre-split
X-Pack. However, this grants unnecessary permissions to the child
plugins. This commit is a simple attempt at removing permissions that
are not needed in the child plugins.

Relates elastic/x-pack-elasticsearch#3651

Original commit: elastic/x-pack-elasticsearch@8325ed83d7
2018-01-24 08:57:54 -05:00
Tanguy Leroux ba7b84d4d0 Fix XPackExtension javadoc (elastic/x-pack-elasticsearch#3711)
Original commit: elastic/x-pack-elasticsearch@bbe950ce40
2018-01-24 14:24:39 +01:00
Simon Willnauer 3b7d1f4d98 Prevent watcher from starting after node has shutdown (elastic/x-pack-elasticsearch#3709)
Some tests seem to be pretty flaky due to concurrent watcher restarts.
This change makes sure we never restart watcher once the node is shutting down.

Original commit: elastic/x-pack-elasticsearch@f0bed7269b
2018-01-24 14:16:05 +01:00
Alexander Reelsen 1ebccfcf50 Settings: Cut over to affix settings where filters are needed (elastic/x-pack-elasticsearch#3685)
x-pack makes extensive use of group settings in its exporters as well as
its notification services. This does not cope well with settings being
marked as filtered.

This replaces a fair share of group settings (unfortunately not all of
them) with affix key settings, allowing for better filtering and
registering of settings.

Original commit: elastic/x-pack-elasticsearch@968bc8c2ee
2018-01-24 13:14:08 +01:00
Michael Basnight 4475b718a4 Remove invalid use of XPackPlugin class (elastic/x-pack-elasticsearch#3700)
Original commit: elastic/x-pack-elasticsearch@f4aabe1259
2018-01-23 21:11:24 -06:00
Jason Tedor c0790d6a49 Move x-pack-core to core package (elastic/x-pack-elasticsearch#3678)
This commit moves the source file in x-pack-core to a org.elasticsearch.xpack.core package. This is to prevent issues where we have compile-time success reaching through packages that will cross module boundaries at runtime (due to being in different classloaders). By moving these to a separate package, we have compile-time safety. Follow-ups can consider build time checking that only this package is defined in x-pack-core, or sealing x-pack-core until modules arrive for us.

Original commit: elastic/x-pack-elasticsearch@232e156e0e
2018-01-23 12:43:58 -06:00
David Kyle 97e018f1bd [ML] Return the updated calendar after removing a job (elastic/x-pack-elasticsearch#3690)
Original commit: elastic/x-pack-elasticsearch@1bf1f3228b
2018-01-23 17:40:41 +00:00
Alexander Reelsen d065b087ee Revert "Cleanup: Remove HaltedClock (elastic/x-pack-elasticsearch#3664)"
This reverts commit elastic/x-pack-elasticsearch@f91c401a60 due to
failing tests, like

./gradlew :x-pack-elasticsearch:plugin:watcher:test -Dtests.seed=AE30350FCE96D26D -Dtests.class=org.elasticsearch.xpack.watcher.watch.WatchTests -Dtests.method="testParserSelfGenerated" -Dtests.security.manager=true -Dtests.locale=ja-JP -Dtests.timezone=EET

Original commit: elastic/x-pack-elasticsearch@e45d79d643
2018-01-23 18:08:54 +01:00
David Roberts 697a08e742 [ML] Refactor so ML doesn't require PersistentTasksService at startup (elastic/x-pack-elasticsearch#3682)
At present the PersistentTasksService is created inside the ML plugin.
This is undesirable, as other plugins will use persistent tasks in the
near future.

This change refactors the startup code so that the PersistentTasksService
no longer needs to be passed to any constructors for ML components.

A future change will still be required to actually move the initialization
of the PersistentTasksClusterService, PersistentTasksService and
PersistentTasksExecutorRegistry out of the ML plugin, but following this
change it should be fairly simple.

Original commit: elastic/x-pack-elasticsearch@3c2a8e020e
2018-01-23 16:55:08 +00:00
Simon Willnauer 63c0e288af Ensure we protect Collections obtained from scripts from self-referencing (elastic/x-pack-elasticsearch#3681)
Self referencing maps can cause SOE if they are iterated ie. in their toString methods. This chance adds some protected to the usage of those collections.
see elastic/elasticsearch#28335

Original commit: elastic/x-pack-elasticsearch@c4f1089c74
2018-01-23 17:02:37 +01:00
Dimitris Athanasiou 215f9af1cc [ML] Add trace logging for when search response is obtained (elastic/x-pack-elasticsearch#3669)
This is useful for understanding performance characteristics
as it helps us understand whether the bottleneck is the search
part or the analytics part.

Relates elastic/x-pack-elasticsearch#3590

Original commit: elastic/x-pack-elasticsearch@dc8c095958
2018-01-23 14:16:34 +00:00
Alexander Reelsen e3da8fa4ae Cleanup: Remove HaltedClock (elastic/x-pack-elasticsearch#3664)
The HaltedClock was a leftover from moving over from our own Clock
implementation to a java.time one. java.time already has a fixed clock,
this one is not needed.

Original commit: elastic/x-pack-elasticsearch@f91c401a60
2018-01-23 14:13:22 +01:00