You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/12/23 19:51:28 UTC

[GitHub] [druid] jihoonson opened a new pull request #12095: Use Druid's extension loading for integration test instead of maven

jihoonson opened a new pull request #12095:
URL: https://github.com/apache/druid/pull/12095


   ### Description
   
   Currently, our integration test uses maven to pull in dependencies for some extensions instead of Druid's extension loading system. The discrepancy in how Druid loads extension dependencies between in production and in integration tests makes our integration tests less trust-able. This PR fixes it to use Druid's extension system for every extension. 
   
   This PR also cleans up a bit how integration test configuration system works. 
   
   - Before this PR, some integration tests use a fixed loadList that is set in `setupData` in `druid.sh`. This loadList is not overrideable which is confusing and also hard to debug. This PR removes the fixed loadList.
   - This PR also removes unnecessary docker compose settings for `custom-coordinator-duties` and `shuffle-deep-store` groups. The docker compose setting should be used only when the test group requires for extra nodes to run besides the default nodes defined in `docker-compose.yml` or `docker-compose.override-env.yml`.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `copy_resources_template.sh`
    * `druid.sh`
   
   <hr>
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
   
   This PR has:
   - [ ] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on a change in pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #12095:
URL: https://github.com/apache/druid/pull/12095#discussion_r778578628



##########
File path: integration-tests/script/copy_resources_template.sh
##########
@@ -27,9 +27,16 @@ cp -r client_tls docker/client_tls
 rm -rf $SHARED_DIR/docker
 mkdir -p $SHARED_DIR
 cp -R docker $SHARED_DIR/docker
-mvn -B dependency:copy-dependencies -DoutputDirectory=$SHARED_DIR/docker/lib
 
-# Make directories if they dont exist
+pushd ../
+rm -rf apache-druid-$DRUID_VERSION
+mvn -DskipTests -T1C -Danimal.sniffer.skip=true -Dcheckstyle.skip=true -Ddruid.console.skip=true -Denforcer.skip=true -Dforbiddenapis.skip=true -Dmaven.javadoc.skip=true -Dpmd.skip=true -Dspotbugs.skip=true install -Pdist
+tar xzf distribution/target/apache-druid-$DRUID_VERSION-bin.tar.gz

Review comment:
       That's a good idea, though the extra time that this PR added in each integration test was about 2-5 min in travis which seems not that bad. It sounds better since it would be clearer. I added a new maven profile, `integration-test`, that creates an exploded directory under `distribution/target/`. Integration tests now use this new profile. In a simple test in my machine, the `integration-test` profile took 54 sec while the `dist` profile took 90 sec. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson closed pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
jihoonson closed pull request #12095:
URL: https://github.com/apache/druid/pull/12095


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a change in pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #12095:
URL: https://github.com/apache/druid/pull/12095#discussion_r779123389



##########
File path: distribution/src/assembly/integration-test-assembly.xml
##########
@@ -0,0 +1,109 @@
+<?xml version="1.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.
+  -->
+
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+    <id>bin</id>
+    <formats>
+        <format>dir</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <fileSets>
+        <fileSet>
+            <directory>${project.build.directory}/extensions</directory>
+            <includes>
+                <include>*/*</include>
+            </includes>
+            <outputDirectory>extensions</outputDirectory>
+        </fileSet>
+
+        <fileSet>
+            <directory>${project.build.directory}/hadoop-dependencies</directory>
+            <includes>
+                <include>*/*/*</include>
+            </includes>
+            <outputDirectory>hadoop-dependencies</outputDirectory>
+        </fileSet>
+        <fileSet>

Review comment:
       are all of the example files needed?

##########
File path: integration-tests/docker/docker-compose.yml
##########
@@ -36,6 +36,7 @@ services:
     environment:
       - DRUID_INTEGRATION_TEST_GROUP=${DRUID_INTEGRATION_TEST_GROUP}
     depends_on:
+      - druid-overlord

Review comment:
       why this change?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson merged pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
jihoonson merged pull request #12095:
URL: https://github.com/apache/druid/pull/12095


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on a change in pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #12095:
URL: https://github.com/apache/druid/pull/12095#discussion_r779215903



##########
File path: integration-tests/docker/docker-compose.yml
##########
@@ -36,6 +36,7 @@ services:
     environment:
       - DRUID_INTEGRATION_TEST_GROUP=${DRUID_INTEGRATION_TEST_GROUP}
     depends_on:
+      - druid-overlord

Review comment:
       So, I copied this change over from the previous `docker-compose.override-config.yml` file. I'm not sure how it worked before, but now it fails without this change due to circular dependencies in this docker compose file.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson closed pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
jihoonson closed pull request #12095:
URL: https://github.com/apache/druid/pull/12095


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a change in pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #12095:
URL: https://github.com/apache/druid/pull/12095#discussion_r777763581



##########
File path: integration-tests/script/copy_resources_template.sh
##########
@@ -27,9 +27,16 @@ cp -r client_tls docker/client_tls
 rm -rf $SHARED_DIR/docker
 mkdir -p $SHARED_DIR
 cp -R docker $SHARED_DIR/docker
-mvn -B dependency:copy-dependencies -DoutputDirectory=$SHARED_DIR/docker/lib
 
-# Make directories if they dont exist
+pushd ../
+rm -rf apache-druid-$DRUID_VERSION
+mvn -DskipTests -T1C -Danimal.sniffer.skip=true -Dcheckstyle.skip=true -Ddruid.console.skip=true -Denforcer.skip=true -Dforbiddenapis.skip=true -Dmaven.javadoc.skip=true -Dpmd.skip=true -Dspotbugs.skip=true install -Pdist
+tar xzf distribution/target/apache-druid-$DRUID_VERSION-bin.tar.gz

Review comment:
       it looks like maven assembly plugin supports a 'dir' format, which "Creates an exploded directory format" according to the docs here https://maven.apache.org/plugins/maven-assembly-plugin/assembly.html. What do you think about making a custom integration-tests version of https://github.com/apache/druid/blob/master/distribution/src/assembly/assembly.xml (which leaves out all of the normal distribution stuff like examples and licenses and stuff) along with custom distribution build profile so we could skip making and then unpacking the archive? I suspect it would shave off some overhead, anecdotally it seems like this part is pretty slow when i do these things locally.
   
   semi related, (but not to this PR) the normal docker image could probably stand to do this too https://github.com/apache/druid/blob/master/distribution/docker/Dockerfile#L43, but it would need all the normal distribution stuff so it would just need a way to override the format or just like make the 'dir' version the base and then a 'tar' version that depends on the output of the base version to archive it for a distribution.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on a change in pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
jihoonson commented on a change in pull request #12095:
URL: https://github.com/apache/druid/pull/12095#discussion_r779215221



##########
File path: distribution/src/assembly/integration-test-assembly.xml
##########
@@ -0,0 +1,109 @@
+<?xml version="1.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.
+  -->
+
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+    <id>bin</id>
+    <formats>
+        <format>dir</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <fileSets>
+        <fileSet>
+            <directory>${project.build.directory}/extensions</directory>
+            <includes>
+                <include>*/*</include>
+            </includes>
+            <outputDirectory>extensions</outputDirectory>
+        </fileSet>
+
+        <fileSet>
+            <directory>${project.build.directory}/hadoop-dependencies</directory>
+            <includes>
+                <include>*/*/*</include>
+            </includes>
+            <outputDirectory>hadoop-dependencies</outputDirectory>
+        </fileSet>
+        <fileSet>

Review comment:
       No, I was a bit lazy :sweat_smile: Removed unnecessary files now.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson closed pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
jihoonson closed pull request #12095:
URL: https://github.com/apache/druid/pull/12095


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jihoonson commented on pull request #12095: Use Druid's extension loading for integration test instead of maven

Posted by GitBox <gi...@apache.org>.
jihoonson commented on pull request #12095:
URL: https://github.com/apache/druid/pull/12095#issuecomment-1006344455


   @clintropolis thanks for the review!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org