Back to home page

EIC code displayed by LXR

 
 

    


Warning, /harvester/Dockerfile is written in an unsupported language. File is not indexed.

0001 # non default Dockerfile since Condor 9 doesn't support AL9
0002 
0003 ARG PYTHON_VERSION=3.11.4
0004 
0005 FROM docker.io/almalinux:9.4
0006 
0007 ARG PYTHON_VERSION
0008 
0009 RUN dnf update -y
0010 RUN dnf install -y epel-release
0011 RUN dnf install -y yum-utils
0012 RUN yum-config-manager --enable crb
0013 
0014 RUN dnf install -y --allowerasing gcc make less git psmisc curl voms-clients-cpp wget httpd logrotate procps mod_ssl \
0015     openssl-devel readline-devel bzip2-devel libffi-devel zlib-devel passwd voms-clients-java which mysql-devel mariadb \
0016     sudo vim htop
0017 
0018 # install python
0019 RUN mkdir /tmp/python && cd /tmp/python && \
0020     wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
0021     tar -xzf Python-*.tgz && rm -f Python-*.tgz && \
0022     cd Python-* && \
0023     ./configure --enable-shared --enable-optimizations --with-lto && \
0024     make altinstall && \
0025     echo /usr/local/lib > /etc/ld.so.conf.d/local.conf && ldconfig && \
0026     cd / && rm -rf /tmp/pyton
0027 
0028 # install condor
0029 RUN mkdir -p /data/condor; cd /data/condor; \
0030     wget https://research.cs.wisc.edu/htcondor/tarball/9.0/9.0.17/release/condor-9.0.17-x86_64_CentOS7-stripped.tar.gz -O condor.tar.gz.9; \
0031     curl -fsSL https://get.htcondor.org | /bin/bash -s -- --download --channel stable; \
0032     mv condor.tar.gz condor.tar.gz.stable; \
0033     curl -fsSL https://get.htcondor.org | /bin/bash -s -- --download; \
0034     ln -fs condor.tar.gz condor.tar.gz.latest
0035     
0036 #install gcloud
0037 RUN echo $'[google-cloud-cli] \n\
0038 name=Google Cloud CLI \n\
0039 baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64 \n\
0040 enabled=1 \n\
0041 gpgcheck=1 \n\
0042 repo_gpgcheck=0 \n\
0043 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg \n\
0044        https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg \n ' > /etc/yum.repos.d/google-cloud-sdk.repo
0045 
0046 # download and install google rpms avoiding conflicts between google-cloud-sdk and google-cloud-cli
0047 RUN mkdir /tmp/gtemp &&  \
0048     dnf install -y --downloadonly --downloaddir=/tmp/gtemp google-cloud-sdk-gke-gcloud-auth-plugin && \
0049     dnf install -y --downloadonly --downloaddir=/tmp/gtemp kubectl && \
0050     rpm -Uvh --force --nodeps /tmp/gtemp/*.rpm && \
0051     rm -rf /tmp/gtemp
0052 
0053 # install voms
0054 RUN dnf install -y https://repo.opensciencegrid.org/osg/3.6/el9/release/x86_64/osg-ca-certs-1.114-2.osg36.el9.noarch.rpm
0055 RUN dnf install -y https://repo.opensciencegrid.org/osg/3.6/el9/release/x86_64/vo-client-131-1.osg36.el9.noarch.rpm
0056 
0057 # setup venv with pythonX.Y
0058 RUN python$(echo ${PYTHON_VERSION} | sed -E 's/\.[0-9]+$//') -m venv /opt/harvester
0059 RUN /opt/harvester/bin/pip install -U pip
0060 RUN /opt/harvester/bin/pip install -U setuptools
0061 RUN /opt/harvester/bin/pip install -U gnureadline
0062 RUN /opt/harvester/bin/pip install -U mysqlclient uWSGI pyyaml
0063 RUN /opt/harvester/bin/pip install -U kubernetes
0064 RUN mkdir /tmp/src
0065 WORKDIR /tmp/src
0066 COPY . .
0067 RUN /opt/harvester/bin/pip install -U .
0068 WORKDIR /
0069 RUN rm -rf /tmp/src
0070 
0071 RUN mv /opt/harvester/etc/sysconfig/panda_harvester.rpmnew.template /opt/harvester/etc/sysconfig/panda_harvester
0072 RUN mv /opt/harvester/etc/panda/panda_common.cfg.rpmnew /opt/harvester/etc/panda/panda_common.cfg
0073 RUN mv /opt/harvester/etc/panda/panda_harvester.cfg.rpmnew.template /opt/harvester/etc/panda/panda_harvester.cfg
0074 RUN mv /opt/harvester/etc/panda/panda_harvester-uwsgi.ini.rpmnew.template /opt/harvester/etc/panda/panda_harvester-uwsgi.ini
0075 RUN mv /opt/harvester/etc/rc.d/init.d/panda_harvester-uwsgi.rpmnew.template /opt/harvester/etc/rc.d/init.d/panda_harvester-uwsgi
0076 
0077 RUN cp /opt/harvester/local/bin/harvester-admin.rpmnew /opt/harvester/local/bin/harvester-admin && \
0078     chmod a+x /opt/harvester/local/bin/harvester-admin
0079 
0080 RUN ln -fs /opt/harvester/etc/queue_config/panda_queueconfig.json /opt/harvester/etc/panda/panda_queueconfig.json
0081 
0082 RUN adduser atlpan
0083 RUN groupadd zp
0084 RUN usermod -a -G zp atlpan
0085 RUN passwd -d atlpan
0086 
0087 RUN mkdir -p /var/log/panda
0088 RUN chown -R atlpan:zp /var/log/panda
0089 
0090 RUN mkdir -p /data/harvester
0091 RUN chown -R atlpan:zp /data/harvester
0092 
0093 # to run with non-root PID
0094 RUN mkdir -p /etc/grid-security/certificates
0095 RUN chmod -R 777 /etc/grid-security/certificates
0096 RUN chmod -R 777 /data/harvester
0097 RUN chmod -R 777 /data/condor
0098 RUN chmod -R 777 /etc/httpd
0099 RUN chmod -R 777 /etc/vomses
0100 
0101 RUN chmod -R 777 /etc/grid-security/vomsdir
0102 RUN chmod -R 777 /var/log/httpd
0103 RUN chmod -R 777 /var/lib/logrotate
0104 RUN mkdir -p /opt/harvester/etc/queue_config && chmod 777 /opt/harvester/etc/queue_config
0105 
0106 RUN mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.back
0107 COPY docker/httpd.conf /etc/httpd/conf/
0108 COPY docker/ssl-httpd.conf /etc/httpd/conf.d/
0109 RUN mkdir -p /opt/harvester/etc/certs
0110 RUN chmod -R 777 /opt/harvester/etc/certs
0111 RUN ln -fs /opt/harvester/etc/certs/hostkey.pem /etc/grid-security/hostkey.pem
0112 RUN ln -fs /opt/harvester/etc/certs/hostcert.pem /etc/grid-security/hostcert.pem
0113 RUN ln -fs /opt/harvester/etc/certs/chain.pem /etc/grid-security/chain.pem
0114 RUN openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/pki/tls/private/localhost.key \
0115     -out /etc/ssl/certs/localhost.crt \
0116     -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname"
0117 RUN chmod 644 /etc/pki/tls/private/localhost.key
0118 RUN chmod 644 /etc/pki/tls/certs/localhost.crt
0119 
0120 RUN dnf clean all && rm -rf /var/cache/yum
0121 
0122 # make lock dir
0123 ENV PANDA_LOCK_DIR /var/run/panda
0124 RUN mkdir -p ${PANDA_LOCK_DIR} && chmod 777 ${PANDA_LOCK_DIR}
0125 
0126 # make a wrapper script to launch services and periodic jobs in non-root container
0127 RUN echo $'#!/bin/bash \n\
0128 set -m \n\
0129 /data/harvester/init-harvester \n\
0130 /data/harvester/run-harvester-crons & \n\
0131 source /data/harvester/setup-harvester \n\
0132 \n\
0133 # if no host certificate \n\
0134 if [[ ! -f /opt/harvester/etc/certs/hostkey.pem ]]; then \n\
0135     ln -s /etc/pki/tls/certs/localhost.crt   /opt/harvester/etc/certs/hostcert.pem \n\
0136     ln -s /etc/pki/tls/private/localhost.key /opt/harvester/etc/certs/hostkey.pem \n\
0137     ln -s /etc/pki/tls/certs/ca-bundle.crt   /opt/harvester/etc/certs/chain.pem \n\
0138 fi \n\
0139 \n\
0140 cd /data/condor \n\
0141 tar -x -f condor.tar.gz${CONDOR_CHANNEL} \n\
0142 mv condor-*stripped condor \n\
0143 cd condor \n\
0144 ./bin/make-personal-from-tarball \n\
0145 . condor.sh \n\
0146 ln -s /data/harvester/condor_config.local /data/condor/condor/local/config.d/ \n\
0147 condor_master \n\
0148 /sbin/httpd \n\
0149 /opt/harvester/etc/rc.d/init.d/panda_harvester-uwsgi start \n ' > /opt/harvester/etc/rc.d/init.d/run-harvester-services
0150 
0151 RUN chmod +x /opt/harvester/etc/rc.d/init.d/run-harvester-services
0152 
0153 # add condor setup ins sysconfig
0154 RUN echo source /data/condor/condor/condor.sh >> /opt/harvester/etc/sysconfig/panda_harvester
0155 RUN echo source /data/harvester/setup-harvester >> /opt/harvester/etc/sysconfig/panda_harvester
0156 
0157 CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"
0158 
0159 EXPOSE 8080 8443