From 9a3924a64181d7acdbd923a4e9aa97f7b9f0cbf5 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Fri, 8 May 2020 16:22:45 +0100 Subject: [PATCH] [ML] Adjust list of platforms that have ML native code (#56426) Native code is now available for linux-aarch64. Note that it is _not_ currently supported! --- .../elasticsearch/xpack/ml/MachineLearningFeatureSet.java | 4 ++-- .../xpack/ml/MachineLearningFeatureSetTests.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSet.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSet.java index f3ccf797fe3..2a1ef118f74 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSet.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSet.java @@ -72,8 +72,8 @@ public class MachineLearningFeatureSet implements XPackFeatureSet { /** * List of platforms for which the native processes are available */ - private static final List mlPlatforms = - Arrays.asList("darwin-x86_64", "linux-x86_64", "windows-x86_64"); + private static final List mlPlatforms = Collections.unmodifiableList( + Arrays.asList("darwin-x86_64", "linux-aarch64", "linux-x86_64", "windows-x86_64")); private final boolean enabled; private final XPackLicenseState licenseState; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSetTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSetTests.java index 7be16d2f54e..9e8ccfd641b 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSetTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MachineLearningFeatureSetTests.java @@ -122,8 +122,10 @@ public class MachineLearningFeatureSetTests extends ESTestCase { public void testIsRunningOnMlPlatform() { assertTrue(MachineLearningFeatureSet.isRunningOnMlPlatform("Linux", "amd64", true)); - assertTrue(MachineLearningFeatureSet.isRunningOnMlPlatform("Windows 10", "amd64", true)); + assertTrue(MachineLearningFeatureSet.isRunningOnMlPlatform("Linux", "aarch64", true)); assertTrue(MachineLearningFeatureSet.isRunningOnMlPlatform("Mac OS X", "x86_64", true)); + assertTrue(MachineLearningFeatureSet.isRunningOnMlPlatform("Windows 10", "amd64", true)); + assertFalse(MachineLearningFeatureSet.isRunningOnMlPlatform("Windows 10", "arm64", false)); assertFalse(MachineLearningFeatureSet.isRunningOnMlPlatform("Linux", "i386", false)); assertFalse(MachineLearningFeatureSet.isRunningOnMlPlatform("Windows 10", "i386", false)); assertFalse(MachineLearningFeatureSet.isRunningOnMlPlatform("SunOS", "amd64", false)); @@ -131,6 +133,8 @@ public class MachineLearningFeatureSetTests extends ESTestCase { () -> MachineLearningFeatureSet.isRunningOnMlPlatform("Linux", "i386", true)); expectThrows(ElasticsearchException.class, () -> MachineLearningFeatureSet.isRunningOnMlPlatform("Windows 10", "i386", true)); + expectThrows(ElasticsearchException.class, + () -> MachineLearningFeatureSet.isRunningOnMlPlatform("Windows 10", "arm64", true)); expectThrows(ElasticsearchException.class, () -> MachineLearningFeatureSet.isRunningOnMlPlatform("SunOS", "amd64", true)); }