Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
112 changes: 77 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye
FROM debian:trixie

ENV CPANMIRROR=http://cpan.cpantesters.org
# based on the vagrant provision.sh script by Nick Morales <nm529@cornell.edu>
Expand All @@ -7,6 +7,8 @@ ENV CPANMIRROR=http://cpan.cpantesters.org
#
EXPOSE 8080



# create directory layout
#
RUN mkdir -p /home/production/public/sgn_static_content
Expand All @@ -20,50 +22,74 @@ WORKDIR /home/production/cxgn
# install system dependencies
#
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
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

# for R cran-40
#
RUN bash -c "apt-key adv --keyserver keyserver.ubuntu.com --recv-key '95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7' 1>/key.out 2> /key.err"
RUN apt-get update -y --allow-unauthenticated && \
apt-get upgrade -y && \
apt-get install -y ack anacron apt-transport-https apt-utils bowtie bowtie2 \
build-essential clustalw cron curl dkms emacs gedit git gnupg2 graphviz \
htop imagemagick less libcupsimage2 libgdal-dev libglib2.0-bin libglib2.0-dev \
libimage-exiftool-perl libimage-magick-perl libmunge-dev libmunge2 libnlopt0 \
libproj-dev libslurm-perl libssl-dev libterm-readline-zoid-perl libudunits2-dev \
linux-headers-generic locales locales-all lsof lynx mailutils make mrbayes \
munge muscle nano ncbi-blast+ nfs-common nginx npm perl-doc pkg-config plink \
postfix postgresql-client primer3 rsyslog screen slurm-wlm slurmctld slurmd \
starman sudo vim wget xutils-dev xvfb libstring-crc32-perl locate adduser


# add cran backports repo and required deps
# npm install needs a non-root user (new in latest version)
#
RUN echo "deb https://cloud.r-project.org/bin/linux/debian/ bullseye-cran40/" >> /etc/apt/sources.list

RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list

RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

RUN apt-get update --fix-missing -y
#RUN apt-get update -y;

RUN apt-get install -y aptitude

RUN aptitude install -y libimage-magick-perl libimage-exiftool-perl libterm-readline-zoid-perl nginx starman emacs gedit vim less sudo htop git dkms linux-headers-generic perl-doc ack make xutils-dev nfs-common lynx xvfb ncbi-blast+ primer3 libmunge-dev libmunge2 munge slurm-wlm slurmctld slurmd libslurm-perl libssl-dev graphviz lsof imagemagick mrbayes muscle clustalw bowtie bowtie2 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 libnlopt0 plink
USER root
RUN adduser --disabled-password --gecos "" -u 1250 production

# Set the locale correclty to UTF-8
RUN locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8

RUN curl -L https://cpanmin.us | perl - --sudo App::cpanminus

# Slurm setup
#
RUN rm /etc/munge/munge.key

RUN chmod 777 /var/spool/ \
&& mkdir /var/spool/slurmstate \
&& mkdir /var/run/slurm-llnl/ \
&& chown slurm:slurm /var/run/slurm-llnl/ \
&& chown slurm:slurm /var/spool/slurmstate/ \
&& mkdir /var/spool/slurmd/ \
&& chown slurm:slurm /var/spool/slurmd/ \
&& /usr/sbin/mungekey \
&& ln -s /var/lib/slurm-llnl /var/lib/slurm \
&& mkdir -p /var/log/slurm
RUN usermod -a -G postdrop www-data

# Add CRAN signing key and apt source to install R
#
RUN curl -fsSL 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7' | \
gpg --dearmor --yes -o /usr/share/keyrings/cran.gpg && \
. /etc/os-release && \
printf '%s\n' \
"Types: deb" \
"URIs: https://cloud.r-project.org/bin/linux/debian" \
"Suites: ${VERSION_CODENAME}-cran40/" \
"Signed-By: /usr/share/keyrings/cran.gpg" | \
tee /etc/apt/sources.list.d/cran.sources > /dev/null
RUN apt-get install -y r-base r-base-dev

# Install some additional system dependencies for some R packages
RUN apt-get install -y gdal-bin gsfonts libgit2-dev libglpk-dev pandoc texlive default-jdk

RUN apt-get install r-base r-base-dev -y --allow-unauthenticated
# Update repos
#
RUN apt-get update --fix-missing -y

# required for R-package spdep, and other dependencies of agricolae
# install postgres client
#
RUN apt-get install libudunits2-dev libproj-dev libgdal-dev -y
RUN apt-get install -y postgresql-client

# Set the locale correclty to UTF-8
RUN locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8

RUN curl -L https://cpanmin.us | perl - --sudo App::cpanminus

# XML::Simple dependency
#
Expand Down Expand Up @@ -95,11 +121,13 @@ RUN apt-get install nodejs -y
RUN cpanm Selenium::Remote::Driver@1.49

#INSTALL OPENCV IMAGING LIBRARY

RUN apt-get install -y python3-dev python3-pip python3-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 cmake libgdal-dev exiftool libzbar-dev zbar-tools libbarcode-zbar-perl libtext-multimarkdown-perl

RUN pip3 install --upgrade pip
RUN pip3 install grpcio==1.40.0 imutils numpy matplotlib pillow statistics PyExifTool pytz pysolar scikit-image packaging pyzbar pandas opencv-python && pip3 install -U keras-tuner
RUN apt-get install -y python3-dev python3-pip python3-numpy python3-setuptools libgtk2.0-dev \
libgtk-3-0 libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libhdf5-serial-dev \
libtbbmalloc2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libxvidcore-dev libopenblas-dev \
gfortran cmake libgdal-dev exiftool libzbar-dev zbar-tools libbarcode-zbar-perl libtext-multimarkdown-perl
RUN pip3 install --break-system-packages grpcio imutils matplotlib pillow statistics PyExifTool pytz \
pysolar scikit-image packaging pyzbar pandas opencv-python && \
pip3 install --break-system-packages -U keras-tuner

# copy some tools that don't have a Debian package
#
Expand All @@ -114,9 +142,11 @@ COPY tools/sreformat /usr/local/bin/
#
ADD cxgn /home/production/cxgn


# move this here so it is not clobbered by the cxgn move
#
COPY slurm.conf /etc/slurm/slurm.conf
COPY cgroup.conf /etc/slurm/cgroup.conf
COPY starmachine.conf /etc/starmachine/
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
Expand All @@ -127,9 +157,17 @@ COPY sgn_local.conf /home/production/cxgn/sgn/sgn_local.conf
RUN cd /home/production/cxgn/gtsimsrch/src; make; cd -;
RUN cd /home/production/cxgn/sgn/programs/; make; cd -;

# npm install needs a non-root user (new in latest version)
#
RUN adduser --disabled-password --gecos "" -u 1250 production && chown -R production /home/production

# add npm
RUN curl -sL https://deb.nodesource.com/setup_24.x | bash -
RUN apt-get install nodejs -y
RUN cd /home/production/cxgn/sgn/js; npm install

#then a few steps to clean up permissions
RUN rm -rf /home/production/.npm
RUN chown -R production /home/production/cxgn/sgn/js/node_modules
RUN chown production /home/production/cxgn/sgn/js/package-lock.json


WORKDIR /home/production/cxgn/sgn

Expand All @@ -148,8 +186,12 @@ ENV PERL5LIB=/home/production/cxgn/bio-chado-schema/lib:/home/production/cxgn/lo

ENV HOME=/home/production
ENV PGPASSFILE=/home/production/.pgpass
RUN echo "R_LIBS_USER=/home/production/cxgn/R_libs" >> /etc/R/Renviron
ENV R_LIBS_USER=/home/production/cxgn/R_libs
RUN echo "R_LIBS_USER=/home/production/cxgn/R4.5_libs" >> /etc/R/Renviron
ENV R_LIBS_USER=/home/production/cxgn/R4.5_libs

COPY R_deps.R /home/production/R_deps.R

RUN Rscript --vanilla /home/production/R_deps.R

RUN ln -s /home/production/cxgn/starmachine/bin/starmachine_init.d /etc/init.d/sgn

Expand Down
2 changes: 1 addition & 1 deletion cxgn/local-lib
Submodule local-lib updated 7414 files
19 changes: 13 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
sed -i s/localhost/$HOSTNAME/g /etc/slurm/slurm.conf
/etc/init.d/postfix start
/etc/init.d/cron start
chown 106 /etc/munge/munge.key
chown munge /etc/munge/munge.key
/etc/init.d/munge start
/etc/init.d/slurmctld start
/etc/init.d/slurmd start
#/etc/init.d/postgres start

# undrain node if needed
#
scontrol update NodeName=node_name State=RESUME

chown root /etc/crontab # in case it was mounted from local dir

if [ "${MODE}" = 'TESTING' ]; then
Expand All @@ -25,7 +29,7 @@ if [[ $(psql -lqt -h ${PGHOST} -U ${PGUSER} | cut -d '|' -f1 | sed 's/^[[:blan
echo "CREATING web_usr...";
psql -d postgres -c "CREATE USER web_usr PASSWORD 'postgres';"
echo "CREATING breedbase DATABASE...";

psql -d postgres -c "CREATE DATABASE breedbase; "
if [ -e '/db_dumps/empty_breedbase.sql' ]
then
Expand All @@ -37,8 +41,8 @@ if [[ $(psql -lqt -h ${PGHOST} -U ${PGUSER} | cut -d '|' -f1 | sed 's/^[[:blan
psql -f t/data/fixture/cxgn_fixture.sql
(cd db && ./run_all_patches.pl -u ${PGUSER} -p ${PGPASSWORD} -h ${PGHOST} -d ${PGDATABASE} -e janedoe )
fi


fi

# create necessary dirs/permissions if we have a docker volume dir
Expand Down Expand Up @@ -99,7 +103,7 @@ then
chown www-data /home/production/volume/cluster
chmod 770 /home/production/volume/cluster
fi

if [[ ! -e /home/production/volume/pgdata ]]
then
mkdir /home/production/volume/pgdata
Expand All @@ -109,9 +113,12 @@ else
echo "/home/production/volume does not exist... not creating dirs";
fi

echo "PERL5LIB: " $PERL5LIB
echo "PERL LOCATION: " `which perl`
echo "PERL VERSION: " `perl -v`

if [ "$MODE" == "DEVELOPMENT" ]; then
/home/production/cxgn/sgn/bin/sgn_server.pl --fork -r -p 8080
perl /home/production/cxgn/sgn/bin/sgn_server.pl --fork -r -p 8080
else
/etc/init.d/sgn start
touch /var/log/sgn/error.log
Expand Down
19 changes: 12 additions & 7 deletions slurm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# Put this file on all nodes of your cluster.
# See the slurm.conf man page for more information.
#
ControlMachine=localhost
SlurmctldHost=2966a8cf8960
#ControlMachine=6f00832efaf6
#ControlAddr=127.0.1.1
#BackupController=
#BackupAddr=
#
AuthType=auth/munge
CacheGroups=0
#CacheGroups=0
#CheckpointType=checkpoint/none
CryptoType=crypto/munge
#DisableRootJobs=NO
Expand Down Expand Up @@ -98,8 +99,8 @@ Waittime=0
#SchedulerRootFilter=1
#SchedulerTimeSlice=30
SchedulerType=sched/backfill
SchedulerPort=7321
SelectType=select/cons_res
#SchedulerPort=7321
SelectType=select/cons_tres
SelectTypeParameters=CR_CORE
#
#
Expand All @@ -126,7 +127,8 @@ SelectTypeParameters=CR_CORE
#AccountingStoragePort=
AccountingStorageType=accounting_storage/none
#AccountingStorageUser=
AccountingStoreJobComment=YES
#AccountingStoreJobComment=YES
AccountingStoreFlags=job_comment
ClusterName=cluster
#DebugFlags=
#JobCompHost=
Expand Down Expand Up @@ -159,5 +161,8 @@ SlurmSchedLogFile=/var/log/slurm/scheduler.log
#
#
# COMPUTE NODES
NodeName=localhost NodeHostName=localhost CPUs=1 State=UNKNOWN
PartitionName=localhost Nodes=localhost Default=YES MaxTime=INFINITE State=UP
#NodeName=6f00832efaf6 NodeHostName=6f00832efaf6 NodeAddr=127.0.0.1 CPUs=1 State=UNKNOWN
#PartitionName=6f00832efaf6 Nodes=6f00832efaf6 Default=YES MaxTime=INFINITE State=UP
# COMPUTE NODES
NodeName=2966a8cf8960 NodeHostName=2966a8cf8960 CPUs=4 Boards=1 SocketsPerBoard=1 CoresPerSocket=2 ThreadsPerCore=2 RealMemory=39686 State=UNKNOWN
PartitionName=2966a8cf8960 Nodes=2966a8cf8960 Default=YES MaxTime=INFINITE State=UP
Loading