Conversation
|
@sharkymark @whitney-coder @ericpaulsen — once this is merged, Quotas will come with Template RBAC and the Quota field in licenses will have no effect. |
| @@ -0,0 +1,3 @@ | |||
| ALTER TABLE workspace_builds ADD COLUMN cost int NOT NULL DEFAULT 0; | |||
| ALTER TABLE workspace_resources ADD COLUMN cost int NOT NULL DEFAULT 0; | |||
| ALTER TABLE groups ADD COLUMN quota_allowance int NOT NULL DEFAULT 0; | |||
There was a problem hiding this comment.
I might make this daily_quota_allowance as well... although since it's not time based, that gets a bit odd... maybe maximum_concurrent_quota?
| The quota is enabled by either the `CODER_USER_WORKSPACE_QUOTA` | ||
| environment variable or the `--user-workspace-quota` flag. For example, | ||
| you may limit each user in a deployment to 5 workspaces like so: | ||
| The workspace provisioner enforces quota during workspace start and stop operations. |
There was a problem hiding this comment.
| The workspace provisioner enforces quota during workspace start and stop operations. | |
| The workspace provisioner enforces quotas during workspace start and stop operations. |
| ## Quota Enforcement | ||
|
|
||
| ## Enabling this feature | ||
| Coder enforces Quota on workspace start and stop operations. The workspace |
There was a problem hiding this comment.
| Coder enforces Quota on workspace start and stop operations. The workspace | |
| Coder enforces quotas on workspace start and stop operations. The workspace |
| string icon = 6; | ||
| string instance_type = 7; | ||
| int32 cost = 8; | ||
| int32 daily_cost = 8; |
There was a problem hiding this comment.
I'm sure there was a conversation here, but why we did land on "daily" as the unit? I've been thinking about how we present this, and the more I thought about it the more I think giving this a unit is not ideal. Mainly because of it being lossy to our currently planned implementation.
There was a problem hiding this comment.
We want to encourage standard practices across all deployments for follow-on features such as reporting and burst quotas. For time units, the reasonable options are "hourly", "daily" and "monthly".
I threw out hourly because I thought it may require precision beyond a cent. For example, a $20/m instance costs 2.7 cents per hour, and we want to avoid floating point arithmetic.
I threw out monthly because it's not always clear what the exact length of a month is. It could be 30, 30.5, or 30.437 (right answer) days.
| type WorkspaceQuota struct { | ||
| UserWorkspaceCount int `json:"user_workspace_count"` | ||
| UserWorkspaceLimit int `json:"user_workspace_limit"` | ||
| CreditsConsumed int `json:"credits_consumed"` |
There was a problem hiding this comment.
We aren't really using the "credits" terminology anywhere else, right? Seems a little odd to introduce at this point.
There was a problem hiding this comment.
Yeah I agree, it could just be "QuotaConsumed"?
Some background here.
terraform-provider-coderand publish a new release therecost— use hourly/daily/monthly and smallest denomination of currency (e.g. cents for USD)coder/licensetooLater
Follow-up tasks to be worked after merge: