This repository serves as the hub for Docker related files to setup the backend for Species mapper.
./npsdocker.sh build
Windows Powershell: docker build ['folder where Dockerfile is]'
./npsdocker.sh run
./npsdocker.sh -u MB_USER MB_ACCESS_TOKEN run
./npsdocker.sh -u MB_USER MB_ACCESS_TOKEN -d run
./npsdocker.sh -u MB_USER MB_ACCESS_TOKEN -d -c run
Provided is a shell script that will generate the image for you. Clone this repository to the computer with docker, use the shell script provided, npsdocker.sh, to build an image.
./npsdocker.sh build
./npsdocker.sh freshBuild
Provided is a shell script that will run an instance of a built image for you. Clone this repository to the computer with docker, use the shell script provided, npsdocker.sh, to build an image. After uploading environmental data, one may then use the run command to launch an instance of the image and perform the necessary computations for maxent.
. <- Current Folder
├── Dockerfile # Dockerfile that sets up max-ent and backend
├── npsdocker.sh # Helper script to build and run a Docker Instance
└── mountdata # Default mounted volume, folder where data is uploaded and output is dumped
├── ENVIRONMENTS.zip # Uploaded ENVIRONMENTS.zip, a zip containing *no folders*, only .asc files
└── config.txt (optional) # An optional config.txt, to run maxent on select species
This is the default mounted volume (change this folder from default mountdata
if so desired with the -v
or --volume
flag). The Docker instance expects to find ENVIRONMENTS.zip
here, optionally there may be a config.txt here as well. Output from maxent and eden will be placed here if requested with the d
or --dump
flag.
This is the data that is fed to maxent. It is a zip of .asc
files, it should contain no folders or subfolders. When unzipped, it should be .asc
files only.
This is an optional configuration file. It is a text file, first naming the number of folds then listing names of species that will be ran through maxent. If no config file is specified, all species will be simulated.
Here is the format of config.txt
:
10 <- Number of folds, advised to keep it at 10
Catocala_ilia <- Scientific name of species with spaces replaced with underscore
Luzula_acuminata_variety
Ephemerella_invaria_group
Eutyphlus_similis
Xestia_normaniana
Lochmaeus_manteo
Acentrella_ampla
Calycanthus_floridus_v_glaucus
To avoid putting public access tokens in plain text, username and access token is passed to the run script. -u
stands for upload. Without this flag, it will not upload output to mapbox.
Example:
./npsdocker.sh -u pprovins sk.ThisIsAPrivateAccessToken run
pprovins
using the access token sk.ThisIsAPrivateAccessToken
To dump the outputs of the computations onto disk, use the -d
flag. The mounted volume, mountdata
, will contain the dump inside mountdata/output
.
Example:
./npsdocker.sh -d run
mountdata/output
./npsdocker.sh -u pprovins sk.ThisIsAPrivateAccessToken -d run
mountdata/output
If a full simulation is not necessary (only a few species are wanted to be updated), the -c
flag allows those species to be specified. If -c
is specified, there is expected to be a config.txt
to be found in mountdata
(see preliminary for such an example). Example:
./npsdocker.sh -c run
config.txt
in mountdata
./npsdocker.sh -d -c run
mountdata/output
of species specified by config.txt
in mountdata
./npsdocker.sh -u pprovins sk.ThisIsAPrivateAccessToken -c run
config.txt
in mountdata
./npsdocker.sh -u pprovins sk.ThisIsAPrivateAccessToken -c -d run
config.txt
in mountdata
and creates a dump as well.