From 8174799fabef7fed9ac03b02aa941c2f826340b6 Mon Sep 17 00:00:00 2001 From: frank chen Date: Wed, 4 May 2022 13:57:15 +0800 Subject: [PATCH 1/5] Move web-console dependency from druid-server to distribution --- distribution/pom.xml | 6 ++++++ server/pom.xml | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/distribution/pom.xml b/distribution/pom.xml index 6654bdd072de..d14a1a8bcd4d 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -39,6 +39,12 @@ druid-services ${project.parent.version} + + + org.apache.druid + druid-console + ${project.parent.version} + diff --git a/server/pom.xml b/server/pom.xml index febee7035d3f..339ac5661232 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -48,13 +48,6 @@ druid-gcp-common ${project.parent.version} runtime - - - - org.apache.druid - druid-console - ${project.parent.version} - runtime org.apache.druid From d6ac8f3087b22515b03e42fd57d24e7f3ddca254 Mon Sep 17 00:00:00 2001 From: frank chen Date: Wed, 4 May 2022 14:13:18 +0800 Subject: [PATCH 2/5] Add a test to check if the web-console is correctly integrated --- .../org/apache/druid/tests/TestNGGroup.java | 2 + .../druid/tests/console/ITWebConsoleTest.java | 75 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 integration-tests/src/test/java/org/apache/druid/tests/console/ITWebConsoleTest.java diff --git a/integration-tests/src/test/java/org/apache/druid/tests/TestNGGroup.java b/integration-tests/src/test/java/org/apache/druid/tests/TestNGGroup.java index aeb8a010efd8..f96b2908ab73 100644 --- a/integration-tests/src/test/java/org/apache/druid/tests/TestNGGroup.java +++ b/integration-tests/src/test/java/org/apache/druid/tests/TestNGGroup.java @@ -161,4 +161,6 @@ public class TestNGGroup public static final String CUSTOM_COORDINATOR_DUTIES = "custom-coordinator-duties"; public static final String HTTP_ENDPOINT = "http-endpoint"; + + public static final String WEB_CONSOLE = "web-console"; } diff --git a/integration-tests/src/test/java/org/apache/druid/tests/console/ITWebConsoleTest.java b/integration-tests/src/test/java/org/apache/druid/tests/console/ITWebConsoleTest.java new file mode 100644 index 000000000000..82f4a2fbc9cc --- /dev/null +++ b/integration-tests/src/test/java/org/apache/druid/tests/console/ITWebConsoleTest.java @@ -0,0 +1,75 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.tests.console; + +import com.google.common.util.concurrent.ListenableFuture; +import com.google.inject.Inject; +import org.apache.druid.java.util.common.StringUtils; +import org.apache.druid.java.util.http.client.HttpClient; +import org.apache.druid.java.util.http.client.Request; +import org.apache.druid.java.util.http.client.response.StatusResponseHandler; +import org.apache.druid.java.util.http.client.response.StatusResponseHolder; +import org.apache.druid.testing.IntegrationTestingConfig; +import org.apache.druid.testing.guice.DruidTestModuleFactory; +import org.apache.druid.testing.guice.TestClient; +import org.apache.druid.testing.utils.ITRetryUtil; +import org.apache.druid.tests.TestNGGroup; +import org.jboss.netty.handler.codec.http.HttpMethod; +import org.jboss.netty.handler.codec.http.HttpResponseStatus; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +import java.net.URL; + +@Test(groups = TestNGGroup.WEB_CONSOLE) +@Guice(moduleFactory = DruidTestModuleFactory.class) +public class ITWebConsoleTest +{ + @Inject + @TestClient + HttpClient httpClient; + + @Inject + IntegrationTestingConfig config; + + @Test + public void testWebConsoleHomePageExists() + { + ITRetryUtil.retryUntil( + () -> { + ListenableFuture status = httpClient.go( + new Request( + HttpMethod.GET, + new URL(config.getRouterUrl()) + ), + StatusResponseHandler.getInstance() + ); + + int httpStatusCode = status.get().getStatus().getCode(); + return httpStatusCode == HttpResponseStatus.OK.getCode() + || httpStatusCode == HttpResponseStatus.FOUND.getCode(); + }, + true, + ITRetryUtil.DEFAULT_RETRY_SLEEP, + 5, + StringUtils.format("WebConsole home page at [%s] does not exist.", config.getRouterUrl()) + ); + } +} From 8d72225544f83514c344b5ecd9c69c9b3114ee33 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Sat, 3 Sep 2022 15:08:36 +0800 Subject: [PATCH 3/5] exclude web-console from 'other integration tests' --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2179125d1a61..ebb126754213 100644 --- a/.travis.yml +++ b/.travis.yml @@ -663,7 +663,7 @@ jobs: - <<: *integration_tests name: "(Compile=openjdk8, Run=openjdk8) other integration tests with Indexer" - env: TESTNG_GROUPS='-DexcludedGroups=batch-index,input-format,input-source,perfect-rollup-parallel-batch-index,kafka-index,query,query-retry,query-error,realtime-index,security,ldap-security,s3-deep-storage,gcs-deep-storage,azure-deep-storage,hdfs-deep-storage,s3-ingestion,kinesis-index,kinesis-data-format,kafka-transactional-index,kafka-index-slow,kafka-transactional-index-slow,kafka-data-format,hadoop-s3-to-s3-deep-storage,hadoop-s3-to-hdfs-deep-storage,hadoop-azure-to-azure-deep-storage,hadoop-azure-to-hdfs-deep-storage,hadoop-gcs-to-gcs-deep-storage,hadoop-gcs-to-hdfs-deep-storage,aliyun-oss-deep-storage,append-ingestion,compaction,high-availability,upgrade,shuffle-deep-store,custom-coordinator-duties' JVM_RUNTIME='-Djvm.runtime=8' USE_INDEXER='indexer' + env: TESTNG_GROUPS='-DexcludedGroups=batch-index,input-format,input-source,perfect-rollup-parallel-batch-index,kafka-index,query,query-retry,query-error,realtime-index,security,ldap-security,s3-deep-storage,gcs-deep-storage,azure-deep-storage,hdfs-deep-storage,s3-ingestion,kinesis-index,kinesis-data-format,kafka-transactional-index,kafka-index-slow,kafka-transactional-index-slow,kafka-data-format,hadoop-s3-to-s3-deep-storage,hadoop-s3-to-hdfs-deep-storage,hadoop-azure-to-azure-deep-storage,hadoop-azure-to-hdfs-deep-storage,hadoop-gcs-to-gcs-deep-storage,hadoop-gcs-to-hdfs-deep-storage,aliyun-oss-deep-storage,append-ingestion,compaction,high-availability,upgrade,shuffle-deep-store,custom-coordinator-duties,web-console' JVM_RUNTIME='-Djvm.runtime=8' USE_INDEXER='indexer' #- <<: *integration_tests # name: "(Compile=openjdk8, Run=openjdk8) leadership and high availability integration tests" @@ -759,7 +759,7 @@ jobs: - <<: *integration_tests name: "(Compile=openjdk8, Run=openjdk11) other integration test" jdk: openjdk8 - env: TESTNG_GROUPS='-DexcludedGroups=batch-index,input-format,input-source,perfect-rollup-parallel-batch-index,kafka-index,query,query-retry,query-error,realtime-index,security,ldap-security,s3-deep-storage,gcs-deep-storage,azure-deep-storage,hdfs-deep-storage,s3-ingestion,kinesis-index,kinesis-data-format,kafka-transactional-index,kafka-index-slow,kafka-transactional-index-slow,kafka-data-format,hadoop-s3-to-s3-deep-storage,hadoop-s3-to-hdfs-deep-storage,hadoop-azure-to-azure-deep-storage,hadoop-azure-to-hdfs-deep-storage,hadoop-gcs-to-gcs-deep-storage,hadoop-gcs-to-hdfs-deep-storage,aliyun-oss-deep-storage,append-ingestion,compaction,high-availability,upgrade,shuffle-deep-store,custom-coordinator-duties' JVM_RUNTIME='-Djvm.runtime=11' USE_INDEXER='middleManager' + env: TESTNG_GROUPS='-DexcludedGroups=batch-index,input-format,input-source,perfect-rollup-parallel-batch-index,kafka-index,query,query-retry,query-error,realtime-index,security,ldap-security,s3-deep-storage,gcs-deep-storage,azure-deep-storage,hdfs-deep-storage,s3-ingestion,kinesis-index,kinesis-data-format,kafka-transactional-index,kafka-index-slow,kafka-transactional-index-slow,kafka-data-format,hadoop-s3-to-s3-deep-storage,hadoop-s3-to-hdfs-deep-storage,hadoop-azure-to-azure-deep-storage,hadoop-azure-to-hdfs-deep-storage,hadoop-gcs-to-gcs-deep-storage,hadoop-gcs-to-hdfs-deep-storage,aliyun-oss-deep-storage,append-ingestion,compaction,high-availability,upgrade,shuffle-deep-store,custom-coordinator-duties,web-console' JVM_RUNTIME='-Djvm.runtime=11' USE_INDEXER='middleManager' - <<: *integration_tests name: "(Compile=openjdk8, Run=openjdk11) leadership and high availability integration tests" From 4c274f9e5c15ad80815627d8c399bb47301166b6 Mon Sep 17 00:00:00 2001 From: frank chen Date: Sat, 10 Sep 2022 18:45:00 +0800 Subject: [PATCH 4/5] Revert "exclude web-console from 'other integration tests'" This reverts commit 8d72225544f83514c344b5ecd9c69c9b3114ee33. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ebb126754213..2179125d1a61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -663,7 +663,7 @@ jobs: - <<: *integration_tests name: "(Compile=openjdk8, Run=openjdk8) other integration tests with Indexer" - env: TESTNG_GROUPS='-DexcludedGroups=batch-index,input-format,input-source,perfect-rollup-parallel-batch-index,kafka-index,query,query-retry,query-error,realtime-index,security,ldap-security,s3-deep-storage,gcs-deep-storage,azure-deep-storage,hdfs-deep-storage,s3-ingestion,kinesis-index,kinesis-data-format,kafka-transactional-index,kafka-index-slow,kafka-transactional-index-slow,kafka-data-format,hadoop-s3-to-s3-deep-storage,hadoop-s3-to-hdfs-deep-storage,hadoop-azure-to-azure-deep-storage,hadoop-azure-to-hdfs-deep-storage,hadoop-gcs-to-gcs-deep-storage,hadoop-gcs-to-hdfs-deep-storage,aliyun-oss-deep-storage,append-ingestion,compaction,high-availability,upgrade,shuffle-deep-store,custom-coordinator-duties,web-console' JVM_RUNTIME='-Djvm.runtime=8' USE_INDEXER='indexer' + env: TESTNG_GROUPS='-DexcludedGroups=batch-index,input-format,input-source,perfect-rollup-parallel-batch-index,kafka-index,query,query-retry,query-error,realtime-index,security,ldap-security,s3-deep-storage,gcs-deep-storage,azure-deep-storage,hdfs-deep-storage,s3-ingestion,kinesis-index,kinesis-data-format,kafka-transactional-index,kafka-index-slow,kafka-transactional-index-slow,kafka-data-format,hadoop-s3-to-s3-deep-storage,hadoop-s3-to-hdfs-deep-storage,hadoop-azure-to-azure-deep-storage,hadoop-azure-to-hdfs-deep-storage,hadoop-gcs-to-gcs-deep-storage,hadoop-gcs-to-hdfs-deep-storage,aliyun-oss-deep-storage,append-ingestion,compaction,high-availability,upgrade,shuffle-deep-store,custom-coordinator-duties' JVM_RUNTIME='-Djvm.runtime=8' USE_INDEXER='indexer' #- <<: *integration_tests # name: "(Compile=openjdk8, Run=openjdk8) leadership and high availability integration tests" @@ -759,7 +759,7 @@ jobs: - <<: *integration_tests name: "(Compile=openjdk8, Run=openjdk11) other integration test" jdk: openjdk8 - env: TESTNG_GROUPS='-DexcludedGroups=batch-index,input-format,input-source,perfect-rollup-parallel-batch-index,kafka-index,query,query-retry,query-error,realtime-index,security,ldap-security,s3-deep-storage,gcs-deep-storage,azure-deep-storage,hdfs-deep-storage,s3-ingestion,kinesis-index,kinesis-data-format,kafka-transactional-index,kafka-index-slow,kafka-transactional-index-slow,kafka-data-format,hadoop-s3-to-s3-deep-storage,hadoop-s3-to-hdfs-deep-storage,hadoop-azure-to-azure-deep-storage,hadoop-azure-to-hdfs-deep-storage,hadoop-gcs-to-gcs-deep-storage,hadoop-gcs-to-hdfs-deep-storage,aliyun-oss-deep-storage,append-ingestion,compaction,high-availability,upgrade,shuffle-deep-store,custom-coordinator-duties,web-console' JVM_RUNTIME='-Djvm.runtime=11' USE_INDEXER='middleManager' + env: TESTNG_GROUPS='-DexcludedGroups=batch-index,input-format,input-source,perfect-rollup-parallel-batch-index,kafka-index,query,query-retry,query-error,realtime-index,security,ldap-security,s3-deep-storage,gcs-deep-storage,azure-deep-storage,hdfs-deep-storage,s3-ingestion,kinesis-index,kinesis-data-format,kafka-transactional-index,kafka-index-slow,kafka-transactional-index-slow,kafka-data-format,hadoop-s3-to-s3-deep-storage,hadoop-s3-to-hdfs-deep-storage,hadoop-azure-to-azure-deep-storage,hadoop-azure-to-hdfs-deep-storage,hadoop-gcs-to-gcs-deep-storage,hadoop-gcs-to-hdfs-deep-storage,aliyun-oss-deep-storage,append-ingestion,compaction,high-availability,upgrade,shuffle-deep-store,custom-coordinator-duties' JVM_RUNTIME='-Djvm.runtime=11' USE_INDEXER='middleManager' - <<: *integration_tests name: "(Compile=openjdk8, Run=openjdk11) leadership and high availability integration tests" From 618dd67a39a6dbfc3e32e933ea7b96f1eb30c40c Mon Sep 17 00:00:00 2001 From: frank chen Date: Sat, 10 Sep 2022 18:45:11 +0800 Subject: [PATCH 5/5] Revert "Add a test to check if the web-console is correctly integrated" This reverts commit d6ac8f3087b22515b03e42fd57d24e7f3ddca254. --- .../org/apache/druid/tests/TestNGGroup.java | 2 - .../druid/tests/console/ITWebConsoleTest.java | 75 ------------------- 2 files changed, 77 deletions(-) delete mode 100644 integration-tests/src/test/java/org/apache/druid/tests/console/ITWebConsoleTest.java diff --git a/integration-tests/src/test/java/org/apache/druid/tests/TestNGGroup.java b/integration-tests/src/test/java/org/apache/druid/tests/TestNGGroup.java index f96b2908ab73..aeb8a010efd8 100644 --- a/integration-tests/src/test/java/org/apache/druid/tests/TestNGGroup.java +++ b/integration-tests/src/test/java/org/apache/druid/tests/TestNGGroup.java @@ -161,6 +161,4 @@ public class TestNGGroup public static final String CUSTOM_COORDINATOR_DUTIES = "custom-coordinator-duties"; public static final String HTTP_ENDPOINT = "http-endpoint"; - - public static final String WEB_CONSOLE = "web-console"; } diff --git a/integration-tests/src/test/java/org/apache/druid/tests/console/ITWebConsoleTest.java b/integration-tests/src/test/java/org/apache/druid/tests/console/ITWebConsoleTest.java deleted file mode 100644 index 82f4a2fbc9cc..000000000000 --- a/integration-tests/src/test/java/org/apache/druid/tests/console/ITWebConsoleTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.tests.console; - -import com.google.common.util.concurrent.ListenableFuture; -import com.google.inject.Inject; -import org.apache.druid.java.util.common.StringUtils; -import org.apache.druid.java.util.http.client.HttpClient; -import org.apache.druid.java.util.http.client.Request; -import org.apache.druid.java.util.http.client.response.StatusResponseHandler; -import org.apache.druid.java.util.http.client.response.StatusResponseHolder; -import org.apache.druid.testing.IntegrationTestingConfig; -import org.apache.druid.testing.guice.DruidTestModuleFactory; -import org.apache.druid.testing.guice.TestClient; -import org.apache.druid.testing.utils.ITRetryUtil; -import org.apache.druid.tests.TestNGGroup; -import org.jboss.netty.handler.codec.http.HttpMethod; -import org.jboss.netty.handler.codec.http.HttpResponseStatus; -import org.testng.annotations.Guice; -import org.testng.annotations.Test; - -import java.net.URL; - -@Test(groups = TestNGGroup.WEB_CONSOLE) -@Guice(moduleFactory = DruidTestModuleFactory.class) -public class ITWebConsoleTest -{ - @Inject - @TestClient - HttpClient httpClient; - - @Inject - IntegrationTestingConfig config; - - @Test - public void testWebConsoleHomePageExists() - { - ITRetryUtil.retryUntil( - () -> { - ListenableFuture status = httpClient.go( - new Request( - HttpMethod.GET, - new URL(config.getRouterUrl()) - ), - StatusResponseHandler.getInstance() - ); - - int httpStatusCode = status.get().getStatus().getCode(); - return httpStatusCode == HttpResponseStatus.OK.getCode() - || httpStatusCode == HttpResponseStatus.FOUND.getCode(); - }, - true, - ITRetryUtil.DEFAULT_RETRY_SLEEP, - 5, - StringUtils.format("WebConsole home page at [%s] does not exist.", config.getRouterUrl()) - ); - } -}