tree: 456e0873c1405b30a8cb73dd5de04bb1cc3dfe52 [path history] [tgz]
  1. configs/
  2. go/
  3. images/
  4. modules/
  5. pages/
  6. secrets/
  7. BUILD.bazel
  8. karma.conf.ts
  9. Makefile
  10. package-lock.json
  11. package.json
  12. README.md
  13. tsconfig.json
  14. webpack.config.ts
machine/README.md

Machine Server

The machine state server is a centralized management application for device testing.

See the Design Doc.

Code structure

The main code is structure as:

go/machine/
    source/
    processor/
    store/

Where:

  • types contains the Go types used across the rest of the modules.
  • The source module contains source.Source, a way to get update events from machines.
  • The store module contains store.Store, a way to persist and retrieve each machines state.
  • The 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)
	})
}