Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do Integrate test for Druid base on K8s cluster #10669

Merged
merged 15 commits into from
Dec 17, 2020

Conversation

zhangyue19921010
Copy link
Contributor

@zhangyue19921010 zhangyue19921010 commented Dec 11, 2020

Linked #10542.

Description

As the relationship between Druid and K8s gets closer, maybe it is good to have a IT job to check the running status of Druid on K8s like #10544

This PR add a new travis job to do simple integrate test on K8s, using Minikube + druid-operator + single-server
What I have done are as follows :

  1. Launched/Destroyed a Druid Cluster on Minikube locally with a script.
    2.Tested ingest -> load segment -> query. And it works fine.

Although It is in WIP
There are some bugs need to be fixed, such as

  1. Permissions issue
  2. Integration with travis: It seems that I can't set hostNetWork in statefuleset using druid-operator. So I have to use NodePort Service to expose Druid service like router, middleManager and so on but only can use ports 30000-32767.
    So I perform integration tests in int-tests-config-file mentioned https://github.com/apache/druid/blob/master/integration-tests/README.md
  3. Pod resource adjust including disks.

Any help is greatly appreciated.

Updated:

This PR add a new IT Job 71:

  1. Deploy a K8s cluster based on minikube.
  2. Deploy Druid cluster on K8s: single Druid, use local disk as Deep Storage and use derby as MetaStorage.
  3. Run single IT test ITNestedQueryPushDownTest which includes data ingestion, Historical loading and query action.

Now job 71 is successful which means this PR is not WIP anymore!


This PR has:

  • been self-reviewed.
  • 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
  • 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 is met.
  • added integration tests.
  • been tested in a test Druid cluster.

Key changed/added classes in this PR
  • .travis.yml

@zhangyue19921010
Copy link
Contributor Author

re-start to trigger CI again.

@zhangyue19921010
Copy link
Contributor Author

This PR add a new IT Job 71:

  1. Deploy a K8s cluster based on minikube.
  2. Deploy Druid cluster on K8s: single Druid, use local disk as Deep Storage and use derby as MetaStorage
  3. Run single IT test ITNestedQueryPushDownTest which includes data ingestion, Historical loading and query action.
    Now job 71 is successful which means this PR is not WIP anymore!

@zhangyue19921010 zhangyue19921010 changed the title [WIP] Do Integrate test base on K8s Do Integrate test for Druid base on K8s cluster Dec 15, 2020
@himanshug himanshug self-requested a review December 15, 2020 16:32
Copy link
Contributor

@himanshug himanshug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is great start for testing k8s stuff.

Comment on lines +59 to +60
cp integration-tests/tiny-cluster.yaml druid-operator/examples/
cp integration-tests/tiny-cluster-zk.yaml druid-operator/examples/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not sure why we need to copy, can't we directly use those two files ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes in integration-tests/tiny-cluster.yaml and integration-tests/tiny-cluster-zk.yaml, such as:

  1. New NodeType Service.
  2. Configs changing.
  3. Add MiddleManager configs.

So the original files in druid-operator can't be used directly here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I wasn't clear, in this context "original" meant files in "integration-tests/" i.e. you have

cp integration-tests/tiny-cluster.yaml druid-operator/examples/
cp integration-tests/tiny-cluster-zk.yaml druid-operator/examples/
...
sed -i "s|REPLACE_VOLUMES|`pwd`|g" druid-operator/examples/tiny-cluster.yaml
..
sudo /usr/local/bin/kubectl apply -f druid-operator/examples/tiny-cluster-zk.yaml
sudo /usr/local/bin/kubectl apply -f druid-operator/examples/tiny-cluster.yaml

as opposed to

...
sed -i "s|REPLACE_VOLUMES|`pwd`|g" integration-tests/tiny-cluster.yaml
..
sudo /usr/local/bin/kubectl apply -f integration-tests/tiny-cluster-zk.yaml
sudo /usr/local/bin/kubectl apply -f integration-tests/tiny-cluster.yaml

regardless, it is a nit and doesn't really matter much.

# Prepare For Druid-Operator
git clone https://github.com/druid-io/druid-operator.git
cd druid-operator
git checkout -b druid-operator-0.0.3 druid-operator-0.0.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe define DRUID_OPERATOR_VERSION=0.0.3 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. Done!

@@ -0,0 +1,62 @@
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this looks mostly a copy of other Dockerfile , it would be nice to reuse same if possible.

Copy link
Contributor Author

@zhangyue19921010 zhangyue19921010 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also. There are some changes between DockerfileBuildTarAdvanced and original Dockerfile, such as :

  1. Prepare test data.
  2. Move mvn package out of Dockerfile.
  3. Mkdir necessary for IT.

So that we can't use the original Dockerfile here.

@zhangyue19921010
Copy link
Contributor Author

zhangyue19921010 commented Dec 16, 2020

@himanshug Thanks for your review!
Job 71 is successful after changing as you suggested, but 48, 55, 65 are failed unexpected. I am pretty sure these failures are not this PR related.
Will trigger the CI again soon.

Updated:

CI is successful. PTAL :)

@zhangyue19921010
Copy link
Contributor Author

@himanshug Thanks for your review and merge!

@jihoonson jihoonson added this to the 0.21.0 milestone Jan 4, 2021
JulianJaffePinterest pushed a commit to JulianJaffePinterest/druid that referenced this pull request Jan 22, 2021
* add a travls job to do integrate test on K8s

* revert build_run_cluster.sh

* revert msic

* run IT test

* ready to test

* modify before/after script

* done

* change mod for script

* done

* add env DRUID_OPERATOR_VERSION=0.0.3

* change version

Co-authored-by: yuezhang <yuezhang@freewheel.tv>
@zhangyue19921010 zhangyue19921010 deleted the intergrate-test-base-on-K8s branch February 9, 2021 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants