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/02/07 20:39:57 UTC

[GitHub] [superset] shemExelate commented on issue #12942: Generating Reports

shemExelate commented on issue #12942:
URL: https://github.com/apache/superset/issues/12942#issuecomment-774756667


   I'm having the same issue, running latest from `/docker`
   my config:
   
   **docker-compose.yaml**
   added:
   ```yaml
     superset-beat:
       image: *superset-image
       container_name: superset_beat
       command: ["/app/docker/docker-bootstrap.sh", "beat"]
       env_file: docker/.env
       restart: unless-stopped
       depends_on: *superset-depends-on
       user: "root"
       volumes: *superset-volumes
   ```
   
   **docker-bootstrap.sh**
   modified to:
   ```sh
   if [[ "${1}" == "worker" ]]; then
     echo "Starting Celery worker..."
     celery worker --app=superset.tasks.celery_app:app --pool=prefork -O fair -c 4 -l DEBUG
   elif [[ "${1}" == "beat" ]]; then
     echo "Starting Celery beat..."
     celery beat --app=superset.tasks.celery_app:app -l DEBUG
   elif [[ "${1}" == "app" ]]; then
     echo "Starting web app..."
     flask run -p 8088 --with-threads --reload --debugger --host=0.0.0.0
   fi
   ```
   
   **superset_config.py**
   modified to:
   ```py
   
   RESULTS_BACKEND = RedisCache(
       host=REDIS_HOST, port=REDIS_PORT)
   
   FEATURE_FLAGS = {
       "ALERT_REPORTS": True,
   }
   
   class CeleryConfig(object):
       BROKER_URL = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}"
       CELERY_IMPORTS = (
           "superset.sql_lab",
           "superset.tasks",
       )
       CELERY_RESULT_BACKEND = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}"
       CELERY_ANNOTATIONS = {
           "tasks.add": {
               "rate_limit": "10/s",
           },
           "sql_lab.get_sql_results": {
               "rate_limit": "100/s",
           },
           "email_reports.send": {
               "rate_limit": "1/s",
               "time_limit": 120,
               "soft_time_limit": 150,
               "ignore_result": True,
           },
       }
       CELERYBEAT_SCHEDULE = {
           "email_reports.schedule_hourly": {
               "task": "email_reports.schedule_hourly",
               "schedule": crontab(minute=1, hour="*"),
           },
       }
       CELERY_TASK_PROTOCOL = 1
   
   CACHE_CONFIG = {
       "CACHE_TYPE": "redis",
       "CACHE_DEFAULT_TIMEOUT": 60 * 60 * 24, # 1 day default (in secs)
       "CACHE_KEY_PREFIX": "superset_results",
       "CACHE_REDIS_URL": f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}",
   }
   
   CELERY_CONFIG = CeleryConfig
   SQLLAB_CTAS_NO_LIMIT = True
   
   ENABLE_SCHEDULED_EMAIL_REPORTS = True
   EMAIL_NOTIFICATIONS = True
   
   SMTP_HOST = "smtp.gmail.com"
   SMTP_STARTTLS = True
   SMTP_SSL = True
   SMTP_USER = "df.team.test@gmail.com"
   SMTP_PORT = 465
   SMTP_PASSWORD = os.environ.get("SMTP_PASSWORD")
   SMTP_MAIL_FROM = "df.team.test@gmail.com"
   ```


----------------------------------------------------------------
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.

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