diff --git a/docs/images/add-bumper-terminal.png b/docs/images/add-bumper-terminal.png new file mode 100644 index 0000000000000..29e214453613b Binary files /dev/null and b/docs/images/add-bumper-terminal.png differ diff --git a/docs/images/auto-start.png b/docs/images/auto-start.png new file mode 100644 index 0000000000000..b62970657cfad Binary files /dev/null and b/docs/images/auto-start.png differ diff --git a/docs/images/auto-stop.png b/docs/images/auto-stop.png new file mode 100644 index 0000000000000..6f61310f5d7b8 Binary files /dev/null and b/docs/images/auto-stop.png differ diff --git a/docs/workspaces.md b/docs/workspaces.md index 9560a30dfb3b4..1b7c3e1b08bd5 100644 --- a/docs/workspaces.md +++ b/docs/workspaces.md @@ -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). + +![Auto start](./images/auto-start.png) + +You can also set a "time until shutdown" to auto-stop your workspace (e.g "8" hours after stopped). + +![Auto stop](./images/auto-stop.png) + +In order to use your workspace past the "time until shutdown," you can use bumpers in the dashboard to keep the workspace alive: + +![Dashboard bumpers](./images/add-bumper-terminal.png) + +### 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 + +- 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.