arrow-left

All pages
gitbookPowered by GitBook
1 of 3

Loading...

Loading...

Loading...

Local Development

hashtag
Accessing the Service

Superset - http://127.0.0.1:8089/arrow-up-right

hashtag
Using the superset_config.py file

The Superset package is configured to contain a superset_config.py file, which Superset looks for, and subsequently activates the contained feature flags. For more information on the allowed feature flags, visit .

hashtag
Importing & Exporting Assets

The config importer written in JS will import the file superset-export.zip that exists in the folder <path to project packages>/dashboard-visualiser-superset/importer/config. The assets that will be imported to Superset are the following:

  • The link to the Clickhouse database

  • The dataset saved from Clickhouse DB

  • The dashboards

If you made any changes to these objects please don't forget to export and save the file as superset-export.zip under the folder specified above. NB! It is not possible to export all these objects from the Superset UI, you can check the Postman collection: CARES DISI CDR -> Superset export assets and you will find two requests. To do the export, three steps are required:

  1. Run the Get Token Superset request to get the token (please make sure that you are using the correct request URL). An example of a response from Superset that will be displayed: { "access_token": "eyJ0eXAiOiJKV1...." }

  2. Copy the access token and put it into the second request Export superset assets in the Authorization section.

Your changes should then be saved.

Dashboard Visualiser - Superset

Superset is a visualisation tool meant for querying data from a SQL-type database.

hashtag
Version upgrade process (with rollback capability)

By default if you simply update the image that the superset service uses to a later version, when the container is scheduled it will automatically run a database migration and the version of superset will be upgraded. The problem, however, is that if there is an issue with this newer version you cannot rollback the upgrade since the database migration that ran will cause the older version to throw an error and the container will no longer start. As such it is recommended to first create a postgres dump of the superset postgres database before attempting to upgrade superset's version.

  1. Exec into the postgres container as the root user (otherwise you will get write permission issues)

  1. Run the pg_dump command on the superset database. The database name is stored in SUPERSET_POSTGRESQL_DATABASE and defaults to superset

  1. Copy that dumpped sql script outside the container

  1. Update the superset version (either through a platform deploy or with a docker command on the server directly -- docker service update superset_dashboard-visualiser-superset --image apache/superset:tag)

hashtag
Rolling back upgrade

In the event that something goes wrong you'll need to rollback the database changes too, i.e.: run the superset_backup.sql script we created before upgrading the superset version

  1. Copy the superset_backup.sql script into the container

  1. Exec into the postgres container

  1. Run the sql script (where -d superset is the database name stored in SUPERSET_POSTGRESQL_DATABASE)

The charts
Run the second request Export superset assets . You can save the response into a file called superset-export.zip under the folder specified above.
https://github.com/apache/superset/blob/master/RESOURCES/FEATURE_FLAGS.mdarrow-up-right
docker exec -u root -it superset_postgres-metastore-1.container-id-here bash
pg_dump superset -c -U admin > superset_backup.sql
docker cp superset_postgres-metastore-1.container-id-here:/superset_backup.sql /path/to/save/to/superset_backup.sql
docker cp /path/to/save/to/superset_backup.sql superset_postgres-metastore-1.container-id-here:/superset_backup.sql 
docker exec -it superset_postgres-metastore-1.container-id-here bash
cat superset_backup.sql | psql -U admin -d superset

Environment Variables

Listed in this page are all environment variables needed to run Superset.

Variable Name
Type
Relevance
Required
Default

SUPERSET_USERNAME

String

Service username

No

admin

SUPERSET_FIRSTNAME

String

Admin account first name

No

SUPERSET

SUPERSET_LASTNAME

String

Admin account last name

No

ADMIN

SUPERSET_EMAIL

String

Admin account email address

No

admin@superset.com

SUPERSET_PASSWORD

String

Admin account password

No

admin

SUPERSET_API_USERNAME

String

Service username

No

admin

SUPERSET_API_PASSWORD

String

Service password

No

admin

SUPERSET_SSL

Boolean

SSL protocol requirement

No

False

CONFIG_FILE

String

Path to the dashboard import file

No

superset-export.zip