Skip to content

Commit ac11dd6

Browse files
authored
Only ship Linux binaries for the correct architecture (#55280)
Following elastic/ml-cpp#1135 there are now Linux binaries for both x86_64 and aarch64. The code that finds the correct binaries to ship with each distribution was including both on every Linux distribution. This change alters that logic to consider the architecture as well as the operating system. Also, there is no need to disable ML on aarch64 now that we have the native binaries available. ML is still not supported on aarch64, but the processes at least run up and work at a superficial level. Backport of #55256
1 parent 5de6ddf commit ac11dd6

File tree

4 files changed

+20
-27
lines changed

4 files changed

+20
-27
lines changed

distribution/archives/build.gradle

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -125,25 +125,25 @@ tasks.register('buildIntegTestZip', Zip) {
125125
tasks.register('buildWindowsZip', Zip) {
126126
configure(commonZipConfig)
127127
archiveClassifier = 'windows-x86_64'
128-
with archiveFiles(modulesFiles(false, 'windows'), 'zip', 'windows', 'x64', false, true)
128+
with archiveFiles(modulesFiles(false, 'windows-x86_64'), 'zip', 'windows', 'x64', false, true)
129129
}
130130

131131
tasks.register('buildOssWindowsZip', Zip) {
132132
configure(commonZipConfig)
133133
archiveClassifier = 'windows-x86_64'
134-
with archiveFiles(modulesFiles(true, 'windows'), 'zip', 'windows', 'x64', true, true)
134+
with archiveFiles(modulesFiles(true, 'windows-x86_64'), 'zip', 'windows', 'x64', true, true)
135135
}
136136

137137
tasks.register('buildNoJdkWindowsZip', Zip) {
138138
configure(commonZipConfig)
139139
archiveClassifier = 'no-jdk-windows-x86_64'
140-
with archiveFiles(modulesFiles(false, 'windows'), 'zip', 'windows', 'x64', false, false)
140+
with archiveFiles(modulesFiles(false, 'windows-x86_64'), 'zip', 'windows', 'x64', false, false)
141141
}
142142

143143
tasks.register('buildOssNoJdkWindowsZip', Zip) {
144144
configure(commonZipConfig)
145145
archiveClassifier = 'no-jdk-windows-x86_64'
146-
with archiveFiles(modulesFiles(true, 'windows'), 'zip', 'windows', 'x64', true, false)
146+
with archiveFiles(modulesFiles(true, 'windows-x86_64'), 'zip', 'windows', 'x64', true, false)
147147
}
148148

149149
Closure commonTarConfig = {
@@ -156,61 +156,61 @@ Closure commonTarConfig = {
156156
tasks.register('buildDarwinTar', SymbolicLinkPreservingTar) {
157157
configure(commonTarConfig)
158158
archiveClassifier = 'darwin-x86_64'
159-
with archiveFiles(modulesFiles(false, 'darwin'), 'tar', 'darwin', 'x64', false, true)
159+
with archiveFiles(modulesFiles(false, 'darwin-x86_64'), 'tar', 'darwin', 'x64', false, true)
160160
}
161161

162162
tasks.register('buildOssDarwinTar', SymbolicLinkPreservingTar) {
163163
configure(commonTarConfig)
164164
archiveClassifier = 'darwin-x86_64'
165-
with archiveFiles(modulesFiles(true, 'darwin'), 'tar', 'darwin', 'x64', true, true)
165+
with archiveFiles(modulesFiles(true, 'darwin-x86_64'), 'tar', 'darwin', 'x64', true, true)
166166
}
167167

168168
tasks.register('buildNoJdkDarwinTar', SymbolicLinkPreservingTar) {
169169
configure(commonTarConfig)
170170
archiveClassifier = 'no-jdk-darwin-x86_64'
171-
with archiveFiles(modulesFiles(false, 'darwin'), 'tar', 'darwin', 'x64', false, false)
171+
with archiveFiles(modulesFiles(false, 'darwin-x86_64'), 'tar', 'darwin', 'x64', false, false)
172172
}
173173

174174
tasks.register('buildOssNoJdkDarwinTar', SymbolicLinkPreservingTar) {
175175
configure(commonTarConfig)
176176
archiveClassifier = 'no-jdk-darwin-x86_64'
177-
with archiveFiles(modulesFiles(true, 'darwin'), 'tar', 'darwin', 'x64', true, false)
177+
with archiveFiles(modulesFiles(true, 'darwin-x86_64'), 'tar', 'darwin', 'x64', true, false)
178178
}
179179

180180
tasks.register('buildLinuxAarch64Tar', SymbolicLinkPreservingTar) {
181181
configure(commonTarConfig)
182182
archiveClassifier = 'linux-aarch64'
183-
with archiveFiles(modulesFiles(false, 'linux'), 'tar', 'linux', 'aarch64', false, true)
183+
with archiveFiles(modulesFiles(false, 'linux-aarch64'), 'tar', 'linux', 'aarch64', false, true)
184184
}
185185

186186
tasks.register('buildLinuxTar', SymbolicLinkPreservingTar) {
187187
configure(commonTarConfig)
188188
archiveClassifier = 'linux-x86_64'
189-
with archiveFiles(modulesFiles(false, 'linux'), 'tar', 'linux', 'x64', false, true)
189+
with archiveFiles(modulesFiles(false, 'linux-x86_64'), 'tar', 'linux', 'x64', false, true)
190190
}
191191

192192
tasks.register('buildOssLinuxAarch64Tar', SymbolicLinkPreservingTar) {
193193
configure(commonTarConfig)
194194
archiveClassifier = 'linux-aarch64'
195-
with archiveFiles(modulesFiles(true, 'linux'), 'tar', 'linux', 'aarch64', true, true)
195+
with archiveFiles(modulesFiles(true, 'linux-aarch64'), 'tar', 'linux', 'aarch64', true, true)
196196
}
197197

198198
tasks.register('buildOssLinuxTar', SymbolicLinkPreservingTar) {
199199
configure(commonTarConfig)
200200
archiveClassifier = 'linux-x86_64'
201-
with archiveFiles(modulesFiles(true, 'linux'), 'tar', 'linux', 'x64', true, true)
201+
with archiveFiles(modulesFiles(true, 'linux-x86_64'), 'tar', 'linux', 'x64', true, true)
202202
}
203203

204204
tasks.register('buildNoJdkLinuxTar', SymbolicLinkPreservingTar) {
205205
configure(commonTarConfig)
206206
archiveClassifier = 'no-jdk-linux-x86_64'
207-
with archiveFiles(modulesFiles(false, 'linux'), 'tar', 'linux', 'x64', false, false)
207+
with archiveFiles(modulesFiles(false, 'linux-x86_64'), 'tar', 'linux', 'x64', false, false)
208208
}
209209

210210
tasks.register('buildOssNoJdkLinuxTar', SymbolicLinkPreservingTar) {
211211
configure(commonTarConfig)
212212
archiveClassifier = 'no-jdk-linux-x86_64'
213-
with archiveFiles(modulesFiles(true, 'linux'), 'tar', 'linux', 'x64', true, false)
213+
with archiveFiles(modulesFiles(true, 'linux-x86_64'), 'tar', 'linux', 'x64', true, false)
214214
}
215215

216216
Closure tarExists = { it -> new File('/bin/tar').exists() || new File('/usr/bin/tar').exists() || new File('/usr/local/bin/tar').exists() }

distribution/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
296296
modulesFiles = { oss, platform ->
297297
copySpec {
298298
eachFile {
299-
if (it.relativePath.segments[-2] == 'bin' || (platform == 'darwin' && it.relativePath.segments[-2] == 'MacOS')) {
299+
if (it.relativePath.segments[-2] == 'bin' || (platform == 'darwin-x86_64' && it.relativePath.segments[-2] == 'MacOS')) {
300300
// bin files, wherever they are within modules (eg platform specific) should be executable
301301
// and MacOS is an alternative to bin on macOS
302302
it.mode = 0755
@@ -310,15 +310,15 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
310310
} else {
311311
buildModules = project(':distribution').buildDefaultModules
312312
}
313-
List excludePlatforms = ['linux', 'windows', 'darwin']
313+
List excludePlatforms = ['linux-x86_64', 'linux-aarch64', 'windows-x86_64', 'darwin-x86_64']
314314
if (platform != null) {
315315
excludePlatforms.remove(excludePlatforms.indexOf(platform))
316316
} else {
317317
excludePlatforms = []
318318
}
319319
from(buildModules) {
320320
for (String excludePlatform : excludePlatforms) {
321-
exclude "**/platform/${excludePlatform}-x86_64/**"
321+
exclude "**/platform/${excludePlatform}/**"
322322
}
323323
}
324324
if (project.path.startsWith(':distribution:packages')) {

distribution/packages/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
154154
with libFiles(oss)
155155
}
156156
into('modules') {
157-
with modulesFiles(oss, 'linux')
157+
with modulesFiles(oss, 'linux-' + ((architecture == 'x64') ? 'x86_64' : architecture))
158158
}
159159
if (jdk) {
160160
into('jdk') {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,8 @@ private XPackSettings() {
7171
public static final Setting<Boolean> GRAPH_ENABLED = Setting.boolSetting("xpack.graph.enabled", true, Setting.Property.NodeScope);
7272

7373
/** Setting for enabling or disabling machine learning. Defaults to true. */
74-
public static final Setting<Boolean> MACHINE_LEARNING_ENABLED = Setting.boolSetting(
75-
"xpack.ml.enabled",
76-
"aarch64".equals(System.getProperty("os.arch")) ? false : true,
77-
value -> {
78-
if (value && "aarch64".equals(System.getProperty("os.arch"))) {
79-
throw new IllegalArgumentException("[xpack.ml.enabled] can not be set to [true] on [aarch64]");
80-
}
81-
},
82-
Setting.Property.NodeScope);
74+
public static final Setting<Boolean> MACHINE_LEARNING_ENABLED = Setting.boolSetting("xpack.ml.enabled", true,
75+
Setting.Property.NodeScope);
8376

8477
/** Setting for enabling or disabling rollup. Defaults to true. */
8578
public static final Setting<Boolean> ROLLUP_ENABLED = Setting.boolSetting("xpack.rollup.enabled", true,

0 commit comments

Comments
 (0)