Skip to content

Commit

Permalink
Merge pull request #848 from dmwm/rucio_35
Browse files Browse the repository at this point in the history
Merge Rucio 35
  • Loading branch information
ericvaandering authored Sep 26, 2024
2 parents 0193225 + 130a1ad commit 4ff204f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 7 deletions.
10 changes: 8 additions & 2 deletions docker/rucio-daemons/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ RUN mkdir -p /patch
# Patch for overwrite when only on disk in Rucio
# Required for additional checks that were introduced in the latest CMS FTS as a result of overwrite-when-only-on-disk implementation in FTS
# TODO: To be removed in Rucio 35
ADD https://patch-diff.githubusercontent.com/raw/rucio/rucio/pull/6903.diff /patch/6903.patch
# ADD https://patch-diff.githubusercontent.com/raw/rucio/rucio/pull/6903.diff /patch/6903.patch

# Patch for dst_file_report
ADD https://patch-diff.githubusercontent.com/raw/dynamic-entropy/rucio/pull/1.patch /patch/1.patch
ADD https://patch-diff.githubusercontent.com/raw/dynamic-entropy/rucio/pull/2.patch /patch/2.patch
ADD https://patch-diff.githubusercontent.com/raw/ericvaandering/rucio/pull/10.patch /patch/10.patch

# Patch for get-rse-info command for tapes
# Most probably not needed here at all, json serialisation should not be needed in daemons
ADD https://patch-diff.githubusercontent.com/raw/dynamic-entropy/rucio/pull/3.patch /patch/3.patch

# To be removed once this PR is available in our rucio version
ADD https://patch-diff.githubusercontent.com/raw/rucio/rucio/pull/7106.patch /patch/7106.patch
ENTRYPOINT ["/cms-entrypoint.sh"]
3 changes: 2 additions & 1 deletion docker/rucio-probes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ ADD https://raw.githubusercontent.com/voetberg/rucio_probes/common_context_manag
ADD https://raw.githubusercontent.com/voetberg/rucio_probes/common_context_manager_update/common/check_unlocked_replicas /probes/common
ADD https://raw.githubusercontent.com/voetberg/rucio_probes/common_context_manager_update/common/check_updated_dids /probes/common

# PR 136 - Can be merged when working
# PR 136 which was closed in favor of #145, which should be watched.
# N.b. they will not move to the CMS VO, so we need a change to flux as well
ADD https://raw.githubusercontent.com/ericvaandering/probes/cms_usage_probes/cms/check_deletable_replicas /probes/cms
ADD https://raw.githubusercontent.com/ericvaandering/probes/cms_usage_probes/cms/check_obsolete_replicas /probes/cms

Expand Down
5 changes: 4 additions & 1 deletion docker/rucio-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN mkdir -p /patch

# Patch for dst_file_report
ADD https://patch-diff.githubusercontent.com/raw/dynamic-entropy/rucio/pull/1.patch /patch/1.patch
ADD https://patch-diff.githubusercontent.com/raw/dynamic-entropy/rucio/pull/2.patch /patch/2.patch
ADD https://patch-diff.githubusercontent.com/raw/ericvaandering/rucio/pull/10.patch /patch/10.patch

# Patch for get-rse-info command for tapes
ADD https://patch-diff.githubusercontent.com/raw/dynamic-entropy/rucio/pull/3.patch /patch/3.patch

ENTRYPOINT ["/cms-entrypoint.sh"]
5 changes: 4 additions & 1 deletion docker/rucio-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ RUN rm -f /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/userdir.conf /etc/htt
ENV RUCIO_CA_PATH="/cvmfs/grid.cern.ch/etc/grid-security/certificates"

# Cannot make patch directory unless there are patches
#RUN mkdir -p /patch
RUN mkdir -p /patch

# Patch for auto approve plugin rucio/pull/6215
#ADD https://github.com/rucio/rucio/pull/6215.patch /patch/6215.patch

# Patch for get-rse-info command for tapes
ADD https://patch-diff.githubusercontent.com/raw/dynamic-entropy/rucio/pull/3.patch /patch/3.patch

ADD docker/rucio-ui/cms-entrypoint.sh /
ENTRYPOINT ["/cms-entrypoint.sh"]
7 changes: 5 additions & 2 deletions src/policy/CMSRucioPolicy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#
# Eric Vaandering <[email protected]>, 2022

from CMSRucioPolicy.algorithms import lfn2pfn, auto_approve
from CMSRucioPolicy.algorithms import lfn2pfn, auto_approve, pfn2lfn

SUPPORTED_VERSION = ["32", "33", "34"]
SUPPORTED_VERSION = ["32", "33", "34", "35"]


def get_algorithms():
Expand All @@ -17,5 +17,8 @@ def get_algorithms():
},
'auto_approve': {
'global': auto_approve.global_approval,
},
'pfn2lfn': {
'cms_pfn2lfn': pfn2lfn.cms_pfn2lfn,
}
}
14 changes: 14 additions & 0 deletions src/policy/CMSRucioPolicy/algorithms/pfn2lfn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
PFN to scope:name translation algorithm for CMS Rucio policy
"""
from collections.abc import Mapping

def cms_pfn2lfn(parsed_pfn: Mapping[str, str]) -> tuple[str, str]:
"""
This function converts a PFN into scope:name pair.
It ignores user scopes and sets all scopes to cms.
"""
# Ignore user scopes for now
scope = "cms"
name = parsed_pfn['path'] + parsed_pfn['name']
return name, scope

0 comments on commit 4ff204f

Please sign in to comment.