From a911a5edf0b96d795ff1f21d5714d89cc8b748ab Mon Sep 17 00:00:00 2001 From: David Waring Date: Fri, 29 May 2026 13:21:44 -0400 Subject: [PATCH 1/4] Update base OS to debian trixie and update packages to match --- Dockerfile | 85 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 38 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6717e62..85ae051 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -20,29 +20,52 @@ 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 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 + +# Slurm setup # -RUN bash -c "apt-key adv --keyserver keyserver.ubuntu.com --recv-key '95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7' 1>/key.out 2> /key.err" - +RUN rm /etc/munge/munge.key +RUN chmod 777 /var/spool/ \ + && mkdir /var/spool/slurmstate \ + && chown slurm:slurm /var/spool/slurmstate/ \ + && /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 backports repo and required deps +# Add CRAN signing key and apt source to install R # -RUN echo "deb https://cloud.r-project.org/bin/linux/debian/ bullseye-cran40/" >> /etc/apt/sources.list +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 -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 - +# 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 +# Update repos +# RUN apt-get update --fix-missing -y -#RUN apt-get update -y; -RUN apt-get install -y aptitude - -RUN aptitude install -y npm 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 +# install postgres client +# +RUN apt-get install -y postgresql-client # Set the locale correclty to UTF-8 RUN locale-gen en_US.UTF-8 @@ -50,21 +73,6 @@ 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 -RUN rm /etc/munge/munge.key - -RUN chmod 777 /var/spool/ \ - && mkdir /var/spool/slurmstate \ - && chown slurm:slurm /var/spool/slurmstate/ \ - && /usr/sbin/mungekey \ - && ln -s /var/lib/slurm-llnl /var/lib/slurm \ - && mkdir -p /var/log/slurm - -RUN apt-get install r-base r-base-dev -y --allow-unauthenticated - -# required for R-package spdep, and other dependencies of agricolae -# -RUN apt-get install libudunits2-dev libproj-dev libgdal-dev -y - # XML::Simple dependency # RUN apt-get install libexpat1-dev -y @@ -95,12 +103,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 # From 95316930a9a3b9fa000b32e0568c000f5d484efd Mon Sep 17 00:00:00 2001 From: Lukas Mueller Date: Fri, 25 Sep 2026 18:31:37 -0400 Subject: [PATCH 2/4] adapt Dockerfile for Debian 13. --- Dockerfile | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 85ae051..5a888f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,8 @@ ENV CPANMIRROR=http://cpan.cpantesters.org # EXPOSE 8080 + + # create directory layout # RUN mkdir -p /home/production/public/sgn_static_content @@ -30,14 +32,28 @@ RUN apt-get update -y --allow-unauthenticated && \ 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 + starman sudo vim wget xutils-dev xvfb libstring-crc32-perl locate adduser + + +# npm install needs a non-root user (new in latest version) +# +USER root +RUN adduser --disabled-password --gecos "" -u 1250 production + +###&& chown -R production /home/production + + # 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 @@ -124,9 +140,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 @@ -137,9 +155,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 @@ -147,8 +173,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 From 670f3bd398eafcbcba3bf08ffb31da4f04684d9a Mon Sep 17 00:00:00 2001 From: Lukas Mueller Date: Mon, 28 Sep 2026 09:46:26 -0400 Subject: [PATCH 3/4] adapt slurm.conf for trixie - some config params have changed. --- cxgn/DroneImageScripts | 2 +- cxgn/local-lib | 2 +- slurm.conf | 19 ++++++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/cxgn/DroneImageScripts b/cxgn/DroneImageScripts index 1998062..7728b03 160000 --- a/cxgn/DroneImageScripts +++ b/cxgn/DroneImageScripts @@ -1 +1 @@ -Subproject commit 1998062efeec114a4f4156bbf6834e4ea4d907dd +Subproject commit 7728b03876bf6de151913c11f11c26b2244f99ef diff --git a/cxgn/local-lib b/cxgn/local-lib index 0138171..e06b55f 160000 --- a/cxgn/local-lib +++ b/cxgn/local-lib @@ -1 +1 @@ -Subproject commit 0138171fa03e47485cc4c496208ee9eb5e5c8ed2 +Subproject commit e06b55fd254500244405fdeae01670e7e136bfc0 diff --git a/slurm.conf b/slurm.conf index c3b5f53..d96ec47 100644 --- a/slurm.conf +++ b/slurm.conf @@ -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 @@ -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 # # @@ -126,7 +127,8 @@ SelectTypeParameters=CR_CORE #AccountingStoragePort= AccountingStorageType=accounting_storage/none #AccountingStorageUser= -AccountingStoreJobComment=YES +#AccountingStoreJobComment=YES +AccountingStoreFlags=job_comment ClusterName=cluster #DebugFlags= #JobCompHost= @@ -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 From c1229744d3bd39232861b06fb475dd50fa8d4208 Mon Sep 17 00:00:00 2001 From: Lukas Mueller Date: Mon, 28 Sep 2026 09:47:30 -0400 Subject: [PATCH 4/4] fix entrypoint.sh: change munge user and undrain node if needed. --- entrypoint.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0329234..4e3f3d8 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 @@ -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 @@ -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 @@ -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 @@ -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