You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Template constraint for workspace scheduling #1433
In v1, we have customers that wanted to shut down all workspaces in an organization on a period while simultaneously giving their developers control to suit their working patterns and time zone.
The problem with developer controlled auto stop is they're not the ones incentivized to reduce costs.
Solution
The cleanest solution I could think of is we allow the ability to set an auto-start at the template level in addition to the workspace level. That auto-stop can be overridden by the workspace, but only by schedules that have the same interval or less. For example, if a daily auto-stop is set in the template, a daily one must be set by the user.
Auto start policy is flipped, the template interval serves as the floor instead of the ceiling.
A caveat with this approach is UX complexity.
For example, if I set a template cron auto start of 9am CST Mon to Fri, and then a user configures 9AM GMT Tues to Sun (one extra day), we need a really clear error, because it's an easy mistake to make.
Org-level auto-start
We don't implement this. For one, it's added complexity. For two, the templates describe the resource costs, they should also describe the cost management. This is consistent with my proposed quota system.
I love the approach described here. Add just talked to @johnstcn about using the template-level for permissions on Friday. We should have a breakout to discuss technical impact so that we can slot this.
We're thinking about adding a max_uptime time.Duration field on a template -- this would be some duration after which ephemeral workspace resources built from the aforementioned template would be eligible for automatic shutdown.
Spec:
max_uptime on template
validation on setting autostart and autostop that ensures they are within this interval.
There's other template-specific metadata such as description that doesn't relate specifically to the template schedule; do you want to break this out into separate template subcommands?
Maybe not. Given that this is non-interactive, then it isn't the issue I assumed because users aren't prompted for a bunch of stuff they don't want to change. They opt in via the arguments they pass. edit is good, carry on, carry on.
On Wed, May 18, 2022 at 12:58 PM Cian Johnston ***@***.***> wrote:
Why? I can understand why user-autostop is in the DB, but as much template
configuration as possible should be as code.
I don't understand how this could even fit into the template code.
The provisioner only handles the actual operation of starting and stopping
workspaces.
A separate entity handles triggering the starting and stopping of
workspaces.
—
Reply to this email directly, view it on GitHub
<#1433 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYSSUA53USFO2B2ACBRWELVKUVTJANCNFSM5V4APPLA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
Activity
greyscaled commentedon May 14, 2022
I love the approach described here. Add just talked to @johnstcn about using the template-level for permissions on Friday. We should have a breakout to discuss technical impact so that we can slot this.
[-]Add hierarchical workspace scheduling[/-][+]Add Template constraint on workspace scheduling[/+][-]Add Template constraint on workspace scheduling[/-][+]Template constraint for workspace scheduling[/+]greyscaled commentedon May 17, 2022
Breakout details between @johnstcn and @vapurrmaid
We're thinking about adding a
max_uptime time.Durationfield on a template -- this would be some duration after which ephemeral workspace resources built from the aforementioned template would be eligible for automatic shutdown.Spec:
max_uptimeon template16 remaining items
ammario commentedon Jun 7, 2022
@johnstcn why can't constraints be updated after the template is first created?
johnstcn commentedon Jun 8, 2022
#2159
ketang commentedon Jun 8, 2022
Nit: could it be confusing to use the
editcommand to change metadata rather than the core scripts?Can these be edited non-interactively via command line arguments?
johnstcn commentedon Jun 8, 2022
What do you suggest as an alternative name? Would
editmetaormetadatasound better?Currently, only non-interactive editing is supported.
ketang commentedon Jun 8, 2022
Perhaps
coder template schedule?Non interactive only is fine.
johnstcn commentedon Jun 8, 2022
There's other template-specific metadata such as description that doesn't relate specifically to the template schedule; do you want to break this out into separate template subcommands?
ketang commentedon Jun 8, 2022
Maybe not. Given that this is non-interactive, then it isn't the issue I assumed because users aren't prompted for a bunch of stuff they don't want to change. They opt in via the arguments they pass.
editis good, carry on, carry on.johnstcn commentedon Jun 8, 2022
@ammario Can this issue be closed?
ammario commentedon Oct 11, 2022