justfile will download, create, and populate db with AACT data

llm-extraction v0.1.0
youainti 3 years ago
parent 91eeea100e
commit b82dea3bce

@ -0,0 +1 @@
This is what is needed to setup the database.

@ -0,0 +1 @@
Most of these are related to potentially parsing orangebook data from the pdfs.

@ -0,0 +1 @@
I believe this is for a ml classification or reasons for terminations.

@ -13,6 +13,16 @@ data_filepath := data_path / data_file
#must match the 'container name: aact_db' in the docker-compose.yaml #must match the 'container name: aact_db' in the docker-compose.yaml
docker_container := `docker container ls -a | grep aact_db | cut -f 1 -d " " | tr "\n" " "` docker_container := `docker container ls -a | grep aact_db | cut -f 1 -d " " | tr "\n" " "`
#Various paths for docker stuff
dockerdef_path := "./AACT_downloader/ClinicalTrialHistory"
dockerdef_dockerfile := dockerdef_path / "Dockerfile"
dockerdef_schema_path := dockerdef_path / "docker-entrypoint-initdb.d"
dockerdef_schema_http := dockerdef_schema_path / "020_HttpSchema.sql"
dockerdef_schema_hist:= dockerdef_schema_path / "030_HistoricalSchema.sql"
dockerdef_schema_AViews := dockerdef_schema_path / "090_AnalysisViews.sql"
docker-compose_path := "./AACT_downloader/docker-compose.yaml"
#check for necessary dependencies #check for necessary dependencies
check-status: check-status:
docker --version docker --version
@ -23,23 +33,29 @@ check-status:
#Setup the AACT container #Setup the AACT container
setup-containers: setup-containers:
@echo "Check for downloaded data" @echo "Check for downloaded data"
[ -f ./AACT_downloader/aact_downloads/{{data_file}} ] [ -s {{data_path}}/postgres_data.dmp ]
@echo "Setting up AACT container"
@echo "Checking for key files"
#check appropriate files and directories are setup #check appropriate files and directories are setup
[ -s {{dockerdef_schema_http}} ]
[ -s {{dockerdef_schema_hist}} ]
[ -s {{dockerdef_schema_AViews}} ]
#run docker compose #run docker compose
@echo "Setting up AACT container"
docker-compose -f {{docker-compose_path}} up -d
#Stop the appropriate docker container #Stop the appropriate docker container
stop-containers: stop-containers:
#stop all docker containers if they are currently running. #stop all docker containers if they are currently running.
#The if statement is used because sometimes there are no running containers #The if statement is used because sometimes there are no running containers
if [ "{{docker_container}}" ]; then docker stop {{docker_container}}; fi if [ -n "{{docker_container}}" ]; then docker stop {{docker_container}}; fi
@echo "confirmed that docker containers {{docker_container}} are stopped" @echo "confirmed that docker containers {{docker_container}} are stopped"
#Remove the appropriate docker container as well as associated volumes #Remove the appropriate docker container as well as associated volumes
clean-docker: stop-containers clean-docker: stop-containers
# remove docker containers # remove docker containers
if [ "{{docker_container}}" ]; then docker rm {{docker_container}}; fi if [ -n "{{docker_container}}" ]; then docker rm {{docker_container}}; fi
# cleanup docker network # cleanup docker network
docker network prune docker network prune
# cleanup docker volumes # cleanup docker volumes

Loading…
Cancel
Save