Repository navigation
feat(controller): allocate private servers per owner - #55
Merged
Merged
Conversation
Pools with a private section are created on demand through /v1/private-servers, limited per owner, and stopped after they stayed empty for the idle timeout. Adds grus private create and list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Players and groups cannot get a server of their own. Everything in a pool is shared, and a pool that scales by
buffer would either keep idle servers around or never start one for a single owner.
Approach
A pool can now declare a
privatesection (quota per owner, idle timeout). Such a pool is never autoscaled:nothing runs until an owner asks.
POST /v1/private-serversreturns the owner's running server or starts one;an owner who is at the quota gets a 409.
GETlists them,DELETEdrains one. A server that stays empty for theidle timeout is stopped and a
private.idle-stopevent is published.grus private create|listwraps this.The owner is stored as the instance label
grus.olf/owner. Instances can no longer overwritegrus.olf/labelswhen they report their own labels.
World persistence is spec only (README and code comment): a later version snapshots the instance directory to a
template on stop.
Testing
Controller, model, autoscaler, API, client and CLI tests with a fake clock and fake driver, no sleeps. The
OpenAPI document and the web types are regenerated (separate commit). The web commit only touches the generated
types file.