WormBase / caltech-curation-services

Modular curation services for Caltech WormBase data
1 stars 0 forks source link

Mount shared volume in postgres #35

Closed valearna closed 1 year ago

valearna commented 1 year ago

From email thread with @azurebrd:

There's a script (in repo) /home/azurebrd/git/caltech-curation-services/curation/scripts/pgpopulation/obo_oa_ontologies/nightly_geneace.pl

That gets called by another script from a cronjob (inside docker) /usr/lib/scripts/pgpopulation/obo_oa_ontologies/nightly_geneace.pl

And it's properly creating .pg files inside docker at /usr/caltech_curation_files/cronjobs/obo_oa_ontologies/geneace/

like obo_name_laboratory.pg

But then it fails to find the file when trying COPY obo_name_laboratory FROM '/usr/caltech_curation_files/cronjobs/obo_oa_ontologies/geneace/obo_name_laboratory.pg';

giving DBD::Pg::db do failed: ERROR: could not open file "/usr/caltech_curation_files/cronjobs/obo_oa_ontologies/geneace/obo_name_laboratory.pg" for reading: No such file or directory

Is the postgres command expecting to read the file from outside docker ?

This is something we'll need to figure out before switching over, but it's not really urgent right now.

valearna commented 1 year ago

Added volume to the db container. Can you check if this is working @azurebrd ?

azurebrd commented 1 year ago

Yes, I'll check it, thanks @valearna

azurebrd commented 1 year ago

Rebuilt with docker stop caltech-curation-services-main_db_1
docker rm caltech-curation-services-main_db_1
docker-compose up --build -d db

Then reloaded postgres with psql -h localhost -e caltech_curation -U postgres < testdb.dump.20230215

but roles didn't exist.

And script still not able to find files inside docker COPY obo_syn_laboratory FROM '/usr/caltech_curation_files/cronjobs/obo_oa_ontologies/geneace/obo_syn_laboratory.pg'; DBD::Pg::db do failed: ERROR: could not open file "/usr/caltech_curation_files/cronjobs/obo_oa_ontologies/geneace/obo_syn_laboratory.pg" for reading: No such file or directory

azurebrd commented 1 year ago

The issue was that my .env file had COMPOSE_PROJECT_NAME=caltech-curation-services-main set to COMPOSE_PROJECT_NAME=caltech-curation-services-juancarlos which was creating a new container that didn't connect to the volume that had the postgres data

azurebrd commented 1 year ago

Now working