Skip to content

Commit e55cbf8

Browse files
authored
Only ship Linux binaries for the correct architecture (#55256)
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.
1 parent befbe9a commit e55cbf8

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
@@ -123,25 +123,25 @@ tasks.register('buildIntegTestZip', Zip) {
123123
tasks.register('buildWindowsZip', Zip) {
124124
configure(commonZipConfig)
125125
archiveClassifier = 'windows-x86_64'
126-
with archiveFiles(modulesFiles(false, 'windows'), 'zip', 'windows', 'x64', false, true)
126+
with archiveFiles(modulesFiles(false, 'windows-x86_64'), 'zip', 'windows', 'x64', false, true)
127127
}
128128

129129
tasks.register('buildOssWindowsZip', Zip) {
130130
configure(commonZipConfig)
131131
archiveClassifier = 'windows-x86_64'
132-
with archiveFiles(modulesFiles(true, 'windows'), 'zip', 'windows', 'x64', true, true)
132+
with archiveFiles(modulesFiles(true, 'windows-x86_64'), 'zip', 'windows', 'x64', true, true)
133133
}
134134

135135
tasks.register('buildNoJdkWindowsZip', Zip) {
136136
configure(commonZipConfig)
137137
archiveClassifier = 'no-jdk-windows-x86_64'
138-
with archiveFiles(modulesFiles(false, 'windows'), 'zip', 'windows', 'x64', false, false)
138+
with archiveFiles(modulesFiles(false, 'windows-x86_64'), 'zip', 'windows', 'x64', false, false)
139139
}
140140

141141
tasks.register('buildOssNoJdkWindowsZip', Zip) {
142142
configure(commonZipConfig)
143143
archiveClassifier = 'no-jdk-windows-x86_64'
144-
with archiveFiles(modulesFiles(true, 'windows'), 'zip', 'windows', 'x64', true, false)
144+
with archiveFiles(modulesFiles(true, 'windows-x86_64'), 'zip', 'windows', 'x64', true, false)
145145
}
146146

147147
Closure commonTarConfig = {
@@ -154,61 +154,61 @@ Closure commonTarConfig = {
154154
tasks.register('buildDarwinTar', SymbolicLinkPreservingTar) {
155155
configure(commonTarConfig)
156156
archiveClassifier = 'darwin-x86_64'
157-
with archiveFiles(modulesFiles(false, 'darwin'), 'tar', 'darwin', 'x64', false, true)
157+
with archiveFiles(modulesFiles(false, 'darwin-x86_64'), 'tar', 'darwin', 'x64', false, true)
158158
}
159159

160160
tasks.register('buildOssDarwinTar', SymbolicLinkPreservingTar) {
161161
configure(commonTarConfig)
162162
archiveClassifier = 'darwin-x86_64'
163-
with archiveFiles(modulesFiles(true, 'darwin'), 'tar', 'darwin', 'x64', true, true)
163+
with archiveFiles(modulesFiles(true, 'darwin-x86_64'), 'tar', 'darwin', 'x64', true, true)
164164
}
165165

166166
tasks.register('buildNoJdkDarwinTar', SymbolicLinkPreservingTar) {
167167
configure(commonTarConfig)
168168
archiveClassifier = 'no-jdk-darwin-x86_64'
169-
with archiveFiles(modulesFiles(false, 'darwin'), 'tar', 'darwin', 'x64', false, false)
169+
with archiveFiles(modulesFiles(false, 'darwin-x86_64'), 'tar', 'darwin', 'x64', false, false)
170170
}
171171

172172
tasks.register('buildOssNoJdkDarwinTar', SymbolicLinkPreservingTar) {
173173
configure(commonTarConfig)
174174
archiveClassifier = 'no-jdk-darwin-x86_64'
175-
with archiveFiles(modulesFiles(true, 'darwin'), 'tar', 'darwin', 'x64', true, false)
175+
with archiveFiles(modulesFiles(true, 'darwin-x86_64'), 'tar', 'darwin', 'x64', true, false)
176176
}
177177

178178
tasks.register('buildLinuxAarch64Tar', SymbolicLinkPreservingTar) {
179179
configure(commonTarConfig)
180180
archiveClassifier = 'linux-aarch64'
181-
with archiveFiles(modulesFiles(false, 'linux'), 'tar', 'linux', 'aarch64', false, true)
181+
with archiveFiles(modulesFiles(false, 'linux-aarch64'), 'tar', 'linux', 'aarch64', false, true)
182182
}
183183

184184
tasks.register('buildLinuxTar', SymbolicLinkPreservingTar) {
185185
configure(commonTarConfig)
186186
archiveClassifier = 'linux-x86_64'
187-
with archiveFiles(modulesFiles(false, 'linux'), 'tar', 'linux', 'x64', false, true)
187+
with archiveFiles(modulesFiles(false, 'linux-x86_64'), 'tar', 'linux', 'x64', false, true)
188188
}
189189

190190
tasks.register('buildOssLinuxAarch64Tar', SymbolicLinkPreservingTar) {
191191
configure(commonTarConfig)
192192
archiveClassifier = 'linux-aarch64'
193-
with archiveFiles(modulesFiles(true, 'linux'), 'tar', 'linux', 'aarch64', true, true)
193+
with archiveFiles(modulesFiles(true, 'linux-aarch64'), 'tar', 'linux', 'aarch64', true, true)
194194
}
195195

196196
tasks.register('buildOssLinuxTar', SymbolicLinkPreservingTar) {
197197
configure(commonTarConfig)
198198
archiveClassifier = 'linux-x86_64'
199-
with archiveFiles(modulesFiles(true, 'linux'), 'tar', 'linux', 'x64', true, true)
199+
with archiveFiles(modulesFiles(true, 'linux-x86_64'), 'tar', 'linux', 'x64', true, true)
200200
}
201201

202202
tasks.register('buildNoJdkLinuxTar', SymbolicLinkPreservingTar) {
203203
configure(commonTarConfig)
204204
archiveClassifier = 'no-jdk-linux-x86_64'
205-
with archiveFiles(modulesFiles(false, 'linux'), 'tar', 'linux', 'x64', false, false)
205+
with archiveFiles(modulesFiles(false, 'linux-x86_64'), 'tar', 'linux', 'x64', false, false)
206206
}
207207

208208
tasks.register('buildOssNoJdkLinuxTar', SymbolicLinkPreservingTar) {
209209
configure(commonTarConfig)
210210
archiveClassifier = 'no-jdk-linux-x86_64'
211-
with archiveFiles(modulesFiles(true, 'linux'), 'tar', 'linux', 'x64', true, false)
211+
with archiveFiles(modulesFiles(true, 'linux-x86_64'), 'tar', 'linux', 'x64', true, false)
212212
}
213213

214214
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
@@ -65,15 +65,8 @@ private XPackSettings() {
6565
public static final Setting<Boolean> GRAPH_ENABLED = Setting.boolSetting("xpack.graph.enabled", true, Setting.Property.NodeScope);
6666

6767
/** Setting for enabling or disabling machine learning. Defaults to true. */
68-
public static final Setting<Boolean> MACHINE_LEARNING_ENABLED = Setting.boolSetting(
69-
"xpack.ml.enabled",
70-
"aarch64".equals(System.getProperty("os.arch")) ? false : true,
71-
value -> {
72-
if (value && "aarch64".equals(System.getProperty("os.arch"))) {
73-
throw new IllegalArgumentException("[xpack.ml.enabled] can not be set to [true] on [aarch64]");
74-
}
75-
},
76-
Setting.Property.NodeScope);
68+
public static final Setting<Boolean> MACHINE_LEARNING_ENABLED = Setting.boolSetting("xpack.ml.enabled", true,
69+
Setting.Property.NodeScope);
7770

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

0 commit comments

Comments
 (0)