-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new version 0.11.0
- Loading branch information
Showing
536 changed files
with
1,735 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0OA | ||
# | ||
# Authors: | ||
# - Wen Guan, <[email protected]>, 2022 | ||
|
||
|
||
FROM docker.io/centos:7 | ||
|
||
ARG TAG | ||
|
||
WORKDIR /tmp | ||
|
||
RUN yum install -y epel-release.noarch && \ | ||
yum clean all && \ | ||
rm -rf /var/cache/yum | ||
RUN yum upgrade -y && \ | ||
yum clean all && \ | ||
rm -rf /var/cache/yum | ||
|
||
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 && \ | ||
yum clean all && \ | ||
rm -rf /var/cache/yum | ||
|
||
# RUN curl http://repository.egi.eu/sw/production/cas/1/current/repo-files/EGI-trustanchors.repo -o /etc/yum.repos.d/EGI-trustanchors.repo | ||
RUN curl https://repository.egi.eu/sw/production/cas/1/current/repo-files/EGI-trustanchors.repo -o /etc/yum.repos.d/EGI-trustanchors.repo | ||
|
||
RUN yum install -y fetch-crl.noarch lcg-CA ca-policy-egi-core && \ | ||
yum clean all && \ | ||
rm -rf /var/cache/yum | ||
|
||
# setup env | ||
RUN adduser atlpan | ||
RUN groupadd zp | ||
RUN usermod -a -G zp atlpan | ||
|
||
RUN mkdir /opt/idds | ||
RUN mkdir /var/log/idds | ||
RUN mkdir /var/log/idds/wsgisocks/ | ||
RUN mkdir /var/idds | ||
RUN mkdir /var/idds/wsgisocks | ||
RUN chown atlpan -R /opt/idds | ||
# RUN chown atlpan -R /opt/idds_source | ||
RUN chown atlpan /var/log/idds | ||
RUN chown apache -R /var/idds/wsgisocks/ | ||
|
||
# setup conda virtual env | ||
ADD requirements.yaml /opt/idds/ | ||
# ADD start-daemon.sh /opt/idds/ | ||
RUN conda env create --prefix=/opt/idds -f /opt/idds/requirements.yaml | ||
RUN source /etc/profile.d/conda.sh; conda activate /opt/idds | ||
# RUN conda activate /opt/idds | ||
|
||
# Make RUN commands use the new environment: | ||
# SHELL ["conda", "run", "-p", "/opt/idds", "/bin/bash", "-c"] | ||
|
||
# install required packages | ||
RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; python3 -m pip install --no-cache-dir --upgrade pip | ||
RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; python3 -m pip install --no-cache-dir --upgrade setuptools | ||
|
||
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 | ||
RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; python3 -m pip install --no-cache-dir --upgrade psycopg2-binary | ||
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 | ||
RUN source /etc/profile.d/conda.sh; conda activate /opt/idds; 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 | ||
|
||
RUN mkdir /opt/idds/config | ||
RUN mkdir /opt/idds/config/idds | ||
# RUN mkdir /opt/idds/config_default | ||
|
||
# ADD idds.cfg.default /opt/idds/config | ||
|
||
# RUN ls /opt/idds/etc; ls /opt/idds/etc/idds; ls /opt/idds/etc/panda; | ||
# RUN ls /opt/idds/config; ls /opt/idds/config/idds; | ||
|
||
# for rest service | ||
# RUN ln -fs /opt/idds/config/hostkey.pem /etc/grid-security/hostkey.pem | ||
# RUN ln -fs /opt/idds/config/hostcert.pem /etc/grid-security/hostcert.pem | ||
|
||
# to authenticate to rucio | ||
RUN ln -fs /opt/idds/config/ca.crt /opt/idds/etc/ca.crt | ||
RUN ln -fs /opt/idds/config/rucio.cfg /opt/idds/etc/rucio.cfg | ||
|
||
# for panda client to access panda | ||
RUN ln -fs /opt/idds/config/panda.cfg /opt/idds/etc/panda/panda.cfg | ||
|
||
# for idds rest service | ||
RUN ln -fs /opt/idds/config/idds/idds.cfg /opt/idds/etc/idds/idds.cfg | ||
RUN ln -fs /opt/idds/config/idds/auth.cfg /opt/idds/etc/idds/auth/auth.cfg | ||
RUN ln -fs /opt/idds/config/idds/gacl /opt/idds/etc/idds/rest/gacl | ||
RUN ln -fs /opt/idds/config/idds/httpd-idds-443-py39-cc7.conf /etc/httpd/conf.d/httpd-idds-443-py39-cc7.conf | ||
|
||
# for idds daemons | ||
RUN ln -fs /opt/idds/config/idds/supervisord_idds.ini /etc/supervisord.d/idds.ini | ||
|
||
ENV PATH /opt/idds/bin/:$PATH | ||
|
||
ADD start-daemon.sh /opt/idds/bin/ | ||
|
||
VOLUME /var/log/idds | ||
VOLUME /opt/idds/config | ||
|
||
ENTRYPOINT ["start-daemon.sh"] | ||
|
||
STOPSIGNAL SIGINT | ||
|
||
EXPOSE 443 | ||
CMD ["all"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
# - Wen Guan, <[email protected]>, 2019 - 2021 | ||
|
||
|
||
release_version = "0.10.5" | ||
release_version = "0.11.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
# - Wen Guan, <[email protected]>, 2019 - 2021 | ||
|
||
|
||
release_version = "0.10.5" | ||
release_version = "0.11.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0OA | ||
# | ||
# Authors: | ||
# - Wen Guan, <[email protected]>, 2022 | ||
|
||
import json | ||
from dogpile.cache import make_region | ||
|
||
from idds.common.config import config_has_section, config_has_option, config_get | ||
|
||
|
||
def get_cache_url(): | ||
if config_has_section('cache') and config_has_option('cache', 'url'): | ||
return config_get('cache', 'url') | ||
return '127.0.0.1:11211' | ||
|
||
|
||
def make_region_memcached(expiration_time, function_key_generator=None): | ||
""" | ||
Make and configure a dogpile.cache.memcached region | ||
""" | ||
if function_key_generator: | ||
region = make_region(function_key_generator=function_key_generator) | ||
else: | ||
region = make_region() | ||
|
||
region.configure( | ||
'dogpile.cache.memcached', | ||
expiration_time=expiration_time, | ||
arguments={ | ||
'url': get_cache_url, | ||
'distributed_lock': True, | ||
'memcached_expire_time': expiration_time + 60, # must be bigger than expiration_time | ||
} | ||
) | ||
|
||
return region | ||
|
||
|
||
REGION = make_region_memcached(expiration_time=3600) | ||
|
||
|
||
def update_cache(key, data): | ||
REGION.set(key, json.dumps(data)) | ||
|
||
|
||
def get_cache(key): | ||
data = REGION.get(key) | ||
if data: | ||
return json.loads(data) | ||
return data | ||
|
||
|
||
def delete_cache(key): | ||
REGION.delete(key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.