Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
44996ca
update compose for dev settings
Oct 18, 2019
26c2eb3
add build script and docker labels
Oct 21, 2019
d5cd3ce
add hierarchy of compose files and update conf template
Oct 21, 2019
c262a87
organize docs by purpose, and add table of contents
bellerbrock Oct 22, 2019
55f03eb
fix toc formatting
bellerbrock Oct 22, 2019
80085bf
add breedbase img to readme
bellerbrock Oct 22, 2019
cfc23ac
reduce img size
bellerbrock Oct 22, 2019
f6d06a4
move learn more to intro
bellerbrock Oct 22, 2019
b3a6bd6
fix toc link and reduce img res
bellerbrock Oct 22, 2019
c1447e9
center image
bellerbrock Oct 22, 2019
4289a8a
rearrange readme order
Oct 22, 2019
2f8601b
fix README formatting
Oct 22, 2019
bbb6d5c
merge master
bellerbrock Sep 21, 2020
cebd5ab
remove develvs production tagging, update docs
bellerbrock Sep 24, 2020
b1dd84d
remove old tag
bellerbrock Sep 24, 2020
1833b74
add restart policy
bellerbrock Sep 28, 2020
6401fb4
merge master
bellerbrock Feb 11, 2021
76bc382
remove build changes moved to own branch
bellerbrock Feb 11, 2021
f3996e6
move most binds to volumes and create local conf file in prepare.sh
bellerbrock Feb 11, 2021
7d6a67e
adjust volume syntax
bellerbrock Feb 11, 2021
cd66830
update volumes declaration
bellerbrock Feb 11, 2021
23ca75c
update images and always restart for production only
bellerbrock Feb 11, 2021
b9e47c4
bind local conf file in docker-compose.yml
bellerbrock Feb 12, 2021
1786bc9
add configuration section to readme
bellerbrock Feb 12, 2021
0863206
update to latest breedbase image tag and remove old production yml file
bellerbrock Feb 18, 2021
733341a
merge master
bellerbrock Feb 18, 2021
1ef4a0a
move volume definitions to shared yaml
bellerbrock Feb 18, 2021
f5b5f1e
simplify by using default postgres docker image and loading empty_fix…
bellerbrock Feb 18, 2021
bd77f39
fix README table of contents
bellerbrock Feb 18, 2021
7daa366
actually fix toc
bellerbrock Feb 18, 2021
59d2faf
yet another readme format fix
bellerbrock Feb 18, 2021
756986c
merge master
bellerbrock Mar 4, 2021
20948a8
add environment variables to compose file and instructions to README
bellerbrock Mar 4, 2021
f4ea86d
update entrypoint and breedbase image version
bellerbrock Mar 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
sgn_local.conf
repos
sgn
Expand Down
Binary file added Breedbase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 21 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM debian:stretch

LABEL maintainer="lam87@cornell.edu"

ENV CPANMIRROR=http://cpan.cpantesters.org
# based on the vagrant provision.sh script by Nick Morales <nm529@cornell.edu>

Expand Down Expand Up @@ -39,9 +37,9 @@ RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | tee
# install system dependencies
#
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update -y --allow-unauthenticated
RUN apt-get update -y --allow-unauthenticated
RUN apt-get upgrade -y
RUN apt-get install build-essential pkg-config apt-utils gnupg2 curl wget -y
RUN apt-get install build-essential pkg-config apt-utils gnupg2 curl wget -y
# key for cran-backports (not working though)
#
RUN bash -c "apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF' 1>/key.out 2> /key.err"
Expand All @@ -51,8 +49,8 @@ RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-
#RUN apt-get update --fix-missing -y
RUN apt-get update -y

RUN apt-get install -y aptitude
RUN aptitude install -y libterm-readline-zoid-perl nginx starman emacs gedit vim less sudo htop git dkms linux-headers-4.9.0-11-amd64 perl-doc ack-grep make xutils-dev nfs-common lynx xvfb ncbi-blast+ libmunge-dev libmunge2 munge slurm-wlm slurmctld slurmd libslurm-perl libssl-dev graphviz lsof imagemagick mrbayes muscle bowtie bowtie2 blast2 postfix mailutils libcupsimage2 postgresql-client-12 libglib2.0-dev libglib2.0-bin screen apt-transport-https libgdal-dev libproj-dev libudunits2-dev locales locales-all rsyslog cron
RUN apt-get install -y aptitude
RUN aptitude install -y libterm-readline-zoid-perl nginx starman emacs gedit vim less sudo htop git dkms linux-headers-4.9.0-14-amd64 perl-doc ack-grep make xutils-dev nfs-common lynx xvfb ncbi-blast+ libmunge-dev libmunge2 munge slurm-wlm slurmctld slurmd libslurm-perl libssl-dev graphviz lsof imagemagick mrbayes muscle bowtie bowtie2 blast2 postfix mailutils libcupsimage2 postgresql-client-12 libglib2.0-dev libglib2.0-bin screen apt-transport-https libgdal-dev libproj-dev libudunits2-dev locales locales-all rsyslog cron

# Set the locale correclty to UTF-8
RUN locale-gen en_US.UTF-8
Expand Down Expand Up @@ -136,14 +134,30 @@ ENV R_LIBS_USER=/home/production/cxgn/R_libs

#INSTALL OPENCV IMAGING LIBRARY
RUN apt-get install -y python3-dev python-pip python3-pip python-numpy libgtk2.0-dev libgtk-3-0 libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libhdf5-serial-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libxvidcore-dev libatlas-base-dev gfortran libgdal-dev exiftool libzbar-dev cmake

RUN pip3 install --upgrade pip
RUN pip3 install imutils numpy matplotlib pillow statistics PyExifTool pytz pysolar scikit-image packaging pyzbar pandas opencv-python \
&& pip3 install -U keras-tuner

RUN bash /home/production/cxgn/sgn/js/install_node.sh

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN ln -s /home/production/cxgn/starmachine/bin/starmachine_init.d /etc/init.d/sgn

ARG CREATED
ARG REVISION
ARG BUILD_VERSION

LABEL maintainer="lam87@cornell.edu"
LABEL org.opencontainers.image.created=$CREATED
LABEL org.opencontainers.image.url="https://breedbase.org/"
LABEL org.opencontainers.image.source="https://github.com/solgenomics/breedbase_dockerfile"
LABEL org.opencontainers.image.version=$BUILD_VERSION
LABEL org.opencontainers.image.revision=$REVISION
LABEL org.opencontainers.image.vendor="Boyce Thompson Institute"
LABEL org.opencontainers.image.title="breedbase/breedbase"
LABEL org.opencontainers.image.description="Breedbase web server"
LABEL org.opencontainers.image.documentation="https://solgenomics.github.io/sgn/"

# start services when running container...
ENTRYPOINT /bin/bash /entrypoint.sh
338 changes: 156 additions & 182 deletions README.md

Large diffs are not rendered by default.

23 changes: 0 additions & 23 deletions docker-compose-production.yml

This file was deleted.

10 changes: 10 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3.7"

services:
breedbase:
volumes:
- type: bind
source: ./repos
target: /home/production/cxgn
environment:
MODE: 'DEVELOPMENT'
66 changes: 26 additions & 40 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,36 @@ version: "3.7"

services:
breedbase:
image: breedbase/breedbase:v0.17
depends_on:
- breedbase_db
container_name: breedbase_web
ports:
- 7080:8080
- 25:25
environment:
PGDATABASE: ${PGDATABASE:?}
PGHOST: ${PGHOST:?}
PGPASSWORD: ${PGPASSWORD:?}
PGUSER: ${PGUSER:?}
volumes:
- type: bind
source: ${HOME}/sgn_local.conf
source: ./sgn_local.conf
target: /home/production/cxgn/sgn/sgn_local.conf
# - type: bind
# source: ${HOME}/empty_dump_20200313.sql
# target: /home/production/empty_dump_20200313.sql
# - type: bind
# source: ${HOME}/archive
# target: /home/production/archive
# - type: bind
# source: ${HOME}/tmp
# target: /home/production/tmp
# - type: bind
# source: ${HOME}/cache
# target: /home/production/cache
# - type: bind
# source: ${HOME}/cluster
# target: /home/production/cluster
# - type: bind
# source: ${HOME}/blast
# target: /home/production/blast
# - type: bind
# source: ${HOME}/images
# target: /home/production/images
- breedbase_volume:/home/production/breedbase_volume
- webdata:/home/production/volume
ports:
- 7080:8080
- 25:25
image: breedbase/breedbase:v0.21
depends_on:
- breedbase_db
container_name: breedbase_web

breedbase_db:
image: breedbase/breedbase_pg12.4:v0.5
container_name: breedbase_db
# ports:
# - 5431:5432
volumes:
# - type: bind
# source: /home/production/pgdata
# target: /var/lib/postgresql/data
- db_volume:/home/production/breedbase_volume
- dbdata:/var/lib/postgresql/data
image: postgres:12.6
container_name: breedbase_db
environment:
POSTGRES_DB: ${PGDATABASE:?}
POSTGRES_PASSWORD: ${PGPASSWORD:?}
healthcheck:
test: "pg_isready -U postgres -d $${POSTGRES_DB} || exit 1"
interval: 10s

volumes:
breedbase_volume:
db_volume:
webdata:
dbdata:
73 changes: 71 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,80 @@ sed -i s/localhost/$HOSTNAME/g /etc/slurm-llnl/slurm.conf
/etc/init.d/slurmd start
#/etc/init.d/postgres start

# load empty fixture and run any missing patches

if [ $(psql -Atc 'select count(distinct table_schema) from information_schema.tables;') -eq 2 ]; then
psql -c "CREATE USER web_usr PASSWORD 'postgres';"
psql -f t/data/fixture/empty_fixture.sql
( cd db && ./run_all_patches.pl -u ${PGUSER} -p "${PGPASSWORD}" -h ${PGHOST} -d ${PGDATABASE} -e janedoe )
fi

# create necessary dirs/permissions if we have a docker volume dir
# at /home/production/volume

if [[ -e /home/production/volume ]]
then
if [[ ! -e /home/production/volume/archive ]]
then
mkdir /home/production/volume/archive
chown www-data /home/production/volume/archive
fi

if [[ ! -e /home/production/volume/logs ]]
then
mkdir /home/production/volume/logs
chown www-data /home/production/volume/logs
fi

if [[ ! -e /home/production/volume/blast ]]
then
mkdir /home/production/volume/blast
fi

if [[ ! -e /home/production/volume/public ]]
then
mkdir /home/production/volume/public
fi

if [[ ! -e /home/production/volume/public/images ]]
then
mkdir /home/production/volume/public/images
chown www-data /home/production/volume/public/images
fi

if [[ ! -e /home/production/volume/tmp ]]
then
mkdir /home/production/volume/tmp
chown www-data /home/production/volume/tmp
fi

if [[ ! -e /home/production/volume/cache ]]
then
mkdir /home/production/volume/cache
chown www-data /home/production/volume/cache
fi

if [[ ! -e /home/production/volume/cluster ]]
then
mkdir /home/production/volume/cluster
chown www-data /home/production/volume/cluster
fi

if [[ ! -e /home/production/volume/pgdata ]]
then
mkdir /home/production/volume/pgdata
chown postgres /home/production/pgdata
fi
else
echo "/home/production/volume does not exist... not creating dirs";
fi



if [ "$MODE" == "DEVELOPMENT" ]; then
/home/production/cxgn/sgn/bin/sgn_server.pl --fork -r -d -p 8080
/home/production/cxgn/sgn/bin/sgn_server.pl --fork -r -d -p 8080
else
/etc/init.d/sgn start
chmod 777 /var/log/sgn/error.log
tail -f /var/log/sgn/error.log
fi

2 changes: 2 additions & 0 deletions prepare.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# create local conf file and dir for code repos
cp sgn_local.conf.template sgn_local.conf
mkdir repos

# main code
Expand Down
10 changes: 10 additions & 0 deletions production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3.7"

services:
breedbase:
restart: always
environment:
MODE: 'PRODUCTION'

breedbase_db:
restart: always
6 changes: 3 additions & 3 deletions sgn_local.conf.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dbhost <dbhost>
dbname <dbname>
dbhost breedbase_db
dbname breedbase
dbuser web_usr
dbpass <password>
dbpass postgres

rootpath /home/production/cxgn
basepath /home/production/cxgn/sgn
Expand Down