diff --git a/.startup/env_var_defaults.json b/.startup/env_var_defaults.json index ed131d0..e3867cf 100644 --- a/.startup/env_var_defaults.json +++ b/.startup/env_var_defaults.json @@ -267,7 +267,7 @@ "invalid_substrings": "[\\s]", "dependant_on_other_env_vars": false }, - ".env::SQLALCHEMY_DATABASE_URI": { + ".env.superset::SQLALCHEMY_DATABASE_URI": { "file": ".env.superset", "name": "SQLALCHEMY_DATABASE_URI", "group": "Superset", diff --git a/.startup/make_env.py b/.startup/make_env.py index 98100c9..5e583b9 100644 --- a/.startup/make_env.py +++ b/.startup/make_env.py @@ -195,4 +195,10 @@ def create_dot_env_files(output_dir: Path, env_var_dict: Dict) -> None: "group": "Superset", "set_value": secret_key, } + env_var_dict[".env.superset::MAPBOX_API_KEY"] = { + "file": ".env.superset", + "name": "MAPBOX_API_KEY", + "group": "Superset", + "set_value": "", + } create_dot_env_files(output_dir=output_dir, env_var_dict=env_var_dict) diff --git a/docs/assets/imgs/superset/deckgl_polygon_chart_demo.png b/docs/assets/imgs/superset/deckgl_polygon_chart_demo.png index a8c43a0..c0852a3 100644 Binary files a/docs/assets/imgs/superset/deckgl_polygon_chart_demo.png and b/docs/assets/imgs/superset/deckgl_polygon_chart_demo.png differ diff --git a/docs/assets/imgs/superset/deckgl_polygon_chart_demo_no_basemap.png b/docs/assets/imgs/superset/deckgl_polygon_chart_demo_no_basemap.png new file mode 100644 index 0000000..a8c43a0 Binary files /dev/null and b/docs/assets/imgs/superset/deckgl_polygon_chart_demo_no_basemap.png differ diff --git a/docs/setup/getting_started.md b/docs/setup/getting_started.md index e5548e0..6265e17 100644 --- a/docs/setup/getting_started.md +++ b/docs/setup/getting_started.md @@ -1,11 +1,11 @@ -## System Setup +# System Setup Preprequisites: To use this system, Docker is the only absolutely necessary prerequisite. Having `GNU make` and core python on your host system will enable you to use included `makefile` recipes and scripts to streamline setup and common operations, but you could get by without them (although you'll have to figure more out). -### Setting up credentials +## Setting up credentials After cloning this project, `cd` into your local repo, run this `make` command and enter appropriate responses to the prompts. You may want to have a password generator open. ```bash @@ -14,7 +14,22 @@ make make_credentials The program will validate the values you enter, assemble them into some compound values (mostly connection strings), and output these configs into the dot-env files (`.env`, `.env.dwh`, and `.env.superset`) in the top-level repo directory. Review these files and make any changes before you initialize the system (i.e., when these username and password pairs are used to create roles in databases or Airflow starts using the Fernet key to encrypt passwords in connection strings). -### Initializing the system +### [Optional] Mapbox API Token for Geospatial Superset Maps + +To include a basemap underneath geospatial visualizations in Superset, you'll need to: + +1. [Create a free Mapbox account](https://account.mapbox.com/auth/signup), +2. Create a new API access token on your [Mapbox account page](https://account.mapbox.com/), and +3. Open your `.env.superset` dot-env file and paste that API access token in for the `MAPBOX_API_KEY` environment variable so that it looks like the example below. + + `MAPBOX_API_KEY=pk.` + +You can still make geospatial Superset charts without an API key, but your geospatial charts won't have a basemap (like the left example). + +![Without Mapbox API key](/assets/imgs/superset/deckgl_polygon_chart_demo_no_basemap.png){ style="width:46.25%" } +![With Mapbox API key](/assets/imgs/superset/deckgl_polygon_chart_demo.png){ style="width:51%" } + +## Initializing the system On the first startup of the system (and after setting your credentials), run the commands below to 1. build the platform's docker images, and initialize the airflow metadata database, diff --git a/docs/setup/superset_setup.md b/docs/setup/superset_setup.md index 67ccba1..169bcff 100644 --- a/docs/setup/superset_setup.md +++ b/docs/setup/superset_setup.md @@ -21,9 +21,6 @@ Select the PostgreSQL option and then enter the following credentials: ![Select the PostgreSQL database driver](/assets/imgs/superset/connecting_a_db_step_1_of_3.png){ style="width:49%" } ![Enter your credentials for the data warehouse database](/assets/imgs/superset/connecting_a_db_step_2_of_3.png){ style="width:49%" } - - - If credentials and configs were entered correctly (and the database container is running), superset will successfully connect to the database and you can save the connection by clicking **FINISH**.
diff --git a/makefile b/makefile index 222bb40..506fea7 100644 --- a/makefile +++ b/makefile @@ -28,6 +28,12 @@ make_credentials: | make_venv --project_dir=$(MAKEFILE_DIR_PATH) \ --mode=interactive +make_credentials_dev: | make_venv + source $(VENV_PATH)/bin/activate; \ + python $(STARTUP_DIR)make_env.py \ + --project_dir=$(MAKEFILE_DIR_PATH) \ + --mode=dev + build_images: docker compose build 2>&1 | tee logs/where_house_build_logs_$(run_time).txt