Skip to content
This repository has been archived by the owner on May 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #23 from analyticsMD/configDeploy
Browse files Browse the repository at this point in the history
Changing superset config
  • Loading branch information
niharikay authored Jun 6, 2019
2 parents 14b0dca + 97ac0a2 commit 2030905
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 7 deletions.
61 changes: 54 additions & 7 deletions contrib/docker/superset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
import os
import boto3
from celery.schedules import crontab


Expand All @@ -30,6 +31,17 @@ def get_env_variable(var_name, default=None):
.format(var_name)
raise EnvironmentError(error_msg)

def getSecretKey():
ssm = boto3.client('ssm')
key = ssm.get_parameter(Name='/devops/superset/secret_key', WithDecryption=True)
secret_key = key['Parameter']['Value']
return secret_key

def getMapBoxKey():
ssm = boto3.client('ssm')
key = ssm.get_parameter(Name='/devops/superset/map_key', WithDecryption=True)
map_key = key['Parameter']['Value']
return map_key

MYSQL_USER = get_env_variable('MYSQL_USER')
MYSQL_PASSWORD = get_env_variable('MYSQL_PASSWORD')
Expand Down Expand Up @@ -79,18 +91,18 @@ class CeleryConfig(object):

CELERY_CONFIG = CeleryConfig

CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_DEFAULT_TIMEOUT': 60 * 60 * 24, # 1 day default (in secs)
'CACHE_KEY_PREFIX': 'superset_results',
'CACHE_REDIS_URL': 'redis://%s:%s/0' % (REDIS_HOST, REDIS_PORT),
}
#CACHE_CONFIG = {
# 'CACHE_TYPE': 'redis',
# 'CACHE_DEFAULT_TIMEOUT': 60 * 60 * 24, # 1 day default (in secs)
# 'CACHE_KEY_PREFIX': 'superset_results',
# 'CACHE_REDIS_URL': 'redis://%s:%s/0' % (REDIS_HOST, REDIS_PORT),
#}

from werkzeug.contrib.cache import RedisCache
RESULTS_BACKEND = RedisCache(
host=REDIS_HOST, port=REDIS_PORT, key_prefix='superset_results')

WEBDRIVER_BASEURL = 'http://0.0.0.0:8088/'
WEBDRIVER_BASEURL = 'https://0.0.0.0:8088/'
# Enable / disable scheduled email reports
ENABLE_SCHEDULED_EMAIL_REPORTS = True

Expand Down Expand Up @@ -134,3 +146,38 @@ class CeleryConfig(object):
SMTP_PORT = 465 #465 , 587
SMTP_PASSWORD = 'D0ndeMail'
SMTP_MAIL_FROM = '[email protected]'
SECRET_KEY = getSecretKey()
ROW_LIMIT = 100
SQL_MAX_ROW = 500
VIZ_ROW_LIMIT = 500
# max rows retrieved by filter select auto complete
FILTER_SELECT_ROW_LIMIT = 1000
# Maximum number of rows returned from a database
# in async mode, no more than SQL_MAX_ROW will be returned and stored
# in the results backend. This also becomes the limit when exporting CSVs
SQL_MAX_ROW = 10000

# Default row limit for SQL Lab queries
DEFAULT_SQLLAB_LIMIT = 100

DISPLAY_MAX_ROW = 500
SUPERSET_WORKERS = 4

# Timeout duration for SQL Lab synchronous queries
SQLLAB_TIMEOUT = 600

# The MAX duration (in seconds) a query can run for before being killed
# by celery.
SQLLAB_ASYNC_TIME_LIMIT_SEC = 60 * 60

SUPERSET_WEBSERVER_TIMEOUT = 1200

SUPERSET_WEBSERVER_PORT = 8088
# Flask-WTF flag for CSRF
WTF_CSRF_ENABLED = True
# Add endpoints that need to be exempt from CSRF protection
WTF_CSRF_EXEMPT_LIST = []
# A CSRF token that expires in 1 year
WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365
# Set this API key to enable Mapbox visualizations
MAPBOX_API_KEY = getMapBoxKey()
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
boto3
console_log==0.2.10
flake8-commas==2.0.0
flake8-import-order==0.18
Expand Down

0 comments on commit 2030905

Please sign in to comment.