Skip to content

Commit 3b92e27

Browse files
seth-priyareta
authored andcommitted
add support for ppc64le architecture (opensearch-project#5459)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
1 parent 76acf95 commit 3b92e27

File tree

12 files changed

+47
-5
lines changed

12 files changed

+47
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1616
- Adds support for minimum compatible version for extensions ([#6003](https://github.com/opensearch-project/OpenSearch/pull/6003))
1717
- Add a guardrail to limit maximum number of shard on the cluster ([#6143](https://github.com/opensearch-project/OpenSearch/pull/6143))
1818
- Add cancellation of in-flight SearchTasks based on resource consumption ([#5606](https://github.com/opensearch-project/OpenSearch/pull/5605))
19+
- Add support for ppc64le architecture ([#5459](https://github.com/opensearch-project/OpenSearch/pull/5459))
1920

2021
### Dependencies
2122
- Update nebula-publishing-plugin to 19.2.0 ([#5704](https://github.com/opensearch-project/OpenSearch/pull/5704))

buildSrc/src/main/java/org/opensearch/gradle/Architecture.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public enum Architecture {
3636

3737
X64,
3838
ARM64,
39-
S390X;
39+
S390X,
40+
PPC64LE;
4041

4142
public static Architecture current() {
4243
final String architecture = System.getProperty("os.arch", "");
@@ -48,6 +49,8 @@ public static Architecture current() {
4849
return ARM64;
4950
case "s390x":
5051
return S390X;
52+
case "ppc64le":
53+
return PPC64LE;
5154
default:
5255
throw new IllegalArgumentException("can not determine architecture from [" + architecture + "]");
5356
}

buildSrc/src/main/java/org/opensearch/gradle/DistributionDownloadPlugin.java

+3
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ private String dependencyNotation(OpenSearchDistribution distribution) {
273273
case S390X:
274274
classifier = ":" + distribution.getPlatform() + "-s390x";
275275
break;
276+
case PPC64LE:
277+
classifier = ":" + distribution.getPlatform() + "-ppc64le";
278+
break;
276279
default:
277280
throw new IllegalArgumentException("Unsupported architecture: " + distribution.getArchitecture());
278281
}

buildSrc/src/main/java/org/opensearch/gradle/Jdk.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@
4949

5050
public class Jdk implements Buildable, Iterable<File> {
5151

52-
private static final List<String> ALLOWED_ARCHITECTURES = Collections.unmodifiableList(Arrays.asList("aarch64", "x64", "s390x"));
52+
private static final List<String> ALLOWED_ARCHITECTURES = Collections.unmodifiableList(
53+
Arrays.asList("aarch64", "x64", "s390x", "ppc64le")
54+
);
5355
private static final List<String> ALLOWED_VENDORS = Collections.unmodifiableList(Arrays.asList("adoptium", "adoptopenjdk", "openjdk"));
5456
private static final List<String> ALLOWED_PLATFORMS = Collections.unmodifiableList(
5557
Arrays.asList("darwin", "freebsd", "linux", "mac", "windows")

buildSrc/src/test/java/org/opensearch/gradle/ArchitectureTests.java

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public void testCurrentArchitecture() {
1919
assertEquals(Architecture.X64, currentArchitecture("x86_64"));
2020
assertEquals(Architecture.ARM64, currentArchitecture("aarch64"));
2121
assertEquals(Architecture.S390X, currentArchitecture("s390x"));
22+
assertEquals(Architecture.PPC64LE, currentArchitecture("ppc64le"));
2223
}
2324

2425
public void testInvalidCurrentArchitecture() {

buildSrc/src/test/java/org/opensearch/gradle/JdkDownloadPluginTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void testUnknownArchitecture() {
108108
"11.0.2+33",
109109
"linux",
110110
"unknown",
111-
"unknown architecture [unknown] for jdk [testjdk], must be one of [aarch64, x64, s390x]"
111+
"unknown architecture [unknown] for jdk [testjdk], must be one of [aarch64, x64, s390x, ppc64le]"
112112
);
113113
}
114114

distribution/archives/build.gradle

+9
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,15 @@ distribution_archives {
167167
}
168168
}
169169

170+
// Should really be `no-jdk-linux-ppc64le` as it ships without a JDK, however it seems that the build can't handle
171+
// the absence of the `linux-ppc64le` target.
172+
linuxPpc64leTar {
173+
archiveClassifier = 'linux-ppc64le'
174+
content {
175+
archiveFiles(modulesFiles('linux-ppc64le'), 'tar', 'linux', 'ppc64le', false)
176+
}
177+
}
178+
170179
windowsZip {
171180
archiveClassifier = 'windows-x64'
172181
content {

distribution/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
280280
// Setup all required JDKs
281281
project.jdks {
282282
['darwin', 'linux', 'windows'].each { platform ->
283-
(platform == 'linux' || platform == 'darwin' ? ['x64', 'aarch64', 's390x'] : ['x64']).each { architecture ->
283+
(platform == 'linux' || platform == 'darwin' ? ['x64', 'aarch64', 's390x', 'ppc64le'] : ['x64']).each { architecture ->
284284
"bundled_${platform}_${architecture}" {
285285
it.platform = platform
286286
it.version = VersionProperties.getBundledJdk(platform)
@@ -353,7 +353,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
353353
}
354354
}
355355
def buildModules = buildModulesTaskProvider
356-
List excludePlatforms = ['darwin-x64', 'freebsd-x64', 'linux-x64', 'linux-arm64', 'linux-s390x', 'windows-x64', 'darwin-arm64']
356+
List excludePlatforms = ['darwin-x64', 'freebsd-x64', 'linux-x64', 'linux-arm64', 'linux-s390x', 'linux-ppc64le', 'windows-x64', 'darwin-arm64']
357357
if (platform != null) {
358358
excludePlatforms.remove(excludePlatforms.indexOf(platform))
359359
} else {

distribution/docker/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ testFixtures.useFixture()
2828
configurations {
2929
arm64DockerSource
3030
s390xDockerSource
31+
ppc64leDockerSource
3132
dockerSource
3233
}
3334

3435
dependencies {
3536
arm64DockerSource project(path: ":distribution:archives:linux-arm64-tar", configuration:"default")
3637
s390xDockerSource project(path: ":distribution:archives:linux-s390x-tar", configuration:"default")
38+
ppc64leDockerSource project(path: ":distribution:archives:linux-ppc64le-tar", configuration:"default")
3739
dockerSource project(path: ":distribution:archives:linux-tar", configuration:"default")
3840
}
3941

@@ -46,6 +48,8 @@ ext.expansions = { Architecture architecture, DockerBase base, boolean local ->
4648
classifier = "linux-x64"
4749
} else if (architecture == Architecture.S390X) {
4850
classifier = "linux-s390x"
51+
} else if (architecture == Architecture.PPC64LE) {
52+
classifier = "linux-ppc64le"
4953
} else {
5054
throw new IllegalArgumentException("Unsupported architecture [" + architecture + "]")
5155
}
@@ -90,13 +94,15 @@ private static String buildPath(Architecture architecture, DockerBase base) {
9094
return 'build/' +
9195
(architecture == Architecture.ARM64 ? 'arm64-' : '') +
9296
(architecture == Architecture.S390X ? 's390x-' : '') +
97+
(architecture == Architecture.PPC64LE ? 'ppc64le-' : '') +
9398
'docker'
9499
}
95100

96101
private static String taskName(String prefix, Architecture architecture, DockerBase base, String suffix) {
97102
return prefix +
98103
(architecture == Architecture.ARM64 ? 'Arm64' : '') +
99104
(architecture == Architecture.S390X ? 'S390x' : '') +
105+
(architecture == Architecture.PPC64LE ? 'Ppc64le' : '') +
100106
suffix
101107
}
102108

@@ -135,6 +141,8 @@ void addCopyDockerContextTask(Architecture architecture, DockerBase base) {
135141
from configurations.arm64DockerSource
136142
} else if (architecture == Architecture.S390X) {
137143
from configurations.s390xDockerSource
144+
} else if (architecture == Architecture.PPC64LE) {
145+
from configurations.ppc64leDockerSource
138146
} else {
139147
from configurations.dockerSource
140148
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* The OpenSearch Contributors require contributions made to
6+
* this file be licensed under the Apache-2.0 license or a
7+
* compatible open source license.
8+
*
9+
*/
10+
11+
// This file is intentionally blank. All configuration of the
12+
// export is done in the parent project.

server/src/main/java/org/opensearch/bootstrap/SystemCallFilter.java

+1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ static class Arch {
260260
m.put("amd64", new Arch(0xC000003E, 0x3FFFFFFF, 57, 58, 59, 322, 317));
261261
m.put("aarch64", new Arch(0xC00000B7, 0xFFFFFFFF, 1079, 1071, 221, 281, 277));
262262
m.put("s390x", new Arch(0x80000016, 0xFFFFFFFF, 2, 190, 11, 354, 348));
263+
m.put("ppc64le", new Arch(0xC0000015, 0xFFFFFFFF, 2, 189, 11, 362, 358));
263264
ARCHITECTURES = Collections.unmodifiableMap(m);
264265
}
265266

settings.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ List projects = [
4949
'distribution:archives:linux-arm64-tar',
5050
'distribution:archives:no-jdk-linux-arm64-tar',
5151
'distribution:archives:linux-s390x-tar',
52+
'distribution:archives:linux-ppc64le-tar',
5253
'distribution:archives:linux-tar',
5354
'distribution:archives:no-jdk-linux-tar',
5455
'distribution:docker',
5556
'distribution:docker:docker-arm64-build-context',
5657
'distribution:docker:docker-arm64-export',
5758
'distribution:docker:docker-s390x-export',
59+
'distribution:docker:docker-ppc64le-export',
5860
'distribution:docker:docker-build-context',
5961
'distribution:docker:docker-export',
6062
'distribution:packages:arm64-deb',

0 commit comments

Comments
 (0)