Skip to content

Commit 5196599

Browse files
jamesp-epccbari12
authored andcommitted
Add documentation on how to add a new policy package algorithm class
1 parent fd78100 commit 5196599

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/operator/policy_packages.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,29 @@ In all cases the names used to register the functions must be prefixed
9393
with the name of the virtual organisation that owns the policy package,
9494
to avoid naming conflicts on multi-VO Rucio installations.
9595

96+
## Adding a new algorithm class
97+
98+
The system for registering algorithms within policy packages is
99+
intended to be extensible so that new algorithm classes can be added
100+
relatively easily. The basic workflow is as follows:
101+
102+
- The `get_algorithms` function within the policy package (see above)
103+
should return a dictionary of functions of the new class, indexed
104+
by name
105+
- The core Rucio code should maintain a dictionary of functions of the
106+
new class, ready to be called when required. The details of this
107+
will differ depending on what the new class actually does and how it
108+
integrates with the Rucio code, but typically the algorithm name to
109+
be used will be selected by a value in the config file, as for the
110+
current `lfn2pfn` and `surl` algorithm types.
111+
- Before the algorithm is called for the first time, the core Rucio
112+
code should call `rucio.common.utils.register_policy_package_algorithms`
113+
to import the algorithms for this class from the policy package and
114+
store them in its internal dictionary. This function takes care of
115+
the complexities of interfacing with the policy package, such as
116+
importing the package if necessary, and dealing with multiple
117+
packages in multi-VO Rucio installations.
118+
96119
## Deploying Policy Packages in containers
97120

98121
It is now common to deploy Rucio using containers managed by software

0 commit comments

Comments
 (0)