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

Add mapbox api key #96

Merged
merged 2 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .startup/env_var_defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions .startup/make_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Binary file modified docs/assets/imgs/superset/deckgl_polygon_chart_demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 18 additions & 3 deletions docs/setup/getting_started.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.<the rest of the API token you created>`

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,
Expand Down
3 changes: 0 additions & 3 deletions docs/setup/superset_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%" }

<!-- ![Select the PostgreSQL database driver](/assets/imgs/superset/connecting_a_db_step_3_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**.

<figure markdown>
Expand Down
6 changes: 6 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down