Controller architecture » History » Version 6
Tom Clegg, 06/12/2019 06:24 PM
| 1 | 1 | Tom Clegg | h1. Controller architecture |
|---|---|---|---|
| 2 | |||
| 3 | 6 | Tom Clegg | **sdk/go/arvados** (Apache2) provides http endpoints (method/path), request/response structs (Collection, CreateOptions, UpdateOptions). |
| 4 | 1 | Tom Clegg | |
| 5 | 6 | Tom Clegg | **lib/controller/federation** provides an Interface with a method for each Arvados API action, e.g., CollectionList(context.Context, ListOptions) (CollectionListResponse, error). |
| 6 | 1 | Tom Clegg | |
| 7 | 6 | Tom Clegg | **lib/controller/federation** provides Conn, which implements federation.Interface by fanning out to multiple backends (typically one local and several remotes, to suit cluster config). Federation-unaware APIs just call through to the default (local) backend. |
| 8 | 1 | Tom Clegg | |
| 9 | 6 | Tom Clegg | **lib/controller/rpc** provides Conn, implements federation.Interface by calling an Arvados controller's http server. |
| 10 | 4 | Tom Clegg | |
| 11 | 6 | Tom Clegg | **lib/controller/railsproxy** implements federation.Interface using an rpc.Conn whose target is the local RailsAPI server. |
| 12 | 1 | Tom Clegg | |
| 13 | 6 | Tom Clegg | **lib/controller/router** provides an http.Handler that maps each HTTP request to a backend (federation.Interface) method: deserialize the request to a Provider call signature, check auth scope, call the backend method, and serialize the return values as an HTTP response. |
| 14 | 1 | Tom Clegg | |
| 15 | 6 | Tom Clegg | **lib/controller** provides an http service consisting of a router with a federation.Conn backend. |
| 16 | 1 | Tom Clegg | |
| 17 | Diagram: https://docs.google.com/drawings/d/1Qsj7Re4kE1tNMy7RaNR_dc9U5t6vswMJOhCI2YlbsCM/edit?usp=sharing |
||
| 18 | 5 | Tom Clegg | |
| 19 | 6 | Tom Clegg | The rpc, federation, and (future) localdb packages offer backends with a common 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. |