Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load dashboard on environment setup #112

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open

Conversation

aspedrosa
Copy link
Contributor

@aspedrosa aspedrosa commented Oct 8, 2020

We already have some dashboards setup on our deployment.
This PR creates a script to upload, these already setup dashboards, to a superset installation. This script uses commands provided by the superset python package to execute these uploads.

Changelog:

  1. Move materialized_queries_manager models to the achilles database.
  2. Use only one migrate command for the achillesdatabase.
  3. Create fixtures to insert initial data. The insertion of countries' initial data is made now through it, previously was made using a django-admin command.
  4. Create a command to generate materialized queries records as materialized views on Postgres, to be executed after loading the initial data.
  5. Static files of the dashboard app are now accessed by Nginx through a named volume instead of a bind volume.
  6. Superset docker-init.sh script now only applies the migrations and creates roles and permissions. The creation of the admin user was moved to another script which will run only one time.
  7. Created a separate script to load the already built dashboards (load-dashboards.sh).
  8. Added a SUPERSET_URL variable to .env-example so that before tabs initial_data fixture is loaded, the value of this variable is used to complete the URLs present there.

@aspedrosa
Copy link
Contributor Author

aspedrosa commented Oct 12, 2020

  • flask shell run a python shell with the running app's context

  • To insert new records:

from superset import db
db.session.add(model)

@aspedrosa aspedrosa changed the title [WIP] Load dashboard on environment setup Load dashboard on environment setup Oct 28, 2020
@aspedrosa aspedrosa mentioned this pull request Dec 20, 2021
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant