domain/architecture/system/deployment/type.bend
near-v-framework@0.5.1.0 · 32 lines · 0 definitions
1import Base
2import near-v-framework@0.5.1.0/domain/architecture/system/deployment/host/type.bend as H
3import near-v-framework@0.5.1.0/domain/architecture/system/deployment/nix_darwin/type.bend as ND
4import near-v-framework@0.5.1.0/domain/architecture/system/deployment/azure/type.bend as Az
5import near-v-framework@0.5.1.0/domain/architecture/system/deployment/launchd/type.bend as Ld
6
7# A device is someone's own (a phone, a laptop); a server runs the system for others.
8type Role is Data:
9 Device{}
10 Server{}
11
12# What configures a node: nothing V manages, nix-darwin, an Azure subscription, or only the launch agents and
13# Tailscale serves V declares on a Mac something else configures.
14type Platform is Data:
15 Unmanaged{}
16 Darwin{config: ND.NixDarwin}
17 AzureCloud{config: Az.Azure}
18 Launchd{config: Ld.Launchd}
19
20# Where containers run: a machine, a runtime inside it, nested as deep as it is. Instances are container keys.
21type Node is Data:
22 Node{key: String, name: String, technology: String, role: Role, host: H.Host, platform: Platform, children: List<&2, Node>, instances: List<&2, String>}
23
24# What a deploy breaks, compared with what was deployed before.
25type Break is Data:
26 AddressChanged{}
27 StoreRemoved{name: String}
28
29# Where the system runs: the address it is reached at, the data stores that must survive a deploy, the
30# breaks accepted for the next deploy, and the nodes.
31type Deployment is Data:
32 Deployment{address: String, stores: List<&2, String>, accepted: List<&2, Break>, nodes: List<&2, Node>}