246 lines
6.9 KiB
YAML
246 lines
6.9 KiB
YAML
bootstrapScript: |
|
|
#!/bin/bash
|
|
apt-get update && apt-get install -y python3-dev default-libmysqlclient-dev
|
|
rm -rf /var/lib/apt/lists/*
|
|
pip install --upgrade pip
|
|
pip install \
|
|
sqlalchemy-bigquery \
|
|
cachelib \
|
|
redis \
|
|
authlib \
|
|
packaging==23.2 \
|
|
clickhouse-connect \
|
|
sqlalchemy==1.4.36 && \
|
|
if [ ! -f ~/bootstrap ]; then echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap; fi
|
|
|
|
extraEnv:
|
|
GUNICORN_TIMEOUT: 900
|
|
SERVER_WORKER_AMOUNT: 4
|
|
WORKER_MAX_REQUESTS: 0
|
|
WORKER_MAX_REQUESTS_JITTER: 0
|
|
SERVER_THREADS_AMOUNT: 20
|
|
GUNICORN_KEEPALIVE: 2
|
|
SERVER_LIMIT_REQUEST_LINE: 0
|
|
SERVER_LIMIT_REQUEST_FIELD_SIZE: 0
|
|
|
|
configOverrides:
|
|
sql_query_settings: |
|
|
SQL_MAX_ROW = 1000000
|
|
SQLLAB_CTAS_NO_LIMIT = True
|
|
FEATURE_FLAGS = {"ALLOW_FULL_CSV_EXPORT": True, "DRUID_JOINS": True, "ALERT_REPORTS": True, "ALLOW_ADHOC_SUBQUERY": True, "DASHBOARD_VIRTUALIZATION": True, "DYNAMIC_PLUGINS": True, "DRILL_TO_DETAIL": True, "DRILL_BY": True, "ENABLE_TEMPLATE_PROCESSING": True, "DASHBOARD_NATIVE_FILTERS": True, "DASHBOARD_CROSS_FILTERS": True, "EMBEDDED_SUPERSET": True, "DASHBOARD_RBAC": False}
|
|
metatda_db_settings:
|
|
SQLALCHEMY_DATABASE_URI = f"mysql+mysqldb://{env('DB_USER')}:{env('DB_PASS')}@{env('DB_HOST')}:{env('DB_PORT')}/{env('DB_NAME')}"
|
|
superset_config.py: |
|
|
import logging
|
|
import os
|
|
from datetime import timedelta
|
|
from typing import Optional
|
|
from cachelib.file import FileSystemCache
|
|
from celery.schedules import crontab
|
|
|
|
REDIS_HOST = os.environ.get("REDIS_HOST"),
|
|
REDIS_PORT = "6379"
|
|
REDIS_CELERY_DB = "0"
|
|
REDIS_RESULTS_DB = "1"
|
|
|
|
CACHE_CONFIG = {
|
|
"CACHE_TYPE": "RedisCache",
|
|
"CACHE_DEFAULT_TIMEOUT": 86400,
|
|
"CACHE_KEY_PREFIX": "superset_",
|
|
"CACHE_REDIS_HOST": REDIS_HOST,
|
|
"CACHE_REDIS_PORT": REDIS_PORT,
|
|
"CACHE_REDIS_DB": REDIS_RESULTS_DB,
|
|
}
|
|
DATA_CACHE_CONFIG = CACHE_CONFIG
|
|
|
|
class CeleryConfig:
|
|
broker_url = "redis://superset-infra-admin-prd-redis-master.prd-superset-infra.svc.cluster.local:6379/0"
|
|
imports = ('superset.sql_lab', "superset.tasks", "superset.tasks.thumbnails",)
|
|
result_backend = "redis://superset-infra-admin-prd-redis-master.prd-superset-infra.svc.cluster.local:6379/1"
|
|
CELERYD_LOG_LEVEL = "DEBUG"
|
|
worker_prefetch_multiplier = 10
|
|
task_acks_late = True
|
|
task_annotations = {
|
|
'sql_lab.get_sql_results': {
|
|
'rate_limit': '100/s',
|
|
},
|
|
'email_reports.send': {
|
|
'rate_limit': '1/s',
|
|
'time_limit': 600,
|
|
'soft_time_limit': 600,
|
|
'ignore_result': True,
|
|
},
|
|
}
|
|
|
|
CELERY_CONFIG = CeleryConfig
|
|
|
|
extend_timeout: |
|
|
# Extend timeout to allow long running queries.
|
|
SQLLAB_TIMEOUT = 300
|
|
SQLLAB_ASYNC_TIME_LIMIT_SEC = 900
|
|
SUPERSET_WEBSERVER_TIMEOUT = 300
|
|
enable_oauth: |
|
|
import os
|
|
from flask_appbuilder.security.manager import AUTH_OID, AUTH_REMOTE_USER, AUTH_DB, AUTH_LDAP, AUTH_OAUTH
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
ENABLE_PROXY_FIX = True
|
|
AUTH_TYPE = AUTH_OAUTH
|
|
PREFERRED_URL_SCHEME = "https"
|
|
OAUTH_HOME_DOMAIN = "meesho.com"
|
|
CSRF_ENABLED = True
|
|
OAUTH_PROVIDERS = [
|
|
{
|
|
"name": "google",
|
|
"whitelist": [ "@meesho.com" ],
|
|
"icon": "fa-google",
|
|
"token_key": "access_token",
|
|
"remote_app": {
|
|
"client_id": os.environ.get("GOOGLE_KEY"),
|
|
"client_secret": os.environ.get("GOOGLE_SECRET"),
|
|
"api_base_url": "https://www.googleapis.com/oauth2/v2/",
|
|
"client_kwargs": {"scope": "email profile"},
|
|
"request_token_url": None,
|
|
"access_token_url": "https://accounts.google.com/o/oauth2/token",
|
|
"authorize_url": "https://accounts.google.com/o/oauth2/auth",
|
|
"authorize_params": {"hd": "meesho.com"}
|
|
}
|
|
}
|
|
]
|
|
# Map Authlib roles to superset roles
|
|
AUTH_ROLE_ADMIN = 'Admin'
|
|
AUTH_ROLE_PUBLIC = 'Public'
|
|
# Will allow user self registration, allowing to create Flask users from Authorized User
|
|
AUTH_USER_REGISTRATION = True
|
|
# The default user self registration role
|
|
AUTH_USER_REGISTRATION_ROLE = "read_user_basic"
|
|
cors: |
|
|
ENABLE_CORS = True
|
|
CORS_OPTIONS = {
|
|
'supports_credentials': True,
|
|
'allow_headers': [
|
|
'*',
|
|
],
|
|
'resources': [
|
|
'*'
|
|
],
|
|
'origins': ['*'],
|
|
}
|
|
WTF_CSRF_ENABLED = False
|
|
TALISMAN_ENABLED = False
|
|
ENABLE_PROXY_FIX = True
|
|
extend_timeout: |
|
|
SUPERSET_WEBSERVER_TIMEOUT = 300
|
|
secret: |
|
|
SECRET_KEY = os.getenv("SECRET_KEY")
|
|
|
|
ingress:
|
|
enabled: true
|
|
ingressClassName: nginx-external
|
|
annotations:
|
|
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
|
|
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
|
nginx.ingress.kubernetes.io/rewrite-target: /
|
|
nginx.ingress.kubernetes.io/proxy-connect-timeout: "300"
|
|
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
|
|
nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
|
|
path: /
|
|
pathType: Prefix
|
|
hosts:
|
|
- superset-infra-prd.meeshogcp.in
|
|
|
|
labels:
|
|
priority: p1
|
|
env: prd
|
|
team: devops
|
|
bu: infra
|
|
service: superset-infra
|
|
|
|
resources:
|
|
limits:
|
|
cpu: 1000m
|
|
memory: 1000Mi
|
|
requests:
|
|
cpu: 1000m
|
|
memory: 1000Mi
|
|
|
|
supersetNode:
|
|
replicas:
|
|
replicaCount: 2
|
|
connections:
|
|
redis_host: 'superset-infra-admin-prd-redis-master.prd-superset-infra.svc.cluster.local'
|
|
redis_port: "6379"
|
|
|
|
affinity: {}
|
|
resources:
|
|
limits:
|
|
cpu: 3
|
|
memory: 8000Mi
|
|
requests:
|
|
cpu: 2000m
|
|
memory: 4000Mi
|
|
|
|
supersetWorker:
|
|
replicas:
|
|
replicaCount: 2
|
|
resources:
|
|
limits:
|
|
cpu: 2000m
|
|
memory: 6000Mi
|
|
requests:
|
|
cpu: 1000m
|
|
memory: 3000Mi
|
|
|
|
init:
|
|
enabled: true
|
|
loadExamples: false
|
|
createAdmin: true
|
|
adminUser:
|
|
username: admin
|
|
firstname: Superset
|
|
lastname: Admin
|
|
email: devops@meesho.com
|
|
password: superset
|
|
|
|
celery:
|
|
enabled: true
|
|
broker_url: 'redis://superset-infra-admin-prd-redis-master.prd-superset-infra.svc.cluster.local:6379/0'
|
|
result_backend: 'redis://superset-infra-admin-prd-redis-master.prd-superset-infra.svc.cluster.local:6379/1'
|
|
worker:
|
|
replicas: 1 # Number of Celery workers
|
|
resources:
|
|
limits:
|
|
cpu: 500m
|
|
memory: 2000Mi
|
|
requests:
|
|
cpu: 100m
|
|
memory: 1000Mi
|
|
|
|
|
|
postgresql:
|
|
enabled: false
|
|
|
|
redis:
|
|
enabled: true
|
|
image:
|
|
registry: asia-southeast1-docker.pkg.dev
|
|
repository: meesho-devops-admin-0622/admin/devops/bitnami/redis
|
|
tag: "7.0.10-debian-11-r4"
|
|
pullPolicy: IfNotPresent
|
|
architecture: standalone
|
|
auth:
|
|
enabled: false
|
|
master:
|
|
resources:
|
|
limits:
|
|
cpu: 2
|
|
memory: 8000Mi
|
|
requests:
|
|
cpu: 1
|
|
memory: 4000Mi
|
|
|
|
tolerations:
|
|
- key: dedicated
|
|
operator: "Equal"
|
|
value: devops
|
|
effect: "NoSchedule"
|