Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e95f794

Browse files
committed
added template schedule settings, very likely broke some things
1 parent 062e5fe commit e95f794

File tree

7 files changed

+119
-11
lines changed

7 files changed

+119
-11
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Workspace Scheduling
2+
3+
You can configure a template to control how workspaces are started and stopped.
4+
You can also manage the lifecycle of failed or inactive workspaces.
5+
6+
![Schedule screen](../../../images/templates/schedule/template-schedule-settings.png)
7+
8+
## Schedule
9+
10+
Template [admins](../../users/README.md) may define these default values:
11+
12+
- [**Default autostop**](../workspaces.md#autostart-and-autostop): How long a
13+
workspace runs without user activity before Coder automatically stops it.
14+
- [**Autostop requirement**](#autostop-requirement-enterprise-premium): Enforce
15+
mandatory workspace restarts to apply template updates regardless of user
16+
activity.
17+
- **Activity bump**: The duration of inactivity that must pass before a worksace
18+
is automatically stopped.
19+
- **Dormancy**: This allows automatic deletion of unused workspaces to reduce
20+
spend on idle resources.
21+
22+
## Allow users scheduling
23+
24+
For templates where a uniform autostop duration is not appropriate, admins may
25+
allow users to define their own autostart and autostop schedules. Admins can
26+
restrict the days of the week a workspace should automatically start to help
27+
manage infrastructure costs.
28+
29+
## Failure cleanup (enterprise)
30+
31+
Failure cleanup defines how long a workspace is permitted to remain in the
32+
failed state prior to being automatically stopped. Failure cleanup is an
33+
enterprise-only feature.
34+
35+
## Dormancy threshold (enterprise)
36+
37+
Dormancy Threshold defines how long Coder allows a workspace to remain inactive
38+
before being moved into a dormant state. A workspace's inactivity is determined
39+
by the time elapsed since a user last accessed the workspace. A workspace in the
40+
dormant state is not eligible for autostart and must be manually activated by
41+
the user before being accessible. Coder stops workspaces during their transition
42+
to the dormant state if they are detected to be running. Dormancy Threshold is
43+
an enterprise-only feature.
44+
45+
## Dormancy auto-deletion (enterprise)
46+
47+
Dormancy Auto-Deletion allows a template admin to dictate how long a workspace
48+
is permitted to remain dormant before it is automatically deleted. Dormancy
49+
Auto-Deletion is an enterprise-only feature.
50+
51+
## Autostop requirement (enterprise) (premium)
52+
53+
Autostop requirement is a template setting that determines how often workspaces
54+
using the template must automatically stop. Autostop requirement ignores any
55+
active connections, and ensures that workspaces do not run in perpetuity when
56+
connections are left open inadvertently.
57+
58+
Workspaces will apply the template autostop requirement on the given day in the
59+
user's timezone and specified quiet hours (see below). This ensures that
60+
workspaces will not be stopped during work hours.
61+
62+
The available options are "Days", which can be set to "Daily", "Saturday" or
63+
"Sunday", and "Weeks", which can be set to any number from 1 to 16.
64+
65+
"Days" governs which days of the week workspaces must stop. If you select
66+
"daily", workspaces must be automatically stopped every day at the start of the
67+
user's defined quiet hours. When using "Saturday" or "Sunday", workspaces will
68+
be automatically stopped on Saturday or Sunday in the user's timezone and quiet
69+
hours.
70+
71+
"Weeks" determines how many weeks between required stops. It cannot be changed
72+
from the default of 1 if you have selected "Daily" for "Days". When using a
73+
value greater than 1, workspaces will be automatically stopped every N weeks on
74+
the day specified by "Days" and the user's quiet hours. The autostop week is
75+
synchronized for all workspaces on the same template.
76+
77+
Autostop requirement is disabled when the template is using the deprecated max
78+
lifetime feature. Templates can choose to use a max lifetime or an autostop
79+
requirement during the deprecation period, but only one can be used at a time.
80+
81+
## User quiet hours (enterprise) (premium)
82+
83+
User quiet hours can be configured in the user's schedule settings page.
84+
Workspaces on templates with an autostop requirement will only be forcibly
85+
stopped due to the policy at the start of the user's quiet hours.
86+
87+
![User schedule settings](../../../images/admin/templates/schedule/user-quiet-hours.png)
88+
89+
Admins can define the default quiet hours for all users with the
90+
`--default-quiet-hours-schedule` flag or `CODER_DEFAULT_QUIET_HOURS_SCHEDULE`
91+
environment variable. The value should be a cron expression such as
92+
`CRON_TZ=America/Chicago 30 2 * * *` which would set the default quiet hours to
93+
2:30 AM in the America/Chicago timezone. The cron schedule can only have a
94+
minute and hour component. The default schedule is UTC 00:00. It is recommended
95+
to set the default quiet hours to a time when most users are not expected to be
96+
using Coder.
97+
98+
Admins can force users to use the default quiet hours with the
99+
[CODER_ALLOW_CUSTOM_QUIET_HOURS](../../../reference/cli/server.md#allow-custom-quiet-hours)
100+
environment variable. Users will still be able to see the page, but will be
101+
unable to set a custom time or timezone. If users have already set a custom
102+
quiet hours schedule, it will be ignored and the default will be used instead.

docs/admin/workspaces/README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,19 @@ that are currently running.
3131
The following filters are supported:
3232

3333
- `owner` - Represents the `username` of the owner. You can also use `me` as a
34-
convenient alias for the logged-in user.
35-
- `template` - Specifies the name of the template.
36-
- `status` - Indicates the status of the workspace. For a list of supported
37-
statuses, see
34+
convenient alias for the logged-in user, e.g., `owner:me`
35+
- `name` - Name of the workspace.
36+
- `template` - Name of the template.
37+
- `status` - Indicates the status of the workspace, e.g, `status:failed` For a
38+
list of supported statuses, see
3839
[WorkspaceStatus documentation](https://pkg.go.dev/github.com/coder/coder/codersdk#WorkspaceStatus).
40+
- `outdated` - Filters workspaces using an outdated template version, e.g,
41+
`outdated:true`
42+
- `dormant` - Filters workspaces based on the dormant state, e.g `dormant:true`
43+
- `has-agent` - Only applicable for workspaces in "start" transition. Stopped
44+
and deleted workspaces don't have agents. List of supported values
45+
`connecting|connected|timeout`, e.g, `has-agent:connecting`
46+
- `id` - Workspace UUID
3947

4048
## Updating workspaces
4149

docs/admin/workspaces/lifecycle.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Workspace lifecycle
22

3-
<!-- TODO: Make a sexier opener -->
4-
53
Workspaces are flexible, reproducible, and isolated units of compute. Workspaces
64
are created via Terraform, managed through the Coder control plane, accessed
75
through the Coder agent, then stopped and deleted again by Terraform.
@@ -43,10 +41,8 @@ API, or dashboard. To learn how, read our
4341

4442
By default, there is no limit on the number of workspaces a user may create,
4543
regardless of the template's resource demands. Enterprise administrators may
46-
limit the number of workspaces per template or group using quotas to prevent
47-
over provisioning and control costs.
48-
49-
<!-- TODO: Quota link -->
44+
limit the number of workspaces per template, group, and organization using
45+
[quotas](../users/quotas.md) to prevent over provisioning and control costs.
5046

5147
When a user creates a workspace, they're sending a build request to the control
5248
plane. Coder takes this and uses [Terraform](https://www.terraform.io/) to

docs/user-guides/workspace-scheduling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ User quiet hours can be configured in the user's schedule settings page.
6565
Workspaces on templates with an autostop requirement will only be forcibly
6666
stopped due to the policy at the **start** of the user's quiet hours.
6767

68-
![User schedule settings](../images/user-quiet-hours.png)
68+
![User schedule settings](../images/admin/templates/schedule/user-quiet-hours.png)
6969

7070
## Scheduling configuration examples
7171

docs/workspaces.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Workspaces
22

3+
<!-- TODO: ENSURE THIS CONTENT IS COPIED IN RESTRUCTURE -->
4+
35
A workspace is the environment that a developer works in. Developers in a team
46
each work from their own workspace and can use
57
[multiple IDEs](./user-guides/workspace-access/README.md).

0 commit comments

Comments
 (0)