Skip to content

Commit

Permalink
chore(thumbnails): change default executor
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Jan 20, 2023
1 parent 1fe4a71 commit c322407
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
9 changes: 6 additions & 3 deletions docs/docs/installation/cache.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
15 changes: 6 additions & 9 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c322407

Please sign in to comment.