Launch your own instance of ImageBreed to manage your plant breeding field experiments, genotyping, aerial image phenotyping, and high-dimensional phenotyping (NIRS, transcriptomics, metabolomics)!
Please check the changelog for update information.
For a tutorials of pieces of the aerial image phenotyping system, follow the ImageBreed Channel.
Now integrated with OpenDroneMap for creating orthophotomosaics directly into the database!
-
You need Docker, docker-compose, and nginx installed on a machine with at least 8GB RAM and 50GB of disk. Though it is not necessary, ideally, the computer has >8 CPU cores, >96GB RAM, and >4TB disk space, and the disk space should be fast (Thunderbolt if NAS used).
-
Check the speed of your disks and ensure a write speed >1 GB/s.
-
To start the service, simply change directories to where the provided
docker-compose.yml
file is located (you can simply copy-paste the provideddocker-compose.yml
onto your own computer or you cangit clone
this repository), then:docker-compose up -d
-
Note, it may take up to 10 minutes for the service to fully start up the first time, as it must rebuild the Node JavaScript dependencies.
-
The Docker compose will fetch the container images from this DockerHub.
-
Access the Application: Once the container is running, you can access the application from your host at http://localhost:7080
-
Logging In: The database has a user named
janedoe
with passwordsecretpw
for easy logging in from the web-interface. -
Starting with an Empty Database: When starting the service, the database is named
empty_fixture
and is loaded with SQL from Here. -
Note, if
RUN_DB_PATCHES=TRUE
in thedocker-compose.yml
, then the service will wait 1 minute before checking if all database patches have been run. TheRUN_DB_PATCHES=TRUE
option is important when updating between versions (e.g. V4.0 to V4.1) and can be set to FALSE when not needed to avoid waiting an additional minute.
-
IMPORTANT: to maintain persistent data directories mounted, use the bind mounts via the
docker-compose.yml
and ensure the directories exist on your machine with the proper permissions. Most critically, create the${HOME}/archive
,${HOME}/images
,${HOME}/pgdata
directories on your host machine! DO NOT alter the target, only alter the source to match your host configuration. -
TO BEGIN you don't need to change anything, but in actual production setting you will want to write an
sgn_local.conf
file specific to your service. A template is provided. Your personalsgn_local.conf
can be mounted in thedocker-compose.yml
, where a commented-out example is given.
-
Stopping the service: This will stop all containers (both web and db). Note: You must be located in the directory where the
docker-compose.yml
file is located.docker-compose down
-
Docker-compose will not delete the downloaded Docker images. Use
docker images
to view the downloaded images and then usedocker rmi IMAGEID
to delete it. The Docker images are large and can take up large amounts of disk space, and should be deleted when not in use.
-
To view the log on a running service:
docker attach breedbase_web
-
To fully debug, log into the breedbase_web container:
docker exec -it breedbase_web bash
Look at the error log using
tail -f /var/log/sgn/error.log
orless /var/log/sgn/error.log
. -
To login to the database breedbase_db container:
docker exec -it breedbase_db bash
-
When updating between versions, first check the changelog. The changelog will tell you if you need to modify the
docker-compose.yml
to enable database updating. Then, simply change the imagebreed and imagebreedpg image versions in thedocker-compose.yml
e.g. imagebreed/imagebreed:v6.2 and imagebreed/imagebreedpg:v6.2 to imagebreed/imagebreed:v6.3 and imagebreed/imagebreedpg:v6.3. Then start the Docker containers usingdocker-compose up -d
. -
Beginning with the v7.0 release of this Docker, ontology updates can automatically be run on startup. In the
docker-compose.yml
make sure to set the appropriateRUN_DB_ONTOLOGY_XXX_UPDATES=TRUE
and provide the database parameters as is done in the provided example. Beginning with v4.0, database patches can automatically be run on startup. In thedocker-compose.yml
make sure to setRUN_DB_PATCHES=TRUE
and provide the database parameters. Note, setting either of these keys to TRUE will cause the service to wait 1 minute, so to save time this should be set to FALSE when an update in versions is not underway. -
If you need to manually run database patches or load new ontologies, please view the database patch wiki and the ontology update wiki.
-
Very occasionally the PostgreSQL version of the database will be upgraded (e.g PostgreSQL 12 to 14). Currently this upgrade is not automated and requires to reload your database SQL (e.g.
pg_dump
and then reload usingpsql
).
-
The provided
docker-compose.yml
will launch abreedbase_web
andbreedbase_db
container. If you prefer to install PostgreSQL on your host machine and avoid using thebreedbase_db
Docker, you can comment out the associated breedbase_db lines in thedocker-compose.yml
. This requires adjusting yoursgn_local.conf
to point to your host database, and adjusting yourpostgresql.conf
andpg_hba.conf
configuration to work in this network configuration. You can load SQL from SGN as a starting point for your host database. Please ensure that theweb_usr
user exists in PostgreSQL and has the correct access to your database as is done here. -
If you choose to not use the database Docker, please use PostgreSQL version 14.
-
Only works on Linux machines as far as I know. On Mac and Windows, Docker is installed with a GUI that creates symbolic links to /var/run/docker.sock, which causes problems when ImageBreed runs ODM. If you can install only the command line Docker this may work; check the permissions of and make sure there are no symbolic links to /var/run/docker.sock on your machine.
-
In the
docker-compose.yml
, uncomment the bind mounts for/var/run/docker.sock
andsgn_local.conf
. Then, in yoursgn_local.conf
setenable_opendronemap 1
and make surehostpath_archive
is set to the directory where the archive mount lives on your host e.g./home/user
if the archive is mounted to/home/user/archive
as the source as defined indocker-compose.yml
. Make sure your machine has at least 64GB of RAM. You can also changeopendronemap_max_processes
to allow for greater numbers of parallel OpenDroneMap processes, if your hardware is capable.
-
In the
docker-compose.yml
file you can mount the code directories you are developing, such as the sgn, DroneImageScripts, R_libs, perl-local-lib or other directories. If you mount the sgn directory, you must also mount in the sgn_local.conf file. -
In the
docker-compose.yml
add in the environment section:MODE=DEVELOPMENT
. This will restart the service whenever code changes are made to sgn or other core directories. Note, you may need to delete sgn/js/build and allow the application to rebuild this with the correct permissions; please allow up to 10 minutes for the JS to rebuild. Note, you may need to delete the sgn/static/documents/tempfiles directory.
Alternatively, the docker image can be built from scratch. This is recommended if you would like to develop based on the image.
-
Chage directory into the directory containing the
Dockerfile
and run theprepare.sh
script. This will clone all the git repos that are needed for the build into a directory calledrepos/
. You can then checkout particular branches or tags in the repo before the build. -
Build the images on your host with
docker build -t imagebreed_image .