Skip to content

Commit

Permalink
Update BWC zip links (opensearch-project#625)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
  • Loading branch information
ohltyler authored and kaituo committed Nov 12, 2022
1 parent 28f785b commit 143442f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
17 changes: 9 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ buildscript {
'/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-job-scheduler-' + plugin_no_snapshot + '.zip'
anomaly_detection_build_download = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + opensearch_no_snapshot +
'/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-anomaly-detection-' + plugin_no_snapshot + '.zip'
bwcOpenDistroADDownload = 'https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/' +
'opendistro-anomaly-detection/opendistro-anomaly-detection-1.13.0.0.zip'
bwcOpenDistroJSDownload = 'https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/' +
'opendistro-job-scheduler/opendistro-job-scheduler-1.13.0.0.zip'
bwcOpenSearchADDownload = 'https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/' +
'opensearch-anomaly-detection-1.1.0.0.zip'
bwcOpenSearchJSDownload = 'https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/' +
'opensearch-job-scheduler-1.1.0.0.zip'

// gradle build won't print logs during test by default unless there is a failure.
// It is useful to record intermediately information like prediction precision and recall.
// This option turn on log printing during tests.
Expand Down Expand Up @@ -372,7 +373,7 @@ task integTestRemote(type: RestIntegTestTask) {
}
}

String bwcVersion = "1.13.0.0"
String bwcVersion = "1.1.0.0"
String baseName = "adBwcCluster"
String bwcFilePath = "src/test/resources/org/opensearch/ad/bwc/"
String bwcJobSchedulerPath = bwcFilePath + "job-scheduler/"
Expand All @@ -382,7 +383,7 @@ String bwcAnomalyDetectionPath = bwcFilePath + "anomaly-detection/"
testClusters {
"${baseName}$i" {
testDistribution = "ARCHIVE"
versions = ["7.10.2", opensearch_version]
versions = ["1.1.0", opensearch_version]
numberOfNodes = 3
plugin(provider(new Callable<RegularFile>(){
@Override
Expand All @@ -394,7 +395,7 @@ String bwcAnomalyDetectionPath = bwcFilePath + "anomaly-detection/"
project.delete(files("$project.rootDir/$bwcFilePath/job-scheduler/$bwcVersion"))
}
project.mkdir bwcJobSchedulerPath + bwcVersion
ant.get(src: bwcOpenDistroJSDownload,
ant.get(src: bwcOpenSearchJSDownload,
dest: bwcJobSchedulerPath + bwcVersion,
httpusecaches: false)
return fileTree(bwcJobSchedulerPath + bwcVersion).getSingleFile()
Expand All @@ -412,7 +413,7 @@ String bwcAnomalyDetectionPath = bwcFilePath + "anomaly-detection/"
project.delete(files("$project.rootDir/$bwcFilePath/anomaly-detection/$bwcVersion"))
}
project.mkdir bwcAnomalyDetectionPath + bwcVersion
ant.get(src: bwcOpenDistroADDownload,
ant.get(src: bwcOpenSearchADDownload,
dest: bwcAnomalyDetectionPath + bwcVersion,
httpusecaches: false)
return fileTree(bwcAnomalyDetectionPath + bwcVersion).getSingleFile()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public void testBackwardsCompatibility() throws Exception {
categoryFieldSize
);
assertEquals(totalDocsPerCategory * categoryFieldSize * 2, getDocCountOfIndex(client(), dataIndexName));
Assert.assertTrue(pluginNames.contains("opendistro-anomaly-detection"));
Assert.assertTrue(pluginNames.contains("opendistro-job-scheduler"));
Assert.assertTrue(pluginNames.contains("opensearch-anomaly-detection"));
Assert.assertTrue(pluginNames.contains("opensearch-job-scheduler"));

// Create single entity detector and start realtime job
createRealtimeAnomalyDetectorsAndStart(SINGLE_ENTITY_DETECTOR);
Expand Down Expand Up @@ -403,8 +403,7 @@ private List<String> createRealtimeAnomalyDetectorsAndStart(ADRestTestUtils.Dete
}
}

@SuppressWarnings("unchecked")
private void createHistoricalAnomalyDetectorsAndStart() throws Exception {
private List<String> createHistoricalAnomalyDetectorsAndStart() throws Exception {
// only support single entity for historical detector
Response historicalSingleFlowDetectorResponse = createAnomalyDetector(
client(),
Expand All @@ -418,16 +417,7 @@ private void createHistoricalAnomalyDetectorsAndStart() throws Exception {
null,
true
);
List<String> historicalDetectorStartResult = startAnomalyDetector(historicalSingleFlowDetectorResponse, true);
String detectorId = historicalDetectorStartResult.get(0);
String taskId = historicalDetectorStartResult.get(1);
deleteRunningDetector(detectorId);
waitUntilTaskDone(client(), detectorId);
List<ADTask> adTasks = searchLatestAdTaskOfDetector(client(), detectorId, ADTaskType.HISTORICAL.name());
assertEquals(1, adTasks.size());
assertEquals(taskId, adTasks.get(0).getTaskId());
int adResultCount = countADResultOfDetector(client(), detectorId, taskId);
assertTrue(adResultCount > 0);
return startAnomalyDetector(historicalSingleFlowDetectorResponse, true);
}

private void deleteRunningDetector(String detectorId) {
Expand Down

0 comments on commit 143442f

Please sign in to comment.