Skip to content

Update devcontainer.json schema with "hostRequirements" #5144

Closed

Description

"hostRequirements": {
  "cpus": 8,
  "memory": "16gb", // otherwise is bytes - allows for other units like mb, or k
  "storage": "32gb" // otherwise is bytes - allows for other units like tb, or mb, or k
}

Activity

  1. added
    bug
    containers
    on Jun 4, 2021
  2. added
    candidate
    on Jun 4, 2021
  3. rzhao271 commented on Jun 7, 2021

    @rzhao271

    Christof Marti (@chrmarti) I'm wondering how to verify this issue?
    I added the following to my devcontainer.json, and rebuilt and reopened the workspace in a container, and the container opened as usual:

    "hostRequirements": {
    	"cpus": 100,
    	"memory": "2kb",
    	"storage": "1mb
    }
  4. chrmarti commented on Jun 8, 2021

    @chrmarti
    ContributorAuthor

    Raymond Zhao (@rzhao271) I should have mentioned: This is only implemented in Codespaces right now.

    To verify make sure you get proposals for the new properties, their format (number or number with unit) is validated and there are no errors/warnings when using valid values.

  5. rzhao271 commented on Jun 8, 2021

    @rzhao271

    Christof Marti (@chrmarti) I adjusted the values in Codespaces Web and rebuilt the container.
    The values pass validation, but I'm not sure whether Codespaces handled the values properly.

    examplecs

  6. chrmarti commented on Jun 9, 2021

    @chrmarti
    ContributorAuthor

    I'm not sure what the fallback is when the requirements can't be met. /fyi Jake Shorty (@jshorty) see screenshot above.

  7. jshorty commented on Jun 9, 2021

    @jshorty

    At the moment the only place where these get used is in surfacing the list of available machine types for a new/existing codespace— for example here's the UI in GH to create one for github/github:
    Screen Shot 2021-06-09 at 9 10 00 AM
    and related hostRequirements:

      "hostRequirements": {    // Require specs of the extremeLinux machine type for codespaces
        "storage": "64gb",
        "memory": "64gb"
      },
    

    When creating from within VS Code it'll filter the list down to eligible choices but won't display these grayed-out ones.

    There isn't really a fallback in either case, we'll just display warning messages— but in GH the modal context should help explain. In the VS Code case, I believe the extension would give the following error:

    "There are currently no machine types available for which you have access. Please check the repository's devcontainer configuration or contact support."
    
  8. rzhao271 commented on Jun 9, 2021

    @rzhao271

    Christof Marti (@chrmarti) I'll let you create a new issue for #5144 (comment) as you see fit.

    Marking this issue as verified.

  9. jshorty commented on Jun 9, 2021

    @jshorty

    If desired, we could update the GH API to give a more specific message in the case where the user would have access to one ore more machine types, but they're all excluded by devcontainer requirements.

  10. locked and limited conversation to collaborators on Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcandidatecontainersverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions