Skip to content

Commit

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

This reverts the changes in elastic#100752. The issue with the
artifacts-snapshots repository is that older artifacts are deleted,
which means that you cannot build older branches of Elasticsearch due to
missing artifacts. This reverts back to the S3-backed repository that
keeps artifacts indefinitely.
# Conflicts:
#	x-pack/plugin/ml/build.gradle
  • Loading branch information
mark-vieira committed May 28, 2024
1 parent ac5c67a commit 933941f
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions x-pack/plugin/ml/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.elasticsearch.gradle.internal.info.BuildParams
import org.elasticsearch.gradle.VersionProperties
import org.elasticsearch.gradle.internal.dra.DraResolvePlugin
import org.elasticsearch.gradle.internal.info.BuildParams
Expand All @@ -15,42 +16,27 @@ 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()
}
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]'
}
}
patternLayout {
artifact "maven/org/elasticsearch/ml/ml-cpp/[revision]/[module]-[revision](-[classifier]).[ext]"
}
}
}
filter {
includeGroup 'org.elasticsearch.ml'
}
}
}

}

configurations {
Expand Down Expand Up @@ -100,16 +86,21 @@ 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:${project.version}:deps@zip") {
nativeBundle("org.elasticsearch.ml:ml-cpp:${mlCppVersion()}:deps@zip") {
changing = true
}
nativeBundle("org.elasticsearch.ml:ml-cpp:${project.version}:nodeps@zip") {
nativeBundle("org.elasticsearch.ml:ml-cpp:${mlCppVersion()}:nodeps@zip") {
changing = true
}
testImplementation 'org.ini4j:ini4j:0.5.2'
testImplementation "com.google.jimfs:jimfs:${versions.jimfs}"
}

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

0 comments on commit 933941f

Please sign in to comment.