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