Skip to content

Commit

Permalink
Revert back to using DRA repository for ML artifacts on main branch (#…
Browse files Browse the repository at this point in the history
…100752)

This is a forward port of #94655.

ML artifacts are stored on both S3 and GCS. On GCS they're fronted by a CDN but on S3 they are not. About a year ago there were problems with the GCS CDN that led to many incomplete downloads. As a result the ML downloads were switched to use S3 in #92381. Those problems were supposed to be fixed about 6 months ago, and the 8.7 branch was switched back to GCS in #94655. However, the main branch was left using S3.

Now that we believe GCS is stable the benefits of having its CDN and hence fast downloads worldwide means it is best to switch back to it as the primary download location.
  • Loading branch information
droberts195 authored Oct 12, 2023
1 parent 79b2e9a commit f62157b
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions x-pack/plugin/ml/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.elasticsearch.gradle.internal.info.BuildParams
import org.elasticsearch.gradle.VersionProperties
import org.elasticsearch.gradle.internal.dra.DraResolvePlugin

apply plugin: 'elasticsearch.internal-es-plugin'
apply plugin: 'elasticsearch.internal-cluster-test'
Expand All @@ -13,27 +14,42 @@ esplugin {
extendedPlugins = ['x-pack-autoscaling', 'lang-painless']
}

def localRepo = providers.systemProperty('build.ml_cpp.repo').orNull
if (useDra == false) {
repositories {
exclusiveContent {
filter {
includeGroup 'org.elasticsearch.ml'
}
forRepository {
ivy {
name "ml-cpp"
url providers.systemProperty('build.ml_cpp.repo').orElse('https://prelert-artifacts.s3.amazonaws.com').get()
metadataSources {
// no repository metadata, look directly for the artifact
artifact()
}
patternLayout {
artifact "maven/org/elasticsearch/ml/ml-cpp/[revision]/[module]-[revision](-[classifier]).[ext]"
if (localRepo) {
url localRepo
patternLayout {
artifact "maven/[orgPath]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"
}
} else {
url "https://artifacts-snapshot.elastic.co/"
patternLayout {
if (VersionProperties.isElasticsearchSnapshot()) {
artifact '/ml-cpp/[revision]/downloads/ml-cpp/[module]-[revision]-[classifier].[ext]'
} else {
// When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
// Release builds are always done with a local repo.
artifact '/ml-cpp/[revision]-SNAPSHOT/downloads/ml-cpp/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
}
}
}
}
}
filter {
includeGroup 'org.elasticsearch.ml'
}
}
}

}

configurations {
Expand Down Expand Up @@ -80,20 +96,15 @@ dependencies {
api "org.apache.lucene:lucene-analysis-icu:${versions.lucene}"
api "org.apache.lucene:lucene-analysis-kuromoji:${versions.lucene}"
implementation 'org.ojalgo:ojalgo:51.2.0'
nativeBundle("org.elasticsearch.ml:ml-cpp:${mlCppVersion()}:deps@zip") {
nativeBundle("org.elasticsearch.ml:ml-cpp:${project.version}:deps@zip") {
changing = true
}
nativeBundle("org.elasticsearch.ml:ml-cpp:${mlCppVersion()}:nodeps@zip") {
nativeBundle("org.elasticsearch.ml:ml-cpp:${project.version}:nodeps@zip") {
changing = true
}
testImplementation 'org.ini4j:ini4j:0.5.2'
}

def mlCppVersion(){
return (project.gradle.parent != null && BuildParams.isSnapshotBuild() == false) ?
(project.version + "-SNAPSHOT") : project.version;
}

artifacts {
// normal es plugins do not publish the jar but we need to since users need it for extensions
archives tasks.named("jar")
Expand Down Expand Up @@ -122,4 +133,4 @@ tasks.named("dependencyLicenses").configure {
mapping from: /lucene-.*/, to: 'lucene'
}

addQaCheckDependencies(project)
addQaCheckDependencies(project)

0 comments on commit f62157b

Please sign in to comment.