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

Refactor level-2 branch to use remote db #13

Open
wants to merge 6 commits into
base: level2
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.git/
.gitignore
Dockerfile
docker-compose.yml
__pycache__/
Expand All @@ -8,4 +9,7 @@ data-raw/
data-clean/
venv/
todo
.DS_Store
.DS_Store
.env
data-private/
data-public/
17 changes: 4 additions & 13 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Mode (level 1 or 2)
MODE=1
MODE=2

# The database URL
# ----------------
#
# This is the postgres instance the parsed cases will
# load data into.
#
# If you use the Dockerfile you don't need to change this.
# If you use the Dockerfile you don't need to change this. Otherwise make this the remote

DATABASE_URL=postgres://postgres:oca@db/oca
DATABASE_URL=


# Amazon Web Services (AWS) configuration
Expand All @@ -32,13 +32,4 @@ AWS_S3_BUCKET_NAME=
SFTP_HOST=
SFTP_USER=
SFTP_PSWD=
SFTP_DIR=

# The RDS- remove database URL
# ----------------
#
# This is the postgres instance that others can connect to
#
# Leave blank if you do NOT want to clone the data over to RDS

CLONED_DATABASE_URL=
SFTP_DIR=
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ RUN apt-get install -y \
# Check the latest version here https://www.nyc.gov/site/planning/data-maps/open-data/dwn-gdelx.page
ENV RELEASE=23d
ENV MAJOR=23
ENV MINOR=3
ENV MINOR=4
ENV PATCH=0
WORKDIR /geosupport

RUN pip install python-geosupport; \
FILE_NAME=linux_geo${RELEASE}_${MAJOR}_${MINOR}.zip; \
FILE_NAME=linux_geo${RELEASE}_${MAJOR}.${MINOR}.zip; \
echo ${FILE_NAME}; \
curl -O https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/$FILE_NAME; \
unzip *.zip; \
Expand Down
41 changes: 1 addition & 40 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,4 @@ services:
dockerfile: Dockerfile
user: 'root'
volumes:
- .:/app
depends_on:
db:
condition: service_healthy
links:
- db
db:
image: postgres:15.3-alpine
environment:
- POSTGRES_DB=oca
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=oca
ports:
- 5432:5432
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
timeout: 5s
interval: 1s
retries: 20
command:
# See https://osm2pgsql.org/doc/manual.html#tuning-the-postgresql-server
- "postgres"
- "-c"
- "shared_buffers=256MB"
- "-c"
- "work_mem=25MB"
- "-c"
- "maintenance_work_mem=128MB"
- "-c"
- "wal_level=minimal"
- "-c"
- "max_wal_size=4GB"
- "-c"
- "checkpoint_completion_target=0.9"
- "-c"
- "max_wal_senders=0"
- "-c"
- "random_page_cost=1.0"
- "-c"
- "checkpoint_timeout=30min"
- .:/app
Loading