Skip to content

database: views for prebuilds #299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dannykopping opened this issue Jan 23, 2025 · 1 comment
Closed

database: views for prebuilds #299

dannykopping opened this issue Jan 23, 2025 · 1 comment
Assignees

Comments

@dannykopping
Copy link
Collaborator

prebuilds view

Encapsulate the logic of how prebuilds are identified

  • a prebuild is identified as a workspaces row being owned by the prebuilds user (database: migration for prebuild user #298)
  • every prebuild will only have one workspace_builds entry with a start transition, and its initiator_id will be set to the prebuilds user

prebuilds_reconciliation view

Encapsulates the logic of how prebuilds must be scheduled

  • desired count: instances specified in the coder_workspace_preset resource per active template version
  • actual count: number of running prebuilds per active template version
  • extraneous count: number of running prebuilds per inactive template version
@dannykopping dannykopping added the s estimated at 1-2 days of work label Jan 23, 2025
@coder-labeler coder-labeler bot added help wanted Extra attention is needed tech-debt labels Jan 23, 2025
@dannykopping dannykopping removed help wanted Extra attention is needed tech-debt s estimated at 1-2 days of work labels Jan 23, 2025
@dannykopping dannykopping self-assigned this Jan 23, 2025
@dannykopping
Copy link
Collaborator Author

Status update:

I opted to move the prebuilds_reconciliation view into a query rather than a view; we'll likely not need to reuse this query in other queries.

This work is now ~complete, but may need to be revisited later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant