Project

General

Profile

Controller architecture » History » Version 5

Tom Clegg, 05/09/2019 07:07 PM

1 1 Tom Clegg
h1. Controller architecture
2
3 5 Tom Clegg
**arvados** (Apache2) defines a Provider interface with the Arvados database operations, like CollectionList(context.Context, ListOptions) (CollectionListResponse, error).
4 1 Tom Clegg
5 5 Tom Clegg
**rpc** (Apache2) implements arvados.Provider by calling an Arvados controller's http service.
6 1 Tom Clegg
7 5 Tom Clegg
**pgdb** implements arvados.Provider by doing PostgreSQL queries. Enforces permissions, validations, model integrity.
8 1 Tom Clegg
9 5 Tom Clegg
**pgdb/container** implements the Container/ContainerRequest methods of pgdb.Provider. Similarly: pgdb/collection, pgdb/user, etc.
10 2 Tom Clegg
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 1 Tom Clegg
15 5 Tom Clegg
**federation** implements arvados.Provider by fanning out to multiple arvados.DBClient backends (typically one local and several remotes, to suit cluster config). Federation-unaware APIs just call through to the default (local) Provider.
16 1 Tom Clegg
17 5 Tom Clegg
**router** provides an http.Handler that maps each HTTP request to a Provider action: deserialize the request to a Provider call signature, check auth scope, call the Provider method, and serialize the return values as an HTTP response.
18 1 Tom Clegg
19 5 Tom Clegg
**controller** reads a cluster config file and starts a server backed by a federation.Provider.
20 1 Tom Clegg
21
Diagram: https://docs.google.com/drawings/d/1Qsj7Re4kE1tNMy7RaNR_dc9U5t6vswMJOhCI2YlbsCM/edit?usp=sharing
22 5 Tom Clegg
23
The rpc, federation, and pgdb providers offer the same interface so any given program can switch easily between using the federation and model logic built into its own binary and calling out to a different process or host.