Skip to content

Commit

Permalink
Adding a Codespaces policy to constrain available machine types (#23814)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike McDonald <2575327+asciimike@users.noreply.github.com>
Co-authored-by: Steve Guntrip <12534592+stevecat@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 11, 2022
1 parent fcc9b90 commit 3d2a641
Show file tree
Hide file tree
Showing 31 changed files with 211 additions and 26 deletions.
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.
Binary file modified assets/images/help/codespaces/choose-custom-machine-type.png
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.
Binary file modified assets/images/help/codespaces/new-codespace-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/help/codespaces/policy-delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/help/codespaces/policy-edit.png
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.
Binary file modified assets/images/help/organizations/codespaces-sidebar-tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ For information on managing and changing your account's spending limit, see "[Ma

{% data reusables.codespaces.exporting-changes %}

## Limiting the choice of machine types

The type of machine a user chooses when they create a codespace affects the per-minute charge for that codespace, as shown above.

Organization owners can create a policy to restrict the machine types that are available to users. For more information, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)."

## How billing is handled for forked repositories

{% data variables.product.prodname_codespaces %} can only be used in organizations where a billable owner has been defined. To incur charges to the organization, the user must be a member or collaborator, otherwise they cannot create a codespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ Enterprise owners and billing managers can manage the spending limit for {% data
Email notifications are sent to account owners and billing managers when spending reaches 50%, 75%, and 90% of your account's spending limit.

You can disable these notifications anytime by navigating to the bottom of the **Spending Limit** page.

## Further reading

- "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)"
- "[Managing billing for Codespaces in your organization](/codespaces/managing-codespaces-for-your-organization/managing-billing-for-codespaces-in-your-organization)"
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ Your codespace will be automatically deleted when you are removed from an organi
## Deleting your unused codespaces

You can manually delete your codespaces in https://github.com/codespaces and from within {% data variables.product.prodname_vscode %}. To reduce the size of a codespace, you can manually delete files using the terminal or from within {% data variables.product.prodname_vscode %}.

## Further reading

- "[Managing billing for Codespaces in your organization](/codespaces/managing-codespaces-for-your-organization/managing-billing-for-codespaces-in-your-organization)"
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ topics:

You can choose a machine type either when you create a codespace or you can change the machine type at any time after you've created a codespace.

For information on choosing a machine type when you create a codespace, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)."
For information on changing the machine type within {% data variables.product.prodname_vscode %}, see "[Using {% data variables.product.prodname_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code#changing-the-machine-type-in-visual-studio-code)."
For information on choosing a machine type when you create a codespace, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)." For information on changing the machine type within {% data variables.product.prodname_vscode %}, see "[Using {% data variables.product.prodname_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code#changing-the-machine-type-in-visual-studio-code)."

## Changing the machine type in {% data variables.product.prodname_dotcom %}

Expand All @@ -40,7 +39,11 @@ For information on changing the machine type within {% data variables.product.pr

!['Change machine type' menu option](/assets/images/help/codespaces/change-machine-type-menu-option.png)

1. Choose the required machine type.
1. If multiple machine types are available for your codespace, choose the type of machine you want to use.

![Dialog box showing available machine types to choose](/assets/images/help/codespaces/change-machine-type-choice.png)

{% data reusables.codespaces.codespaces-machine-type-availability %}

2. Click **Update codespace**.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ If you would like to create a codespace for a repository owned by your personal

![New codespace button](/assets/images/help/codespaces/new-codespace-button.png)

If you are a member of an organization and are creating a codespace on a repository owned by that organization, you can select the option of a different machine type. From the dialog, choose a machine type and then click **Create codespace**.
![Machine type choice](/assets/images/help/codespaces/choose-custom-machine-type.png)
If you are a member of an organization and are creating a codespace on a repository owned by that organization, you can select the option of a different machine type. From the dialog box, choose a machine type and then click **Create codespace**.

![Machine type choice](/assets/images/help/codespaces/choose-custom-machine-type.png)

{% data reusables.codespaces.codespaces-machine-type-availability %}

{% endwebui %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,28 @@ Use the {% data variables.product.prodname_vs %} Marketplace to install the [{%
{% mac %}

{% data reusables.codespaces.click-remote-explorer-icon-vscode %}
2. Click **Sign in to view {% data variables.product.prodname_dotcom %}...**.
1. Click **Sign in to view {% data variables.product.prodname_dotcom %}...**.

![Signing in to view {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode-mac.png)

3. To authorize {% data variables.product.prodname_vscode %} to access your account on {% data variables.product.product_name %}, click **Allow**.
4. Sign in to {% data variables.product.product_name %} to approve the extension.
1. To authorize {% data variables.product.prodname_vscode %} to access your account on {% data variables.product.product_name %}, click **Allow**.
1. Sign in to {% data variables.product.product_name %} to approve the extension.

{% endmac %}

{% windows %}

{% data reusables.codespaces.click-remote-explorer-icon-vscode %}
2. Use the "REMOTE EXPLORER" drop-down, then click **{% data variables.product.prodname_github_codespaces %}**.
1. Use the "REMOTE EXPLORER" drop-down, then click **{% data variables.product.prodname_github_codespaces %}**.

![The {% data variables.product.prodname_codespaces %} header](/assets/images/help/codespaces/codespaces-header-vscode.png)

3. Click **Sign in to view {% data variables.product.prodname_codespaces %}...**.
1. Click **Sign in to view {% data variables.product.prodname_codespaces %}...**.

![Signing in to view {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode.png)

4. To authorize {% data variables.product.prodname_vscode %} to access your account on {% data variables.product.product_name %}, click **Allow**.
5. Sign in to {% data variables.product.product_name %} to approve the extension.
1. To authorize {% data variables.product.prodname_vscode %} to access your account on {% data variables.product.product_name %}, click **Allow**.
1. Sign in to {% data variables.product.product_name %} to approve the extension.

{% endwindows %}

Expand All @@ -68,8 +68,8 @@ Use the {% data variables.product.prodname_vs %} Marketplace to install the [{%
## Opening a codespace in {% data variables.product.prodname_vscode %}

{% data reusables.codespaces.click-remote-explorer-icon-vscode %}
2. Under "Codespaces", click the codespace you want to develop in.
3. Click the Connect to Codespace icon.
1. Under "Codespaces", click the codespace you want to develop in.
1. Click the Connect to Codespace icon.

![The Connect to Codespace icon in {% data variables.product.prodname_vscode %}](/assets/images/help/codespaces/click-connect-to-codespace-icon-vscode.png)

Expand All @@ -80,17 +80,23 @@ Use the {% data variables.product.prodname_vs %} Marketplace to install the [{%
You can change the machine type of your codespace at any time.

1. In {% data variables.product.prodname_vscode %}, open the Command Palette (`shift command P` / `shift control P`).
2. Search for and select "Codespaces: Change Machine Type."
1. Search for and select "Codespaces: Change Machine Type."

![Searching for a branch to create a new {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/vscode-change-machine-type-option.png)

3. Click the codespace that you want to change.
1. Click the codespace that you want to change.

![Searching for a branch to create a new {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/vscode-change-machine-choose-repo.png)

4. Choose the machine type you want to use.
1. Choose the machine type you want to use.

If the codespace is currently running, a message is displayed asking if you would like to restart and reconnect to your codespace now. Click **Yes** if you want to change the machine type used for this codespace immediately. If you click **No**, or if the codespace is not currently running, the change will take effect the next time the codespace restarts.
{% data reusables.codespaces.codespaces-machine-type-availability %}

1. If the codespace is currently running, a message is displayed asking if you would like to restart and reconnect to your codespace now.

Click **Yes** if you want to change the machine type used for this codespace immediately.

If you click **No**, or if the codespace is not currently running, the change will take effect the next time the codespace restarts.

## Deleting a codespace in {% data variables.product.prodname_vscode %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Organization owners can control which users in your organization can create and
To use codespaces in your organization, you must do the following:

- Ensure that users have [at least write access](/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization) to the repositories where they want to use a codespace.
- [Enable {% data variables.product.prodname_codespaces %} for users in your organization](#configuring-which-users-in-your-organization-can-use-codespaces). You can choose allow {% data variables.product.prodname_codespaces %} for selected users or only for specific users.
- [Enable {% data variables.product.prodname_codespaces %} for users in your organization](#enable-codespaces-for-users-in-your-organization). You can choose allow {% data variables.product.prodname_codespaces %} for selected users or only for specific users.
- [Set a spending limit](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)
- Ensure that your organization does not have an IP address allow list enabled. For more information, see "[Managing allowed IP addresses for your organization](/organizations/keeping-your-organization-secure/managing-allowed-ip-addresses-for-your-organization)."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ children:
- /managing-encrypted-secrets-for-your-repository-and-organization-for-codespaces
- /managing-repository-access-for-your-organizations-codespaces
- /reviewing-your-organizations-audit-logs-for-codespaces
- /restricting-access-to-machine-types
shortTitle: Managing your organization
---

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ You can disable the use of {% data variables.product.prodname_codespaces %} in y

You can also limit the individual users who can use {% data variables.product.prodname_codespaces %}. For more information, see "[Managing user permissions for your organization](/codespaces/managing-codespaces-for-your-organization/managing-user-permissions-for-your-organization)."

You can limit the choice of machine types that are available for repositories owned by your organization. This allows you to prevent people using overly resourced machines for their codespaces. For more information, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)."

## Deleting unused codespaces

Your users can delete their codespaces in https://github.com/codespaces and from within Visual Studio Code. To reduce the size of a codespace, users can manually delete files using the terminal or from within Visual Studio Code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ You can check which access policies are applied to a secret in your organization
![Secrets list](/assets/images/help/settings/actions-org-secrets-list.png)
1. For more details on the configured permissions for each secret, click **Update**.

## Further Reading
## Further reading

- "[Managing encrypted secrets for your codespaces](/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces)"
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ To manage which users in your organization can use {% data variables.product.pro
1. If you chose "Selected repositories", select the drop-down menu, then click a repository to allow the repository's codespaces to access other repositories owned by your organization. Repeat for all repositories whose codespaces you want to access other repositories.
!["Selected repositories" drop-down menu](/assets/images/help/settings/codespaces-access-and-security-repository-drop-down.png)

## Further Reading
## Further reading

- "[Managing repository access for your codespaces](/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces)"
Loading

0 comments on commit 3d2a641

Please sign in to comment.