Warning, /iDDS/Dockerfile.centos7 is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env python
0002 #
0003 # Licensed under the Apache License, Version 2.0 (the "License");
0004 # You may not use this file except in compliance with the License.
0005 # You may obtain a copy of the License at
0006 # http://www.apache.org/licenses/LICENSE-2.0OA
0007 #
0008 # Authors:
0009 # - Wen Guan, <wen.guan@cern.ch>, 2022
0010
0011
0012 FROM docker.io/centos:7
0013
0014 ENV LANG en_US.UTF-8
0015 ENV LC_ALL en_US.UTF-8
0016
0017 ARG TAG
0018
0019 WORKDIR /tmp
0020
0021 RUN yum install -y epel-release.noarch && \
0022 yum clean all && \
0023 rm -rf /var/cache/yum
0024 RUN yum upgrade -y && \
0025 yum clean all && \
0026 rm -rf /var/cache/yum
0027
0028 # RUN yum install -y httpd.x86_64 conda gridsite mod_ssl.x86_64 httpd-devel.x86_64 gcc.x86_64 supervisor.noarch fetch-crl.noarch lcg-CA postgresql postgresql-contrib postgresql-static postgresql-libs postgresql-devel && \
0029 # yum clean all && \
0030 # rm -rf /var/cache/yum
0031 RUN yum install -y httpd.x86_64 which conda gridsite mod_ssl.x86_64 httpd-devel.x86_64 gcc.x86_64 supervisor.noarch fetch-crl.noarch lcg-CA redis syslog-ng systemd-udev && \
0032 yum clean all && \
0033 rm -rf /var/cache/yum
0034
0035 RUN yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
0036 RUN yum install -y postgresql14
0037
0038 # RUN curl http://repository.egi.eu/sw/production/cas/1/current/repo-files/EGI-trustanchors.repo -o /etc/yum.repos.d/EGI-trustanchors.repo/
0039 RUN curl https://repository.egi.eu/sw/production/cas/1/current/repo-files/egi-trustanchors.repo -o /etc/yum.repos.d/EGI-trustanchors.repo
0040
0041 RUN yum install -y fetch-crl.noarch lcg-CA ca-policy-egi-core && \
0042 yum clean all && \
0043 rm -rf /var/cache/yum
0044
0045 # update network limitations
0046 # RUN echo 4096 > /proc/sys/net/core/somaxconn
0047 # RUN sysctl -w net.core.somaxconn=4096
0048 RUN echo 'net.core.somaxconn=4096' >> /etc/sysctl.d/999-net.somax.conf
0049
0050 # setup env
0051 RUN adduser atlpan
0052 RUN groupadd zp
0053 RUN usermod -a -G zp atlpan
0054
0055 RUN mkdir /opt/idds
0056 RUN mkdir /var/log/idds
0057 RUN mkdir /var/log/idds/wsgisocks/
0058 RUN mkdir /var/idds
0059 RUN mkdir /var/idds/wsgisocks
0060 RUN chown atlpan -R /opt/idds
0061 # RUN chown atlpan -R /opt/idds_source
0062 RUN chown atlpan -R /var/log/idds
0063 RUN chown apache -R /var/idds/wsgisocks/
0064
0065 # redis
0066 RUN chmod a+rx /etc/redis*
0067 # RUN chmod a+rwx /var/log/redis
0068 # RUN chmod a+rwx /var/lib/redis
0069 RUN rm -fr /var/log/redis
0070 RUN rm -fr /var/lib/redis
0071 RUN mkdir /var/log/idds/redis
0072 RUN chmod a+rwx /var/log/idds/redis
0073 RUN ln -s /var/log/idds/redis /var/log/redis
0074 RUN ln -s /var/log/idds/redis /var/lib/redis
0075
0076 # setup conda virtual env
0077 ADD requirements.yaml /opt/idds/
0078 # ADD start-daemon.sh /opt/idds/
0079 RUN conda env create --prefix=/opt/idds -f /opt/idds/requirements.yaml
0080 RUN source /etc/profile.d/conda.sh; conda activate /opt/idds
0081 # RUN conda activate /opt/idds
0082
0083 # Make RUN commands use the new environment:
0084 # SHELL ["conda", "run", "-p", "/opt/idds", "/bin/bash", "-c"]
0085
0086 # install required packages
0087 RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; python3 -m pip install --no-cache-dir --upgrade pip
0088 RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; python3 -m pip install --no-cache-dir --upgrade setuptools
0089
0090 RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; python3 -m pip install --no-cache-dir --upgrade requests SQLAlchemy urllib3 retrying mod_wsgi flask futures stomp.py cx-Oracle unittest2 pep8 flake8 pytest nose sphinx recommonmark sphinx-rtd-theme nevergrad
0091 RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; python3 -m pip install --no-cache-dir --upgrade psycopg2-binary
0092 RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; python3 -m pip install --no-cache-dir --upgrade rucio-clients-atlas rucio-clients panda-client-light
0093
0094
0095 WORKDIR /tmp/src
0096 COPY . .
0097
0098 RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; \
0099 if [[ -z "$TAG" ]] ; then \
0100 python3 build_all.py wheel && main/tools/env/install_packages.sh ; \
0101 else \
0102 python3 -m pip install --no-cache-dir --upgrade idds-common==$TAG idds-workflow==$TAG idds-server==$TAG idds-client==$TAG idds-doma==$TAG idds-atlas==$TAG idds-website==$TAG idds-monitor==$TAG ; \
0103 fi
0104
0105 WORKDIR /tmp
0106 RUN rm -rf /tmp/src
0107
0108 RUN chmod 777 /opt/idds/monitor/data
0109 RUN chmod 777 /opt/idds/monitor/data/conf.js
0110 RUN mkdir /opt/idds/config
0111 RUN mkdir /opt/idds/config/idds
0112 # RUN mkdir /opt/idds/config_default
0113
0114 # ADD idds.cfg.default /opt/idds/config
0115
0116 # RUN ls /opt/idds/etc; ls /opt/idds/etc/idds; ls /opt/idds/etc/panda;
0117 # RUN ls /opt/idds/config; ls /opt/idds/config/idds;
0118
0119 # for rest service
0120 # RUN ln -fs /opt/idds/config/hostkey.pem /etc/grid-security/hostkey.pem
0121 # RUN ln -fs /opt/idds/config/hostcert.pem /etc/grid-security/hostcert.pem
0122
0123 # to authenticate to rucio
0124 RUN ln -fs /opt/idds/config/ca.crt /opt/idds/etc/ca.crt
0125 RUN ln -fs /opt/idds/config/rucio.cfg /opt/idds/etc/rucio.cfg
0126
0127 # for panda client to access panda
0128 RuN mkdir -p /opt/idds/etc/panda/
0129 RUN ln -fs /opt/idds/config/panda.cfg /opt/idds/etc/panda/panda.cfg
0130
0131 # for idds rest service
0132 RUN ln -fs /opt/idds/config/idds/idds.cfg /opt/idds/etc/idds/idds.cfg
0133 RUN ln -fs /opt/idds/config/idds/auth.cfg /opt/idds/etc/idds/auth/auth.cfg
0134 RUN ln -fs /opt/idds/config/idds/gacl /opt/idds/etc/idds/rest/gacl
0135 RUN ln -fs /opt/idds/config/idds/httpd-idds-443-py39-cc7.conf /etc/httpd/conf.d/httpd-idds-443-py39-cc7.conf
0136
0137 # update http config
0138 RUN sed -i 's/Listen\ 443/#\ Listen\ 443/g' /etc/httpd/conf.d/ssl.conf
0139 RUN sed -i 's/Listen\ 80/#\ Listen\ 80/g' /etc/httpd/conf/httpd.conf
0140 RUN sed -i "s/WSGISocketPrefix\ \/var\/log\/idds\/wsgisocks\/wsgi/WSGISocketPrefix\ \/var\/idds\/wsgisocks\/wsgi/g" /opt/idds/config_default/httpd-idds-443-py39-cc7.conf
0141
0142 # for idds daemons
0143 RUN ln -fs /opt/idds/config/idds/supervisord_idds.ini /etc/supervisord.d/idds.ini
0144 # RUN ln -fs /opt/idds/config/idds/supervisord_iddsfake.ini /etc/supervisord.d/iddsfake.ini
0145 RUN ln -fs /opt/idds/config/idds/supervisord_httpd.ini /etc/supervisord.d/httpd.ini
0146 # RUN ln -fs /opt/idds/config/idds/supervisord_syslog-ng.ini /etc/supervisord.d/syslog-ng.ini
0147 RUN ln -fs /opt/idds/config/idds/supervisord_logrotate.ini /etc/supervisord.d/logrotate.ini
0148 RUN ln -fs /opt/idds/config/idds/logrotate_idds /etc/logrotate.d/idds
0149
0150 # for syslog-ng
0151 RUN mv /etc/syslog-ng/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf.back
0152 ADD main/tools/syslog-ng/syslog-ng.conf /etc/syslog-ng/
0153 ADD main/tools/syslog-ng/idds.conf /etc/syslog-ng/conf.d/
0154 ADD main/tools/syslog-ng/http.conf /etc/syslog-ng/conf.d/
0155
0156 RUN chown atlpan -R /etc/grid-security/certificates
0157
0158 RUN chmod -R 777 /opt/idds/config
0159 RUN chmod -R 777 /var/log/idds
0160 RUN chmod -R 777 /var/idds
0161 RUN chmod 777 /etc/grid-security
0162 RUN chmod 777 /etc/httpd/conf.d
0163 RUN chmod 777 /etc/httpd/conf/httpd.conf
0164 RUN chmod 777 /etc/httpd/conf
0165 RUN chmod 777 /run/httpd
0166 RUN chmod 777 /var/log/supervisor/
0167 RUN chmod 777 /var/run/supervisor
0168 RUN chmod 777 /var/run
0169 RUN chmod 777 /etc/httpd/logs
0170
0171 ENV PATH /opt/idds/bin/:$PATH
0172
0173 ADD start-daemon.sh /opt/idds/bin/
0174 RUN mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.back
0175 # ADD ssl.conf /etc/httpd/conf.d/ssl.conf
0176 RUN ln -s /opt/idds/etc/idds/rest/ssl.conf /etc/httpd/conf.d/ssl.conf
0177
0178 VOLUME /var/log/idds
0179 VOLUME /opt/idds/config
0180
0181 ENTRYPOINT ["start-daemon.sh"]
0182
0183 STOPSIGNAL SIGINT
0184
0185 EXPOSE 443
0186 CMD ["all"]