The machine state server is a centralized management application for device testing.
See the Design Doc.
The main code is structure as:
go/machine/
source/
processor/
store/
Where:
types contains the Go types used across the rest of the modules.source module contains source.Source, a way to get update events from machines.store module contains store.Store, a way to persist and retrieve each machine's state.processor module contains processor.Processor, a way to update a machine state from an incoming event.The main loop of machine state server looks like:
for event := range eventCh {
store.Update(ctx, event.Host.Name, func(previous machine.Description) machine.Description {
return processor.Process(ctx, previous, event)
})
}
The application that runs on each switchboard test machine and feeds information into the machine state server.
See the Design Doc.
| initiator | message | target | notes |
|---|---|---|---|
| machineserver | >Set(ΔDescription) | DB | Description.Powercycle=true |
| powercycle_server_ansible | <WebAPI(ListPowerCycleResponse) | machineserver | GET on /json/v1/powercycle/list |
| powercycle_server_ansible | >WebAPI | machineserver | POST to /json/v1/powercycle/complete/{id:.+} |
| initiator | message | target | notes |
|---|---|---|---|
| powercycle_server_ansible | >WebAPI(UpdatePowerCycleStateRequest) | machineserver | POST to /json/v1/powercycle/state/update |
| initiator | message | target | notes |
|---|---|---|---|
| test_machine_monitor | >PubSub(Event) | machineserver | Sends results from interrogate. |
| test_machine_monitor | <WebAPI(Description) | machineserver | GET to /json/v1/machine/description/{id:.+} |
Set - A database operationWebAPI - An HTTP RequestPubSub - A PubSub message.