You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/07/05 03:01:28 UTC

[GitHub] [superset] pabrahamusa edited a comment on issue #15065: 500 - Internal Server Error - Searching Saved Query

pabrahamusa edited a comment on issue #15065:
URL: https://github.com/apache/superset/issues/15065#issuecomment-873746613


   @nytai this is what I am using for my docker image.
   
   `
   {{/*
   
    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.
   
   */}}
   {{/* vim: set filetype=mustache: */}}
   {{/*
   Expand the name of the chart.
   */}}
   {{- define "superset.name" -}}
   {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
   {{- end -}}
   
   {{/*
   Create a default fully qualified app name.
   We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
   If release name contains chart name it will be used as a full name.
   */}}
   {{- define "superset.fullname" -}}
   {{- if .Values.fullnameOverride -}}
   {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
   {{- else -}}
   {{- $name := default .Chart.Name .Values.nameOverride -}}
   {{- if contains $name .Release.Name -}}
   {{- .Release.Name | trunc 63 | trimSuffix "-" -}}
   {{- else -}}
   {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
   {{- end -}}
   {{- end -}}
   {{- end -}}
   
   {{/*
   Create chart name and version as used by the chart label.
   */}}
   {{- define "superset.chart" -}}
   {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
   {{- end -}}
   
   {{- define "superset-bootstrap" }}
   #!/bin/sh
   
   pip install {{ range .Values.additionalRequirements }}{{ . }} {{ end }}
   
   {{ end -}}
   
   {{- define "superset-config" }}
   import os
   from cachelib.redis import RedisCache
   import math
   import time
   from datetime import datetime
   
   def last_mins(mins):
     return ((current_milli_time() * 1000 * 1000 )-(mins * 60000 * 1000 * 1000))
   
   # Default row limit for SQL Lab queries. Is overridden by setting a new limit in
   # the SQL Lab UI
   DEFAULT_SQLLAB_LIMIT = 25
   
   
   SQLLAB_TIMEOUT = 300
   SUPERSET_WEBSERVER_TIMEOUT = 300
   
   
   JINJA_CONTEXT_ADDONS = {
        "last_mins": last_mins
   }
   
   # ---------------------------------------------------
   # Feature flags
   # ---------------------------------------------------
   # Feature flags that are set by default go here. Their values can be
   # overwritten by those specified under FEATURE_FLAGS in super_config.py
   # For example, DEFAULT_FEATURE_FLAGS = { 'FOO': True, 'BAR': False } here
   # and FEATURE_FLAGS = { 'BAR': True, 'BAZ': True } in superset_config.py
   # will result in combined feature flags of { 'FOO': True, 'BAR': True, 'BAZ': True }
   # Candyland enabling feature
   DEFAULT_FEATURE_FLAGS = {
       # Enable jinja templates
       'ENABLE_TEMPLATE_PROCESSING': True,
       # Enables Alerts and reports new implementation
       "ALERT_REPORTS": True,
   }
   # Enable / disable Alerts, where users can define custom SQL that
   # will send emails with screenshots of charts or dashboards periodically
   # if it meets the criteria
   ENABLE_ALERTS = True
   
   # Enable / disable scheduled email reports
   ENABLE_SCHEDULED_EMAIL_REPORTS = False
   
   # START Handle logging
   # Whether to run the web server in debug mode or not
   # and enable DEBIG logs
   # DEBUG = os.environ.get("FLASK_ENV") == "development"
   # FLASK_USE_RELOAD = True
   # SHOW_STACKTRACE = True
   # DEBUG = True
   # LOG_LEVEL = "DEBUG"
   # LOG_LEVEL = DEBUG, INFO, WARNING, ERROR, CRITICAL
   # END Handle logging
   
   
   # Candyland End adding macros
   
   def env(key, default=None):
       return os.getenv(key, default)
   
   MAPBOX_API_KEY = env('MAPBOX_API_KEY', '')
   CACHE_CONFIG = {
         'CACHE_TYPE': 'redis',
         'CACHE_DEFAULT_TIMEOUT': 300,
         'CACHE_KEY_PREFIX': 'superset_',
         'CACHE_REDIS_HOST': env('REDIS_HOST'),
         'CACHE_REDIS_PORT': env('REDIS_PORT'),
         'CACHE_REDIS_DB': 1,
         'CACHE_REDIS_URL': f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/1"
   }
   DATA_CACHE_CONFIG = CACHE_CONFIG
   
   SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{env('DB_USER')}:{env('DB_PASS')}@{env('DB_HOST')}:{env('DB_PORT')}/{env('DB_NAME')}"
   SQLALCHEMY_TRACK_MODIFICATIONS = True
   SECRET_KEY = env('SECRET_KEY', 'thisISaSECRET_1234')
   
   # 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
   class CeleryConfig(object):
     BROKER_URL = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
     CELERY_IMPORTS = ('superset.sql_lab', )
     CELERY_RESULT_BACKEND = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
     CELERY_ANNOTATIONS = {'tasks.add': {'rate_limit': '10/s'}}
   
   CELERY_CONFIG = CeleryConfig
   RESULTS_BACKEND = RedisCache(
         host=env('REDIS_HOST'),
         port=env('REDIS_PORT'),
         key_prefix='superset_results'
   )
   
   {{ if .Values.configOverrides }}
   # Overrides
   {{- range $key, $value := .Values.configOverrides }}
   # {{ $key }}
   {{ tpl $value $ }}
   {{- end }}
   {{- end }}
   
   {{- end }}
   
   `


-- 
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: notifications-unsubscribe@superset.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org