|
35 | 35 | psql -h localhost -U postgres -d bety -c "CREATE EXTENSION postgis;" |
36 | 36 |
|
37 | 37 | - name: Sync with EBI |
38 | | - run: script/load.bety.sh -a "postgres" -p "-h localhost" -d "bety" -o bety -m 99 -r 0 -c -w https://ebi-forecast.igb.illinois.edu/pecan/dump/bety.tar.gz |
| 38 | + run: script/load.bety.sh -a "postgres" -p "-h localhost" -d "bety" -o bety -m 99 -r 0 -c -w http://www.betydb.org/dump/bety.tar.gz |
39 | 39 |
|
40 | 40 | - name: Sync with BU |
41 | 41 | run: script/load.bety.sh -a "postgres" -p "-h localhost" -d "bety" -o bety -m 99 -r 1 |
|
44 | 44 | run: script/load.bety.sh -a "postgres" -p "-h localhost" -d "bety" -o bety -m 99 -r 2 -w ftp://anon:anon@ftp.test.bnl.gov/outgoing/betydb/bety.tar.gz |
45 | 45 |
|
46 | 46 | - name: Sync with Wisconsin |
47 | | - run: script/load.bety.sh -a "postgres" -p "-h localhost" -d "bety" -o bety -m 99 -r 5 -w http://fen.aos.wisc.edu:6480/sync/dump/bety.tar.gz |
| 47 | + run: script/load.bety.sh -a "postgres" -p "-h localhost" -d "bety" -o bety -m 99 -r 5 -w http://tree.aos.wisc.edu:6480/sync/dump/bety.tar.gz |
48 | 48 |
|
49 | 49 | - name: Dump Database |
50 | 50 | run: | |
|
56 | 56 | cd initdb |
57 | 57 | docker build --tag image --file Dockerfile . |
58 | 58 |
|
| 59 | + - name: Build smaller dump for CI runs |
| 60 | + # update on scheduled runs, not every PR |
| 61 | + if: github.event.schedule != '' |
| 62 | + run: | |
| 63 | + # Nuke some large tables not used in testing |
| 64 | + # (to avoid foreign key constraints when deleting their child inputs) |
| 65 | + docker exec ${PG} psql -h localhost -U bety -c " |
| 66 | + TRUNCATE runs,likelihoods,benchmarks CASCADE" |
| 67 | + # Drop unneeded records from inputs table |
| 68 | + # (loop is because many are referenced only by descendent inputs |
| 69 | + # that are themselves deleted here.) |
| 70 | + while [ "$DEL_RES" != "DELETE 0" ]; do |
| 71 | + DEL_RES=$( |
| 72 | + docker exec ${PG} psql -h localhost -U bety -c " |
| 73 | + DELETE FROM inputs WHERE |
| 74 | + id NOT IN ( |
| 75 | + SELECT DISTINCT container_id FROM dbfiles |
| 76 | + WHERE container_type = 'Input' |
| 77 | + AND container_id IS NOT null) |
| 78 | + AND id NOT IN ( |
| 79 | + SELECT DISTINCT parent_id FROM inputs |
| 80 | + WHERE parent_id IS NOT null);" |
| 81 | + ) || break |
| 82 | + echo ${DEL_RES} |
| 83 | + done |
| 84 | + # CI tests don't need any records from the excluded tables, just schemas |
| 85 | + docker exec ${PG} pg_dump \ |
| 86 | + -h localhost -U bety \ |
| 87 | + --exclude-table-data='runs*' \ |
| 88 | + --exclude-table-data='inputs_runs*' \ |
| 89 | + --exclude-table-data='likelihoods*' \ |
| 90 | + --exclude-table-data='ensembles*' \ |
| 91 | + --exclude-table-data='posteriors_ensembles*' \ |
| 92 | + --exclude-table-data='benchmarks*' \ |
| 93 | + --exclude-table-data='reference_runs*' \ |
| 94 | + -F c \ |
| 95 | + bety > initdb/db.dump |
| 96 | + docker build --tag image_ci --file Dockerfile . |
| 97 | +
|
59 | 98 | - name: Login into registry |
60 | 99 | run: | |
61 | 100 | echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin |
|
75 | 114 | docker push pecan/db:$T |
76 | 115 | fi |
77 | 116 | done |
| 117 | + if [ -n "$(docker image ls -q image_ci)" ]; then |
| 118 | + docker tag image_ci $IMAGE_ID:ci |
| 119 | + docker push $IMAGE_ID:ci |
| 120 | + docker tag image_ci pecan/db:ci |
| 121 | + docker push pecan/db:ci |
| 122 | + fi |
0 commit comments