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

Synth data migrator #4976

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4e91546
Migrate arbitrary amounts of synth data
greenape Mar 14, 2022
d82c94a
Wrong path
greenape Mar 14, 2022
f68010b
No structlog
greenape Mar 14, 2022
5bf32f0
No threadlocal
greenape Mar 14, 2022
11a0629
Silly logging
greenape Mar 14, 2022
665436d
Update migrate_synth_data.py
greenape Mar 14, 2022
d52fee8
Run for synth data as well
greenape Mar 14, 2022
4d31f10
Update migrate_synth_data.py
greenape Mar 14, 2022
5ddd25e
Update migrate_synth_data.py
greenape Mar 14, 2022
e8cddf9
Update migrate_synth_data.py
greenape Mar 14, 2022
f844b44
Fix partitions and logging
greenape Mar 14, 2022
bf4592c
Deal with missing gambia
greenape Mar 14, 2022
3e6e79e
Lint
greenape Mar 14, 2022
9c0f345
Longer timeout, fix number of days
greenape Mar 14, 2022
87368d9
Migrate arbitrary amounts of synth data
greenape Mar 14, 2022
85e8ff0
Wrong path
greenape Mar 14, 2022
4c5f026
No structlog
greenape Mar 14, 2022
f0ce2eb
No threadlocal
greenape Mar 14, 2022
eea308a
Silly logging
greenape Mar 14, 2022
553b682
Update migrate_synth_data.py
greenape Mar 14, 2022
5bcd20d
Run for synth data as well
greenape Mar 14, 2022
863821a
Update migrate_synth_data.py
greenape Mar 14, 2022
cb3033f
Update migrate_synth_data.py
greenape Mar 14, 2022
5af9837
Update migrate_synth_data.py
greenape Mar 14, 2022
912fd2f
Fix partitions and logging
greenape Mar 14, 2022
7ee97a5
Deal with missing gambia
greenape Mar 14, 2022
519c561
Lint
greenape Mar 14, 2022
3da74f4
Longer timeout, fix number of days
greenape Mar 14, 2022
b2ad188
Use pipenv python
greenape Jun 14, 2023
81fbaf8
Merge branch 'synth-data-migrator' of https://github.com/Flowminder/F…
Thingus Jun 14, 2023
37d3bcf
Dropping events schema, bringing up to date with master
Thingus Jun 14, 2023
b748822
skip synth dfs events because they use the events tables
greenape Jun 14, 2023
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
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defaults:
- &wait_for_flowdb
name: Wait for flowdb to start
command: |
dockerize -wait tcp://localhost:5432 -timeout 10m
dockerize -wait tcp://localhost:5432 -timeout 20m
- &run_always_org_context
context: org-global
filters:
Expand Down Expand Up @@ -818,6 +818,7 @@ jobs:
name: python_with_flowdb
flowdb_image: "testdata"
python_version: "3.8.5"
num_days: 7 # To avoid overriding fixed number of days
working_directory: /home/circleci/project/integration_tests
steps:
- checkout:
Expand Down
15 changes: 15 additions & 0 deletions flowdb/testdata/bin/9910_migrate_test_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.



set -e
export PGUSER="$POSTGRES_USER"

#
# Migrate synthetic data.
#

pipenv run python /docker-entrypoint-initdb.d/migrate_synth_data.py
389 changes: 0 additions & 389 deletions flowdb/testdata/bin/9910_migrate_test_data.sql

This file was deleted.

This file was deleted.

405 changes: 405 additions & 0 deletions flowdb/testdata/bin/migrate_synth_data.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions flowdb_synthetic_data.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ RUN mkdir -p /docker-entrypoint-initdb.d/sql/syntheticdata/ && \

COPY --chown=postgres flowdb/testdata/bin/9900_ingest_synthetic_data.sh /docker-entrypoint-initdb.d/
COPY --chown=postgres flowdb/testdata/bin/9800_population_density.sql.gz /docker-entrypoint-initdb.d/
COPY --chown=postgres flowdb/testdata/bin/9910_migrate_test_data.sh /docker-entrypoint-initdb.d/
COPY --chown=postgres flowdb/testdata/bin/migrate_synth_data.py /docker-entrypoint-initdb.d/
COPY --chown=postgres flowdb/testdata/bin/9910_run_synthetic_dfs_data_generation_script.sh /docker-entrypoint-initdb.d/
COPY --chown=postgres flowdb/testdata/test_data/py/* /docker-entrypoint-initdb.d/py/testdata/

Expand Down
2 changes: 2 additions & 0 deletions flowdb_synthetic_data.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
!flowdb/testdata/bin/9900_ingest_synthetic_data.sh
!flowdb/testdata/bin/9800_population_density.sql.gz
!flowdb/testdata/bin/generate_synthetic_data*.py
!flowdb/testdata/bin/9910_migrate_test_data.sh
!flowdb/testdata/bin/migrate_synth_data.py
!flowdb/testdata/test_data/sql/admin*.sql
!flowdb/testdata/synthetic_data/data/NPL_admbnda_adm3_Districts_simplified.geojson
!flowdb/testdata/synthetic_data/Pipfile*
Expand Down
3 changes: 2 additions & 1 deletion flowdb_testdata.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
#
!flowdb/testdata/bin/9900_ingest_test_data.sh
!flowdb/testdata/bin/9910_run_synthetic_dfs_data_generation_script.sh
!flowdb/testdata/bin/9910_migrate_test_data.sql
!flowdb/testdata/bin/9910_migrate_test_data.sh
!flowdb/testdata/bin/migrate_synth_data.py
!flowdb/testdata/test_data/Pipfile
!flowdb/testdata/test_data/Pipfile.lock
!flowdb/testdata/test_data/sql/
Expand Down