root / docs / design / resource-defaults.rst @ d8e8581b
History | View | Annotate | Download (4.1 kB)
1 | 111adca0 | Giorgos Korfiatis | Resource default limits and visibility |
---|---|---|---|
2 | 111adca0 | Giorgos Korfiatis | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
3 | 111adca0 | Giorgos Korfiatis | |
4 | 111adca0 | Giorgos Korfiatis | We wish to keep track of resources which are not visible to the user or |
5 | 111adca0 | Giorgos Korfiatis | resources that we don't care to impose a certain limit on. For example, we |
6 | 111adca0 | Giorgos Korfiatis | wish to know the total number of CPUs per user without checking a limit and |
7 | 111adca0 | Giorgos Korfiatis | without the user needing to specify a value when applying for a new project. |
8 | 111adca0 | Giorgos Korfiatis | However, the administrator should be able at any time to change either of |
9 | 111adca0 | Giorgos Korfiatis | these parameters. |
10 | 111adca0 | Giorgos Korfiatis | |
11 | 111adca0 | Giorgos Korfiatis | Resource registration |
12 | 111adca0 | Giorgos Korfiatis | ===================== |
13 | 111adca0 | Giorgos Korfiatis | |
14 | 111adca0 | Giorgos Korfiatis | A new resource will be registered with an infinite base quota limit (denoted |
15 | 111adca0 | Giorgos Korfiatis | by 2**63-1). A holding is created in the quotaholder for each accepted user |
16 | 111adca0 | Giorgos Korfiatis | with the said limit. This means that the resource is ready to be used in a |
17 | 111adca0 | Giorgos Korfiatis | commission, but we are not interested in checking a senseful limit. |
18 | 111adca0 | Giorgos Korfiatis | |
19 | 111adca0 | Giorgos Korfiatis | Resource ``cyclades.cpu`` will from now on denote the number of active cpus. |
20 | 111adca0 | Giorgos Korfiatis | Its description will change to explain this. A new resource, |
21 | 111adca0 | Giorgos Korfiatis | ``cyclades.total_cpu``, will also be registered in the system, with the |
22 | 111adca0 | Giorgos Korfiatis | semantics ``cyclades.cpu`` used to have. The reason for this change is that |
23 | 111adca0 | Giorgos Korfiatis | (in our default policy) we would like to control the number of active CPUs |
24 | 111adca0 | Giorgos Korfiatis | but not the total CPUs (the latter would have an infinite limit). However, |
25 | 111adca0 | Giorgos Korfiatis | existing projects have specified a value for the resource ``cyclades.cpu``. |
26 | 111adca0 | Giorgos Korfiatis | If we don't reinterpret it as active CPUs, then this grant will be |
27 | 111adca0 | Giorgos Korfiatis | useless: It will add a value to infinite total CPUs, but provide no active |
28 | 111adca0 | Giorgos Korfiatis | CPUs. Likewise we will change ``cyclades.ram`` and register |
29 | 111adca0 | Giorgos Korfiatis | ``cyclades.total_ram``. |
30 | 111adca0 | Giorgos Korfiatis | |
31 | 111adca0 | Giorgos Korfiatis | There now exists attribute ``allow_in_projects`` in resource definitions, |
32 | 111adca0 | Giorgos Korfiatis | which controls whether a resource appears in a project application in the |
33 | 111adca0 | Giorgos Korfiatis | UI. Currently, this is set to False only for resource |
34 | 111adca0 | Giorgos Korfiatis | ``astakos.pending_app``. This will be renamed to ``ui_visible`` and affect |
35 | 111adca0 | Giorgos Korfiatis | also the appearance in the Usage page. A new attribute ``api_visible`` will |
36 | 111adca0 | Giorgos Korfiatis | also be included in resource definition (True by default), to control |
37 | 111adca0 | Giorgos Korfiatis | whether the resource can appear in related API calls: GET /resources, GET |
38 | 111adca0 | Giorgos Korfiatis | /quotas, POST /projects (applying for a project), etc. ``ui_visible`` will |
39 | 111adca0 | Giorgos Korfiatis | entail ``api_visible``. Both attributes will be adjustable through |
40 | 111adca0 | Giorgos Korfiatis | ``snf-manage resource-modify``. |
41 | 111adca0 | Giorgos Korfiatis | |
42 | 111adca0 | Giorgos Korfiatis | Resources ``cyclades.total_cpu`` and ``cyclades.total_ram`` will be marked |
43 | 111adca0 | Giorgos Korfiatis | with ``ui_visible=False`` and ``api_visible=False``. |
44 | 111adca0 | Giorgos Korfiatis | |
45 | 111adca0 | Giorgos Korfiatis | Changing base quota |
46 | 111adca0 | Giorgos Korfiatis | =================== |
47 | 111adca0 | Giorgos Korfiatis | |
48 | 111adca0 | Giorgos Korfiatis | Base quota for a certain user is currently determined by looking up |
49 | 111adca0 | Giorgos Korfiatis | the default base quota that is registered for the resource, unless there |
50 | 111adca0 | Giorgos Korfiatis | exists a custom limit for the user/resource pair in the model |
51 | 111adca0 | Giorgos Korfiatis | AstakosUserQuota. Resource limit can change with:: |
52 | 111adca0 | Giorgos Korfiatis | |
53 | 111adca0 | Giorgos Korfiatis | snf-manage resource-modify <resource_name> --limit <value> |
54 | 111adca0 | Giorgos Korfiatis | |
55 | 111adca0 | Giorgos Korfiatis | This not only changes the quota scheme for future users but also affects all |
56 | 111adca0 | Giorgos Korfiatis | existing users that have no custom limit for this resource. This is |
57 | 111adca0 | Giorgos Korfiatis | troublesome, because it doesn't allow simply changing the future quota |
58 | 111adca0 | Giorgos Korfiatis | scheme. One is forced to rather set custom quota for new users, just in |
59 | 111adca0 | Giorgos Korfiatis | order to express the new default. |
60 | 111adca0 | Giorgos Korfiatis | |
61 | 111adca0 | Giorgos Korfiatis | This behavior will change: we will discard the distinction between users |
62 | 111adca0 | Giorgos Korfiatis | having default or custom quota. Resource default limits will be viewed |
63 | 111adca0 | Giorgos Korfiatis | as a skeleton for determining base quota for new users. When a new user |
64 | 111adca0 | Giorgos Korfiatis | is accepted, resource defaults will be consulted in order to fill the |
65 | 111adca0 | Giorgos Korfiatis | user-specific entries in AstakosUserQuota. When a resource default |
66 | 111adca0 | Giorgos Korfiatis | changes, this will not affect quota of existing users. |
67 | 111adca0 | Giorgos Korfiatis | |
68 | 111adca0 | Giorgos Korfiatis | For clarity, option ``--limit`` will be renamed ``--default-quota``. |
69 | 111adca0 | Giorgos Korfiatis | |
70 | 111adca0 | Giorgos Korfiatis | We can currently change a user's base quota with:: |
71 | 111adca0 | Giorgos Korfiatis | |
72 | 45112d5a | Giorgos Korfiatis | snf-manage user-modify <id> --set-base-quota <resource_name> <value> |
73 | 111adca0 | Giorgos Korfiatis | |
74 | 111adca0 | Giorgos Korfiatis | This command will be extended with option ``--all`` to allow changing base |
75 | 111adca0 | Giorgos Korfiatis | quota for multiple users; option ``--exclude`` will allow introducing |
76 | 45112d5a | Giorgos Korfiatis | exceptions. ``--set-base-quota`` will be renamed ``--base-quota``. |
77 | 111adca0 | Giorgos Korfiatis | |
78 | 111adca0 | Giorgos Korfiatis | Inspecting base quota |
79 | 111adca0 | Giorgos Korfiatis | ===================== |
80 | 111adca0 | Giorgos Korfiatis | |
81 | 111adca0 | Giorgos Korfiatis | Management command ``quota`` will split into ``quota-list`` and |
82 | 111adca0 | Giorgos Korfiatis | ``quota-verify``. The former will be used to list quota and will provide |
83 | 111adca0 | Giorgos Korfiatis | various filters. Option ``--with-custom`` will allow filtering quota that |
84 | 111adca0 | Giorgos Korfiatis | differ from the default or equal to it. Option ``--filter-by`` will enable |
85 | 111adca0 | Giorgos Korfiatis | filtering specified values, e.g. ``--filter-by "usage>1G"`` |