You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/operator_policy_packages/policy_package_algorithms.md
+71-3Lines changed: 71 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,81 @@ id: policy-package-algorithms
3
3
title: Developing Policy Package algorithms
4
4
---
5
5
6
-
### Adding a new algorithm class
6
+
A policy package can be used to define custom algorithms
7
+
based on core Rucio algorithms, in order to support custom logic.
8
+
9
+
The current core algorithms are:
10
+
-[`NonDeterministicPFNAlgorithms`](https://github.com/rucio/rucio/blob/0d44febcfd5d0a773a24d60668177324c534bd18/lib/rucio/common/utils.py#L384): Construct PFNs for non-deterministic RSEs
11
+
-[`AutoApprove`](https://github.com/rucio/rucio/blob/0d44febcfd5d0a773a24d60668177324c534bd18/lib/rucio/core/rule.py#L96): Handle automatic approval for replication rules
12
+
-[`ScopeExtractionAlgorithms`](https://github.com/rucio/rucio/blob/0d44febcfd5d0a773a24d60668177324c534bd18/lib/rucio/common/utils.py#L546): Extract scope from DID
13
+
-[`RSEDeterministicScopeTranslation`](https://github.com/rucio/rucio/blob/0d44febcfd5d0a773a24d60668177324c534bd18/lib/rucio/rse/translation.py#L31): Translate a PFN dictionary into a scope and name
14
+
-[`RSEDeterministicTranslation`](https://github.com/rucio/rucio/blob/0d44febcfd5d0a773a24d60668177324c534bd18/lib/rucio/rse/translation.py#L102): Translate an LFN to a path
15
+
-[`FTS3TapeMetadataPlugin`](https://github.com/rucio/rucio/blob/0d44febcfd5d0a773a24d60668177324c534bd18/lib/rucio/transfertool/fts3_plugins.py#L29): Add `archive_metadata` to FTS transfers to `TAPE`.
16
+
17
+
Most of these algorithms implement some default behaviour.
18
+
It is recommended to check this default behaviour to see
19
+
if it is suitable for your needs; if it needs to be changed,
20
+
please see below for how to create custom algorithms.
21
+
22
+
For `FTS3TapeMetadataPlugin` in particular,
23
+
please check the (FTS3 Transfertool Plugin documentation)[operator_transfers/configure_fts3_plugins.md].
24
+
25
+
## Developing a custom algorithm
26
+
To develop a custom algorithm:
27
+
28
+
1. Create a new class for your algorithm, subclassing the relevant core algorithm
29
+
2. Register the custom algorithm with a name that is unique in relation to all other algorithms of that type
30
+
(i.e. you cannot have two `RSEDeterministicScopeTranslation`-based algorithms with the same name,
31
+
but you can have a `RSEDeterministicScopeTranslation`-based algorithm and a `ScopeExtractionAlgorithms`-based algorithm
32
+
with the same name. In general, using your VO name should suffice.)
33
+
3. Trigger registration of the algorithm by calling the relevant class method at the bottom of your file
34
+
35
+
As an example, this is the custom `RSEDeterministicScopeTranslation` algorithm used in ATLAS:
0 commit comments