-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Adding s3, gcs, azure integration tests #9501
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
Changes from all commits
4d5293a
db9d33e
a331906
a392bdf
aa9b866
aa7002a
b86f8fb
fb9a447
4d02318
c861df5
ee5427f
58e7020
b1ac174
c799c96
e220ddc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,8 @@ | |
|
|
||
| set -e | ||
|
|
||
| getConfPath() { | ||
| getConfPath() | ||
| { | ||
| cluster_conf_base=/tmp/conf/druid/cluster | ||
| case "$1" in | ||
| _common) echo $cluster_conf_base/_common ;; | ||
|
|
@@ -31,7 +32,8 @@ getConfPath() { | |
| } | ||
|
|
||
| # Delete the old key (if existing) and append new key=value | ||
| setKey() { | ||
| setKey() | ||
| { | ||
| service="$1" | ||
| key="$2" | ||
| value="$3" | ||
|
|
@@ -45,7 +47,8 @@ setKey() { | |
| echo "Setting $key=$value in $service_conf" | ||
| } | ||
|
|
||
| setupConfig() { | ||
| setupConfig() | ||
| { | ||
| echo "$(date -Is) configuring service $DRUID_SERVICE" | ||
|
|
||
| # We put all the config in /tmp/conf to allow for a | ||
|
|
@@ -63,7 +66,6 @@ setupConfig() { | |
| setKey $DRUID_SERVICE druid.host $(resolveip -s $HOSTNAME) | ||
| setKey $DRUID_SERVICE druid.worker.ip $(resolveip -s $HOSTNAME) | ||
|
|
||
|
|
||
| # Write out all the environment variables starting with druid_ to druid service config file | ||
| # This will replace _ with . in the key | ||
| env | grep ^druid_ | while read evar; | ||
|
|
@@ -73,4 +75,23 @@ setupConfig() { | |
| var=$(echo "$evar" | sed -e 's?^\([^=]*\)=.*?\1?g' -e 's?_?.?g') | ||
| setKey $DRUID_SERVICE "$var" "$val" | ||
| done | ||
| } | ||
| } | ||
|
|
||
| setupData() | ||
| { | ||
| # The "query" and "security" test groups require data to be setup before running the tests. | ||
| # In particular, they requires segments to be download from a pre-existing s3 bucket. | ||
| # This is done by using the loadSpec put into metadatastore and s3 credientials set below. | ||
| if [ "$DRUID_INTEGRATION_TEST_GROUP" = "query" ] || [ "$DRUID_INTEGRATION_TEST_GROUP" = "security" ]; then | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, this doesn't necessarily need to be changed now, but I think longer term we are going to need a mapping of test groups to configurations, but I'm not sure it should be encoded in a file in the container. This part should maybe be repurposed to allow running of initialization scripts that configurations bring with them to the container, and this stuff be in a script that initializes the legacy integration test environment.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's a good idea. Should definitely revisit this |
||
| # touch is needed because OverlayFS's copy-up operation breaks POSIX standards. See https://github.com/docker/for-linux/issues/72. | ||
| find /var/lib/mysql -type f -exec touch {} \; && service mysql start \ | ||
| && cat /test-data/${DRUID_INTEGRATION_TEST_GROUP}-sample-data.sql | mysql -u root druid && /etc/init.d/mysql stop | ||
| # below s3 credentials needed to access the pre-existing s3 bucket | ||
| setKey $DRUID_SERVICE druid.s3.accessKey AKIAJI7DG7CDECGBQ6NA | ||
| setKey $DRUID_SERVICE druid.s3.secretKey OBaLISDFjKLajSTrJ53JoTtzTZLjPlRePcwa+Pjv | ||
| setKey $DRUID_SERVICE druid.extensions.loadList [\"druid-s3-extensions\"] | ||
| # The region of the sample data s3 blobs needed for these test groups | ||
| export AWS_REGION=us-east-1 | ||
| fi | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # | ||
| # 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. | ||
| # | ||
|
|
||
| # | ||
| # Example of override config file to provide. | ||
| # Please replace <OVERRIDE_THIS> with your cloud configs/credentials | ||
| # | ||
| druid_storage_type=azure | ||
| druid_azure_account=<OVERRIDE_THIS> | ||
| druid_azure_key=<OVERRIDE_THIS> | ||
| druid_azure_container=<OVERRIDE_THIS> | ||
| druid_extensions_loadList=["druid-azure-extensions"] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this approach with trying to use overrides seems like it is going to be sort of brittle and hard to maintain. Like, if i want to ingest data from s3 into hdfs deep storage, or any combination of extensions, I'm not sure how well this approach will hold up, I guess we'll need separate override files for each configuration? That said, maybe is fine until we determine a better solution to integration test config management.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The override-examples directory is meant to be a general guideline of what to override. You may override more or less depending on what test you are running/writing. You may combine multiple files from the override-examples directory if you are running combination of extensions (like ingest data from s3 into hdfs deep storage). |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # | ||
| # 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. | ||
| # | ||
|
|
||
| # | ||
| # Example of override config file to provide. | ||
| # Please replace <OVERRIDE_THIS> and <YOUR_GOOGLE_CREDENTIALS_FILE_NAME> with your cloud configs/credentials | ||
| # | ||
| druid_storage_type=google | ||
| druid_google_bucket=<OVERRIDE_THIS> | ||
| druid_google_prefix=<OVERRIDE_THIS> | ||
| druid_extensions_loadList=["druid-google-extensions"] | ||
| GOOGLE_APPLICATION_CREDENTIALS=/shared/docker/credentials/<YOUR_GOOGLE_CREDENTIALS_FILE_NAME> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # | ||
| # 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. | ||
| # | ||
|
|
||
| # | ||
| # Example of override config file to provide. | ||
| # Please replace <OVERRIDE_THIS> with your cloud configs/credentials | ||
| # | ||
| druid_storage_type=s3 | ||
| druid_storage_bucket=<OVERRIDE_THIS> | ||
| druid_storage_baseKey=druid/segments | ||
| druid_s3_accessKey=<OVERRIDE_THIS> | ||
| druid_s3_secretKey=<OVERRIDE_THIS> | ||
| AWS_REGION=<OVERRIDE_THIS> | ||
| druid_extensions_loadList=["druid-s3-extensions"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work for how our travis CI is setup but if user try running manually locally with...
then the data won't be setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments indicating the above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, one more thing I forgot about, please update the docs in https://github.com/apache/druid/blob/master/integration-tests/README.md to include instructions for how to supply credentials and run these tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done