Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / docs / projects_specs.rst @ 6d9f2d63

History | View | Annotate | Download (21.8 kB)

1 d41f9720 Georgios D. Tsoukalas
Synnefo Projects: General Design Notes
2 d41f9720 Georgios D. Tsoukalas
======================================
3 d41f9720 Georgios D. Tsoukalas
4 d41f9720 Georgios D. Tsoukalas
Projects can be thought of as "contracts" between the infrastructure
5 d41f9720 Georgios D. Tsoukalas
and the members of the Project, so that members can allocate and use
6 d41f9720 Georgios D. Tsoukalas
resources for a specified period in time.
7 d41f9720 Georgios D. Tsoukalas
For every Project there is an *application*, and a *membership set*.
8 d41f9720 Georgios D. Tsoukalas
The application must be approved before the Project "contract"
9 d41f9720 Georgios D. Tsoukalas
comes in effect, and before any members join.
10 d41f9720 Georgios D. Tsoukalas
11 d41f9720 Georgios D. Tsoukalas
Applications contain a Project *definition* that formally includes
12 d41f9720 Georgios D. Tsoukalas
all the policy of the Project "contract", such as name, ownership,
13 d41f9720 Georgios D. Tsoukalas
dates, and resource limits.
14 d41f9720 Georgios D. Tsoukalas
Applications and the definitions they contain are, like contracts,
15 d41f9720 Georgios D. Tsoukalas
immutable objects that can be tracked and effected in their entirety.
16 d41f9720 Georgios D. Tsoukalas
Every change made to a pending application or an existing Project
17 d41f9720 Georgios D. Tsoukalas
must be applied for through a new application.
18 d41f9720 Georgios D. Tsoukalas
19 d41f9720 Georgios D. Tsoukalas
Project Synchronization
20 d41f9720 Georgios D. Tsoukalas
-----------------------
21 d41f9720 Georgios D. Tsoukalas
A Project has two kinds of effects, global and per-membership.
22 d41f9720 Georgios D. Tsoukalas
Global effects are encoded within the Project object itself,
23 d41f9720 Georgios D. Tsoukalas
and may include services (e.g. dns name, website, forum/collaboration),
24 d41f9720 Georgios D. Tsoukalas
project-wide resources (e.g. VMs, IPs, diskspace), etc.
25 d41f9720 Georgios D. Tsoukalas
Per-membership effects are encoded within Membership objects,
26 d41f9720 Georgios D. Tsoukalas
and are prescribed by the policy in the project definition.
27 d41f9720 Georgios D. Tsoukalas
28 d41f9720 Georgios D. Tsoukalas
By design, the effects of the project are expected to extend
29 d41f9720 Georgios D. Tsoukalas
beyond the database system that records the project approval,
30 d41f9720 Georgios D. Tsoukalas
therefore these effects cannot be relied to be implemented
31 d41f9720 Georgios D. Tsoukalas
instantly and atomically upon request.
32 d41f9720 Georgios D. Tsoukalas
For example, project creation or modification may involve
33 d41f9720 Georgios D. Tsoukalas
updating resource management services, notification services,
34 d41f9720 Georgios D. Tsoukalas
project website services, which may all have their own separate
35 d41f9720 Georgios D. Tsoukalas
database systems.
36 d41f9720 Georgios D. Tsoukalas
37 d41f9720 Georgios D. Tsoukalas
Consequently, once a policy is (atomically) registered as being in effect,
38 d41f9720 Georgios D. Tsoukalas
it must be propagated for implementation with separate (non-atomic) procedures,
39 d41f9720 Georgios D. Tsoukalas
collectively called Project Synchronization.
40 d41f9720 Georgios D. Tsoukalas
41 d41f9720 Georgios D. Tsoukalas
Currently, the general approach for Synchronization of synnefo Projects,
42 d41f9720 Georgios D. Tsoukalas
is to maintain appropriate states for the objects encoding policy effects
43 d41f9720 Georgios D. Tsoukalas
(i.e. Project and Membership objects), and execute careful transitions
44 d41f9720 Georgios D. Tsoukalas
among those states, respecting semanting dependencies and limitations,
45 d41f9720 Georgios D. Tsoukalas
and remote system accesses.
46 d41f9720 Georgios D. Tsoukalas
For example, a project cannot be considered "synchronized" unless
47 d41f9720 Georgios D. Tsoukalas
all its Memberships are also considered "synchronized",
48 d41f9720 Georgios D. Tsoukalas
or you cannot declare a Membership as synchronized if the newly-set
49 d41f9720 Georgios D. Tsoukalas
quotas have not been acknowledged by the remote quota service.
50 d41f9720 Georgios D. Tsoukalas
51 d41f9720 Georgios D. Tsoukalas
Creating and Modifying Projects
52 d41f9720 Georgios D. Tsoukalas
-------------------------------
53 d41f9720 Georgios D. Tsoukalas
Projects are created and modified by issuing a corresponding application.
54 d41f9720 Georgios D. Tsoukalas
Applications that refer to the same Project are chained by including
55 d41f9720 Georgios D. Tsoukalas
a reference to the precursor application into the new one.
56 d41f9720 Georgios D. Tsoukalas
Applications that do not specify a precursor always create a new Project
57 d41f9720 Georgios D. Tsoukalas
(that is, a new project object with a new membership set).
58 d41f9720 Georgios D. Tsoukalas
Project applications that have not yet been approved may also be modified.
59 d41f9720 Georgios D. Tsoukalas
When an unapproved application is modified (ie. it is succeeded by another),
60 d41f9720 Georgios D. Tsoukalas
it may or may not be automatically rejected, depending on policy.
61 d41f9720 Georgios D. Tsoukalas
62 d41f9720 Georgios D. Tsoukalas
Projects once created, are expected to always remain in record,
63 d41f9720 Georgios D. Tsoukalas
even if they have been deactivated (i.e. their policies removed from effect).
64 d41f9720 Georgios D. Tsoukalas
Deactivating a project may be the result of a policy-specific action,
65 d41f9720 Georgios D. Tsoukalas
such as *termination* on a pre-defined date or *suspension* following
66 d41f9720 Georgios D. Tsoukalas
an administrative decision.
67 d41f9720 Georgios D. Tsoukalas
Deactivated projects retain both their Definition and their Membership sets,
68 d41f9720 Georgios D. Tsoukalas
allowing them to be reactivated by another kind of policy-specific action.
69 d41f9720 Georgios D. Tsoukalas
70 d41f9720 Georgios D. Tsoukalas
Adding and Removing Project Members
71 d41f9720 Georgios D. Tsoukalas
-----------------------------------
72 d41f9720 Georgios D. Tsoukalas
Memberships once created, are also expected to remain in historical record,
73 d41f9720 Georgios D. Tsoukalas
even if they have been marked as removed by a policy-specific action,
74 d41f9720 Georgios D. Tsoukalas
such as the user leaving the project,
75 d41f9720 Georgios D. Tsoukalas
or the project owner suspending, or terminating them altogether.
76 d41f9720 Georgios D. Tsoukalas
77 d41f9720 Georgios D. Tsoukalas
78 d41f9720 Georgios D. Tsoukalas
79 d41f9720 Georgios D. Tsoukalas
Reference Schema for Projects
80 d41f9720 Georgios D. Tsoukalas
=============================
81 d41f9720 Georgios D. Tsoukalas
82 d41f9720 Georgios D. Tsoukalas
General Terms
83 d41f9720 Georgios D. Tsoukalas
-------------
84 d41f9720 Georgios D. Tsoukalas
For clarity and precision, we (try to) use different terms for similar meanings.
85 d41f9720 Georgios D. Tsoukalas
We also separate low-level technical primitives from related higher-level
86 d41f9720 Georgios D. Tsoukalas
policy actions that include them.
87 d41f9720 Georgios D. Tsoukalas
88 d41f9720 Georgios D. Tsoukalas
synchronize, synchronized, synchronization
89 d41f9720 Georgios D. Tsoukalas
    A low-level term for Projects and Memberships.
90 d41f9720 Georgios D. Tsoukalas
    Refers to the controlled (non-atomic) process that implements
91 d41f9720 Georgios D. Tsoukalas
    a newly modified policy (i.e. adds or removes policy effects
92 d41f9720 Georgios D. Tsoukalas
    such as quota limits).
93 d41f9720 Georgios D. Tsoukalas
94 d41f9720 Georgios D. Tsoukalas
activate, deactivate, active, inactive
95 d41f9720 Georgios D. Tsoukalas
    A low-level term for Projects and Memberships.
96 d41f9720 Georgios D. Tsoukalas
    A Project or Membership is considered active as long as
97 d41f9720 Georgios D. Tsoukalas
    its policy is in effect.
98 d41f9720 Georgios D. Tsoukalas
99 d41f9720 Georgios D. Tsoukalas
suspend, suspended, suspension
100 d41f9720 Georgios D. Tsoukalas
    A policy term for Projects and Memberships,
101 d41f9720 Georgios D. Tsoukalas
    implying temporary deactivation by an administrative action
102 d41f9720 Georgios D. Tsoukalas
    (e.g. abuse report, limits violation).
103 d41f9720 Georgios D. Tsoukalas
104 d41f9720 Georgios D. Tsoukalas
terminate, terminated, termination
105 d41f9720 Georgios D. Tsoukalas
    A policyu term for Projects and Memberships,
106 d41f9720 Georgios D. Tsoukalas
    implying permanent deactivation, especially
107 d41f9720 Georgios D. Tsoukalas
    according to a pre-defined end-of-life event
108 d41f9720 Georgios D. Tsoukalas
    (e.g. project/contract "expiration").
109 d41f9720 Georgios D. Tsoukalas
110 d41f9720 Georgios D. Tsoukalas
add or remove membership
111 d41f9720 Georgios D. Tsoukalas
    Low-level terms for managing memberships to projects.
112 d41f9720 Georgios D. Tsoukalas
113 d41f9720 Georgios D. Tsoukalas
join or leave project
114 d41f9720 Georgios D. Tsoukalas
    Policy terms for when users request their addition or removal
115 d41f9720 Georgios D. Tsoukalas
    from a project membership set.
116 d41f9720 Georgios D. Tsoukalas
117 d41f9720 Georgios D. Tsoukalas
accept or reject membership request
118 d41f9720 Georgios D. Tsoukalas
    Policy terms for a project administrator to decide on
119 d41f9720 Georgios D. Tsoukalas
    join or leave requests.
120 d41f9720 Georgios D. Tsoukalas
121 d41f9720 Georgios D. Tsoukalas
approve or disapprove project
122 d41f9720 Georgios D. Tsoukalas
    Policy terms for service administrators to decide whether
123 d41f9720 Georgios D. Tsoukalas
    to create/activate a project according or not
124 d41f9720 Georgios D. Tsoukalas
125 d41f9720 Georgios D. Tsoukalas
alter project
126 d41f9720 Georgios D. Tsoukalas
    Low-level term for changes made to the global (i.e. not Membership)
127 d41f9720 Georgios D. Tsoukalas
    project status (e.g. new application, suspension).
128 d41f9720 Georgios D. Tsoukalas
129 d41f9720 Georgios D. Tsoukalas
modify project
130 d41f9720 Georgios D. Tsoukalas
    Policy term for submitting a new application as a successor
131 d41f9720 Georgios D. Tsoukalas
    to an existing one, to alter the definition of a project.
132 d41f9720 Georgios D. Tsoukalas
133 d41f9720 Georgios D. Tsoukalas
project leader
134 d41f9720 Georgios D. Tsoukalas
    The user who has authority over a project,
135 d41f9720 Georgios D. Tsoukalas
    to accept or reject membership requests,
136 d41f9720 Georgios D. Tsoukalas
    or to perform other actions according to policy.
137 d41f9720 Georgios D. Tsoukalas
138 d41f9720 Georgios D. Tsoukalas
project applicant
139 d41f9720 Georgios D. Tsoukalas
    The user who submits a project application for creation
140 d41f9720 Georgios D. Tsoukalas
    or modification of a project.
141 d41f9720 Georgios D. Tsoukalas
    The applicant can be a different user than the leader.
142 d41f9720 Georgios D. Tsoukalas
143 d41f9720 Georgios D. Tsoukalas
project administrator
144 d41f9720 Georgios D. Tsoukalas
    A user who has authority to approve, disapprove, and modify
145 d41f9720 Georgios D. Tsoukalas
    projects of a certain class (e.g. according to their domain names).
146 07c87d4f Georgios D. Tsoukalas
147 07c87d4f Georgios D. Tsoukalas
148 07c87d4f Georgios D. Tsoukalas
Definition
149 07c87d4f Georgios D. Tsoukalas
----------
150 dfbf5c50 Giorgos Korfiatis
A **definition** for a project, which represents the initialization
151 dfbf5c50 Giorgos Korfiatis
or modification of a project, has the following attributes:
152 07c87d4f Georgios D. Tsoukalas
153 07c87d4f Georgios D. Tsoukalas
``name``
154 07c87d4f Georgios D. Tsoukalas
    *in dot-hierarchical dns-like form*
155 07c87d4f Georgios D. Tsoukalas
156 07c87d4f Georgios D. Tsoukalas
``description``
157 07c87d4f Georgios D. Tsoukalas
    *text describing the project for the public*
158 07c87d4f Georgios D. Tsoukalas
159 07c87d4f Georgios D. Tsoukalas
``start_date``
160 d41f9720 Georgios D. Tsoukalas
    *when the project is requested to become active*
161 07c87d4f Georgios D. Tsoukalas
162 07c87d4f Georgios D. Tsoukalas
``end_date``
163 d41f9720 Georgios D. Tsoukalas
    *when the project is to be deactivatedended*
164 07c87d4f Georgios D. Tsoukalas
165 07c87d4f Georgios D. Tsoukalas
``member_join_policy``
166 07c87d4f Georgios D. Tsoukalas
    *an enumeration of policies on how new join requests are to be accepted.
167 07c87d4f Georgios D. Tsoukalas
    The policies include the following:*
168 07c87d4f Georgios D. Tsoukalas
169 07c87d4f Georgios D. Tsoukalas
    ``auto_accept``
170 07c87d4f Georgios D. Tsoukalas
        *new join requests are automatically accepted by the system*
171 07c87d4f Georgios D. Tsoukalas
172 07c87d4f Georgios D. Tsoukalas
    ``owner_accepts``
173 07c87d4f Georgios D. Tsoukalas
        *new join requests must be accepted by the owner of the project*
174 07c87d4f Georgios D. Tsoukalas
175 07c87d4f Georgios D. Tsoukalas
    ``closed``
176 07c87d4f Georgios D. Tsoukalas
        *no new members can join the project, even if old ones leave*
177 07c87d4f Georgios D. Tsoukalas
178 07c87d4f Georgios D. Tsoukalas
``member_leave_policy``
179 07c87d4f Georgios D. Tsoukalas
    *an enumeration of policies on how new leave requests are to be accepted.
180 07c87d4f Georgios D. Tsoukalas
    The policies include the following:*
181 07c87d4f Georgios D. Tsoukalas
182 07c87d4f Georgios D. Tsoukalas
    ``auto_accept``
183 07c87d4f Georgios D. Tsoukalas
        *leave requests are automatically accepted by the system*
184 07c87d4f Georgios D. Tsoukalas
185 07c87d4f Georgios D. Tsoukalas
    ``owner_accepts``
186 07c87d4f Georgios D. Tsoukalas
        *leave requests must be accepted by the owner of the project**
187 07c87d4f Georgios D. Tsoukalas
188 07c87d4f Georgios D. Tsoukalas
    ``closed``
189 07c87d4f Georgios D. Tsoukalas
        *no member can leave the project*
190 07c87d4f Georgios D. Tsoukalas
191 d41f9720 Georgios D. Tsoukalas
``limit_on_member_count``
192 07c87d4f Georgios D. Tsoukalas
    *the maximum number of members that can be admitted to the project*
193 07c87d4f Georgios D. Tsoukalas
194 07c87d4f Georgios D. Tsoukalas
``limits_on_resources``
195 07c87d4f Georgios D. Tsoukalas
    *a set of limits on the total resources the group can grant to its members*
196 07c87d4f Georgios D. Tsoukalas
197 07c87d4f Georgios D. Tsoukalas
``resource_grants``
198 07c87d4f Georgios D. Tsoukalas
    *a set of resource usage limits each member is granted by the project*
199 07c87d4f Georgios D. Tsoukalas
200 07c87d4f Georgios D. Tsoukalas
201 07c87d4f Georgios D. Tsoukalas
202 07c87d4f Georgios D. Tsoukalas
Application for a Project
203 07c87d4f Georgios D. Tsoukalas
-------------------------
204 07c87d4f Georgios D. Tsoukalas
An **application** for a project must be issued by a user and
205 d41f9720 Georgios D. Tsoukalas
*approved* by the service before any resources are granted.
206 07c87d4f Georgios D. Tsoukalas
Its attributes are:
207 07c87d4f Georgios D. Tsoukalas
208 07c87d4f Georgios D. Tsoukalas
``serial``
209 07c87d4f Georgios D. Tsoukalas
    *a unique serial number identifying the application*
210 07c87d4f Georgios D. Tsoukalas
211 07c87d4f Georgios D. Tsoukalas
``applicant``
212 07c87d4f Georgios D. Tsoukalas
    *who applies for creation or modification of a project*
213 07c87d4f Georgios D. Tsoukalas
214 07c87d4f Georgios D. Tsoukalas
``owner``
215 07c87d4f Georgios D. Tsoukalas
    *the requested owner of the project*
216 07c87d4f Georgios D. Tsoukalas
217 07c87d4f Georgios D. Tsoukalas
``comments``
218 07c87d4f Georgios D. Tsoukalas
    *text comments for the application*
219 07c87d4f Georgios D. Tsoukalas
220 07c87d4f Georgios D. Tsoukalas
``definition``
221 07c87d4f Georgios D. Tsoukalas
    *the definition of the project being requested*
222 07c87d4f Georgios D. Tsoukalas
223 07c87d4f Georgios D. Tsoukalas
``issue_date``
224 07c87d4f Georgios D. Tsoukalas
    *when the application was submitted*
225 07c87d4f Georgios D. Tsoukalas
226 07c87d4f Georgios D. Tsoukalas
``precursor_application``
227 07c87d4f Georgios D. Tsoukalas
    *a reference by serial to a previous application which this application
228 07c87d4f Georgios D. Tsoukalas
    requests to modify. It can be null if there is no precursor.*
229 07c87d4f Georgios D. Tsoukalas
230 68f03797 Georgios D. Tsoukalas
An application is immutable in its attributes above,
231 68f03797 Georgios D. Tsoukalas
but its status depends on how it has been processed.
232 68f03797 Georgios D. Tsoukalas
The *application status* can be:
233 68f03797 Georgios D. Tsoukalas
234 68f03797 Georgios D. Tsoukalas
    :(1):   pending
235 68f03797 Georgios D. Tsoukalas
    :(2a):  approved
236 68f03797 Georgios D. Tsoukalas
    :(2b):  rejected
237 68f03797 Georgios D. Tsoukalas
    :(3):   replaced
238 68f03797 Georgios D. Tsoukalas
239 d41f9720 Georgios D. Tsoukalas
When an application becomes *approved* and therefore defines
240 d41f9720 Georgios D. Tsoukalas
a the project, its precursor (if any) must atomically be set to *replaced*.
241 d41f9720 Georgios D. Tsoukalas
242 07c87d4f Georgios D. Tsoukalas
243 07c87d4f Georgios D. Tsoukalas
244 07c87d4f Georgios D. Tsoukalas
Project Membership
245 07c87d4f Georgios D. Tsoukalas
-------------------------
246 d41f9720 Georgios D. Tsoukalas
A *project membership* maps a user to a project and holds state for this mapping.
247 07c87d4f Georgios D. Tsoukalas
There are no inherent constraints to this mapping,
248 07c87d4f Georgios D. Tsoukalas
any user might be a member to any project.
249 07c87d4f Georgios D. Tsoukalas
250 07c87d4f Georgios D. Tsoukalas
The **state** of membership can be:
251 07c87d4f Georgios D. Tsoukalas
252 07c87d4f Georgios D. Tsoukalas
    :(1):   *pending acceptance*
253 07c87d4f Georgios D. Tsoukalas
    :(2a):  *rejected*
254 07c87d4f Georgios D. Tsoukalas
    :(2b):  *accepted, pending synchronization*
255 07c87d4f Georgios D. Tsoukalas
    :(3):   *active*
256 07c87d4f Georgios D. Tsoukalas
    :(4):   *pending removal*
257 07c87d4f Georgios D. Tsoukalas
    :(5):   *removed, pending synchronization*
258 07c87d4f Georgios D. Tsoukalas
    :(6):   *removed*
259 07c87d4f Georgios D. Tsoukalas
260 d41f9720 Georgios D. Tsoukalas
The transitions from 2b to 3, and 5 to 6, must first commit
261 d41f9720 Georgios D. Tsoukalas
their starting state and then only update to the next state
262 07c87d4f Georgios D. Tsoukalas
after the *Synchronize Membership* procedure has been
263 07c87d4f Georgios D. Tsoukalas
acknowledged as successful.
264 07c87d4f Georgios D. Tsoukalas
265 d41f9720 Georgios D. Tsoukalas
Except states 2b and 5, which explicitly state that they are
266 d41f9720 Georgios D. Tsoukalas
*pending synchronization*, all other states are considered *synchronized*
267 d41f9720 Georgios D. Tsoukalas
**Synchronization** refers to all external communication 
268 d41f9720 Georgios D. Tsoukalas
(i.e. not within the limits to) required
269 07c87d4f Georgios D. Tsoukalas
270 07c87d4f Georgios D. Tsoukalas
271 07c87d4f Georgios D. Tsoukalas
272 07c87d4f Georgios D. Tsoukalas
Project
273 07c87d4f Georgios D. Tsoukalas
-------
274 07c87d4f Georgios D. Tsoukalas
A **project** is created or modified upon the approval of an application.
275 07c87d4f Georgios D. Tsoukalas
It is initialized with the *definition* contained in the application,
276 07c87d4f Georgios D. Tsoukalas
and grants resources as specified, and acquires all the extra state needed.
277 07c87d4f Georgios D. Tsoukalas
The *definition* of a project does not belong to its mutable state,
278 07c87d4f Georgios D. Tsoukalas
and can only be changed by approving a new application.
279 07c87d4f Georgios D. Tsoukalas
The attributes for a project are:
280 07c87d4f Georgios D. Tsoukalas
281 07c87d4f Georgios D. Tsoukalas
``serial``
282 07c87d4f Georgios D. Tsoukalas
    *a unique serial number identifying the project*
283 07c87d4f Georgios D. Tsoukalas
284 07c87d4f Georgios D. Tsoukalas
``application``
285 be7b2729 Giorgos Korfiatis
    *the last application that was successfully synchronized with Quotaholder.*
286 be7b2729 Giorgos Korfiatis
287 07c87d4f Georgios D. Tsoukalas
``creation_date``
288 07c87d4f Georgios D. Tsoukalas
    *when the project was created (i.e. was first approved)*
289 07c87d4f Georgios D. Tsoukalas
290 07c87d4f Georgios D. Tsoukalas
``last_approval_date``
291 07c87d4f Georgios D. Tsoukalas
    *when was the last approval (i.e. creation or modification).
292 07c87d4f Georgios D. Tsoukalas
    Null if the project has not been approved or has been suspended.*
293 07c87d4f Georgios D. Tsoukalas
294 d41f9720 Georgios D. Tsoukalas
``deactivation_start_date``
295 d41f9720 Georgios D. Tsoukalas
    *when the project was ordered to deactivate,
296 07c87d4f Georgios D. Tsoukalas
    and declared out of sync for its resource grants to be removed.
297 d41f9720 Georgios D. Tsoukalas
    (is null if the project has not been ordered to deactivate)*
298 07c87d4f Georgios D. Tsoukalas
299 d41f9720 Georgios D. Tsoukalas
``deactivation_date``
300 d41f9720 Georgios D. Tsoukalas
    *when the project deactivation was actually registered as completed
301 d41f9720 Georgios D. Tsoukalas
    by the service following the successful revocation of resource grants.
302 d41f9720 Georgios D. Tsoukalas
    (is null if the project has not been deactivated)*
303 07c87d4f Georgios D. Tsoukalas
304 d41f9720 Georgios D. Tsoukalas
``deactivation_reason``
305 d41f9720 Georgios D. Tsoukalas
    *Text indicating indicating the reason for deactivation.*
306 07c87d4f Georgios D. Tsoukalas
307 d41f9720 Georgios D. Tsoukalas
``members``
308 d41f9720 Georgios D. Tsoukalas
    *the set of memberships for this project*
309 07c87d4f Georgios D. Tsoukalas
310 07c87d4f Georgios D. Tsoukalas
311 07c87d4f Georgios D. Tsoukalas
Rules
312 07c87d4f Georgios D. Tsoukalas
-----
313 07c87d4f Georgios D. Tsoukalas
314 07c87d4f Georgios D. Tsoukalas
1. **Valid projects**
315 07c87d4f Georgios D. Tsoukalas
316 07c87d4f Georgios D. Tsoukalas
    Projects are valid only if they violate none of the rules
317 07c87d4f Georgios D. Tsoukalas
318 07c87d4f Georgios D. Tsoukalas
2. **Active projects**
319 07c87d4f Georgios D. Tsoukalas
320 d41f9720 Georgios D. Tsoukalas
    A project is declared **active** when its resource grants and
321 d41f9720 Georgios D. Tsoukalas
    general policy is in effect (even if partially),
322 d41f9720 Georgios D. Tsoukalas
    and no order of deactivation has been given.
323 dfbf5c50 Giorgos Korfiatis
324 d41f9720 Georgios D. Tsoukalas
    A valid project can be active if and only if
325 d41f9720 Georgios D. Tsoukalas
    - its ``deactivation_start_date`` is null
326 07c87d4f Georgios D. Tsoukalas
327 d41f9720 Georgios D. Tsoukalas
2. **Inactive projects**
328 07c87d4f Georgios D. Tsoukalas
329 d41f9720 Georgios D. Tsoukalas
    A valid project is declared **inactive** when its resource grants
330 d41f9720 Georgios D. Tsoukalas
    and general policy is not in effect, or is in effect and
331 07c87d4f Georgios D. Tsoukalas
332 d41f9720 Georgios D. Tsoukalas
    A valid project is inactive if and only if,
333 d41f9720 Georgios D. Tsoukalas
    its ``deactivation_start_date`` is not null
334 07c87d4f Georgios D. Tsoukalas
335 d41f9720 Georgios D. Tsoukalas
3. **Project states**
336 07c87d4f Georgios D. Tsoukalas
337 07c87d4f Georgios D. Tsoukalas
    The states of a project that are significant from a control flow aspect,
338 07c87d4f Georgios D. Tsoukalas
    are the following:
339 07c87d4f Georgios D. Tsoukalas
340 07c87d4f Georgios D. Tsoukalas
    :(0):   pending approval
341 d41f9720 Georgios D. Tsoukalas
    :(1a):  active, pending definition sync
342 d41f9720 Georgios D. Tsoukalas
    :(1b):  active, pending membership sync
343 d41f9720 Georgios D. Tsoukalas
    :(1c):  active, pending total sync
344 d41f9720 Georgios D. Tsoukalas
    :(2):   active
345 d41f9720 Georgios D. Tsoukalas
    :(3a):  inactive, pending definition sync
346 d41f9720 Georgios D. Tsoukalas
    :(3b):  inactive, pending membership sync
347 d41f9720 Georgios D. Tsoukalas
    :(3c):  inactive, pending total sync
348 d41f9720 Georgios D. Tsoukalas
    :(4):   inactive
349 07c87d4f Georgios D. Tsoukalas
350 07c87d4f Georgios D. Tsoukalas
351 d41f9720 Georgios D. Tsoukalas
4. **Synchronization status**
352 07c87d4f Georgios D. Tsoukalas
353 07c87d4f Georgios D. Tsoukalas
    The status of the project's synchronization with Quotaholder
354 d41f9720 Georgios D. Tsoukalas
    and other remote services,
355 07c87d4f Georgios D. Tsoukalas
    can be either **synchronized** or **unsyncrhonized**.
356 07c87d4f Georgios D. Tsoukalas
357 07c87d4f Georgios D. Tsoukalas
    Semantically, the project becomes synchronized when its application
358 07c87d4f Georgios D. Tsoukalas
    definition has been fully implemented and committed to quotaholder,
359 07c87d4f Georgios D. Tsoukalas
    and all its memberships are also synchronized.
360 07c87d4f Georgios D. Tsoukalas
361 d41f9720 Georgios D. Tsoukalas
    The active project loses its synchronization on two occasions.
362 07c87d4f Georgios D. Tsoukalas
    On the approval of a new application modifying the project,
363 07c87d4f Georgios D. Tsoukalas
    and on the addition or removal of any of its memberships.
364 07c87d4f Georgios D. Tsoukalas
365 d41f9720 Georgios D. Tsoukalas
    In general, also considering projects being deactivated,
366 07c87d4f Georgios D. Tsoukalas
    a project is declared synchronized if and only if:
367 07c87d4f Georgios D. Tsoukalas
368 d41f9720 Georgios D. Tsoukalas
    - None of its Memberships is unsynchronized
369 d41f9720 Georgios D. Tsoukalas
    - ``deactivation_start_date`` is null or ``deactivation_date`` is set
370 07c87d4f Georgios D. Tsoukalas
371 d41f9720 Georgios D. Tsoukalas
5. **Unique project names**
372 07c87d4f Georgios D. Tsoukalas
373 07c87d4f Georgios D. Tsoukalas
    The project name (as specified in its application's definition)
374 07c87d4f Georgios D. Tsoukalas
    must be unique among all *alive* projects.
375 07c87d4f Georgios D. Tsoukalas
376 d41f9720 Georgios D. Tsoukalas
6. **Inconsistent dates**
377 07c87d4f Georgios D. Tsoukalas
378 07c87d4f Georgios D. Tsoukalas
    If either ``creation_date`` or ``last_approval_date``
379 07c87d4f Georgios D. Tsoukalas
    is in the future, the project state is declared **inconsistent**
380 07c87d4f Georgios D. Tsoukalas
    but the project is still considered created or approved, respectively.
381 dfbf5c50 Giorgos Korfiatis
382 d41f9720 Georgios D. Tsoukalas
    If ``deactivation_date`` is in the future, the project is declared
383 d41f9720 Georgios D. Tsoukalas
    **inconsistent** but the project is still considered inactive.
384 07c87d4f Georgios D. Tsoukalas
385 d41f9720 Georgios D. Tsoukalas
7. **No project without application**
386 07c87d4f Georgios D. Tsoukalas
387 07c87d4f Georgios D. Tsoukalas
    A project can only exist in reference of the application that has defined it.
388 07c87d4f Georgios D. Tsoukalas
    The attributes in the definition such as its name, resource grants
389 07c87d4f Georgios D. Tsoukalas
    cannot be modified without a new application that must be approved.
390 07c87d4f Georgios D. Tsoukalas
391 d41f9720 Georgios D. Tsoukalas
8. **Creating and modifying projects with follow-up applications**
392 07c87d4f Georgios D. Tsoukalas
393 07c87d4f Georgios D. Tsoukalas
    Every application for a project can be followed up with another one.
394 07c87d4f Georgios D. Tsoukalas
    The new application points back to it with its ``precursor`` attribute.
395 dfbf5c50 Giorgos Korfiatis
396 07c87d4f Georgios D. Tsoukalas
    This means that an applicant can update their application
397 07c87d4f Georgios D. Tsoukalas
    before it has been approved.
398 dfbf5c50 Giorgos Korfiatis
399 07c87d4f Georgios D. Tsoukalas
    Apart from an applicant, whoever can approve the project,
400 07c87d4f Georgios D. Tsoukalas
    can also post a follow up application for it, modifying
401 07c87d4f Georgios D. Tsoukalas
    some aspects of the definition and approve that instead.
402 07c87d4f Georgios D. Tsoukalas
    For example, a user might request for 100 GB storage,
403 07c87d4f Georgios D. Tsoukalas
    but the Service may approve a project with only 80GB,
404 07c87d4f Georgios D. Tsoukalas
    via a follow up application.
405 dfbf5c50 Giorgos Korfiatis
406 07c87d4f Georgios D. Tsoukalas
    If the precursor of an application is not associated with a project
407 be7b2729 Giorgos Korfiatis
    (i.e. no project references it as its defining ``last_application_approved``),
408 07c87d4f Georgios D. Tsoukalas
    then a new project entry is created and initialized.
409 dfbf5c50 Giorgos Korfiatis
410 07c87d4f Georgios D. Tsoukalas
    If the precursor of an application *is* associated with a valid project,
411 07c87d4f Georgios D. Tsoukalas
    then the same project entry is used and is re-initialized according
412 07c87d4f Georgios D. Tsoukalas
    to the new application's definition.
413 d41f9720 Georgios D. Tsoukalas
    The project is made active (if inactive) and its previous state
414 d41f9720 Georgios D. Tsoukalas
    is preserved (mainly, the member set).
415 d41f9720 Georgios D. Tsoukalas
416 d41f9720 Georgios D. Tsoukalas
417 d41f9720 Georgios D. Tsoukalas
Scenarios
418 d41f9720 Georgios D. Tsoukalas
---------
419 d41f9720 Georgios D. Tsoukalas
420 d41f9720 Georgios D. Tsoukalas
Project applicant not confident for his numbers
421 d41f9720 Georgios D. Tsoukalas
'''''''''''''''''''''''''''''''''''''''''''''''
422 d41f9720 Georgios D. Tsoukalas
Researcher requests resources to create a cluster for a protein-folding
423 d41f9720 Georgios D. Tsoukalas
computation experiment. He knows how exactly how many machines,
424 d41f9720 Georgios D. Tsoukalas
memory, and disk he needs but is not certain how many CPU cores
425 d41f9720 Georgios D. Tsoukalas
he should request.
426 d41f9720 Georgios D. Tsoukalas
427 d41f9720 Georgios D. Tsoukalas
He leaves the corresponding resource unspecified,
428 d41f9720 Georgios D. Tsoukalas
and leaves a comment noting the issue.
429 d41f9720 Georgios D. Tsoukalas
430 d41f9720 Georgios D. Tsoukalas
The project administrator responsible for the application
431 d41f9720 Georgios D. Tsoukalas
uses his expertise, and/or consults others to formulate an appropriate
432 d41f9720 Georgios D. Tsoukalas
limit for the resource.
433 d41f9720 Georgios D. Tsoukalas
Then he modifies the (not-yet-approved) project, fills in the resource limit,
434 d41f9720 Georgios D. Tsoukalas
then submits and approves the new application.
435 d41f9720 Georgios D. Tsoukalas
436 d41f9720 Georgios D. Tsoukalas
437 d41f9720 Georgios D. Tsoukalas
Using participation to support an project application
438 d41f9720 Georgios D. Tsoukalas
'''''''''''''''''''''''''''''''''''''''''''''''''''''
439 d41f9720 Georgios D. Tsoukalas
An applicant knows that his application will be rejected unless
440 d41f9720 Georgios D. Tsoukalas
a lot of people support it.
441 d41f9720 Georgios D. Tsoukalas
442 d41f9720 Georgios D. Tsoukalas
Therefore, he applies for a project with no resource grants,
443 d41f9720 Georgios D. Tsoukalas
and notes his rationale in the comments.
444 d41f9720 Georgios D. Tsoukalas
445 d41f9720 Georgios D. Tsoukalas
The project administrator accepts his application in good faith,
446 d41f9720 Georgios D. Tsoukalas
and then the project begins to accept members.
447 d41f9720 Georgios D. Tsoukalas
448 d41f9720 Georgios D. Tsoukalas
Once many and important enough members have joined,
449 d41f9720 Georgios D. Tsoukalas
the project leader modifies the project with a new application
450 d41f9720 Georgios D. Tsoukalas
that now includes significant resource grants.
451 d41f9720 Georgios D. Tsoukalas
452 d41f9720 Georgios D. Tsoukalas
The project administrator reviews the application and membership list,
453 d41f9720 Georgios D. Tsoukalas
and is convinced that the project deserves the grants.
454 d41f9720 Georgios D. Tsoukalas
However, he wants to make sure that this remains so,
455 d41f9720 Georgios D. Tsoukalas
by ensuring that the membership of the project cannot
456 d41f9720 Georgios D. Tsoukalas
include other users without further review.
457 d41f9720 Georgios D. Tsoukalas
458 d41f9720 Georgios D. Tsoukalas
Therefore, he further modifies the (not-yet-approved) application,
459 d41f9720 Georgios D. Tsoukalas
and sets the member accept policy to be 'closed', that is,
460 d41f9720 Georgios D. Tsoukalas
that no new members may join the project.
461 d41f9720 Georgios D. Tsoukalas
Then he sumbits and approves the application.
462 d41f9720 Georgios D. Tsoukalas
463 07c87d4f Georgios D. Tsoukalas
464 07c87d4f Georgios D. Tsoukalas
465 d41f9720 Georgios D. Tsoukalas
-------- gtsouk REVIEW STOPS HERE ---------
466 07c87d4f Georgios D. Tsoukalas
467 07c87d4f Georgios D. Tsoukalas
Procedures
468 07c87d4f Georgios D. Tsoukalas
----------
469 07c87d4f Georgios D. Tsoukalas
470 07c87d4f Georgios D. Tsoukalas
The following procedures are considered essential primitives
471 07c87d4f Georgios D. Tsoukalas
for the function of the Projects feature, and should constitute
472 07c87d4f Georgios D. Tsoukalas
a natural *internal* API to it. This is not a public API for users,
473 07c87d4f Georgios D. Tsoukalas
although the public one should be thinly layered on top of it.
474 07c87d4f Georgios D. Tsoukalas
475 07c87d4f Georgios D. Tsoukalas
For quotaholder interactions, a primitive to synchronize quotaholder
476 07c87d4f Georgios D. Tsoukalas
with a user's resource quotas is assumed to be available.
477 07c87d4f Georgios D. Tsoukalas
478 07c87d4f Georgios D. Tsoukalas
#. Submit an application
479 07c87d4f Georgios D. Tsoukalas
480 07c87d4f Georgios D. Tsoukalas
   Every user might submit an application to create or modify a project.
481 07c87d4f Georgios D. Tsoukalas
   There are no inherent constraints.
482 07c87d4f Georgios D. Tsoukalas
   However, policy may impose restrictions.
483 07c87d4f Georgios D. Tsoukalas
484 07c87d4f Georgios D. Tsoukalas
#. Retrieve applications
485 07c87d4f Georgios D. Tsoukalas
486 07c87d4f Georgios D. Tsoukalas
   Applications should be retrievable by serial, by applicant,
487 07c87d4f Georgios D. Tsoukalas
   and by approval status.
488 07c87d4f Georgios D. Tsoukalas
   Because applications are immutable, some kind of extra state
489 07c87d4f Georgios D. Tsoukalas
   is needed in order to index by approval status.
490 07c87d4f Georgios D. Tsoukalas
   For example, one might instantiate a mutable object for approval state,
491 07c87d4f Georgios D. Tsoukalas
   with attributes (``approval_serial``, ``approval_state``, ``approval_data``)
492 07c87d4f Georgios D. Tsoukalas
493 07c87d4f Georgios D. Tsoukalas
#. Approve an application (create or modify a Project)
494 07c87d4f Georgios D. Tsoukalas
495 07c87d4f Georgios D. Tsoukalas
   Application approval must atomically perform and commit all of the following:
496 07c87d4f Georgios D. Tsoukalas
   - create or modify the project at its specified definition
497 07c87d4f Georgios D. Tsoukalas
   - set the project state to be pending synchronization with quotaholder
498 07c87d4f Georgios D. Tsoukalas
499 07c87d4f Georgios D. Tsoukalas
   After committing, the procedure to synchronize the project (see below)
500 07c87d4f Georgios D. Tsoukalas
   should be called.
501 07c87d4f Georgios D. Tsoukalas
502 07c87d4f Georgios D. Tsoukalas
#. Retrieve projects
503 07c87d4f Georgios D. Tsoukalas
504 07c87d4f Georgios D. Tsoukalas
   Projects should be retrievable by serial, by owner,
505 07c87d4f Georgios D. Tsoukalas
   by application, by life status, and by synchronization status.
506 07c87d4f Georgios D. Tsoukalas
507 07c87d4f Georgios D. Tsoukalas
   *By application* means that given an application, one must be able
508 07c87d4f Georgios D. Tsoukalas
   to retrieve the project that has it approved, if any.
509 07c87d4f Georgios D. Tsoukalas
510 07c87d4f Georgios D. Tsoukalas
#. Add or remove a user to a project
511 07c87d4f Georgios D. Tsoukalas
512 07c87d4f Georgios D. Tsoukalas
   When a new membership is created for a project or
513 07c87d4f Georgios D. Tsoukalas
   an existing one is modified, then in the same
514 07c87d4f Georgios D. Tsoukalas
   transaction the project must be declared *unsynchronized*.
515 07c87d4f Georgios D. Tsoukalas
516 07c87d4f Georgios D. Tsoukalas
#. Suspend a project
517 07c87d4f Georgios D. Tsoukalas
518 d41f9720 Georgios D. Tsoukalas
   A project is suspended by setting ``last_approval_date`` to None.
519 07c87d4f Georgios D. Tsoukalas
520 07c87d4f Georgios D. Tsoukalas
#. Terminate a project
521 07c87d4f Georgios D. Tsoukalas
522 07c87d4f Georgios D. Tsoukalas
   Project termination must atomically perform and commit all of the following:
523 07c87d4f Georgios D. Tsoukalas
   - set the project ``termination_start_date``
524 07c87d4f Georgios D. Tsoukalas
   - set the ``termination_date`` to null (this is a redundant safeguard)
525 07c87d4f Georgios D. Tsoukalas
   in order to mark the project as pending termination synchronization.
526 07c87d4f Georgios D. Tsoukalas
527 07c87d4f Georgios D. Tsoukalas
   After committing, the procedure to synchronize the project (see below)
528 07c87d4f Georgios D. Tsoukalas
   should be called.
529 dfbf5c50 Giorgos Korfiatis
530 07c87d4f Georgios D. Tsoukalas
#. Synchronize a membership with quotaholder
531 07c87d4f Georgios D. Tsoukalas
532 07c87d4f Georgios D. Tsoukalas
   This procedure is not required to be an independent procedure
533 07c87d4f Georgios D. Tsoukalas
   available for individual memberships.
534 07c87d4f Georgios D. Tsoukalas
   That is, if user synchronization takes care of all memberships,
535 07c87d4f Georgios D. Tsoukalas
   one can call user synchronization instead of membership synchronization.
536 07c87d4f Georgios D. Tsoukalas
537 dfbf5c50 Giorgos Korfiatis
#. Synchronize a user with quotaholder
538 07c87d4f Georgios D. Tsoukalas
539 07c87d4f Georgios D. Tsoukalas
   User synchronization is equivalent to the synchronization of
540 07c87d4f Georgios D. Tsoukalas
   all the user's memberships.
541 07c87d4f Georgios D. Tsoukalas
542 07c87d4f Georgios D. Tsoukalas
#. Synchronize a project with quotaholder
543 07c87d4f Georgios D. Tsoukalas
544 07c87d4f Georgios D. Tsoukalas
   Project synchronization is equivelent to the synchronization of
545 07c87d4f Georgios D. Tsoukalas
   either all its memberships, or all its members.
546 07c87d4f Georgios D. Tsoukalas
547 07c87d4f Georgios D. Tsoukalas
548 07c87d4f Georgios D. Tsoukalas
549 07c87d4f Georgios D. Tsoukalas
View elements
550 07c87d4f Georgios D. Tsoukalas
-------------
551 07c87d4f Georgios D. Tsoukalas
In this context, view elements refer to (at best effort) self-contained
552 07c87d4f Georgios D. Tsoukalas
elements that display information for and offer interaction with their
553 07c87d4f Georgios D. Tsoukalas
underlying objects. A final view, such as a web page, or console command
554 07c87d4f Georgios D. Tsoukalas
output, may include several elements.
555 07c87d4f Georgios D. Tsoukalas
556 07c87d4f Georgios D. Tsoukalas
Interaction with the feature is going through several view elements.
557 07c87d4f Georgios D. Tsoukalas
Each element has two pieces of input,
558 07c87d4f Georgios D. Tsoukalas
the *objects being referenced*, and the *accessing user*,
559 dfbf5c50 Giorgos Korfiatis
and its appearance and function is accordingly parameterized.
560 07c87d4f Georgios D. Tsoukalas
561 07c87d4f Georgios D. Tsoukalas
Each *project element* may need to display information
562 07c87d4f Georgios D. Tsoukalas
that internally belongs to its linked object,
563 07c87d4f Georgios D. Tsoukalas
such as its *definition* or *memberships*.
564 07c87d4f Georgios D. Tsoukalas
565 07c87d4f Georgios D. Tsoukalas
A proposed list of elements is following.
566 07c87d4f Georgios D. Tsoukalas
The elements are only considered building blocks
567 07c87d4f Georgios D. Tsoukalas
for views and not full views by themselves.
568 07c87d4f Georgios D. Tsoukalas
More on views later on.
569 07c87d4f Georgios D. Tsoukalas
570 07c87d4f Georgios D. Tsoukalas
#. Project list element
571 07c87d4f Georgios D. Tsoukalas
572 07c87d4f Georgios D. Tsoukalas
   This represents a list of *projects.*
573 07c87d4f Georgios D. Tsoukalas
   Technically, most of information about a project resides in its *application*.
574 07c87d4f Georgios D. Tsoukalas
575 07c87d4f Georgios D. Tsoukalas
   In the case of a *pending application*,
576 07c87d4f Georgios D. Tsoukalas
   one that has not been approved yet,
577 07c87d4f Georgios D. Tsoukalas
   then the row is filled with data from the
578 07c87d4f Georgios D. Tsoukalas
   current (approved and effective) application,
579 07c87d4f Georgios D. Tsoukalas
   or they are left blank if no such project exists yet.
580 07c87d4f Georgios D. Tsoukalas
581 07c87d4f Georgios D. Tsoukalas
   Additionally, the column that displays the pending status
582 07c87d4f Georgios D. Tsoukalas
   of the project (creation or modification), should be a link
583 07c87d4f Georgios D. Tsoukalas
   to the corresponding application detail element.
584 07c87d4f Georgios D. Tsoukalas
585 07c87d4f Georgios D. Tsoukalas
#. Membership element
586 07c87d4f Georgios D. Tsoukalas
587 07c87d4f Georgios D. Tsoukalas
   A list of project members for a single (or maybe multiple) projects.
588 07c87d4f Georgios D. Tsoukalas
   The list must not display user emails if the viewer is not the owner
589 07c87d4f Georgios D. Tsoukalas
   of the group, or a service administrator.
590 07c87d4f Georgios D. Tsoukalas
591 07c87d4f Georgios D. Tsoukalas
#. Application details element
592 07c87d4f Georgios D. Tsoukalas
593 07c87d4f Georgios D. Tsoukalas
   Displays all application details in full,
594 07c87d4f Georgios D. Tsoukalas
   with a link to the (alive) project it defines, if any,
595 07c87d4f Georgios D. Tsoukalas
   or a pending notice,
596 07c87d4f Georgios D. Tsoukalas
   or an obsolescence note if the project it defined was since modified,
597 07c87d4f Georgios D. Tsoukalas
   or a rejection notice.
598 07c87d4f Georgios D. Tsoukalas
599 07c87d4f Georgios D. Tsoukalas
#. Project details element
600 07c87d4f Georgios D. Tsoukalas
601 07c87d4f Georgios D. Tsoukalas
   This element contains both details for the defining application
602 07c87d4f Georgios D. Tsoukalas
   and for the current state of the project.
603 07c87d4f Georgios D. Tsoukalas
604 07c87d4f Georgios D. Tsoukalas
   Details for the current state of the project may include
605 07c87d4f Georgios D. Tsoukalas
   statistics on membership and resource usage.
606 07c87d4f Georgios D. Tsoukalas
607 07c87d4f Georgios D. Tsoukalas
#. Application form element
608 07c87d4f Georgios D. Tsoukalas
609 07c87d4f Georgios D. Tsoukalas
   It submits a new application.
610 07c87d4f Georgios D. Tsoukalas
   If the application is in reference
611 07c87d4f Georgios D. Tsoukalas
   to previous application (the ``precursor``)
612 07c87d4f Georgios D. Tsoukalas
   then the form should be initialized to be a copy of it.
613 07c87d4f Georgios D. Tsoukalas
614 07c87d4f Georgios D. Tsoukalas
   Otherwise, it may be blank, or initialized with defaults from a template.
615 07c87d4f Georgios D. Tsoukalas
616 07c87d4f Georgios D. Tsoukalas
#. Project search element
617 07c87d4f Georgios D. Tsoukalas
618 07c87d4f Georgios D. Tsoukalas
   This is an entry point to a listing, with configurable filtering.
619 07c87d4f Georgios D. Tsoukalas
620 07c87d4f Georgios D. Tsoukalas
#. History and statistics view
621 07c87d4f Georgios D. Tsoukalas
622 07c87d4f Georgios D. Tsoukalas
   No specification currently.