-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate_figures.sh
executable file
·25 lines (23 loc) · 1.7 KB
/
generate_figures.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if ! command -v docker-compose &> /dev/null
then
echo "docker-compose could not be found. This script relies on the original docker-compose rather than docker compose."
echo "docker-compose can be installed as follows:"
echo "sudo curl -L \"https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose"
echo "sudo chmod +x /usr/local/bin/docker-compose"
exit
fi
if test -f ".docker" ; then
printf "One time Docker image download has already been completed, skipping.\n"
else
printf "Downloading pre-build Docker images from Zenodo. This download is ~150MB and may take a while.\n"
printf "You may instead build the Docker image locally using ./build_docker.sh, which may be much faster.\n"
curl https://zenodo.org/record/7627337/files/lidar_tests_study_figs.docker.tar.gz?download=1 | docker load && \
touch .docker
fi
printf "Setting up Docker container\n"
docker-compose up --build -d
printf "Checking if study data has been downloaded\n"
docker-compose exec figs bash -c "mkdir /root/study_data 2>/dev/null"
docker-compose exec figs bash -c "test -f \"/root/study_data/.keep\" && printf \"Files already downloaded\n\" || ( wget -O /root/study_data.tar.xz https://zenodo.org/record/7569212/files/study_data_compressed.tar.xz?download=1 && printf \"Extracting study data to ./study_data, this may take a moment\n\" && tar -xf /root/study_data.tar.xz -C /root/study_data --strip-components=1 --checkpoint=.4000 && rm /root/study_data.tar.xz && touch /root/study_data/.keep )"
printf "\nGenerating figures and printing tables to console\n"
docker-compose exec figs bash -c "cd /root/&& python3 figure_generator.py -full_data /root/study_data"