Skip to content

Activity Based Auto-stop #2995

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
ammario opened this issue Jul 14, 2022 · 5 comments · Fixed by #4119
Closed

Activity Based Auto-stop #2995

ammario opened this issue Jul 14, 2022 · 5 comments · Fixed by #4119
Assignees
Labels
needs decision Needs a higher-level decision to be unblocked.
Milestone

Comments

@ammario
Copy link
Member

ammario commented Jul 14, 2022

Edit from @bpmct: see the RFC here

Allow workspaces to remain "on" if the user is active in the workspace (e.g. writing code, typing in the terminal, etc).

Archive

Proposal

I think we should resolve #2987 first as it affects how this feature is exposed to the template admin. Without templates as code, we can expose the feature in the same way as we do min_autostart_interval and max_ttl today.

Activity Rules

We should discuss which values we want to make knobs immediately. The more we lean into templates as code, the more configurable this can get.

For each of these events, bump the auto-stop by 1h:

  • coder_app HTTP request
  • DevURL HTTP request
  • SSH access

Possible knobs:

  • Bump amount
  • Which coder_apps trigger bump
  • Which access types trigger bumps

To help the user debug why their workspace isn't shutting down, we could add a tooltip to the UI that explains the last bump source. The options could be "Manual", <app name>, <dev url name>, or "SSH".

Screen Shot 2022-07-14 at 12 56 51 PM

Pretty much all of our early scheduling feedback suggests that activity-based auto-stop should be enabled by default. So I propose that it is default with all of the knobs selected.

#3191 is user feedback that shows the value of combining schedule-based auto stop with activity-based auto-stop. If the user just wants activity-based, they can set the schedule to stop one hour after start.


Affected / Related Issues

#2942
#2752

@sharkymark
Copy link
Contributor

@ammario an enterprise prospect today with JupyterLab as a use case reported that a scheduled stop will not work for them, but they want an activity-based stop.

The problem they want to solve is their existing cloud JupyterLab solution just keeps workspaces running if a Python kernel is active, and runs up a big cloud bill.

JupyterLab introduces a couple of areas worth considering.

  1. It is a web-based app, so no config-ssh settings help them
  2. JupyterLab is a coder_app so not how we detect if one of these are open (maybe like how we did in v1)

@ammario

This comment was marked as resolved.

@ketang
Copy link
Contributor

ketang commented Jul 14, 2022

I couldn't find where I originally suggested this, but I believe we should expose a mapping from a user event/activity to a grace period. When an event with a positive grace period happens, we reset the timer to that specific grace period value. If it's negative, we don't reset the timer. If it's zero, we reset to a default value that comes from elsewhere, either the template or some kind of policy rule.

What we'd have out of the box is a default say one hour grace period with a few minor events overridden to not count.

@bpmct
Copy link
Member

bpmct commented Jul 26, 2022

Surfacing @Mainstay-Noah-Huppert's comment in #3191

That could be good. I do like the schedule so that my workspace doesn't shut down during lunch or during a meeting heavy day. Mainly because there are some development tasks (👀 webpack) that take a few minutes to start up with a big app. So having the workspace up and the tasks already running saves time. Additionally having the scheduled start at 9:00 AM is nice because I know that by the time I start dev work after standup all those tasks will be running and good to go.

For my particular use case I think being able to configure only having keep alive functionality and not inacitvity shutdown would be nice.

@bpmct
Copy link
Member

bpmct commented Sep 19, 2022

Gonna unassign this for now. The RFC has been finished and a proposed behavior is in #3529. We still need to make a few decisions about whether we want to support a feature like this prior to #3597 which can give us better data about user activity.

@bpmct bpmct removed their assignment Sep 19, 2022
@bpmct bpmct changed the title RFC: Activity Based Auto-stop Activity Based Auto-stop Sep 19, 2022
@ammario ammario self-assigned this Sep 19, 2022
ammario added a commit that referenced this issue Sep 19, 2022
ammario added a commit that referenced this issue Sep 20, 2022
@ammario ammario linked a pull request Sep 20, 2022 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs decision Needs a higher-level decision to be unblocked.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants