You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ClinicalTrialsDataProcessing/justfile

71 lines
2.5 KiB
Plaintext

#justfile, used for automating build/setup
# TODO
# - setup a .env file so things can be shared between just and docker
# - move network name to .env
# - move postgress login credentials (allow them to be printed from just while setting up)
data_link := "https://ctti-aact.nyc3.digitaloceanspaces.com/27grtsnhtccplxapj2o8ak9aotvv"
data_file := "2022-12-23_postgres_data.zip"
data_path := "./AACT_downloader/aact_downloads"
data_filepath := data_path / data_file
#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" " "`
#check for necessary dependencies
check-status:
docker --version
python --version
curl --version
echo "current docker containers:{{docker_container}}"
#Setup the AACT container
setup-containers:
@echo "Check for downloaded data"
[ -f ./AACT_downloader/aact_downloads/{{data_file}} ]
@echo "Setting up AACT container"
#check appropriate files and directories are setup
#run docker compose
#Stop the appropriate docker container
stop-containers:
#stop all docker containers if they are currently running.
#The if statement is used because sometimes there are no running containers
if [ "{{docker_container}}" ]; then docker stop {{docker_container}}; fi
@echo "confirmed that docker containers {{docker_container}} are stopped"
#Remove the appropriate docker container as well as associated volumes
clean-docker: stop-containers
# remove docker containers
if [ "{{docker_container}}" ]; then docker rm {{docker_container}}; fi
# cleanup docker network
docker network prune
# cleanup docker volumes
docker volume prune
#sets up the docker network
setup-docker-network:
docker network create pharmaceutical_research
#Download the AACT data
download-aact-data:
curl {{data_link}} > ./AACT_downloader/aact_downloads/{{data_file}}
unzip {{data_filepath}} -d {{data_path}}
rm {{data_filepath}}
#Download and parse historical clinical trials data
download-parse-historical-ct:
echo "not implemented"
#Build everything from scratch
build-from-scratch: check-status download-aact-data setup-containers download-parse-historical-ct
echo "system will be built from scratch, including downloading data"
#build based on previously downloaded data
build-from-download: check-status setup-containers download-parse-historical-ct
echo "system will be built from downloading data"