Open sethstoudenmier opened 1 month ago
@sethstoudenmier What do you think about adding an init.sql
script to run some common SQL commands when setting up the DB for the first time, since we're updating the docs? There are some common issues and their solutions don't seem to be documented publicly.
ALTER USER usaspending SET SEARCH_PATH TO "public", "raw", "int", "temp", "rpt";
public
schema not being found.etl_user
readonly
user
@sethstoudenmier What do you think about adding an
init.sql
script to run some common SQL commands when setting up the DB for the first time, since we're updating the docs? There are some common issues and their solutions don't seem to be documented publicly.
ALTER USER usaspending SET SEARCH_PATH TO "public", "raw", "int", "temp", "rpt";
- This prevents a common error about tables outside of the
public
schema not being found.Create the
etl_user
- This user is needed for migrations to run.
Create the
readonly
user
- This user is needed for migrations to run
Funny you should say that, I actually had that in place originally. The problem is that it conflicts with the Travis CI/CD build process when we use the --reuse-db
flag because it attempts to create users that already exist. Instead I opted to document that in the README.
Ahh.. that makes sense with the CI/CD process. I missed the changes to the README, because it was collapsed. I'm happy with those steps being documented!
Description: Update the README and other aspects of the
usaspending-api
codebase to support local development.Technical details: Below is a brief list of changes going file by file in order to give a high-level reasoning of "why".
.env.template
.gitignore
docker-compose.yaml
to use more relative pathsDockerfile
es_configure
job relies oncurl
to query the ES indexescurl
theelasticsearch_indexer
job fails to create the templates for the ES indexes and thus creates many mis-typed fields on the indexesDockerfile.spark
Dockerfile
to change the base image usedDockerfile.testing
Dockerfile.spark
/usaspending-api
instead of/dockermount
docker-compose
to instead usedocker compose
(read more here)README.md
docker-compose.yaml
version
as that is deprecated$PWD
in windows and also more WSL friendlyusaspending-test
volume to be/usaspending-api
in the container to support hot reload when testingusaspending_api/search/tests/integration/test_spending_by_category_categories.py
Requirements for PR merge:
Area for explaining above N/A when needed: