Skip to content

Commit

Permalink
Merge pull request #714 from d-ylee/652-migrate-client-image-for-cron…
Browse files Browse the repository at this point in the history
…jobs-to-alma9

Migrate CMSRucioClient base image to almalinux9
  • Loading branch information
ericvaandering authored Mar 4, 2024
2 parents 3df809c + 07376f4 commit 5e2008b
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 26 deletions.
55 changes: 29 additions & 26 deletions docker/CMSRucioClient/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,55 @@
FROM centos:7
FROM almalinux:9

RUN yum upgrade -y && \
yum clean all && \
rm -rf /var/cache/yum
ARG RUCIO_VERSION

RUN yum install -y epel-release.noarch && \
yum clean all && \
rm -rf /var/cache/yum
RUN dnf upgrade -y && \
dnf clean all && \
rm -rf /var/cache/dnf

RUN dnf install -y epel-release.noarch && \
dnf clean all && \
rm -rf /var/cache/dnf

RUN dnf config-manager --set-enabled crb

# FIXME: What is all this? We can't need it all
RUN yum install -y python3 python3-pip pylint \
httpd mod_wsgi libaio gcc python-devel.x86_64 \
install wget unzip \
mod_ssl openssl-devel.x86_64 bind-utils nano git && \
yum clean all && \
rm -rf /var/cache/yum
RUN dnf install -y python3 python3-pip pylint \
httpd mod_wsgi libaio gcc python3-devel \
wget unzip \
mod_ssl openssl-devel bind-utils nano git && \
dnf clean all && \
rm -rf /var/cache/dnf

WORKDIR /tmp

# Get various repos for yum setup
RUN curl -o /etc/yum.repos.d/ca.repo https://raw.githubusercontent.com/rucio/rucio/1.20.3/etc/docker/dev/ca.repo

# Install WLCG repo for CMS VOMS

RUN yum -y install http://linuxsoft.cern.ch/wlcg/centos7/x86_64/wlcg-repo-1.0.0-1.el7.noarch.rpm && \
yum clean all && \
rm -rf /var/cache/yum
RUN dnf -y install http://linuxsoft.cern.ch/wlcg/el9/x86_64/wlcg-repo-1.0.0-1.el9.noarch.rpm && \
dnf clean all && \
rm -rf /var/cache/dnf

# Install sets of RPM
# FIXME: This overlaps with above

RUN yum-config-manager --save --setopt=wlcg.skip_if_unavailable=true \
&& yum install -y which krb5-devel gridsite \
lcg-CA globus-proxy-utils voms-clients-java voms-clients-cpp wlcg-voms-cms \
gfal2-python gfal2-all gfal2-util gfal2-python3 \
RUN dnf config-manager --save --setopt=wlcg.skip_if_unavailable=true \
&& dnf install -y which krb5-devel gridsite \
globus-proxy-utils voms-clients-java voms-clients-cpp wlcg-voms-cms \
gfal2-util gfal2-all gfal2-plugin-xrootd python3-gfal2 \
nordugrid-arc-client nordugrid-arc-plugins-gfal \
nordugrid-arc-plugins-globus nordugrid-arc-plugins-s3 \
nordugrid-arc-plugins-xrootd \
xrootd-client && \
yum clean all && \
rm -rf /var/cache/yum
dnf clean all && \
rm -rf /var/cache/dnf


# Install Rucio and other stuff

RUN pip3 install --upgrade pip
RUN pip3 install --upgrade setuptools
RUN pip3 install rucio-clients
RUN pip3 -v install rucio-clients==$RUCIO_VERSION
RUN pip3 install python-gitlab
RUN pip3 install liboidcagent

Expand Down Expand Up @@ -75,8 +78,8 @@ RUN mkdir -p /etc/grid-security ; ln -s /cvmfs/grid.cern.ch/etc/grid-security/ce
# COPY scripts /root/CMSRucio/docker/CMSRucioClient/scripts

# Our schema
ADD https://raw.githubusercontent.com/ericvaandering/rucio/cms_nano12/lib/rucio/common/schema/cms.py /usr/lib/python2.7/site-packages/rucio/common/schema/cms.py
RUN python -m compileall /usr/lib/python2.7/site-packages/rucio/common/schema
ADD https://raw.githubusercontent.com/ericvaandering/rucio/cms_nano12/lib/rucio/common/schema/cms.py /usr/lib/python3.9/site-packages/rucio/common/schema/cms.py
RUN python3 -m compileall /usr/lib/python3.9/site-packages/rucio/common/schema

ENV X509_USER_PROXY=/tmp/x509up
ENTRYPOINT ["/bin/bash", "-c", "sleep infinity"]
82 changes: 82 additions & 0 deletions docker/CMSRucioClient/Dockerfile.centos7
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FROM centos:7

RUN yum upgrade -y && \
yum clean all && \
rm -rf /var/cache/yum

RUN yum install -y epel-release.noarch && \
yum clean all && \
rm -rf /var/cache/yum

# FIXME: What is all this? We can't need it all
RUN yum install -y python3 python3-pip pylint \
httpd mod_wsgi libaio gcc python-devel.x86_64 \
install wget unzip \
mod_ssl openssl-devel.x86_64 bind-utils nano git && \
yum clean all && \
rm -rf /var/cache/yum

WORKDIR /tmp

# Get various repos for yum setup
RUN curl -o /etc/yum.repos.d/ca.repo https://raw.githubusercontent.com/rucio/rucio/1.20.3/etc/docker/dev/ca.repo

# Install WLCG repo for CMS VOMS

RUN yum -y install http://linuxsoft.cern.ch/wlcg/centos7/x86_64/wlcg-repo-1.0.0-1.el7.noarch.rpm && \
yum clean all && \
rm -rf /var/cache/yum

# Install sets of RPM
# FIXME: This overlaps with above

RUN yum-config-manager --save --setopt=wlcg.skip_if_unavailable=true \
&& yum install -y which krb5-devel gridsite \
lcg-CA globus-proxy-utils voms-clients-java voms-clients-cpp wlcg-voms-cms \
gfal2-python gfal2-all gfal2-util gfal2-python3 \
nordugrid-arc-client nordugrid-arc-plugins-gfal \
nordugrid-arc-plugins-globus nordugrid-arc-plugins-s3 \
nordugrid-arc-plugins-xrootd \
xrootd-client && \
yum clean all && \
rm -rf /var/cache/yum


# Install Rucio and other stuff

RUN pip3 install --upgrade pip
RUN pip3 install --upgrade setuptools
RUN pip3 -v install rucio-clients
RUN pip3 install python-gitlab
RUN pip3 install liboidcagent

# Install DAS client to pull info from PhEDEx/DBS
RUN curl -k -o /bin/dasgoclient https://www.lns.cornell.edu/~vk/Work/dasgoclient && chmod +x /bin/dasgoclient
RUN curl -o /etc/ca.crt https://cafiles.cern.ch/cafiles/certificates/CERN%20Root%20Certification%20Authority%202.crt

WORKDIR /root
RUN git clone https://github.com/rucio/rucio.git

COPY scripts /scripts
COPY loadtest /loadtest

COPY rucio-testbed.cfg /opt/rucio-testbed/etc/rucio.cfg
COPY rucio-dev.cfg /opt/rucio-dev/etc/rucio.cfg
COPY rucio-int.cfg /opt/rucio-int/etc/rucio.cfg
COPY rucio-prod.cfg /opt/rucio-prod/etc/rucio.cfg

# Pull some useful stuff out of git
WORKDIR /root
RUN git clone https://github.com/dmwm/CMSRucio.git

RUN mkdir -p /etc/grid-security ; ln -s /cvmfs/grid.cern.ch/etc/grid-security/certificates /etc/grid-security/

# Overwrite what's there for testing
# COPY scripts /root/CMSRucio/docker/CMSRucioClient/scripts

# Our schema
ADD https://raw.githubusercontent.com/ericvaandering/rucio/cms_nano12/lib/rucio/common/schema/cms.py /usr/lib/python2.7/site-packages/rucio/common/schema/cms.py
RUN python -m compileall /usr/lib/python2.7/site-packages/rucio/common/schema

ENV X509_USER_PROXY=/tmp/x509up
ENTRYPOINT ["/bin/bash", "-c", "sleep infinity"]
10 changes: 10 additions & 0 deletions docker/CMSRucioClient/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e

export RUCIO_VERSION=32.3.1
export CMS_VERSION=${RUCIO_VERSION}.cms1

export HARBOR=registry.cern.ch/cmsrucio

podman build --build-arg RUCIO_VERSION=$RUCIO_VERSION -f Dockerfile -t $HARBOR/rucio-client:release-$CMS_VERSION .

0 comments on commit 5e2008b

Please sign in to comment.