Skip to content

Commit 37a699f

Browse files
authored
Use DRA artifacts for beats and ML dependencies (#89951) (#89983)
1 parent 5fb9f1c commit 37a699f

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

distribution/docker/build.gradle

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,22 @@ repositories {
3535

3636
// Cloud builds bundle some beats
3737
ivy {
38+
name = 'beats'
3839
if (useLocalArtifacts) {
3940
url "file://${buildDir}/artifacts/"
4041
patternLayout {
41-
artifact '/[organisation]/[module]-[revision]-linux-[classifier].[ext]'
42+
artifact '/[organisation]/[module]-[revision]-[classifier].[ext]'
4243
}
4344
} else {
44-
url "https://${VersionProperties.isElasticsearchSnapshot() ? 'snapshots' : 'artifacts'}-no-kpi.elastic.co/"
45+
url "https://artifacts-snapshot.elastic.co/"
4546
patternLayout {
46-
artifact '/downloads/[organization]/[module]/[module]-[revision]-linux-[classifier].[ext]'
47+
if (VersionProperties.isElasticsearchSnapshot()) {
48+
artifact '/[organization]/[revision]/downloads/[organization]/[module]/[module]-[revision]-[classifier].[ext]'
49+
} else {
50+
// When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
51+
// Release builds are always done with a local repo.
52+
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/[module]/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
53+
}
4754
}
4855
}
4956
metadataSources { artifact() }
@@ -72,8 +79,8 @@ dependencies {
7279
log4jConfig project(path: ":distribution", configuration: 'log4jConfig')
7380
tini "krallin:tini:0.19.0:${tiniArch}"
7481
allPlugins project(path: ':plugins', configuration: 'allPlugins')
75-
filebeat "beats:filebeat:${VersionProperties.elasticsearch}:${beatsArch}@tar.gz"
76-
metricbeat "beats:metricbeat:${VersionProperties.elasticsearch}:${beatsArch}@tar.gz"
82+
filebeat "beats:filebeat:${VersionProperties.elasticsearch}:linux-${beatsArch}@tar.gz"
83+
metricbeat "beats:metricbeat:${VersionProperties.elasticsearch}:linux-${beatsArch}@tar.gz"
7784
}
7885

7986
ext.expansions = { Architecture architecture, DockerBase base ->

x-pack/plugin/ml/build.gradle

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.elasticsearch.gradle.VersionProperties
2+
13
apply plugin: 'elasticsearch.internal-es-plugin'
24
apply plugin: 'elasticsearch.internal-cluster-test'
35
apply plugin: 'elasticsearch.internal-test-artifact'
@@ -10,25 +12,39 @@ esplugin {
1012
extendedPlugins = ['x-pack-autoscaling', 'lang-painless']
1113
}
1214

15+
def localRepo = providers.systemProperty('build.ml_cpp.repo').orNull
1316

1417
repositories {
1518
exclusiveContent {
19+
filter {
20+
includeGroup 'org.elasticsearch.ml'
21+
}
1622
forRepository {
1723
ivy {
1824
name "ml-cpp"
19-
url providers.systemProperty('build.ml_cpp.repo').orElse('https://prelert-artifacts.s3.amazonaws.com').get()
2025
metadataSources {
2126
// no repository metadata, look directly for the artifact
2227
artifact()
2328
}
24-
patternLayout {
25-
artifact "maven/org/elasticsearch/ml/ml-cpp/[revision]/[module]-[revision](-[classifier]).[ext]"
29+
if (localRepo) {
30+
url localRepo
31+
patternLayout {
32+
artifact "maven/[orgPath]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"
33+
}
34+
} else {
35+
url "https://artifacts-snapshot.elastic.co/"
36+
patternLayout {
37+
if (VersionProperties.isElasticsearchSnapshot()) {
38+
artifact '/ml-cpp/[revision]/downloads/ml-cpp/[module]-[revision]-[classifier].[ext]'
39+
} else {
40+
// When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
41+
// Release builds are always done with a local repo.
42+
artifact '/ml-cpp/[revision]-SNAPSHOT/downloads/ml-cpp/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
43+
}
44+
}
2645
}
2746
}
2847
}
29-
filter {
30-
includeGroup 'org.elasticsearch.ml'
31-
}
3248
}
3349
}
3450

0 commit comments

Comments
 (0)