[23 Feb]: Codespaces prebuilds- [Public Beta] (#25066)
* Draft - add copy from Google doc * Add images * More WiP * test (#25121) * Update actions-scheduled-workflow-example.md The editor when changing a CRON time says the most frequent is 5 minutes. Either this section is incorrect or the editor pop over.. * Fix "labels" type * Add apps permissions for code scanning org endpoint. (#24859) * cope with possible translation drift (#24842) * cope with possible translation drift * fix test * don't shallow clone * fix unit tests * update code comments * more code comment corrections * more code comment * feedbacked * Add 💅 * Remove yzhang.markdown-all-in-one extension The markdown-all-in-one extension prevents Alfred expansions happening correctly. * Revert Add apps permissions for code scanning org endpoint (#25023) * Add security overview to github-security-features.md * updating ghcr_token github_token * archived asset redirects (#25025) * updating ghec_token to github_token * set 'manul-purge' surrogate key on assets/cb- URLs (#25028) * Member privileges edit for forking help doc (#24934) * calm down Backfill logging (#25031) * [Feb. 2, 2022] Updates for settings nav redesign (#24604) * Replace accessibility-tab.png with octicon * Update and version appearance-tab references * Replace codespaces-tab.png with octicon * Replace product name with reusable * Version reusable using developer-settings.png * Version reusable using notifcations_menu.png * Replace org-settings-pages.png with octicon * Version reusable using repos-tab.png * Version reusable using saved-replies-tab.png * Version reusable with settings-applications.png * Version reusable with settings-sidebar-account-security.png * version reusable with settings-sidebar-account-settings.png * Replace settings-sidebar-billing-plans.png with octicon * Replace settings-sidebar-blocked-users.png with octicon * Version settings-sidebar-deploy-keys.png * Version reusable with settings-sidebar-emails.png * Replace settings-sidebar-interaction-limits.png with octicon * Replace settings-sidebar-organizations.png with octicon * Version use of settings-sidebar-repositories.png * Version reusable with settings-seidebar-security-analysis.png * Version reusable with settings-sidebar-ssh-keys.png * Version reusable with settings-sidebar-team-settings.png * Replace settings-sidebar-third-party-access.png with octicon * Version reusable with settings-user-orgs.png * Replace user-settings-pages.png with octicon * Update pages octicon * Add explicit versions to elsif tags * Rewording for consistency * Improve versioning for future GHAE * Add missing space Co-authored-by: Felicity Chapman <felicitymay@github.com> Co-authored-by: Felicity Chapman <felicitymay@github.com> * update search indexes * New translation batch for es (#25035) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=es * run script/i18n/reset-known-broken-translation-files.js * Check in es CSV report * Remove duplicated word (#24974) * Fix when we show the 'All Enterprise Releases' link (#25002) * Enterprise versions start with 'enterprise-server' * Show only if all versions are ghes versions * Show link if there's any ghes versioning * Depend on the path for the tool switcher (#25018) * Azure: use shared env setter, fix comment workflow (#25044) * update azure deployments to use shared env getter, fix content changes table * update search indexes * update search indexes * Update workflow-syntax-for-github-actions.md * New translation batch for pt (#25050) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt * run script/i18n/reset-known-broken-translation-files.js * update search indexes * The missing full stop was added. * update search indexes * update search indexes * New translation batch for pt (#25057) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt * run script/i18n/reset-known-broken-translation-files.js * New translation batch for es (#25058) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=es * run script/i18n/reset-known-broken-translation-files.js * update search indexes * update search indexes * Update OpenAPI Descriptions (#25047) * update search indexes * Enterprise bug fixes: week of Jan 31, 2022 (#25043) * delete the workflow linter (#25075) * an empty 'product', 'permissions', or 'learningTracks' gets stuck (#25070) * and empty 'this.product' gets stuck * add test to prove change * Update OpenAPI Descriptions (#25071) * Update OpenAPI Descriptions (#25076) * Update OpenAPI Descriptions * Add decorated OpenAPI schema files Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com> * basic tests of the search API (#25069) * basic tests of the search API * lfs * Revert "Revert Add apps permissions for code scanning org endpoint (#25023)" (#25026) * update website-scraper to update transitive nth-check dep (#25080) * update search indexes * New translation batch for es (#25088) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=es * run script/i18n/reset-known-broken-translation-files.js * Update code-scanning-alert.png (#25072) * use manual surrogate key for nextjs static assets (#25096) * use manual surrogate key for nextjs static assets * refactor * update search indexes * Update differences-between-clustering-and-high-availability-ha.md (#25107) * Update OpenAPI Descriptions (#25104) * Add versioning for GHAE 3.3 (#24936) * Update content/code-security/getting-started/github-security-features.md * update search indexes * [Actions] `push` event does not have Activity types (#15124) * 📝 Clarify usage of single quotes in string datatype for literals (#14895) * Fix value of GITHUB_REF for release events (#14876) * New translation batch for pt (#25084) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt * run script/i18n/reset-known-broken-translation-files.js Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> * New translation batch for ja (#25093) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=ja * run script/i18n/reset-known-broken-translation-files.js * Check in ja CSV report Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> * New translation batch for cn (#25090) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/lint-translation-files.js --check parsing * Run script/i18n/lint-translation-files.js --check rendering * run script/i18n/reset-files-with-broken-liquid-tags.js --language=cn * run script/i18n/reset-known-broken-translation-files.js * Check in cn CSV report Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> * Create github-debian.sh * Update Dockerfile * Update procedures for personal account recovery with two-factor authentication (#25040) * delete old deploy.js script (#24862) Co-authored-by: Mark Battistella <markbattistella@users.noreply.github.com> Co-authored-by: Emily Grace Seville <emilyseville7cf@gmail.com> Co-authored-by: Octomerger Bot <63058869+Octomerger@users.noreply.github.com> Co-authored-by: Anders Starcke Henriksen <starcke@github.com> Co-authored-by: Peter Bengtsson <mail@peterbe.com> Co-authored-by: Laura Coursen <lecoursen@github.com> Co-authored-by: lucie-docs <40564413+lucie-docs@users.noreply.github.com> Co-authored-by: Josh Johanning <joshjohanning@github.com> Co-authored-by: Tahlia G <84726379+tahlialouisa@users.noreply.github.com> Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> Co-authored-by: Felicity Chapman <felicitymay@github.com> Co-authored-by: GitHub Actions <action@github.com> Co-authored-by: docubot <67483024+docubot@users.noreply.github.com> Co-authored-by: Simon Giesemann <kwacky1@github.com> Co-authored-by: Robert Sese <rsese@github.com> Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> Co-authored-by: Albin PK <56157868+albinpk@users.noreply.github.com> Co-authored-by: Dasun Tharanga <dasuntharangaflash@gmail.com> Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com> Co-authored-by: Ramya Parimi <33761166+ramyaparimi@users.noreply.github.com> Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com> Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com> Co-authored-by: Dorothy Mitchell <dorothymitchell@github.com> Co-authored-by: Andy J <mumfy@github.com> Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> Co-authored-by: Marko Kaznovac <kaznovac@users.noreply.github.com> Co-authored-by: Anil Seervi <61609033+AnilSeervi@users.noreply.github.com> Co-authored-by: Johanan Idicula <johanan@forcepush.tech> * Add more screenshots * complete items on plan * Revert changes to files I didn't change * Minor tweaks * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Remove detail about building prebuilds by rerunning a workflow After deleting a prebuild configuration anyone who can access the workflow history can recreate the prebuilds by rerunning the previous workflow run - unless you go through manually deleting all of those entries from the workflow history. Removed this information as per review comment. * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update data/reusables/codespaces/billing-for-prebuilds.md * Update data/reusables/codespaces/billing-for-prebuilds.md * Restructure info into separate articles * Update content/codespaces/prebuilding-your-codespaces/about-codespaces-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Move prerequisites section * Move billing info * Update content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update data/reusables/codespaces/billing-for-prebuilds.md * Update data/reusables/codespaces/billing-for-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Move deletion points, as per review comment * Update link * Add links to new information * Make review comment changes * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md * Update content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Optimize images Co-authored-by: Mark Battistella <markbattistella@users.noreply.github.com> Co-authored-by: Emily Grace Seville <emilyseville7cf@gmail.com> Co-authored-by: Octomerger Bot <63058869+Octomerger@users.noreply.github.com> Co-authored-by: Anders Starcke Henriksen <starcke@github.com> Co-authored-by: Peter Bengtsson <mail@peterbe.com> Co-authored-by: Laura Coursen <lecoursen@github.com> Co-authored-by: lucie-docs <40564413+lucie-docs@users.noreply.github.com> Co-authored-by: Josh Johanning <joshjohanning@github.com> Co-authored-by: Tahlia G <84726379+tahlialouisa@users.noreply.github.com> Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> Co-authored-by: Felicity Chapman <felicitymay@github.com> Co-authored-by: GitHub Actions <action@github.com> Co-authored-by: docubot <67483024+docubot@users.noreply.github.com> Co-authored-by: Simon Giesemann <kwacky1@github.com> Co-authored-by: Robert Sese <rsese@github.com> Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> Co-authored-by: Albin PK <56157868+albinpk@users.noreply.github.com> Co-authored-by: Dasun Tharanga <dasuntharangaflash@gmail.com> Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com> Co-authored-by: Ramya Parimi <33761166+ramyaparimi@users.noreply.github.com> Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com> Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com> Co-authored-by: Dorothy Mitchell <dorothymitchell@github.com> Co-authored-by: Andy J <mumfy@github.com> Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> Co-authored-by: Marko Kaznovac <kaznovac@users.noreply.github.com> Co-authored-by: Anil Seervi <61609033+AnilSeervi@users.noreply.github.com> Co-authored-by: Johanan Idicula <johanan@forcepush.tech> Co-authored-by: Jackie Jiménez <jaclynj@github.com> Co-authored-by: github-actions <github-actions@github.com>
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 86 KiB |
BIN
assets/images/help/codespaces/configure-SSO-for-PAT.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
assets/images/help/codespaces/prebuilds-choose-branch.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
assets/images/help/codespaces/prebuilds-delete.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
assets/images/help/codespaces/prebuilds-edit.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
assets/images/help/codespaces/prebuilds-log-output.png
Normal file
|
After Width: | Height: | Size: 131 KiB |
BIN
assets/images/help/codespaces/prebuilds-manually-trigger.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
assets/images/help/codespaces/prebuilds-regions.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
assets/images/help/codespaces/prebuilds-see-output.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
assets/images/help/codespaces/prebuilds-select-scopes.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
assets/images/help/codespaces/prebuilds-set-up.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/help/codespaces/prebuilds-view-runs.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
assets/images/help/codespaces/prebuilds-workflow-runs.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
@@ -40,6 +40,12 @@ If you purchased {% data variables.product.prodname_enterprise %} through a Micr
|
|||||||
|
|
||||||
{% data reusables.dotcom_billing.pricing_cal %}
|
{% data reusables.dotcom_billing.pricing_cal %}
|
||||||
|
|
||||||
|
### Billing for {% data variables.product.prodname_codespaces %} prebuilds
|
||||||
|
|
||||||
|
{% data reusables.codespaces.prebuilds-beta-note %}
|
||||||
|
|
||||||
|
{% data reusables.codespaces.billing-for-prebuilds %}
|
||||||
|
|
||||||
## Setting a spending limit
|
## Setting a spending limit
|
||||||
|
|
||||||
{% data reusables.codespaces.codespaces-spending-limit-requirement %}
|
{% data reusables.codespaces.codespaces-spending-limit-requirement %}
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ To see the pricing for {% data variables.product.prodname_codespaces %} usage, s
|
|||||||
|
|
||||||
Your codespace is billed for its compute minutes and for the amount of storage it uses on disk.
|
Your codespace is billed for its compute minutes and for the amount of storage it uses on disk.
|
||||||
|
|
||||||
|
If you enable prebuilding of codespaces this will incur additional charges. For more information, see "[About Codespaces prebuilds](/codespaces/prebuilding-your-codespaces/about-codespaces-prebuilds#about-billing-for-codespaces-prebuilds)."
|
||||||
|
|
||||||
### Understanding what compute minutes are
|
### Understanding what compute minutes are
|
||||||
Your codespace is billed for the number of minutes that it's active. If your codespaces window is left idle for 30 minutes, it will automatically shutdown, and compute billing for the codespace will end until you start the codespace again.
|
Your codespace is billed for the number of minutes that it's active. If your codespaces window is left idle for 30 minutes, it will automatically shutdown, and compute billing for the codespace will end until you start the codespace again.
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,5 @@ children:
|
|||||||
- /setting-your-default-editor-for-codespaces
|
- /setting-your-default-editor-for-codespaces
|
||||||
- /setting-your-default-region-for-codespaces
|
- /setting-your-default-region-for-codespaces
|
||||||
- /setting-your-timeout-period-for-codespaces
|
- /setting-your-timeout-period-for-codespaces
|
||||||
- /prebuilding-codespaces-for-your-project
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
title: Prebuilding Codespaces for your project
|
|
||||||
intro: You can configure your project to prebuild a codespace automatically each time you push a change to your repository.
|
|
||||||
versions:
|
|
||||||
fpt: '*'
|
|
||||||
ghec: '*'
|
|
||||||
type: how_to
|
|
||||||
topics:
|
|
||||||
- Codespaces
|
|
||||||
- Set up
|
|
||||||
- Fundamentals
|
|
||||||
product: '{% data reusables.gated-features.codespaces %}'
|
|
||||||
shortTitle: Prebuild Codespaces
|
|
||||||
---
|
|
||||||
|
|
||||||
{% note %}
|
|
||||||
|
|
||||||
**Note:** This feature is currently in private preview.
|
|
||||||
|
|
||||||
{% endnote %}
|
|
||||||
|
|
||||||
## About prebuilding a Codespace
|
|
||||||
|
|
||||||
Prebuilding your codespaces allows you to be more productive and access your codespace faster. This is because any source code, editor extensions, project dependencies, commands, or configurations have already been downloaded, installed, and applied before you begin your coding session. Once you push changes to your repository, {% data variables.product.prodname_codespaces %} automatically handles configuring the builds.
|
|
||||||
|
|
||||||
The ability to prebuild Codespaces is currently in private preview. To get access to this feature, contact codespaces@github.com.
|
|
||||||
@@ -23,6 +23,8 @@ If you choose to create a new codespace each time you work on a project, you sho
|
|||||||
|
|
||||||
If you choose to use a long-running codespace for your project, you should pull from your repository's default branch each time you start working in your codespace so that your environment has the latest commits. This workflow is very similar to if you were working with a project on your local machine.
|
If you choose to use a long-running codespace for your project, you should pull from your repository's default branch each time you start working in your codespace so that your environment has the latest commits. This workflow is very similar to if you were working with a project on your local machine.
|
||||||
|
|
||||||
|
{% data reusables.codespaces.prebuilds-crossreference %}
|
||||||
|
|
||||||
## Saving changes in a codespace
|
## Saving changes in a codespace
|
||||||
|
|
||||||
When you connect to a codespace through the web, auto-save is enabled automatically for the web editor and configured to save changes after a delay. When you connect to a codespace through {% data variables.product.prodname_vscode %} running on your desktop, you must enable auto-save. For more information, see [Save/Auto Save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) in the {% data variables.product.prodname_vscode %} documentation.
|
When you connect to a codespace through the web, auto-save is enabled automatically for the web editor and configured to save changes after a delay. When you connect to a codespace through {% data variables.product.prodname_vscode %} running on your desktop, you must enable auto-save. For more information, see [Save/Auto Save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) in the {% data variables.product.prodname_vscode %} documentation.
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ If you want to use Git hooks for your codespace, then you should set up hooks us
|
|||||||
|
|
||||||
{% data reusables.codespaces.you-can-see-all-your-codespaces %}
|
{% data reusables.codespaces.you-can-see-all-your-codespaces %}
|
||||||
|
|
||||||
|
{% data reusables.codespaces.prebuilds-crossreference %}
|
||||||
|
|
||||||
## Access to {% data variables.product.prodname_codespaces %}
|
## Access to {% data variables.product.prodname_codespaces %}
|
||||||
|
|
||||||
{% data reusables.codespaces.availability %}
|
{% data reusables.codespaces.availability %}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ There are a number of entry points to create a codespace.
|
|||||||
|
|
||||||
Your codespace can be ephemeral if you need to test something or you can return to the same codespace to work on long-running feature work. For more information, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace)."
|
Your codespace can be ephemeral if you need to test something or you can return to the same codespace to work on long-running feature work. For more information, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace)."
|
||||||
|
|
||||||
Once you've selected the option to create a new codespace, some steps happen in the background before the codespace is available to you.
|
Once you've selected the option to create a new codespace, and chosen a machine type for your codespace, some steps happen in the background before the codespace is available to you.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,10 @@ versions:
|
|||||||
children:
|
children:
|
||||||
- /overview
|
- /overview
|
||||||
- /getting-started
|
- /getting-started
|
||||||
|
- /developing-in-codespaces
|
||||||
- /setting-up-your-project-for-codespaces
|
- /setting-up-your-project-for-codespaces
|
||||||
- /customizing-your-codespace
|
- /customizing-your-codespace
|
||||||
- /developing-in-codespaces
|
- /prebuilding-your-codespaces
|
||||||
- /managing-your-codespaces
|
- /managing-your-codespaces
|
||||||
- /managing-codespaces-for-your-organization
|
- /managing-codespaces-for-your-organization
|
||||||
- /codespaces-reference
|
- /codespaces-reference
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ redirect_from:
|
|||||||
versions:
|
versions:
|
||||||
fpt: '*'
|
fpt: '*'
|
||||||
ghec: '*'
|
ghec: '*'
|
||||||
type: quick_start
|
type: overview
|
||||||
topics:
|
topics:
|
||||||
- Codespaces
|
- Codespaces
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
title: About Codespaces prebuilds
|
||||||
|
shortTitle: About prebuilds
|
||||||
|
intro: Codespaces prebuilds help to speed up the creation of new codespaces.
|
||||||
|
versions:
|
||||||
|
fpt: '*'
|
||||||
|
ghec: '*'
|
||||||
|
topics:
|
||||||
|
- Codespaces
|
||||||
|
product: '{% data reusables.gated-features.codespaces %}'
|
||||||
|
---
|
||||||
|
|
||||||
|
{% data reusables.codespaces.prebuilds-beta-note %}
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Prebuilding your codespaces allows you to be more productive and access your codespace faster, regardless of the size and complexity of your project. This is because any source code, editor extensions, project dependencies, commands, and configurations have already been downloaded, installed, and applied before you create a codespace for your project. Think of a prebuild as a "ready-to-go" template for a codespace.
|
||||||
|
|
||||||
|
Whenever you push changes to your repository, {% data variables.product.prodname_codespaces %} uses {% data variables.product.prodname_actions %} to automatically update your prebuilds.
|
||||||
|
|
||||||
|
When prebuilds are available for a particular branch of a repository, and for your region, you'll see the "{% octicon "zap" aria-label="The zap icon" %} Prebuild ready" label in the machine type dialog box that's displayed when you create a codespace and multiple machine types are available.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## About billing for {% data variables.product.prodname_codespaces %} prebuilds
|
||||||
|
|
||||||
|
{% data reusables.codespaces.billing-for-prebuilds %} For details of {% data variables.product.prodname_codespaces %} storage pricing, see "[About billing for {% data variables.product.prodname_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces)."
|
||||||
|
|
||||||
|
Use of codespaces created using prebuilds is charged at the same rate as regular codespaces.
|
||||||
|
|
||||||
|
## About pushing changes to prebuild-enabled branches
|
||||||
|
|
||||||
|
Each push to a branch that has a prebuild configuration results in a {% data variables.product.prodname_dotcom %}-managed Actions workflow run to update the prebuild template. The prebuild workflow has a concurrency limit of one workflow run at a time for a given prebuild configuration, unless changes were made that affect the dev container configuration for the associated repository. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/configuring-codespaces-for-your-project)." If a run is already in progress, the workflow run that was queued most recently queued will run next, after the current run completes.
|
||||||
|
|
||||||
|
This means that if there are very frequent pushes to your repository, prebuild creation will occur at least as often as it takes to run the prebuild workflow. That is, if your workflow run typically takes one hour to complete, prebuilds will be created for your repository roughly hourly, if the run succeeds, or more often if there were pushes that change the dev container on the branch.
|
||||||
|
|
||||||
|
For example, let's imagine 5 pushes are made, in quick succession, against a branch that has a prebuild configuration. In this situation:
|
||||||
|
|
||||||
|
* A workflow run is started for the first push, to update the prebuild template.
|
||||||
|
* If the 4 remaining pushes do not affect the dev container configuration, the workflow runs for these are queued in a "pending" state.
|
||||||
|
|
||||||
|
If any of the remaining 4 pushes change the dev container configuration, then the service will not skip that one and will immediately run the prebuild creation workflow, updating the prebuild accordingly if it succeeds.
|
||||||
|
|
||||||
|
* Once the first run completes, workflow runs for pushes 2, 3, and 4 will be canceled, and the last queued workflow (for push 5) will run and update the prebuild template.
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
---
|
||||||
|
title: Configuring prebuilds
|
||||||
|
shortTitle: Configure prebuilds
|
||||||
|
intro: You can configure your project to prebuild a codespace automatically each time you push a change to your repository.
|
||||||
|
versions:
|
||||||
|
fpt: '*'
|
||||||
|
ghec: '*'
|
||||||
|
type: how_to
|
||||||
|
topics:
|
||||||
|
- Codespaces
|
||||||
|
- Set up
|
||||||
|
product: '{% data reusables.gated-features.codespaces %}'
|
||||||
|
permissions: "People with admin access to a repository can configure prebuilds for the repository."
|
||||||
|
---
|
||||||
|
|
||||||
|
{% data reusables.codespaces.prebuilds-beta-note %}
|
||||||
|
|
||||||
|
You can set up a prebuild configuration for a specific branch of your repository.
|
||||||
|
|
||||||
|
Any branch created from a prebuild-enabled base branch will typically also get assigned a prebuild during codespace creation. This is true if the dev container on the branch is the same as on the base branch. This is because the majority of the prebuild configuration for branches with the same dev container configuration are identical, so developers can benefit from faster codespace creation times on those branches also. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/configuring-codespaces-for-your-project)."
|
||||||
|
|
||||||
|
Typically, when you configure prebuilds for a branch, prebuilds will be available for {% data variables.product.prodname_codespaces %} machine types for that branch. However, if your repository is greater than 32 GB, prebuilds won't be available for 2-core and 4-core machine types, since the storage these provide is limited to 32 GB.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
Before you can configure prebuilds for your project the following must be true:
|
||||||
|
* {% data variables.product.prodname_github_codespaces %} must be enabled for your organization. For more information, see "[Enabling {% data variables.product.prodname_codespaces %} for your organization](/codespaces/managing-codespaces-for-your-organization/enabling-codespaces-for-your-organization)."
|
||||||
|
* {% data variables.product.prodname_actions %} must be enabled for your repository. Each prebuild configuration needs to be able to trigger an associated Actions workflow. For more information, see "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository)."
|
||||||
|
|
||||||
|
## Configuring a prebuild
|
||||||
|
|
||||||
|
{% data reusables.repositories.navigate-to-repo %}
|
||||||
|
{% data reusables.repositories.sidebar-settings %}
|
||||||
|
1. In the "Code & automation" section of the sidebar, click **{% octicon "codespaces" aria-label="The Codespaces icon" %} {% data variables.product.prodname_codespaces %}**.
|
||||||
|
1. Under "Prebuild configuration", click **Set up prebuild**.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
1. Choose the branch for which you want to set up a prebuild.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% note %}
|
||||||
|
|
||||||
|
**Note**: Any branches created from a prebuild-enabled base branch will typically also get prebuilds. For example, if you enable prebuilds for the default branch of the repository, branches based on the default branch will, in most cases, also get prebuilds. For more information, see "[Why do I get prebuilds for branches that do not have prebuilds enabled?](/codespaces/troubleshooting/troubleshooting-prebuilds#2-why-do-i-get-prebuilds-for-branches-that-do-not-have-prebuilds-enabled)"
|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
1. Choose the regions in which you want to set up a prebuild. Developers must be located in a region you select to be able to create codespaces from a prebuild. Alternatively, select **All regions**.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% note %}
|
||||||
|
|
||||||
|
**Notes**:
|
||||||
|
* The prebuild template for each region will incur individual charges. You should, therefore, only enable prebuilds for regions in which you know they'll be used. For more information, see "[About {% data variables.product.prodname_codespaces %} prebuilds](/codespaces/prebuilding-your-codespaces/about-codespaces-prebuilds#about-billing-for-codespaces-prebuilds)."
|
||||||
|
* Developers can set their default region for {% data variables.product.prodname_codespaces %}, which can allow you to enable prebuilds for fewer regions. For more information, see "[Setting your default region for {% data variables.product.prodname_codespaces %}](/codespaces/customizing-your-codespace/setting-your-default-region-for-codespaces)."
|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
1. Click **Create**.
|
||||||
|
|
||||||
|
The prebuild configuration is listed on the {% data variables.product.prodname_codespaces %} page of your repository settings. A {% data variables.product.prodname_actions %} workflow is queued and then run to create prebuild templates, based on the branch you selected, in the regions you specified.
|
||||||
|
|
||||||
|
{% note %}
|
||||||
|
|
||||||
|
**Note**: By default, the {% data variables.product.prodname_actions %} workflow for a prebuild configuration can only access resources in its own repository. If your project uses resources from outside of the repository, you'll need to set the `CODESPACES_PREBUILD_TOKEN` secret to grant the required access. For more information, see "[Allowing a prebuild to access external resources](/codespaces/prebuilding-your-codespaces/managing-prebuilds#allowing-a-prebuild-to-access-external-resources)."
|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
## Configuring access to resources that are not in the repository
|
||||||
|
|
||||||
|
By default, the {% data variables.product.prodname_actions %} workflow for a prebuild configuration can only access its own repository contents. If your project needs to access external resources to build the development environment, you will need to set up a personal access token (PAT) with the appropriate access scopes.
|
||||||
|
|
||||||
|
For more information, see “[Allowing a prebuild to access external resources](/codespaces/prebuilding-your-codespaces/managing-prebuilds#allowing-a-prebuild-to-access-external-resources)."
|
||||||
|
|
||||||
|
## Configuring environment variables
|
||||||
|
|
||||||
|
To allow the prebuild process to access environment variables required to create your development environment, you can set these either as {% data variables.product.prodname_codespaces %} repository secrets or as {% data variables.product.prodname_codespaces %} organization secrets. For more information, see "[Adding secrets for a repository](/codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-codespaces#adding-secrets-for-a-repository)" and "[Adding secrets for an organization](/codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-codespaces#adding-secrets-for-an-organization)."
|
||||||
|
|
||||||
|
Prebuilds do not use any user-level secrets while building your environment, because these are not added until after the codespace has been created.
|
||||||
|
|
||||||
|
{% data variables.product.prodname_codespaces %} secrets that you create in this way will be accessible by anyone who creates a codespace from this repository. If you do not want this, you can alternatively set the `CODESPACES_PREBUILD_TOKEN` secret. The `CODESPACES_PREBUILD_TOKEN` secret is only used for prebuilding and its value is not accessible in users' codespaces. For more information, see “[Allowing a prebuild to access external resources](/codespaces/prebuilding-your-codespaces/managing-prebuilds#allowing-a-prebuild-to-access-external-resources)."
|
||||||
|
|
||||||
|
## Configuring time-consuming tasks to be included in the prebuild
|
||||||
|
|
||||||
|
You can use the `onCreateCommand` and `updateContentCommand` commands in your `devcontainer.json` to include time-consuming processes as part of the prebuild template creation. For more information, see the Visual Studio Code documentation, "[devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_lifecycle-scripts)."
|
||||||
|
|
||||||
|
`onCreateCommand` is run only once, when the prebuild template is created, whereas `updateContentCommand` is run at template creation and at subsequent template updates. Incremental builds should be included in `updateContentCommand` since they represent the source of your project and need to be included for every prebuild template update.
|
||||||
|
|
||||||
|
## Further reading
|
||||||
|
|
||||||
|
- "[Troubleshooting prebuilds](/codespaces/troubleshooting/troubleshooting-prebuilds)"
|
||||||
19
content/codespaces/prebuilding-your-codespaces/index.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
title: Prebuilding your codespaces
|
||||||
|
intro: 'To speed up codespace creation, you can configure your project to prebuild codespaces for specific branches in specific regions.'
|
||||||
|
product: '{% data reusables.gated-features.codespaces %}'
|
||||||
|
versions:
|
||||||
|
fpt: '*'
|
||||||
|
ghec: '*'
|
||||||
|
topics:
|
||||||
|
- Codespaces
|
||||||
|
redirect_from:
|
||||||
|
- /codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project
|
||||||
|
children:
|
||||||
|
- /about-codespaces-prebuilds
|
||||||
|
- /configuring-prebuilds
|
||||||
|
- /managing-prebuilds
|
||||||
|
- /testing-dev-container-changes
|
||||||
|
---
|
||||||
|
|
||||||
|
{% data reusables.codespaces.prebuilds-beta-note %}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
---
|
||||||
|
title: Managing prebuilds
|
||||||
|
shortTitle: Manage prebuilds
|
||||||
|
intro: You can review, modify, and delete the prebuild configurations for your repository.
|
||||||
|
versions:
|
||||||
|
fpt: '*'
|
||||||
|
ghec: '*'
|
||||||
|
type: how_to
|
||||||
|
topics:
|
||||||
|
- Codespaces
|
||||||
|
product: '{% data reusables.gated-features.codespaces %}'
|
||||||
|
miniTocMaxHeadingLevel: 3
|
||||||
|
---
|
||||||
|
|
||||||
|
{% data reusables.codespaces.prebuilds-beta-note %}
|
||||||
|
|
||||||
|
## Checking, changing, and deleting your prebuild configurations
|
||||||
|
|
||||||
|
The prebuilds that you configure are created and updated using a {% data variables.product.prodname_actions %} workflow, managed by the {% data variables.product.prodname_codespaces %} service.
|
||||||
|
|
||||||
|
The workflow is triggered by these events:
|
||||||
|
|
||||||
|
* Creating or updating the prebuild configuration
|
||||||
|
* Pushing a commit or a pull request to a branch that's configured to have prebuilds
|
||||||
|
* Manually triggering the workflow
|
||||||
|
|
||||||
|
People with admin access to a repository can check the progress of prebuilds, edit, and delete prebuild configurations.
|
||||||
|
|
||||||
|
### Viewing the progress of prebuilds
|
||||||
|
You can view the current status of the latest workflow run for each prebuild configuration you've set up on the {% data variables.product.prodname_codespaces %} page of your repository settings. For example, "Currently running" or "Last run 1 hour ago."
|
||||||
|
|
||||||
|
To see the log output for the latest prebuild workflow run, click **See output**.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This displays the output of the most recent run of the workflow in the **Actions** tab.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Alternatively, to view all prebuild workflow runs associated with the specified branch, click the ellipsis button and choose **View runs** from the dropdown menu.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This displays the workflow run history for prebuilds for the associated branch.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Editing a prebuild configuration
|
||||||
|
|
||||||
|
1. On the {% data variables.product.prodname_codespaces %} page of your repository settings, click the ellipsis to the right of the prebuild configuration you want to edit.
|
||||||
|
1. In the dropdown menu, click **Edit**.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
1. Make the required changes to the prebuild configuration, then click **Update**.
|
||||||
|
|
||||||
|
### Delete a prebuild configuration
|
||||||
|
|
||||||
|
Deleting a prebuild configuration also deletes all previously created prebuild templates for that configuration. As a result, shortly after you delete a configuration, prebuilds generated by that configuration will no longer be available when you create a new codespace.
|
||||||
|
|
||||||
|
After you delete a prebuild configuration, workflow runs for that configuration that have been queued or started will still run. They will be listed in the workflow run history, along with previously completed workflow runs.
|
||||||
|
|
||||||
|
1. On the {% data variables.product.prodname_codespaces %} page of your repository settings, click the ellipsis to the right of the prebuild configuration you want to delete.
|
||||||
|
1. In the dropdown menu, click **Delete**.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
1. Click **OK** to confirm the deletion.
|
||||||
|
|
||||||
|
### Manually trigger prebuilds
|
||||||
|
|
||||||
|
It may be useful to manually trigger a workflow run for a prebuild configuration. Generally this is only necessary if you are debugging a problem with the workflow for a prebuild configuration.
|
||||||
|
|
||||||
|
1. On the {% data variables.product.prodname_codespaces %} page of your repository settings, click the ellipsis to the right of the prebuild configuration whose workflow you want to trigger.
|
||||||
|
1. In the dropdown menu, click **Manually trigger**.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Allowing a prebuild to access external resources
|
||||||
|
|
||||||
|
By default, the {% data variables.product.prodname_actions %} workflow for a prebuild configuration can only access its own repository contents. Your project may use additional resources to build the development environment, such as files in other repositories, packages, GHCR images, and APIs. To allow your prebuild setup to access these resources, you will need to create a new personal account and then use this account to create a personal access token (PAT) with the appropriate scopes.
|
||||||
|
|
||||||
|
1. Create a new personal account on {% data variables.product.prodname_dotcom %}.
|
||||||
|
|
||||||
|
{% warning %}
|
||||||
|
|
||||||
|
**Warning**: Although you can generate the PAT using your existing personal account, we strongly recommend creating a new account with access only to the target repositories required for your scenario. This is because the access token's `repository` permission grants access to all of the repositories that the account has access to. For more information, see "[Signing up for a new GitHub account](/get-started/signing-up-for-github/signing-up-for-a-new-github-account)" and "[Security hardening for {% data variables.product.prodname_actions %}](/actions/security-guides/security-hardening-for-github-actions#considering-cross-repository-access)."
|
||||||
|
|
||||||
|
{% endwarning %}
|
||||||
|
1. Give the new account read access to the required repositories. For more information, see "[Managing an individual's access to an organization repository](/organizations/managing-access-to-your-organizations-repositories/managing-an-individuals-access-to-an-organization-repository)."
|
||||||
|
1. While signed into the new account, create a PAT with the `repo` scope. Optionally, if the prebuild will need to download packages from the {% data variables.product.company_short %} {% data variables.product.prodname_container_registry %}, also select the `read:packages` scope. For more information, see "[Creating a personal access token](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)."
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
If the prebuild will use a package from the {% data variables.product.company_short %} {% data variables.product.prodname_container_registry %}, you will need to either grant the new account access to the package or configure the package to inherit the access permissions of the repository you are prebuilding. For more information, see "[Configuring a package's access control and visibility](/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility)."
|
||||||
|
{% ifversion ghec %}1. Authorize the token for use with SAML single sign-on (SSO), so that it can access repositories that are owned by organizations with SSO enabled. For more information, see "[Authorizing a personal access token for use with SAML single sign-on](/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on)."
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
1. Copy the token string. You will assign this to a {% data variables.product.prodname_codespaces %} repository secret.
|
||||||
|
1. Sign back into the account that has admin access to the repository.
|
||||||
|
1. In the repository for which you want to create {% data variables.product.prodname_codespaces %} prebuilds, create a new {% data variables.product.prodname_codespaces %} repository secret called `CODESPACES_PREBUILD_TOKEN`, giving it the value of the token you created and copied. For more information, see "[Managing encrypted secrets for your repository and organization for {% data variables.product.prodname_codespaces %}](/codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-codespaces#adding-secrets-for-a-repository)."
|
||||||
|
|
||||||
|
The PAT will be used for all subsequent prebuild templates created for your repository. Unlike other {% data variables.product.prodname_codespaces %} repository secrets, the `CODESPACES_PREBUILD_TOKEN` secret is only used for prebuilding and will not be available to use in codespaces created from your repository.
|
||||||
|
|
||||||
|
## Further reading
|
||||||
|
|
||||||
|
- "[Troubleshooting prebuilds](/codespaces/troubleshooting/troubleshooting-prebuilds)"
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
title: Testing dev container configuration changes on a prebuild-enabled branch
|
||||||
|
shortTitle: Test dev container changes
|
||||||
|
allowTitleToDifferFromFilename: true
|
||||||
|
intro: When you change the dev container configuration for a branch that's enabled for prebuilds you should test your changes in a codespace.
|
||||||
|
versions:
|
||||||
|
fpt: '*'
|
||||||
|
ghec: '*'
|
||||||
|
type: how_to
|
||||||
|
topics:
|
||||||
|
- Codespaces
|
||||||
|
- Set up
|
||||||
|
product: '{% data reusables.gated-features.codespaces %}'
|
||||||
|
permissions: "People with write permissions to a repository can create or edit the dev container configuration for a branch."
|
||||||
|
---
|
||||||
|
|
||||||
|
{% data reusables.codespaces.prebuilds-beta-note %}
|
||||||
|
|
||||||
|
Any changes you make to the dev container configuration for a prebuild-enabled branch will result in an update to the codespace configuration and the associated prebuild template. It’s therefore important to test such changes in a codespace from a test branch before committing your changes to a branch of your repository that's actively used. This will ensure you’re not introducing breaking changes for your team.
|
||||||
|
|
||||||
|
For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/configuring-codespaces-for-your-project)."
|
||||||
|
|
||||||
|
## Testing changes to the dev container configuration
|
||||||
|
|
||||||
|
1. Create a codespace from the prebuild-enabled branch whose dev container you want to change. For more information, see "[Creating a codespace
|
||||||
|
](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)."
|
||||||
|
1. In the codespace, check out a test branch. For more information, see "[Using source control in your codespace](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace#creating-or-switching-branches)."
|
||||||
|
1. Make the required changes to the dev container configuration.
|
||||||
|
1. Apply the changes by rebuilding the container. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/configuring-codespaces-for-your-project#applying-changes-to-your-configuration)."
|
||||||
|
1. After everything looks good, we also recommend creating a new codespace from your test branch to ensure everything is working. You can then commit your changes to your repository's default branch, or an active feature branch, triggering an update of the prebuild template for that branch.
|
||||||
|
|
||||||
|
{% note %}
|
||||||
|
|
||||||
|
**Note**: Creating this codespace will take longer than usual because it will not be created from a prebuild.
|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
@@ -171,3 +171,7 @@ For more information about the available settings for `devcontainer.json`, see [
|
|||||||
- To diagnose the error by reviewing the creation logs, click **View creation log**.
|
- To diagnose the error by reviewing the creation logs, click **View creation log**.
|
||||||
- To fix the errors identified in the logs, update your `devcontainer.json` file.
|
- To fix the errors identified in the logs, update your `devcontainer.json` file.
|
||||||
- To apply the changes, rebuild your container.
|
- To apply the changes, rebuild your container.
|
||||||
|
|
||||||
|
## Further reading
|
||||||
|
|
||||||
|
- "[Prebuilding your codespaces](/codespaces/prebuilding-your-codespaces)"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Setting a minimum specification for codespace machines
|
title: Setting a minimum specification for codespace machines
|
||||||
shortTitle: Setting a minimum machine spec
|
shortTitle: Set a minimum machine spec
|
||||||
intro: 'You can avoid under-resourced machine types being used for {% data variables.product.prodname_codespaces %} for your repository.'
|
intro: 'You can avoid under-resourced machine types being used for {% data variables.product.prodname_codespaces %} for your repository.'
|
||||||
permissions: People with write permissions to a repository can create or edit the codespace configuration.
|
permissions: People with write permissions to a repository can create or edit the codespace configuration.
|
||||||
versions:
|
versions:
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ children:
|
|||||||
- /exporting-changes-to-a-branch
|
- /exporting-changes-to-a-branch
|
||||||
- /troubleshooting-creation-and-deletion-of-codespaces
|
- /troubleshooting-creation-and-deletion-of-codespaces
|
||||||
- /troubleshooting-your-connection-to-codespaces
|
- /troubleshooting-your-connection-to-codespaces
|
||||||
|
- /troubleshooting-prebuilds
|
||||||
- /troubleshooting-dotfiles-for-codespaces
|
- /troubleshooting-dotfiles-for-codespaces
|
||||||
- /troubleshooting-port-forwarding-for-codespaces
|
- /troubleshooting-port-forwarding-for-codespaces
|
||||||
- /troubleshooting-codespaces-clients
|
- /troubleshooting-codespaces-clients
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
---
|
||||||
|
title: Troubleshooting prebuilds
|
||||||
|
shortTitle: Codespaces prebuilds
|
||||||
|
intro: You can use prebuilds to speed up the creation of codespaces. This article provides troubleshooting steps for common issues with prebuilds.
|
||||||
|
versions:
|
||||||
|
fpt: '*'
|
||||||
|
ghec: '*'
|
||||||
|
type: reference
|
||||||
|
topics:
|
||||||
|
- Codespaces
|
||||||
|
product: '{% data reusables.gated-features.codespaces %}'
|
||||||
|
miniTocMaxHeadingLevel: 3
|
||||||
|
---
|
||||||
|
|
||||||
|
{% data reusables.codespaces.prebuilds-beta-note %}
|
||||||
|
|
||||||
|
For more information about {% data variables.product.prodname_codespaces %} prebuilds, see "[Prebuilding your codespaces](/codespaces/prebuilding-your-codespaces)."
|
||||||
|
|
||||||
|
## Checking whether a codespace was created from a prebuild?
|
||||||
|
|
||||||
|
If multiple machine types are available when you create a codespace then a dialog box is displayed giving you a choice of machine types. This will display the "{% octicon "zap" aria-label="The zap icon" %} Prebuild ready" label beside machine types for which prebuilds are available.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
If you have your {% data variables.product.prodname_codespaces %} editor preference set to "Visual Studio Code for Web" then the "Setting up your codespace" page will show the message "Prebuilt codespace found" if a prebuild is being used. Similarly, if your editor preference is "Visual Studio Code" then the integrated terminal will contain the message "You are on a prebuilt codespace defined by the prebuild configuration for your repository" when you create a new codespace. For more information, see "[Setting your default editor for Codespaces](/codespaces/customizing-your-codespace/setting-your-default-editor-for-codespaces)."
|
||||||
|
|
||||||
|
After you have created a codespace you can check whether it was created from a prebuild by running the following {% data variables.product.prodname_cli %} command in the terminal:
|
||||||
|
|
||||||
|
```shell{:copy}
|
||||||
|
gh api /user/codespaces/$CODESPACE_NAME --jq .prebuild
|
||||||
|
```
|
||||||
|
|
||||||
|
This returns `true` if the codespace was created using a prebuild.
|
||||||
|
|
||||||
|
Alternatively, if {% data variables.product.prodname_cli %} (`gh`) is not installed, you can use the following command, which returns `createFromPrebuild` if the codespace was created from a prebuild:
|
||||||
|
|
||||||
|
```shell{:copy}
|
||||||
|
cat /workspaces/.codespaces/shared/environment-variables.json | jq '.ACTION_NAME'
|
||||||
|
```
|
||||||
|
|
||||||
|
## The "Prebuild Ready" label is sometimes missing
|
||||||
|
|
||||||
|
You may notice that sometimes, when you create a new codespace from a prebuild-enabled branch, the "{% octicon "zap" aria-label="The zap icon" %} Prebuild Ready" label is not displayed in the dialog box for choosing a machine type. This means that prebuilds are not currently available.
|
||||||
|
|
||||||
|
Each time you push to a prebuild-enabled branch, the prebuild template is updated. If the push involves a change to the dev container then, while the update is in progress, the "{% octicon "zap" aria-label="The zap icon" %} Prebuild Ready" label is removed from the machine types dialog box. During this time you can still create codespaces without a prebuild template.
|
||||||
|
|
||||||
|
If your branch is not specifically enabled for prebuilds it may still benefit from prebuilds if it was branched from a prebuild-enabled branch. However, if the dev container is changed on your branch, so that it's not the same as the dev container on the base branch, prebuilds will no longer be available on your branch.
|
||||||
|
|
||||||
|
Here are things to check if the "{% octicon "zap" aria-label="The zap icon" %} Prebuild Ready" label is not displayed for a particular branch:
|
||||||
|
|
||||||
|
* Confirm that a prebuild configuration exists for this branch. If you’re not a repository administrator, you'll need to reach out to one to confirm this.
|
||||||
|
* Confirm that the prebuild configuration includes your region.
|
||||||
|
* Check whether a change to the dev container configuration was pushed to the prebuild-enabled branch recently. If so, you will have to wait until the prebuild workflow run for this push completes before prebuilds are available again.
|
||||||
|
* If no configuration changes were recently made, go to the **Actions** tab of your repository, click **{% octicon "codespaces" aria-label="The Codespaces icon" %} {% data variables.product.prodname_codespaces %} Prebuilds** in the workflows list, and check that prebuild workflow runs for the branch are succeeding. If latest runs of a workflow failed, and one or more of these failed runs contained changes to the dev container, then there will be no available prebuilds for the associated branch.
|
||||||
|
|
||||||
|
## Further reading
|
||||||
|
|
||||||
|
- "[Configuring prebuilds](/codespaces/prebuilding-your-codespaces/configuring-prebuilds)"
|
||||||
|
- "[Managing prebuilds](/codespaces/prebuilding-your-codespaces/managing-prebuilds)"
|
||||||
5
data/reusables/codespaces/billing-for-prebuilds.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
A {% data variables.product.prodname_actions %} workflow is triggered every time you create or update a prebuild template, or push to a prebuild-enabled branch. As with other workflows, while prebuild workflows are running they will either consume some of the Actions minutes included with your account, if you have any, or they will incur charges for Actions minutes. For more information about pricing for Actions minutes, see "[About billing for {% data variables.product.prodname_actions %}](/billing/managing-billing-for-github-actions/about-billing-for-github-actions)."
|
||||||
|
|
||||||
|
If you are an organization owner, you can track usage of prebuild workflows by downloading a {% data variables.product.prodname_actions %} usage report for your organization. You can identify workflow runs for prebuilds by filtering the CSV output to only include the workflow called "Create Codespaces Prebuilds." For more information, see "[Viewing your {% data variables.product.prodname_actions %} usage](/billing/managing-billing-for-github-actions/viewing-your-github-actions-usage#viewing-github-actions-usage-for-your-organization)."
|
||||||
|
|
||||||
|
While {% data variables.product.prodname_codespaces %} prebuilds is in beta there is no charge for storage of templates. When prebuilds become generally available, you will be billed for storing prebuild templates for each prebuild configuration in each region selected for that configuration.
|
||||||
5
data/reusables/codespaces/prebuilds-beta-note.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{% note %}
|
||||||
|
|
||||||
|
**Note:** The ability to prebuild codespaces is currently in beta and subject to change.
|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
1
data/reusables/codespaces/prebuilds-crossreference.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
To speed up codespace creation, repository administrators can enable {% data variables.product.prodname_codespaces %} prebuilds for a repository. For more information, see "[About {% data variables.product.prodname_codespaces %} prebuilds](/codespaces/prebuilding-your-codespaces/about-codespaces-prebuilds)."
|
||||||