-
Notifications
You must be signed in to change notification settings - Fork 923
docs: add documentation for prebuild scheduling feature #18462
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
docs: add documentation for prebuild scheduling feature #18462
Conversation
21c9c1a
to
b92ae48
Compare
b92ae48
to
d26f663
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic documentation!
docs/admin/templates/extending-templates/prebuilt-workspaces.md
Outdated
Show resolved
Hide resolved
docs/admin/templates/extending-templates/prebuilt-workspaces.md
Outdated
Show resolved
Hide resolved
docs/admin/templates/extending-templates/prebuilt-workspaces.md
Outdated
Show resolved
Hide resolved
docs/admin/templates/extending-templates/prebuilt-workspaces.md
Outdated
Show resolved
Hide resolved
docs/admin/templates/extending-templates/prebuilt-workspaces.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Danny Kopping <danny@coder.com>
Co-authored-by: Danny Kopping <danny@coder.com>
Co-authored-by: Danny Kopping <danny@coder.com>
Co-authored-by: Atif Ali <atif@coder.com>
Co-authored-by: Atif Ali <atif@coder.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 just some small nits
instances = 0 # default to 0 instances | ||
|
||
scheduling { | ||
timezone = "UTC" # only a single timezone may be used for simplicity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add the list of supported timezones
**How scheduling works:** | ||
|
||
1. The reconciliation loop evaluates all active schedules every reconciliation interval (`CODER_WORKSPACE_PREBUILDS_RECONCILIATION_INTERVAL`). | ||
2. The schedule that matches the current time becomes active. Overlapping schedules are disallowed by validation rules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit:
2. The schedule that matches the current time becomes active. Overlapping schedules are disallowed by validation rules. | |
2. The schedule matching the current time is considered active. Overlapping schedules are prevented by validation rules. |
|
||
1. The reconciliation loop evaluates all active schedules every reconciliation interval (`CODER_WORKSPACE_PREBUILDS_RECONCILIATION_INTERVAL`). | ||
2. The schedule that matches the current time becomes active. Overlapping schedules are disallowed by validation rules. | ||
3. If no schedules match the current time, the base `instances` count is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit:
3. If no schedules match the current time, the base `instances` count is used. | |
3. If no schedule matches the current time, the system defaults to the base `instances` count. |
Cron expressions follow the format: `* HOUR DOM MONTH DAY-OF-WEEK` | ||
|
||
- `*` (minute): Must always be `*` to ensure the schedule covers entire hours rather than specific minute intervals | ||
- `HOUR`: 0-23, range (e.g., 8-18 for 8AM-6:59PM), or `*` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use the same time interval for consistency:
- `HOUR`: 0-23, range (e.g., 8-18 for 8AM-6:59PM), or `*` | |
- `HOUR`: 8-18, range (e.g., 8-18 for 8AM-6:59PM), or `*` |
instances = 10 | ||
} | ||
schedule { | ||
cron = "* 19-23,0-7 * * 1,5" # Evenings and nights (7PM-11:59PM, 12AM-7:59AM, Mon-Fri) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, it is possible to compose multiple hour intervals? Nice 🤩
Follow-up to #18126
Changes: