-
Notifications
You must be signed in to change notification settings - Fork 881
docs concept: workspace activity auto-stop #3529
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
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,48 @@ resources](./templates.md#persistent-and-ephemeral-resources). | |
|
||
When a workspace is deleted, all of the workspace's resources are deleted. | ||
|
||
## Workspace Schedule | ||
|
||
You can set a schedule for you workspace to automatically start at a given time (e.g. Monday - Friday at 9 AM). | ||
|
||
 | ||
|
||
You can also set a "time until shutdown" to auto-stop your workspace (e.g "8" hours after stopped). | ||
|
||
 | ||
|
||
In order to use your workspace past the "time until shutdown," you can use bumpers in the dashboard to keep the workspace alive: | ||
|
||
 | ||
|
||
### Activity detection (alpha) | ||
|
||
To keep your workspace running past the "time until shutdown," Coder can bump the workspace lifetime by 1 hour when it detects any of the following activities: | ||
|
||
- Open tunnel (SSH connection) | ||
|
||
If you have an open tunnel/SSH connection, the CLI will send keepalives to Coder, even if you are not typing. | ||
|
||
Use `coder tunnel --disable-keep-alive` or `coder config-ssh --disable-keep-alive` to avoid send keepalives to Coder. | ||
|
||
- HTTP (or websocket) request on `coder_app` | ||
|
||
Coder's proxy will detect any traffic on apps (e.g. code-server) | ||
|
||
- Typing in web terminal | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be rolled up into apps? |
||
|
||
- API Request (Manual/custom integrations) | ||
|
||
```sh | ||
curl https://coder.example.com/api/v2/workspaces/id/extend | ||
``` | ||
|
||
> To prevent false positives, we are considering using VS Code and JetBrains plugins to detect activity, instead of examining network requests. [Let us know](https://github.com/coder/coder/needs-issue) if this feature interesting is to you. | ||
|
||
If a template has a maximum lifetime (e.g. 16 hours), workspaces can no longer be bumped manually or by activity after that time. | ||
|
||
> If you are a Coder admin and would like increased visibility and fine-grained controls on auto start/stop, [we'd like to hear from you](https://coder.com/contact) | ||
|
||
## Updating workspaces | ||
|
||
Use the following command to update a workspace to the latest template version. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
For websockets, it is not clear to me whether we bump the lifetime only on the websocket request, or periodically while it is open like the SSH connection
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.
@Emyrk any thoughts here? I'd imagine websockets are more likely to be left open (vs SSH connections), but I'm admittedly not the expert here 🤷🏼
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.
@spikecurtis would love your thoughts too. Happy to guess here and adjust from feedback 😝
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.
I do know that Jupyter keeps a websocket open while you are interacting with a notebook. So, without periodic bumps, we would not consider a user "active" if they were working in a single Jupyter notebook. (opening new notebooks would cause a bump)
If we're going to do periodic bumps on an SSH connection, I think we should also do the same for any websockets open to coder_apps
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.
Makes sense to me!
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.
Wouldn't any ide app have some sort of long lived connection? For sending keystrokes and whatnot?
I agree with Spike