© Mütli Corp. By Dave Newman.
- collect the state of the world
- collect AWS state (query AWS)
- collect pinky state (read from redis)
- collect prism state (read from redis)
- look for problems
- duplicate servers running
- aws box appeared
- aws box disappeared
- server appeared
- server disappeared
- rebalance (potentially move to brain)
- shutdown empty Shared servers
- bring up new boxes when at capacity
- shut down boxes when excess capacity
- rebalance servers for player counts
-
save new state
/pinky/* /state /pinky/* /servers/state /prism//players/ /server//state /server//allocation (ram/ecus)
/scruffy/cache/boxes
/scruffy/cache/servers /scruffy/cache/pinkies /scruffy/cache/prisms
One box has one pinky, both identified by the instance-id from Amazon (eg i-fb0c3287)
Box - Amazon ec2 instance id started_at instance_type state (starting|up|stopping) # this is the state of the Amazon instance
Pinky id # same as Box#id state (starting|up|stopping) servers players freeDiskMb freeRamMb idleCpu
Server
- id
- state (importing|starting|up|stopping|exporting)
Player
- id
- (scruffy creates EC2 instance - gets instance id)
- (scruffy sets box to starting)
- box - starting
- box - up
- (scruffy sets pinky state to starting)
- pinky - starting
- pinky - up
- (scruffy sets pinky state to stopping)
- (scruffy sets box state to stopping)
- (scruffy terminates box)
foreman start
Required
AWS_ACCESS_KEY
AWS_SECRET_KEY
AWS_REGION
REDIS_URL
BUGSNAG
Optional
SCRUFFY_ENV (staging|production)
SCRUFFY_ROOT