Before we can run the demo, we need to build the container. This documentation assumes that Docker has been installed for your environment.
Note that installing Docker on Windows machines requires Administrator privileges.
After installation, any user that is a member of the "docker-users" group can run Docker
Desktop.
-
Clone or download the repository
git clone https://github.com/biotaphy/tutorials.git
-
Change to the repository directory
cd tutorials
-
Run the bash script with a command and configuration file to:
- create the volumes
data
andoutput
(if they do not exist) - build the image
tutor
(if it does not exist) - start a container
tutor_container
with volumes attached and - run the chosen command with chosen configuration file
- compute output files in the
output
volume - copy output files to the host machine
./run_tutorial.sh wrangle_occurrences data/config/wrangle_species_list_gbif.json
- create the volumes
-
Run a bash shell in the container interactively to examine outputs
Mac / Linux:
docker run -it tutorials_backend bash root@f13e704738cf:/# ls -lahtr /volumes/output/ total 72K drwxr-xr-x 1 root root 4.0K May 25 15:41 .. -rw-r--r-- 1 root root 56K May 25 15:58 resolve_list_names.log -rw-r--r-- 1 root root 97 May 25 15:58 resolve_list_names.rpt -rw-r--r-- 1 root root 2.4K May 25 15:58 heuchera_accepted.txt drwxr-xr-x 2 root root 4.0K May 25 15:58 .
-
Check the output locally
ls -lahtr ./output astewart@murderbot:~/git/tutorials$ ls -lahtr ./output/ total 72K -rw-r--r-- 1 astewart astewart 97 May 25 10:58 resolve_list_names.rpt -rw-r--r-- 1 astewart astewart 56K May 25 10:58 resolve_list_names.log -rw-r--r-- 1 astewart astewart 2.4K May 25 10:58 heuchera_accepted.txt drwxr-xr-x 2 astewart astewart 4.0K May 25 10:58 . drwxrwxr-x 9 astewart astewart 4.0K May 25 12:48 ..
- Occurrence data download
- Occurrence data manipulation
- SDM
- PAM creation and analysis
- Phylogenetic diversity with Tree and PAM
- Biogeographic hypotheses and MCPA
- Hypothesis testing
- Scaling?
Create volumes outside of Dockerfiles and compose files
docker volume create data
docker volume create output
Build and name image:
docker build . -t tutor
Run, attaching volumes, with command and (container) path to config file:
CMD="wrangle_occurrences /volumes/data/input/clean_occurrences.json"
docker run -it --volume data:/volumes/data:ro --volume output:/volumes/output tutor $CMD
Run a bash shell in the container interactively to examine outputs
docker run -it tutorials_backend bash
root@f13e704738cf:/# ls -lahtr /volumes/output/
total 72K
drwxr-xr-x 1 root root 4.0K May 25 15:41 ..
-rw-r--r-- 1 root root 56K May 25 15:58 resolve_list_names.log
-rw-r--r-- 1 root root 97 May 25 15:58 resolve_list_names.rpt
-rw-r--r-- 1 root root 2.4K May 25 15:58 heuchera_accepted.txt
drwxr-xr-x 2 root root 4.0K May 25 15:58 .
To delete all containers, images, networks and volumes, stop any running containers:
docker container stop <container_name>
And run this command (which ignores running container):
docker system prune --all --volumes