Controller architecture » History » Version 4
Tom Clegg, 01/15/2019 04:28 PM
| 1 | 1 | Tom Clegg | h1. Controller architecture |
|---|---|---|---|
| 2 | |||
| 3 | **arvados** (Apache2) defines a DBClient interface with the Arvados database operations, like CollectionList(Context, ListOptions) (CollectionListResponse, error). It also defines a Context interface that adds permission context to context.Context. |
||
| 4 | |||
| 5 | **rpc** (Apache2) implements arvados.DBClient by calling an Arvados controller's http service. It also provides an implementation of arvados.Context that wraps a token so it can be forwarded to the remote. |
||
| 6 | |||
| 7 | **pgdb** implements arvados.DBClient by doing PostgreSQL queries. Enforces permissions, validations, model integrity. It also implements a database-backed arvados.Context. |
||
| 8 | |||
| 9 | 2 | Tom Clegg | **pgdb/container** implements the Container/ContainerRequest methods of pgdb.DBClient. Also: pgdb/collection, pgdb/user, etc. |
| 10 | |||
| 11 | **pgdbrow** provides generic functions (used by pgdb/container et al.) to translate between object fields/transformations and SQL rows/statements. |
||
| 12 | |||
| 13 | 4 | Tom Clegg | **model** validates create/update operations (called by pgdb before doing insert/update statements) |
| 14 | |||
| 15 | 1 | Tom Clegg | **federation** implements arvados.DBClient by fanning out to multiple arvados.DBClient backends (typically one local and several remotes, to suit cluster config). Federation-unaware APIs fall through to a default pgdb.DBClient. |
| 16 | |||
| 17 | **router** maps HTTP requests to actions by checking auth scope and calling the appropriate arvados.DBClient method. |
||
| 18 | |||
| 19 | **server** listens on a port and serves http requests. Handler gets an arvados.Context from the (caller-provided) arvados.DBClient, and passes the request to a Router. |
||
| 20 | |||
| 21 | **controller** reads a cluster config file and starts a server backed by a federation.DBClient. |
||
| 22 | 3 | Tom Clegg | |
| 23 | Diagram: https://docs.google.com/drawings/d/1Qsj7Re4kE1tNMy7RaNR_dc9U5t6vswMJOhCI2YlbsCM/edit?usp=sharing |