Skip to content

Commit 9b6ced0

Browse files
committed
Add timeouts article
1 parent 2380a64 commit 9b6ced0

10 files changed

+115
-18
lines changed
11.4 KB
Loading
109 KB
Loading
24 KB
Loading
33.9 KB
Loading
42.1 KB
Loading

content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ shortTitle: Set the timeout
1212

1313
A codespace will stop running after a period of inactivity. You can specify the length of this timeout period. The updated setting will apply to any newly created codespace.
1414

15+
Some organizations may have a maximum idle timeout policy. If an organization policy sets a maximum timeout which is less than the default timeout you have set, the organization's timeout will be used instead of your setting, and you will be notified of this after the codespace is created. For more information, see "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)."
16+
1517
{% warning %}
1618

1719
**Warning**: Codespaces are billed per minute. If you are not actively using a codespace but the codespace has not yet timed out, you are still billed for the time that the codespace is running. For more information, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)."

content/codespaces/managing-codespaces-for-your-organization/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ children:
1515
- /reviewing-your-organizations-audit-logs-for-codespaces
1616
- /restricting-access-to-machine-types
1717
- /restricting-the-visibility-of-forwarded-ports
18+
- /restricting-the-idle-timeout-period
1819
shortTitle: Managing your organization
1920
---
2021

content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Restricting access to machine types
3-
shortTitle: Machine type access
3+
shortTitle: Restrict machine types
44
intro: You can set constraints on the types of machines users can choose when they create codespaces in your organization.
55
product: '{% data reusables.gated-features.codespaces %}'
6-
permissions: 'To manage access to machine types for the repositories in an organization, you must be an organization owner.'
6+
permissions: 'To manage access to machine types for the repositories in an organization, you must be an owner of the organization.'
77
versions:
88
fpt: '*'
99
ghec: '*'
@@ -48,32 +48,34 @@ If you add an organization-wide policy, you should set it to the largest choice
4848
{% data reusables.profile.access_org %}
4949
{% data reusables.profile.org_settings %}
5050
1. In the "Code, planning, and automation" section of the sidebar, select **{% octicon "codespaces" aria-label="The codespaces icon" %} {% data variables.product.prodname_codespaces %}** then click **Policy**.
51-
2. On the "Codespace policies" page, click **Create Policy**.
52-
3. Enter a name for your new policy.
53-
4. Click **Add constraint** and choose **Machine types**.
51+
1. On the "Codespace policies" page, click **Create Policy**.
52+
1. Enter a name for your new policy.
53+
1. Click **Add constraint** and choose **Machine types**.
5454

5555
![Add a constraint for machine types](/assets/images/help/codespaces/add-constraint-dropdown.png)
5656

57-
5. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint, then clear the selection of any machine types that you don't want to be available.
57+
1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint, then clear the selection of any machine types that you don't want to be available.
5858

5959
![Edit the machine type constraint](/assets/images/help/codespaces/edit-machine-constraint.png)
6060

61-
6. In the "Change policy target" area, click the dropdown button.
62-
7. Choose either **All repositories** or **Selected repositories** to determine which repositories this policy will apply to.
63-
8. If you chose **Selected repositories**:
61+
1. In the "Change policy target" area, click the dropdown button.
62+
1. Choose either **All repositories** or **Selected repositories** to determine which repositories this policy will apply to.
63+
1. If you chose **Selected repositories**:
6464
1. Click {% octicon "gear" aria-label="The settings icon" %}.
6565

6666
![Edit the settings for the policy](/assets/images/help/codespaces/policy-edit.png)
6767

68-
2. Select the repositories you want this policy to apply to.
69-
3. At the bottom of the repository list, click **Select repositories**.
68+
1. Select the repositories you want this policy to apply to.
69+
1. At the bottom of the repository list, click **Select repositories**.
7070

7171
![Select repositories for this policy](/assets/images/help/codespaces/policy-select-repos.png)
7272

73-
9. Click **Save**.
74-
73+
1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see "[Restricting the visibility of forwarded ports](http://localhost:4000/en/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)" and "[Restricting the idle timeout period](http://localhost:4000/en/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)."
74+
1. After you have finished adding constraints to your policy, click **Save**.
7575
## Editing a policy
7676

77+
You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy.
78+
7779
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the available machine types](#adding-a-policy-to-limit-the-available-machine-types)."
7880
1. Click the name of the policy you want to edit.
7981
1. Make the required changes then click **Save**.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: Restricting the idle timeout period
3+
shortTitle: Restrict timeout periods
4+
intro: 'You can set a maximum timeout period for any codespaces owned by your organization.'
5+
product: '{% data reusables.gated-features.codespaces %}'
6+
permissions: 'To manage timeout constraints for an organization''s codespaces, you must be an owner of the organization.'
7+
versions:
8+
fpt: '*'
9+
ghec: '*'
10+
type: how_to
11+
topics:
12+
- Codespaces
13+
---
14+
15+
## Overview
16+
17+
The personal settings of a {% data variables.product.prodname_dotcom %} user allow them to define how long a codespace they have created can remain inactive before it times out. When a codespace times out it is stopped and will no longer incur charges for compute usage. For more information, see "[Setting your timeout period for Codespaces](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)."
18+
19+
As an organization owner, you may want to configure constraints on the maximum idle timeout period for codespaces owned by your organization. This can help you limit costs associated with codespaces that are left to timeout after long periods of inactivity. You can set a maximum timeout for all codespaces owned by your organization, or for the codespaces of specific repositories.
20+
21+
{% note %}
22+
23+
**Note**: Maximum idle timeout constraints only apply to codespaces that are owned by your organization. They do not apply to codespaces for which the organization is not the billable owner.
24+
25+
{% endnote %}
26+
27+
For more information about pricing for {% data variables.product.prodname_codespaces %} compute usage, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)."
28+
29+
### Behavior when you set a maximum idle timeout constraint
30+
31+
If someone sets the default idle timeout to 90 minutes in their personal settings and they then start a codespace for a repository with a maximum idle timeout constraint of 60 minutes, the codespace will time out after 60 minutes of inactivity. When codespace creation completes, a message explaining this will be displayed:
32+
33+
> Idle timeout for this codespace is set to 60 minutes in compliance with your organization’s policy.
34+
35+
### Setting organization-wide and repository-specific policies
36+
37+
When you create a policy you choose whether it applies to all repositories in your organization, or only to specified repositories. If you create an organization-wide policy with a timeout constraint then the timeout constraints in any repository-specific policies must fall within the restriction set at the organization level. The shortest timeout period, in an organization policy, a repository policy, or in someone's personal settings, is applied.
38+
39+
If you add an organization-wide policy with a timeout constraint, you should set the timeout to the longest acceptable period. You can then add repository-specific policies that set the maximum timeout to a shorter period.
40+
41+
## Adding a policy to set a maximum idle timeout period
42+
43+
{% data reusables.profile.access_org %}
44+
{% data reusables.profile.org_settings %}
45+
1. In the "Code, planning, and automation" section of the sidebar, select **{% octicon "codespaces" aria-label="The codespaces icon" %} {% data variables.product.prodname_codespaces %}** then click **Policies**.
46+
1. On the "Codespace policies" page, click **Create Policy**.
47+
1. Enter a name for your new policy.
48+
1. Click **Add constraint** and choose **Maximum idle timeout**.
49+
50+
![Add a constraint for idle timeout](/assets/images/help/codespaces/add-constraint-dropdown-timeout.png)
51+
52+
1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint.
53+
54+
![Edit the timeout constraint](/assets/images/help/codespaces/edit-timeout-constraint.png)
55+
56+
1. Enter the maximum number of minutes codespaces can remain inactive before they time out, then click **Save**.
57+
58+
![Choose the port visibility options](/assets/images/help/codespaces/maximum-minutes-timeout.png)
59+
60+
1. In the "Change policy target" area, click the dropdown button.
61+
1. Choose either **All repositories** or **Selected repositories** to determine which repositories this policy will apply to.
62+
1. If you chose **Selected repositories**:
63+
1. Click {% octicon "gear" aria-label="The settings icon" %}.
64+
65+
![Edit the settings for the policy](/assets/images/help/codespaces/policy-edit.png)
66+
67+
2. Select the repositories you want this policy to apply to.
68+
3. At the bottom of the repository list, click **Select repositories**.
69+
70+
![Select repositories for this policy](/assets/images/help/codespaces/policy-select-repos.png)
71+
72+
1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see "[Restricting access to machine types](http://localhost:4000/en/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)" and "[Restricting the visibility of forwarded ports](http://localhost:4000/en/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)."
73+
1. After you have finished adding constraints to your policy, click **Save**.
74+
75+
The policy will be applied to all new codespaces and to existing codespaces the next time they are started.
76+
77+
## Editing a policy
78+
79+
You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy.
80+
81+
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum idle timeout period](#adding-a-policy-to-set-a-maximum-idle-timeout-period)."
82+
1. Click the name of the policy you want to edit.
83+
1. Make the required changes then click **Save**.
84+
85+
## Deleting a policy
86+
87+
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum idle timeout period](#adding-a-policy-to-set-a-maximum-idle-timeout-period)."
88+
1. Click the delete button to the right of the policy you want to delete.
89+
90+
![The delete button for a policy](/assets/images/help/codespaces/policy-delete.png)

content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Restricting the visibility of forwarded ports
3-
shortTitle: Restricting port visibility
3+
shortTitle: Restrict port visibility
44
intro: 'You can set constraints on the visibility options users can choose when they forward ports from codespaces in your organization.'
55
product: '{% data reusables.gated-features.codespaces %}'
6-
permissions: 'To manage access to port visibility constraints for the repositories in an organization, you must be an organization owner.'
6+
permissions: 'To manage access to port visibility constraints for the repositories in an organization, you must be an owner of the organization.'
77
versions:
88
fpt: '*'
99
ghec: '*'
@@ -47,7 +47,7 @@ If you add an organization-wide policy, you should set it to the most lenient vi
4747

4848
![Add a constraint for port visibility](/assets/images/help/codespaces/add-constraint-dropdown-ports.png)
4949

50-
1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint
50+
1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint.
5151

5252
![Edit the port visibility constraint](/assets/images/help/codespaces/edit-port-visibility-constraint.png)
5353

@@ -67,10 +67,12 @@ If you add an organization-wide policy, you should set it to the most lenient vi
6767

6868
![Select repositories for this policy](/assets/images/help/codespaces/policy-select-repos.png)
6969

70-
1. Click **Save**.
71-
70+
1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see "[Restricting access to machine types](http://localhost:4000/en/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)" and "[Restricting the idle timeout period](http://localhost:4000/en/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)."
71+
1. After you have finished adding constraints to your policy, click **Save**.
7272
## Editing a policy
7373

74+
You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy.
75+
7476
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the port visibility options](#adding-a-policy-to-limit-the-port-visibility-options)."
7577
1. Click the name of the policy you want to edit.
7678
1. Make the required changes then click **Save**.

0 commit comments

Comments
 (0)