From 143442f8157abd3b938f7b03637368f7cbef5de6 Mon Sep 17 00:00:00 2001 From: Tyler Ohlsen Date: Thu, 4 Aug 2022 19:46:25 -0400 Subject: [PATCH] Update BWC zip links (#625) Signed-off-by: Tyler Ohlsen --- build.gradle | 17 +++++++++-------- .../ad/bwc/ADBackwardsCompatibilityIT.java | 18 ++++-------------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 32eb8ff6a..9aa688a41 100644 --- a/build.gradle +++ b/build.gradle @@ -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. @@ -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/" @@ -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(){ @Override @@ -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() @@ -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() diff --git a/src/test/java/org/opensearch/ad/bwc/ADBackwardsCompatibilityIT.java b/src/test/java/org/opensearch/ad/bwc/ADBackwardsCompatibilityIT.java index faa4bf510..157ff539e 100644 --- a/src/test/java/org/opensearch/ad/bwc/ADBackwardsCompatibilityIT.java +++ b/src/test/java/org/opensearch/ad/bwc/ADBackwardsCompatibilityIT.java @@ -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); @@ -403,8 +403,7 @@ private List createRealtimeAnomalyDetectorsAndStart(ADRestTestUtils.Dete } } - @SuppressWarnings("unchecked") - private void createHistoricalAnomalyDetectorsAndStart() throws Exception { + private List createHistoricalAnomalyDetectorsAndStart() throws Exception { // only support single entity for historical detector Response historicalSingleFlowDetectorResponse = createAnomalyDetector( client(), @@ -418,16 +417,7 @@ private void createHistoricalAnomalyDetectorsAndStart() throws Exception { null, true ); - List historicalDetectorStartResult = startAnomalyDetector(historicalSingleFlowDetectorResponse, true); - String detectorId = historicalDetectorStartResult.get(0); - String taskId = historicalDetectorStartResult.get(1); - deleteRunningDetector(detectorId); - waitUntilTaskDone(client(), detectorId); - List 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) {