
Dominion
Golang distributed system for service ecosystem management
This library serves on an IoT network were services (lights, speakers, thermostat, cameras, processing...) will be auto-started, auto-distributed, and (maybe) auto-scaled. The Dominion & Domains are sorts of managers of all devices which are participating. They manage service start, maintance, and discovery.
Abstractions
Dominion (leader)
Run the Domain with go run cmd/dominion/main.go
Don't forget to set DOMINION_CONFIG_FILE
example
Listen for new Domains by:
- Wait for ZeroConf Broadcasts advertizing a Domain
- Dial Domain & establish lasting connection
Review Domains by:
- Repeadetly send heartbeat to Domains to keep connection alive
- Update Domains service list from heartbeat reply
Review Domain's Services by:
- Routinely reviewing Domains and checking that required services are available/started
- Routinely reviewing Services and checking that dependencies are available/started
Domain (follower)
Run the Domain with go run cmd/domain/main.go
Don't forget to set DOMAIN_CONFIG_FILE
example
Domains find a Dominion by:
- Identifying that they are lonely (no history of a dominion or heartbeats stopped)
- Broadcasting to the network using ZeroConf
Domains remain in a Dominion by:
- Listening for incomming Heartbeat RPCs
- Update stored Dominion's identity
Domains start Services by:
- Listening for incomming StartService RPCs
- Calling make in the specified Service Directory
Service (Ecosystem)
Services do whatever you want them too. Services are language agnostic. They can locate other services through the Dominion's GRPC server. Service dependencies are defined in the DOMINION_CONFIG_FILE
Services I use -> ExMachina
Utilized Libraries
github.com/blang/semver
google.golang.org/grpc
github.com/grandcat/zeroconf
github.com/BurntSushi/toml
Planned Development
- Expose Logfiles - Dominion & Domain offer routes with logfiles
- Connection encryption - encrypt RPCs
- Identity verification - sign communication with preestablished keypairs
gRPC & protoc are used by go generate
to update bitbox/grpc.
gRPCox is a lightweight docker container for easy manual testing.