ArchitectureOverview
The crates
Ferry is a Cargo workspace of ten crates whose dependencies go in one direction.
A crate is a package of Rust code. The dependencies go one way. Thus you can build and test each crate alone.
| Crate | Kind | Role |
|---|---|---|
ferry-core | Library | The shared types and the store. It depends on no other Ferry crate. |
ferry-docker | Library | Controls containers through the Docker Engine API. |
ferry-build | Library | Changes source into an image. |
ferry-scm | Library | The git providers: GitHub and GitLab. |
ferry-proxy | Library | The public edge: routes, load balancing, TLS. |
ferry-tls | Library | Automatic HTTPS certificates. |
ferry-engine | Library | The engine: deploys, reconciler, cron, datastores. |
ferry-api | Library | The REST API and the dashboard. |
ferry-cli | Program ferry | The command-line client. |
ferryd | Program | The server. It connects the other crates. |
Traits keep the crates apart
ferry-api never depends on ferry-engine. It holds an Arc<dyn Engine> and calls the trait from ferry-core. In the tests of the API, a mock that records the calls replaces the engine.
The proxy calls ferry-tls through the TlsHooks trait in the same way. Only ferryd knows the engine, the proxy, the API and ferry-tls together.