Convert ml-cpp repo to be part of elasticsearch-extra (elastic/elasticsearch#890)

This means we can reference the local build from within the prelert-legacy build script and build it directly

Original commit: elastic/x-pack-elasticsearch@14024841ab
This commit is contained in:
Colin Goodheart-Smithe 2017-02-08 14:39:22 +00:00 committed by GitHub
parent 91883ad57b
commit 30b6425b3a
2 changed files with 17 additions and 16 deletions

View File

@ -64,6 +64,8 @@ Vault vault = new Vault(config)
LogicalResponse secret = vault.logical().read("aws-dev/creds/prelertartifacts") LogicalResponse secret = vault.logical().read("aws-dev/creds/prelertartifacts")
String mlAwsAccessKey = secret.data.get('access_key') String mlAwsAccessKey = secret.data.get('access_key')
String mlAwsSecretKey = secret.data.get('secret_key') String mlAwsSecretKey = secret.data.get('secret_key')
// Sleeping to give AWS a chance to propagate the credentials
sleep(3000)
String envCppLocalDists = System.env.CPP_LOCAL_DISTS String envCppLocalDists = System.env.CPP_LOCAL_DISTS
if (envCppLocalDists != null) { if (envCppLocalDists != null) {

View File

@ -8,15 +8,23 @@ esplugin {
classname 'org.elasticsearch.xpack.ml.MlPlugin' classname 'org.elasticsearch.xpack.ml.MlPlugin'
} }
if (findProject(':machine-learning-cpp') != null) {
configurations.archives {
resolutionStrategy.dependencySubstitution {
substitute module("org.elasticsearch.ml:ml-cpp") with project(":machine-learning-cpp")
}
}
bundlePlugin.dependsOn ':machine-learning-cpp:buildUberZip'
}
configurations { configurations {
nativeBundle archives
} }
dependencies { dependencies {
compile group: 'net.sf.supercsv', name: 'super-csv', version:"${supercsvVersion}" compile group: 'net.sf.supercsv', name: 'super-csv', version:"${supercsvVersion}"
nativeBundle group: "${project.group}", name: 'ml-cpp', version:"${project.version}", classifier: 'darwin-x86_64', ext: 'zip' archives group: "${project.group}", name: 'ml-cpp', version:"${project.version}", ext: 'zip'
nativeBundle group: "${project.group}", name: 'ml-cpp', version:"${project.version}", classifier: 'linux-x86_64', ext: 'zip'
nativeBundle group: "${project.group}", name: 'ml-cpp', version:"${project.version}", classifier: 'windows-x86_64', ext: 'zip'
testCompile group: 'org.ini4j', name: 'ini4j', version:"${ini4jVersion}" testCompile group: 'org.ini4j', name: 'ini4j', version:"${ini4jVersion}"
} }
@ -28,18 +36,9 @@ integTest {
} }
bundlePlugin { bundlePlugin {
if (project.cppLocalDists) { for (outputFile in configurations.archives) {
def localCppBundles = fileTree(dir: cppLocalDists).matching { include "ml-cpp-${project.version}-*.zip" } from(zipTree(outputFile)) {
for (outputFile in localCppBundles) { duplicatesStrategy 'exclude'
from(zipTree(outputFile)) {
duplicatesStrategy 'exclude'
}
}
} else {
for (outputFile in configurations.nativeBundle) {
from(zipTree(outputFile)) {
duplicatesStrategy 'exclude'
}
} }
} }
} }