From c32240778bbb1d74f5f05b698378623286d29ac8 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Fri, 20 Jan 2023 09:42:54 +0200 Subject: [PATCH] chore(thumbnails): change default executor --- docs/docs/installation/cache.mdx | 9 ++++++--- superset/config.py | 15 ++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/docs/installation/cache.mdx b/docs/docs/installation/cache.mdx index 58b4bcb2b0b74..15450bae046ad 100644 --- a/docs/docs/installation/cache.mdx +++ b/docs/docs/installation/cache.mdx @@ -87,13 +87,16 @@ FEATURE_FLAGS = { } ``` -By default thumbnails are rendered using the `THUMBNAIL_SELENIUM_USER` user account. To render thumbnails as the -logged in user (e.g. in environments that are using user impersonation), use the following configuration: +By default thumbnails are rendered per user. To render thumbnails as a fixed user (`admin` in this example), use the following configuration: ```python -THUMBNAIL_EXECUTE_AS = [ExecutorType.CURRENT_USER] +from superset.tasks.types import ExecutorType + +THUMBNAIL_SELENIUM_USER = "admin" +THUMBNAIL_EXECUTE_AS = [ExecutorType.SELENIUM] ``` + For this feature you will need a cache system and celery workers. All thumbnails are stored on cache and are processed asynchronously by the workers. diff --git a/superset/config.py b/superset/config.py index 42dbeda852dd9..4e5ebf2791c98 100644 --- a/superset/config.py +++ b/superset/config.py @@ -611,16 +611,13 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]: # --------------------------------------------------- # Thumbnail config (behind feature flag) # --------------------------------------------------- -# When executing Alerts & Reports or Thumbnails as the Selenium user, this defines -# the username of the account used to render the queries and dashboards/charts +# By default, thumbnails are rendered per user. Similar to Alerts & Reports, thumbnails +# can be configured to be rendered as a fixed user. See +# `superset.tasks.types.ExecutorType` for a full list of executor options. +# To use a fixed user account, use the following configuration: +# THUMBNAIL_EXECUTE_AS = [ExecutorType.SELENIUM] THUMBNAIL_SELENIUM_USER: Optional[str] = "admin" - -# To be able to have different thumbnails for different users, use these configs to -# define which user to execute the thumbnails and potentially custom functions for -# calculating thumbnail digests. To have unique thumbnails for all users, use the -# following config: -# THUMBNAIL_EXECUTE_AS = [ExecutorType.CURRENT_USER] -THUMBNAIL_EXECUTE_AS = [ExecutorType.SELENIUM] +THUMBNAIL_EXECUTE_AS = [ExecutorType.CURRENT_USER] # By default, thumbnail digests are calculated based on various parameters in the # chart/dashboard metadata, and in the case of user-specific thumbnails, the