-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from wri/feature/dev-without-data-api
dont require local data api dependency for development
- Loading branch information
Showing
4 changed files
with
74 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# GFW Tile Service | ||
Raster and vector tile API for datasets in the [GFW Data API](https://github.com/wri/gfw-data-api) and Titiler dynamic tiling for raster assets in publicly accessible cloud storage. | ||
|
||
## Developing | ||
### Option 1: Developing against the Data API postgres database in one of the cloud environments (dev, staging or production): | ||
* Make sure you have ssh access to the bastion host of the aws account (contact a Data API Engineering team member to get help with this). | ||
|
||
* Open ssh tunnel connection to the database you'd like to connect to. For example, for the `staging` environment: | ||
|
||
```ssh -i ~/.ssh/id_rsa -N -L 5432:application-autoscaling-698c9c01-db99-4430-a97a-6baaae853dc6.cljrqsduwhdo.us-east-1.rds.amazonaws.com:5432 ec2-user@gfw-staging``` | ||
|
||
* Set the environment variables for the **read only** credentials of the above database. The environment variables are `GFW_DB_NAME`, `GFW_DB_USER_RO` and `GFW_DB_PASSWORD_RO`. These are also listed in the `docker-compose.dev.yml` file. | ||
|
||
* In `docker-compose.dev.yml`, set `DATA_LAKE_BUCKET` to the desired environment's bucket name. By default, the `staging` environment bucket (`gfw-data-lake-staging`) will be used. | ||
|
||
* In `docker-compose.dev.yml`, set `AWS_DEFAULT_PROFILE` to your aws profile in `~/.aws` that will grant your dev instance access to the aws resources including the data lake bucket above in the aws account of the interest (contact a Data API Engineering team member to get an account). | ||
|
||
* Run the start up script from the root directory: | ||
```./scripts/develop``` | ||
|
||
### Option 2: Developing against a local instance of Data API database | ||
|
||
* Start dev instance of Data API locally using the instructions [here](https://github.com/wri/gfw-data-api?tab=readme-ov-file#run-locally-with-docker) | ||
|
||
* Run the start up script from the root directory with the option to point to the local Data API: | ||
```./scripts/develop --local_data_api``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: "3.5" | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
args: | ||
- ENV=dev | ||
container_name: tile-cache_dev | ||
restart: on-failure | ||
volumes: | ||
- $HOME/.aws:/root/.aws:ro | ||
- ./app:/app/app | ||
networks: | ||
- gfw-data-api | ||
environment: | ||
- DB_HOST_RO=database_12 | ||
- DATABASE_RO=geostore | ||
- DB_USER_RO=gfw_readonly | ||
- DB_PASSWORD_RO=readonly # pragma: allowlist secret | ||
- DB_PORT_RO=5432 | ||
- AWS_DEFAULT_PROFILE=gfw-dev | ||
- LOG_LEVEL=debug | ||
- RASTER_TILER_LAMBDA_NAME=test | ||
- ENV=dev | ||
- PLANET_API_KEY | ||
ports: | ||
- 8088:80 | ||
entrypoint: wait_for_postgres.sh /start-reload.sh | ||
|
||
networks: | ||
gfw-data-api: | ||
name: gfw-data-api_dev_default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters