@@ -93,6 +93,29 @@ In all cases the names used to register the functions must be prefixed
93
93
with the name of the virtual organisation that owns the policy package,
94
94
to avoid naming conflicts on multi-VO Rucio installations.
95
95
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
+
96
119
## Deploying Policy Packages in containers
97
120
98
121
It is now common to deploy Rucio using containers managed by software
0 commit comments