GitHub user GajendraAchar created a discussion: Superset Issue with Alerts

Hi Team.

I have deployed the superset version 6.0.0 on the Kubernetes stack and enabled 
the "Alerts and Reports" feature. When I schedule the report the screenshot is 
not capturing the full dashboard. It's breaking in half. When I try to download 
the dashboard it downloads the complete dashboard as PDF but when I schedule it 
doesn't capture the full dashboard. 

Please find the values.yaml below.

`image:
  repository: apachesuperset.docker.scarf.sh/apache/superset
  tag: 6.0.0
  pullPolicy: IfNotPresent

resources:
  limits:
    cpu: 2000m
    memory: 4000Mi
  requests:
    cpu: 1000m
    memory: 2000Mi

ingress:
  enabled: true
  ingressClassName: ~
  annotations:
    kubernetes.io/ingress.class: "nginx"
    kubernetes.io/tls-acme: "true"
    cert-manager.io/cluster-issuer: letsencrypt
    cert-manager.io/acme-challenge-type: dns01
    cert-manager.io/acme-dns01-provider: route53
    nginx.ingress.kubernetes.io/proxy-buffer-size: "128k"
    nginx.ingress.kubernetes.io/affinity: "cookie"
    nginx.ingress.kubernetes.io/session-cookie-name: "sticky-cookie"
    nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
    nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
    nginx.ingress.kubernetes.io/affinity-mode: persistent
    nginx.ingress.kubernetes.io/session-cookie-hash: sha1
  path: /
  pathType: ImplementationSpecific
  hosts:
    - superset-dev.eha.im
  ssl:
    letsencrypt: true
    cert_secret: superset-dev.eha.im
  tls:
    - hosts:
        - superset-dev.eha.im
      secretName: "superset-dev.eha.im"
  extraHostsRaw: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

bootstrapScript: |
  #!/bin/bash
  if [ ! -f ~/bootstrap ]; then
    echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap

    # Install custom packages
    uv pip install holidays prophet flask_cors authlib psycopg2-binary 
databricks-sql-connector sqlalchemy-databricks databricks-dbapi pyodbc
    # Install Chromium & screenshot dependencies
    apt-get update -y && \
    apt-get install -y chromium chromium-driver fonts-liberation 
libappindicator3-1 libasound2 libatk-bridge2.0-0 \
    libnspr4 libnss3 libxss1 libxtst6 xdg-utils xvfb
  fi


envFromSecret: superset-auth
secretEnv:
  create: false

extraEnvRaw:
  - name: DB_PASS
    valueFrom:
      secretKeyRef:
        name: superset-auth
        key: DB_PASS
  - name: SMTP_HOST
    valueFrom:
      secretKeyRef:
        name: superset-auth
        key: SMTP_HOST
  - name: SMTP_STARTTLS
    valueFrom:
      secretKeyRef:
        name: superset-auth
        key: SMTP_STARTTLS
  - name: SMTP_SSL
    valueFrom:
      secretKeyRef:
        name: superset-auth
        key: SMTP_SSL
  - name: SMTP_USER
    valueFrom:
      secretKeyRef:
        name: superset-auth
        key: SMTP_USER
  - name: SMTP_PORT
    valueFrom:
      secretKeyRef:
        name: superset-auth
        key: SMTP_PORT
  - name: SMTP_MAIL_FROM
    valueFrom:
      secretKeyRef:
        name: superset-auth
        key: SMTP_MAIL_FROM


envFrom:
  - secretRef:
      name: superset-secret-key

configOverrides:
  superset_config.py: |
    import os
    SECRET_KEY = os.environ.get('SECRET_KEY', 'fallback-secret-if-missing')
    
    # -------- REPORTS / SELENIUM FIXES --------
    GLOBAL_ASYNC_QUERIES = False
    DASHBOARD_NATIVE_FILTERS_SET = False

    # Required for headless Chrome over HTTPS
    SESSION_COOKIE_SAMESITE = "None"
    SESSION_COOKIE_SECURE = True

    # Avoid report lock starvation
    REPORT_SCHEDULE_EXECUTION_TIMEOUT = 900
    
  feature_flags: |
    import ast

    FEATURE_FLAGS = {
        "ALERT_REPORTS": True,
        "SCHEDULED_EMAIL_REPORTS": True,
        "ENABLE_TEMPLATE_PROCESSING": True,
    }

    SMTP_HOST = os.getenv("SMTP_HOST")
    SMTP_STARTTLS = ast.literal_eval(os.getenv("SMTP_STARTTLS", "True"))
    SMTP_SSL = ast.literal_eval(os.getenv("SMTP_SSL", "False"))
    SMTP_USER = os.getenv("SMTP_USER","superset")
    SMTP_PORT = os.getenv("SMTP_PORT",25)
    SMTP_PASSWORD = os.getenv("SMTP_PASSWORD","superset")
    SMTP_MAIL_FROM = os.getenv("SMTP_MAIL_FROM","[email protected]")

    SLACK_API_TOKEN = os.getenv("SLACK_API_TOKEN",None)

  celery_conf: |
    from celery.schedules import crontab

    class CeleryConfig:
      broker_url = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
      imports = (
          "superset.sql_lab",
          "superset.tasks.cache",
          "superset.tasks.scheduler",
      )
      result_backend = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/1"
      task_annotations = {
          "sql_lab.get_sql_results": {
              "rate_limit": "100/s",
          },
      }
      beat_schedule = {
          "reports.scheduler": {
              "task": "reports.scheduler",
              "schedule": crontab(minute="*", hour="*"),
          },
          "reports.prune_log": {
              "task": "reports.prune_log",
              'schedule': crontab(minute=0, hour=0),
          },
          'cache-warmup-hourly': {
              "task": "cache-warmup",
              "schedule": crontab(minute="*/30", hour="*"),
              "kwargs": {
                  "strategy_name": "top_n_dashboards",
                  "top_n": 10,
                  "since": "7 days ago",
              },
          }
      }
    CELERY_CONFIG = CeleryConfig

  reports: |
    SCREENSHOT_LOAD_WAIT = 60
    SCREENSHOT_LOCATE_WAIT = 30
    SCREENSHOT_TIMEOUT = 300
    SCREENSHOT_VIEWPORT_WIDTH = 1920
    SCREENSHOT_VIEWPORT_HEIGHT = 6000
    EMAIL_PAGE_RENDER_WAIT = 180
    
    # IMPORTANT: Use public HTTPS URL
    WEBDRIVER_BASEURL = "https://superset-dev.eha.im";
    WEBDRIVER_BASEURL_USER_FRIENDLY = "https://superset-dev.eha.im/";
    
    WEBDRIVER_TYPE= "chrome"
    WEBDRIVER_OPTION_ARGS = [
        "--force-device-scale-factor=2.0",
        "--high-dpi-support=2.0",
        "--headless",
        "--disable-gpu",
        "--disable-dev-shm-usage",
        # This is required because our process runs as root (in order to 
install pip packages)
        "--no-sandbox",
        "--disable-setuid-sandbox",
        "--disable-extensions",
    ]

extraVolumes:
  - name: cloudsql-instance-credentials
    secret:
      secretName: cloudsql-instance-credentials

extraVolumeMounts:
  - name: cloudsql-instance-credentials
    mountPath: /secrets/cloudsql
    readOnly: true

extraEnvFrom:
  - secretRef:
      name: "superset-auth"

postgresql:
  ##
  ## Use the PostgreSQL chart dependency.
  ## Set to false if bringing your own PostgreSQL.
  enabled: false

# Superset node configuration
supersetNode:
  replicas:
    enabled: true
    replicaCount: 1
  # -- Startup command
  # @default -- See `values.yaml`
  resources:
    limits:
      cpu: 2000m
      memory: 4000Mi
    requests:
      cpu: 1000m
      memory: 2000Mi
  command:
    - "/bin/sh"
    - "-c"
    - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; 
/usr/bin/run-server.sh"
  connections:
    # You need to change below configuration incase bringing own PostgresSQL 
instance and also set postgresql.enabled:false
    db_host: "localhost"
    db_port: "5432"
    db_user: superset
    db_pass: ${DB_PASS}
    db_name: superset
  extraContainers:
    - name: cloudsql-proxy
      image: gcr.io/cloudsql-docker/gce-proxy:1.33.9
      resources:
        limits:
          cpu: 100m
          memory: 128M
        requests:
          cpu: 25m
          memory: 32M
      command:
        [
          "/cloud_sql_proxy",
          
"-instances=development-223016:europe-west1:ehealth-africa-dev=tcp:5432",
          "-credential_file=/secrets/cloudsql/credentials.json",
        ]
      volumeMounts:
        - name: cloudsql-instance-credentials
          mountPath: /secrets/cloudsql
          readOnly: true

# Superset Celery worker configuration
supersetWorker:
  resources:
    limits:
      cpu: 2000m
      memory: 4000Mi
    requests:
      cpu: 1000m
      memory: 2000Mi
  command:
    - /bin/sh
    - -c
    - |
      # Install chrome webdriver
      # See 
https://github.com/apache/superset/blob/4fa3b6c7185629b87c27fc2c0e5435d458f7b73d/docs/src/pages/docs/installation/email_reports.mdx
      apt-get update
      apt-get install -y wget
      wget 
https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
      apt-get install -y --no-install-recommends 
./google-chrome-stable_current_amd64.deb
      wget 
https://chromedriver.storage.googleapis.com/88.0.4324.96/chromedriver_linux64.zip
      apt-get install -y zip
      unzip chromedriver_linux64.zip
      chmod +x chromedriver
      mv chromedriver /usr/bin
      apt-get autoremove -yqq --purge
      apt-get clean
      rm -f google-chrome-stable_current_amd64.deb chromedriver_linux64.zip

      # Run
      . {{ .Values.configMountPath }}/superset_bootstrap.sh; celery 
--app=superset.tasks.celery_app:app worker --concurrency=4
  initContainers: []
  extraContainers:
    - name: cloudsql-proxy
      image: gcr.io/cloudsql-docker/gce-proxy:1.33.9
      resources:
        limits:
          cpu: 100m
          memory: 128M
        requests:
          cpu: 25m
          memory: 32M
      command:
        [
          "/cloud_sql_proxy",
          
"-instances=development-223016:europe-west1:ehealth-africa-dev=tcp:5432",
          "-credential_file=/secrets/cloudsql/credentials.json",
        ]
      volumeMounts:
        - name: cloudsql-instance-credentials
          mountPath: /secrets/cloudsql
          readOnly: true



init:
  initContainers: []

  extraContainers:
    - name: cloudsql-proxy
      image: gcr.io/cloudsql-docker/gce-proxy:1.33.9
      resources:
        limits:
          cpu: 100m
          memory: 128M
        requests:
          cpu: 25m
          memory: 32M
      command:
        [
          "/cloud_sql_proxy",
          
"-instances=development-223016:europe-west1:ehealth-africa-dev=tcp:5432",
          "-credential_file=/secrets/cloudsql/credentials.json",
        ]
      volumeMounts:
        - name: cloudsql-instance-credentials
          mountPath: /secrets/cloudsql
          readOnly: true

supersetNode:
  initContainers: []
  extraContainers:
      - name: cloudsql-proxy
        image: gcr.io/cloudsql-docker/gce-proxy:1.33.9
        resources:
          limits:
            cpu: 100m
            memory: 128M
          requests:
            cpu: 25m
            memory: 32M
        command:
          [
            "/cloud_sql_proxy",
            
"-instances=development-223016:europe-west1:ehealth-africa-dev=tcp:5432",
            "-credential_file=/secrets/cloudsql/credentials.json",
          ]
        volumeMounts:
          - name: cloudsql-instance-credentials
            mountPath: /secrets/cloudsql
            readOnly: true

# Superset beat configuration (to trigger scheduled jobs like reports)
supersetCeleryBeat:
  # -- This is only required if you intend to use alerts and reports
  enabled: true

  command:
    - "/bin/sh"
    - "-c"
    - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery 
--app=superset.tasks.celery_app:app beat --pidfile /tmp/celerybeat.pid 
--schedule /tmp/celerybeat-schedule"

  initContainers:
    - name: wait-for-postgres-redis
      image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}"
      imagePullPolicy: "{{ .Values.initImage.pullPolicy }}"
      envFrom:
        - secretRef:
            name: "{{ tpl .Values.envFromSecret . }}"
      command:
        - /bin/sh
        - -c
        - dockerize -wait "tcp://$REDIS_HOST:$REDIS_PORT" -timeout 120s
  extraContainers:
    - name: cloudsql-proxy
      image: gcr.io/cloudsql-docker/gce-proxy:1.33.9
      resources:
        limits:
          cpu: 100m
          memory: 128M
        requests:
          cpu: 25m
          memory: 32M
      command:
        [
          "/cloud_sql_proxy",
          
"-instances=development-223016:europe-west1:ehealth-africa-dev=tcp:5432",
          "-credential_file=/secrets/cloudsql/credentials.json",
        ]
      volumeMounts:
        - name: cloudsql-instance-credentials
          mountPath: /secrets/cloudsql
          readOnly: true`


I have also attached the scheduled report as well as the downloaded report for 
the reference.

Please let me know if there's any setting which I have to update.

Regards,
Gajendra S

1. Scheduled Report.

[Scheduled_report.pdf](https://github.com/user-attachments/files/24935255/Scheduled_report.pdf)

2. Downloaded Report

[Downloaded_report_compressed.pdf](https://github.com/user-attachments/files/24935369/Downloaded_report_compressed.pdf)



GitHub link: https://github.com/apache/superset/discussions/37549

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to