Skip to content

Commit

Permalink
[ML] Adjust list of platforms that have ML native code (#56426)
Browse files Browse the repository at this point in the history
Native code is now available for linux-aarch64.

Note that it is _not_ currently supported!
  • Loading branch information
droberts195 committed May 8, 2020
1 parent 45b44de commit b6afa7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public class MachineLearningFeatureSet implements XPackFeatureSet {
/**
* List of platforms for which the native processes are available
*/
private static final List<String> mlPlatforms =
Arrays.asList("darwin-x86_64", "linux-x86_64", "windows-x86_64");
private static final List<String> mlPlatforms = Collections.unmodifiableList(
Arrays.asList("darwin-x86_64", "linux-aarch64", "linux-x86_64", "windows-x86_64"));

private final boolean enabled;
private final XPackLicenseState licenseState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,19 @@ public void init() {

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));
expectThrows(ElasticsearchException.class,
() -> 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));
}
Expand Down

0 comments on commit b6afa7c

Please sign in to comment.