Skip to content

Commit 99e0044

Browse files
authored
Revert back to using DRA repository for ML artifacts (#94655)
1 parent 78737bc commit 99e0044

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

x-pack/plugin/ml/build.gradle

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.elasticsearch.gradle.VersionProperties
2+
import org.elasticsearch.gradle.internal.dra.DraResolvePlugin
3+
14
apply plugin: 'elasticsearch.internal-es-plugin'
25
apply plugin: 'elasticsearch.internal-cluster-test'
36
apply plugin: 'elasticsearch.internal-test-artifact'
@@ -11,27 +14,42 @@ esplugin {
1114
extendedPlugins = ['x-pack-autoscaling', 'lang-painless']
1215
}
1316

17+
def localRepo = providers.systemProperty('build.ml_cpp.repo').orNull
1418
if (useDra == false) {
1519
repositories {
1620
exclusiveContent {
21+
filter {
22+
includeGroup 'org.elasticsearch.ml'
23+
}
1724
forRepository {
1825
ivy {
1926
name "ml-cpp"
20-
url providers.systemProperty('build.ml_cpp.repo').orElse('https://prelert-artifacts.s3.amazonaws.com').get()
2127
metadataSources {
2228
// no repository metadata, look directly for the artifact
2329
artifact()
2430
}
25-
patternLayout {
26-
artifact "maven/org/elasticsearch/ml/ml-cpp/[revision]/[module]-[revision](-[classifier]).[ext]"
31+
if (localRepo) {
32+
url localRepo
33+
patternLayout {
34+
artifact "maven/[orgPath]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"
35+
}
36+
} else {
37+
url "https://artifacts-snapshot.elastic.co/"
38+
patternLayout {
39+
if (VersionProperties.isElasticsearchSnapshot()) {
40+
artifact '/ml-cpp/[revision]/downloads/ml-cpp/[module]-[revision]-[classifier].[ext]'
41+
} else {
42+
// When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
43+
// Release builds are always done with a local repo.
44+
artifact '/ml-cpp/[revision]-SNAPSHOT/downloads/ml-cpp/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
45+
}
46+
}
2747
}
2848
}
2949
}
30-
filter {
31-
includeGroup 'org.elasticsearch.ml'
32-
}
3350
}
3451
}
52+
3553
}
3654

3755
configurations {
@@ -112,4 +130,4 @@ tasks.named("dependencyLicenses").configure {
112130
mapping from: /lucene-.*/, to: 'lucene'
113131
}
114132

115-
addQaCheckDependencies(project)
133+
addQaCheckDependencies(project)

0 commit comments

Comments
 (0)