•  


Setting a minimum specification for codespace machines - GitHub Docs
Skip to main content

Setting a minimum specification for codespace machines

You can avoid under-resourced machine types being used for GitHub Codespaces for your repository.

Who can use this feature?

People with write permissions to a repository can create or edit the codespace configuration.

Overview

Each codespace that you create is hosted on a separate virtual machine. When you create a codespace from a repository, you can usually choose from different types of virtual machines. Each machine type has different resources (processor cores, memory, storage) and, by default, the machine type with the least resources is used. For more information, see " Changing the machine type for your codespace ."

If your project needs a certain level of compute power, you can configure GitHub Codespaces so that only machine types that meet these requirements can be used by default, or selected by users. You configure this in a devcontainer.json file.

Unpublished codespaces (codespaces created from a template that are not linked to a repository on GitHub) always run on a virtual machine with the same specifications. You can't change the machine type of an unpublished codespace.

Important: Access to some machine types may be restricted at the organization level. Typically this is done to prevent people choosing higher resourced machines that are billed at a higher rate. If your repository is affected by an organization-level policy for machine types you should make sure you don't set a minimum specification that would leave no available machine types for people to choose. For more information, see " Restricting access to machine types ."

Setting a minimum machine specification

  1. You can configure the codespaces that are created for your repository by adding settings to a devcontainer.json file. If your repository doesn't already contain a devcontainer.json file, you can add one now. See " Adding a dev container configuration to your repository ."

  2. Edit the devcontainer.json file, adding the hostRequirements property at the top level of the file, within the enclosing JSON object. For example:

    JSON
    "hostRequirements"
    :
     {
    
       "cpus"
    :
     8
    ,
    
       "memory"
    :
     "8gb"
    ,
    
       "storage"
    :
     "32gb"
    
    }
    
    

    You can specify any or all of the options: cpus , memory , and storage .

    To check the specifications of the GitHub Codespaces machine types that are currently available for your repository, step through the process of creating a codespace until you see the choice of machine types. For more information, see " Creating a codespace for a repository ."

  3. Save the file and commit your changes to the required branch of the repository.

    Now when you create a codespace for that branch of the repository, and you go to the creation configuration options, you will only be able to select machine types that match or exceed the resources you've specified.

    Screenshot of a list of machine types. The 2- and 4-core options are labeled "Below dev container requirements."

Further reading

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본