Skip to content

Commit fa17d9e

Browse files
authored
Merge branch 'main' into cli_migration
2 parents 6ce1e80 + f9f95b4 commit fa17d9e

14 files changed

+402
-423
lines changed

docs/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ and more can be found by browsing through the sub-sections of this topic.
2727
- [What is Rucio](started/what_is_rucio.md)
2828
- [Main Components](started/main_components.md)
2929
- [Additional Layers and Resources](started/additional_layers_and_resources.md)
30+
- [About Rucio Daemons](started/daemons.md)
3031

3132
## Client
3233

@@ -60,8 +61,8 @@ Developer documentation will help you get started. Peruse some common REST API &
6061
Client API references that are directly derived from Rucio's python
6162
libraries. We also have a contribution guide for those who wish to pitch in.
6263

63-
- [Client API Documentation](client_api/accountclient)
64-
- REST API Documentation
64+
- [Client API Documentation](pathname:///html/site/client.html)
65+
- [REST API Documentation](pathname:///html/rest_api_doc.html)
6566
- [Contributing guide](contributing)
6667

6768
## Contributing to the Documentation

docs/operator/k8s_guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ OPENSTACK_PROJECT=cc059d57-6e98-4688-a3be-aae2b451868b,<your-openstack-project-I
168168
The ID `cc059d57-6e98-4688-a3be-aae2b451868b` will allow the LoadBalancer as a Service (LBaaS) instance to [assign LoadBalancers to this set](https://clouddocs.web.cern.ch/networking/load_balancing.html#adding-load-balancer-to-landb-sets). In the specific case of the COMPASS rucio instance, the `openstack-landb-set-access` is being set as a member of the `rucio-it-admins` egroup.
169169
Please refer to the LoadBalancers section for more information.
170170
:::
171-
![[/img/landb-set-create.png]]
171+
![image](/img/landb-set-create.png)
172172
173173
# Populating the cluster
174174
There are four main components that need to be installed in order to have the Rucio cluster operative:
@@ -338,7 +338,7 @@ With respect to the [original Helm chart](https://github.com/rucio/helm-charts/b
338338
This setup will trigger the `openstack-cloud-controller-manager` pod, and will automatically instantiate the requested LBs.
339339
340340
Please notice that in order to have LBs, one must request a quota change to the openstack project:
341-
![[/img/get-lbs.png]]
341+
![image](/img/get-lbs.png)
342342
343343
To check the status of the LBs, the CLI command can be used:
344344
```sh
@@ -376,7 +376,7 @@ In the current example, a cert for `compass-rucio.cern.ch` (corresponding to the
376376
377377
:::tip[Certs pro move]
378378
> Create a [grid Host certificate](https://ca.cern.ch/ca/host/Request.aspx?template=ee2host) linked to both servers and auth domains. If you need, you can specify Subject Alternative Names (SANs) for your certificate, in DNS format in the SAN box. Then you'll have one cert to rule them all:
379-
![[/img/grid-host-certs.png]]
379+
![image](/img/grid-host-certs.png)
380380
:::
381381

382382
#### Create the `host`, `key`, `ca` and `GridCA` files
@@ -557,7 +557,7 @@ additionalEnvs:
557557
558558
A diagram of how the proxy certificate is created and mounted on the daemons is displayed below:
559559
560-
![[/img/daemons-chart.png]]
560+
![image](/img/daemons-chart.png)
561561
## Rucio UI
562562
[Reference Helm Chart](https://gitlab.cern.ch/rucio-it/flux-compass/-/blob/master/sync/rucio-ui.yaml?ref_type=heads).
563563

docs/operator/multi_vo_rucio.md

Lines changed: 102 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ title: Multi-VO Rucio
44
sidebar_label: Multi-VO Rucio
55
---
66

7-
This section provides an overview of using Rucio for multiple virtual
8-
organizations (VOs) on a single instance with the "Multi-VO" feature. Rather
9-
than each VO having to set up an entire instance by themselves, they can share
10-
the same server and database which are run by a central "super_root", and
11-
continue to use Rucio as they would a normal or "Single-VO" instance. Their
12-
accounts, scopes and RSEs are associated with their VO which ensures all rules
13-
and replicas are kept separate from other VOs using the instance.
7+
Multi-VO Rucio configuration allows a single instance of Rucio to support
8+
multiple experiments or Virtual Organisations (VOs). Multi-VO Rucio are run by a
9+
"super_root" which administers the Rucio instance, creating VOs within Rucio,
10+
each VO is then administered by VO specific "root" accounts created with the VO
11+
that deal with the VO requirements and needs. Each VO uses Rucio as a normal or
12+
"Single-VO" instance, meaning a Rucio instance can transition to support more
13+
VOs without significant disruption. Each VO's accounts, scopes and RSEs are
14+
associated with their VO which ensures all rules and replicas are kept separate
15+
from other VOs using the instance.
1416

1517
## Changes to the Client
1618

17-
At the CLI and client level there are few changes to how Rucio is used. These
18-
cases, such as optional arguments for VO, are covered in documentation for the
19-
affected function. The main change is the addition of two options in the
20-
`rucio.cfg` file, one to flag that the instance is being run in M-VO mode and
21-
another to specify the VO the users belong to:
19+
To utilise the Rucio client against a Multi-VO Rucio the client needs to first
20+
know if it is interacting with a multi-VO Rucio instance, then which VO the client
21+
should be accessing. This is done in the `rucio.cfg` as shown below:
2222

2323
```cfg
2424
[common]
@@ -33,29 +33,39 @@ vo = abc
3333
## Changes to the rucio.cfg on the Server and Daemons
3434

3535
Similar settings need to be changed on the server and daemon rucio.cfg files as
36-
well as on the client end. For the server `multi_vo` should also be set in the
37-
config file. For the daemons another section is needed to be added, this is to
36+
well as on the client end. For the server, `multi_vo` should also be set in the
37+
config file. For the daemons, another section needs to be added: this is to
3838
map each VO to its own proxy certificate. Rucio uses this information when
3939
submitting and polling transfers to use the correct certificates.
4040

4141
```cfg
42+
[common]
43+
...
44+
multi_vo = True
45+
4246
[vo_certs]
4347
...
4448
<3 char vo name> = <path/to/vo/proxy>
4549
```
4650

47-
It is recommended that the proxies are placed in /tmp/x509up_[VO], and the
51+
It is recommended that the proxies are placed in /tmp/x509up\_[VO], and the
4852
certificates and keys are placed in /opt/rucio/certs/[VO]/ and
4953
/opt/rucio/keys/[VO]/ respectively.
5054

51-
However, `vo` should not be set for the server or the daemons as these parts of
52-
Rucio are not associated with a single VO. If `multi_vo` is not set, or set to
53-
False, then Rucio will operate normally.
55+
Unlike the Rucio client, `vo` in the `client` section should not be configured
56+
for the server and daemons, unless specifically to ensure certain daemons act
57+
for one VO alone:
5458

55-
Similar settings need to be changed on the server and daemon rucio.cfg files as
56-
well as on the client end. For the server `multi_vo` should also be set in the
57-
config file. For the daemons another section is needed to be added, this is to
58-
map each VO to its own proxy certificate. Rucio uses this information when
59+
```cfg
60+
[common]
61+
...
62+
multi_vo = True
63+
```
64+
65+
For the daemons, files and configuration are needed to allow daemons to act on
66+
the various VOs: this inludes the VO specific certificates, keys, and proxies,
67+
as well as an additional configuration section which maps each VO to its
68+
respective x.509 authentication credentials. Rucio uses this information when
5969
submitting and polling transfers to use the correct certificates.
6070

6171
```yaml
@@ -64,26 +74,25 @@ submitting and polling transfers to use the correct certificates.
6474
[3 char vo name] = [path/to/vo/proxy]
6575
```
6676

67-
However, `vo` should
68-
not be set for the server or the daemons as these parts of Rucio are not
69-
associated with a single VO. If `multi_vo` is not set, or set to False, then
70-
Rucio will operate normally.
71-
7277
## Role of the super_root
7378

74-
While root accounts still retain their administrative role within a VO, for
75-
example adding RSEs and accounts, functions relating to the creation and
76-
management of VOs is handled by the super_root account, a concept introduced
77-
with M-VO Rucio. It is worth noting that the super_root account **cannot** be
79+
For overall administration of Multi-VO Rucio another layer of admin role has
80+
been created outside of the VO structure. This means each VO has its own
81+
root/admin accounts still retain their administrative role within a VO, for
82+
example adding and editing accounts, adding and modifying RSEs for the VO.
83+
Functions relating to the creation and management of VOs are handled by the
84+
super_root account. It is worth noting that the super_root account **cannot** be
7885
used to perform individual VO administration; the roles of super_root and root
7986
are distinct.
8087

8188
## Access of super_root Functions
8289

8390
As the super_root functions aren't intended for use by normal users of admins,
84-
they do not have an implementation in the client or CLI. They can be accessed
85-
from the core or the :ref:`vo-rest-api`, however the latter will require the VO
86-
endpoint to be added to the aliases file used when setting up the server as it
91+
they do not have an implementation in the client or CLI.
92+
93+
The super_root functions can be accessed from the core or the
94+
:ref:`vo-rest-api`. Access to the functions through the API will require the VO
95+
endpoint to be added to the endpoints list used when setting up the server as it
8796
is disabled by default.
8897

8998
## Starting a M-VO Instance
@@ -96,32 +105,26 @@ it. The identity used to access this account can be managed in the usual way.
96105
## Creating VOs
97106

98107
When creating a new VO with the `add_vo` function you need to specify the three
99-
digit identifier for the new VO, which can contain letters and numbers. This
100-
must be unique for the instance. A more complete description can also be
101-
optionally included, along with an email to use for the root of this new VO. In
102-
addition to creating the new VO, a root account is also created for this VO, and
103-
has all identities associated with super_root added to it. The identities for
104-
the new root can then be configured as usual.
105-
106-
## Managing VOs
107-
108-
In addition to creating VOs, the description and email for a VO can be altered
109-
using `update_vo`. If the root user of a VO loses access to their account, the
110-
super_root can associate a new identity with it using
111-
`recover_vo_root_identity`. Finally, a list of current VOs and their
112-
descriptions is accessible via `list_vos`.
108+
character identifier for the new VO, which can contain letters and numbers. This
109+
must be unique for the instance (A long VO name can be enabled for usage if
110+
required, as shown in the [`Long VO Name Mapping`](#long-vo-name-mapping)
111+
section). A more complete description can also be optionally included, along
112+
with an email to use for the root of this new VO. As the new VO is created, its
113+
corresponding root account is also created, and has all identities associated
114+
with super_root added to it. The identities for the VO root can then be
115+
configured as usual.
113116

114117
## Long VO Name Mapping
115118

116119
The rucio database stores all VO references as a single three-character tag for
117120
performance reasons. It's possible to create aliases for these tag to allow
118121
users/clients to specify long VO names when getting a token (and modifying VOs)
119122
and have these converted to the internal tag automatically. Long VO names should
120-
only use the basic DNS name character set of alphanumber charaters, hyphen and
121-
dot (a-zA-Z0-9-.). The alias mappings are stored in the vo-map section of the
122-
configs database table and can be edited via the usual methods for modifying
123-
this config. The option name is the long VO name and the value is the short
124-
name; for example these can be added using the CLI:
123+
only use the basic DNS name character set of alphanumeric characters, hyphen
124+
and dot (a-zA-Z0-9-.). The alias mappings are stored in the vo-map section of
125+
the configs database table and can be edited via the commands below. The option
126+
name is the long VO name and the value is the short name; for example these can
127+
be added using the CLI:
125128

126129
```bash
127130
rucio-admin config set --section vo-map --option my.long.vo --value mlv
@@ -130,28 +133,44 @@ rucio-admin config set --section vo-map --option another.vo --value ant
130133

131134
You may specify more than one alias for a VO if required.
132135

136+
## Managing VOs
137+
138+
Super_root can also change the description and email for a VO using the `update_vo`
139+
API call. If a VO root user loses access to their account, the super_root can
140+
associate a new identity with it using `recover_vo_root_identity`. Finally, a
141+
list of current VOs and their descriptions is accessible via `list_vos`.
142+
133143
## Converting Existing Instances
134144

135-
As opposed to starting a new M-VO instance from scratch, it may be desirable to
136-
convert the database for an existing (S-VO) Rucio instance into a M-VO instance
137-
so that additional VOs can be added without disrupting the original VO or
138-
needing to create a second instance. Conversely, one VO within a M-VO instance
139-
may grow to the point where it needs its own dedicated instance, and so
140-
converting data from M-VO to S-VO may also be desirable. These operations can be
141-
performed using utility functions included with Rucio.
142-
143-
As mentioned above, in order to configure a M-VO instance of Rucio only the
144-
config file needs to change. However for an existing instance any entries
145-
already in the database will not be associated with a VO (or associated with
146-
their old one if previously in M-VO mode). In order to change these, direct
147-
operations on the database are required. These commands are generated using
148-
SQLAlchemy, and can either be run directly on the database or printed out and
149-
run manually.
145+
Rather than initialising a new Rucio instance to support multiple VOs, a
146+
single-VO instance of Rucio can be converted to a Multi-VO instance if desired.
147+
This conversion allows the Rucio instance to expand the number of supported VOs
148+
with minimal disruption. The tools to perform this can be found in
149+
[`rucio/tools/convert_database_vo.py`](https://github.com/rucio/rucio/blob/master/tools/convert_database_vo.py),
150+
and further documentation on the [single VO to multi VO](#s-vo-to-m-vo) and
151+
[multi-VO to single VO](#m-vo-to-s-vo) instances are found below.
152+
153+
The fuction `convert_to_mvo` facilitates the conversion of a single-VO instance
154+
to a multi-VO instance, where `convert_to_svo` performs the opposite. VOs can
155+
also be renamed using `rename_vo`, or deleted using `remove_vo`. The conversion
156+
functions are callable by using the command line with details on what each
157+
function requires to be carried out, as well as various optional arguments.
158+
159+
Remember that after any database conversion tools are used to update the `rucio.cfg`
160+
appropriately, this may include adding the `multi_vo = True`, as found in
161+
[`changes to the rucio.cfg section`](#changes-to-the-ruciocfg-on-the-server-and-daemons).
162+
163+
These above tools will allow Rucio to change its VO support model. However,
164+
when converting an existing instance, any entries already in the database will
165+
not be associated with a VO (or associated with their old one if previously in
166+
M-VO mode). In order to change these, direct operations on the database are
167+
required. These commands are generated using SQLAlchemy, and can either be run
168+
directly on the database or printed out and run manually.
150169

151170
## Practicalities
152171

153172
Before attempting to convert existing data, it is recommended that a backup of
154-
the database is taken in case an issue arises. Furthermore, of the databases
173+
the database is taken in case any issues arise. Furthermore, of the databases
155174
supported by Rucio, only PostgreSQL has been tested on real data. Based on this
156175
test (which was performed on a machine with 64GB memory and four Intel Xeon
157176
E5-2430 v2), the tables with 2 columns that needed updating were converted at a
@@ -165,8 +184,8 @@ be accessed using the `super_root` account if needed.
165184

166185
## S-VO to M-VO
167186

168-
Before starting, ensure that `multi_vo` is set to `True` in the config file.
169-
The SQL commands needed to convert the database involve dropping foreign key
187+
Before starting, ensure that `multi_vo` is set to `True` in the config file. The
188+
SQL commands needed to convert the database involve dropping foreign key
170189
constraints that affect accounts/scopes, then altering the relevant columns,
171190
before re-adding the constraints. The 3 character identifier for the VO, a full
172191
description and an admin email should be provided:
@@ -194,12 +213,12 @@ $ python
194213
>>> create_root_account(create_counters=False)
195214
```
196215

197-
Alternatively by specifying `--commit_changes` the script will attempt to
198-
modify the database as it runs, however this requires the account used by the
199-
Rucio instance to access the database to be the owner of the the tables. In
200-
this case, the `super_root` account can be added as part of the script by
201-
passing the argument `--create_super_root`. If there is an error during the
202-
conversion, then none of the changes will be committed.
216+
Alternatively by specifying `--commit_changes` the script will attempt to modify
217+
the database as it runs, however this requires the account used by the Rucio
218+
instance to access the database to be the owner of the the tables. In this case,
219+
the `super_root` account can be added as part of the script by passing the
220+
argument `--create_super_root`. If there is an error during the conversion, then
221+
none of the changes will be committed.
203222

204223
```bash
205224
$ tools/convert_database_vo.py --commit_changes \
@@ -223,6 +242,7 @@ Before starting, ensure that `multi_vo` is set to `True` in the config file
223242
the conversion is the same as before, dropping foreign key constraints and
224243
renaming the entries that were associated with the old VO. The name of this VO
225244
is the only required argument:
245+
226246
```bash
227247
$ tools/convert_database_vo.py
228248
convert_to_svo old ALTER TABLE account_limits DROP CONSTRAINT
@@ -233,10 +253,10 @@ account_limits ADD CONSTRAINT "ACCOUNT_LIMITS_ACCOUNT_FK" FOREIGN KEY(account)
233253
REFERENCES accounts (account);
234254
```
235255

236-
By default data associated with any other VOs
237-
is left in the database, but will be inaccessible to Rucio users. By setting
238-
pass the argument `--delete_vos`, these entries will be deleted from the
239-
database completely:
256+
By default, data associated with any other VOs is left in the database, but will
257+
be inaccessible to Rucio users.
258+
These entries can be completely deleted from the database
259+
by pasing the `--delete_vos` argument.
240260

241261
```bash
242262
tools/convert_database_vo.py convert_to_svo old --delete_vos ... \
@@ -250,6 +270,7 @@ Once again, historical tables skipped with `--skip_history`, and the commands
250270
can be run directly against the database using the `--commit_changes` argument;
251271
if this is not set then the `super_root` account should be manually deleted
252272
after running the SQL:
273+
253274
```bash
254275
$ python
255276
>>> from rucio.common.types import InternalAccount

0 commit comments

Comments
 (0)