Skip to content

FIX: Update devcontainer base image to resolve Storage limitations. - #32375

Open
maaz7409 wants to merge 6 commits into
matplotlib:mainfrom
maaz7409:fix-devcontainer
Open

maaz7409 wants to merge 6 commits into
matplotlib:mainfrom
maaz7409:fix-devcontainer

Conversation

@maaz7409

Copy link
Copy Markdown

PR summary

This PR updates the mcr.microsoft.com/devcontainers/universal:2 image to base:ubuntu image. It also makes following changes to ensure container is light, flexible and supports setup.sh installation :

  • Changes strict requirement of 4-cores setup to flexible option for 2-cores or 4-cores setup.

  • Adds SSH feature.

  • Adds Conda ( since base:ubuntu doesn't readily comes with Conda ).

  • Updates conda environment path for base:ubuntu.

  • Explicitly invokes bash for onCreateCommand to avoid permission related issues.

This only consumes 8 GB space. I have tested this and it works fine.

IMG_20260919_172746 IMG_20260919_172941

Fixes #32374

AI Disclosure

No AI was used.

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • [N/A] New and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New features and API changes have release notes
  • [N/A] Documentation complies with general and docstring guidelines

universal:2 image is old, carries a lot of bloat which fills up all space on 32 GB codespace. Most of the packages it downloads are not required for Matplotlib development.
Right now, one has to select 4-core codespace. Removing this gives option to select either 2-core or 4-core codespace.
Without this, it can cause permission issues when creating a codespace.
This allows codespace to be used via SSH
This will be required to create conda environment in setup.sh
The universal image used /home/codespace
This ubuntu image uses /home/vscode 
We can generalize this by using $HOME

and, ubuntu image has .condarc file at home location (~)
@github-actions

Copy link
Copy Markdown

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process.

You can also join us on discourse chat for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@Maharshi-Paul Maharshi-Paul left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was dropping hostRequirements entirely intentional or should cpus/memory be explicitly (e.g cpus: 2) so Codespaces doesnt default to an unpredictable size for a build this heavy?

@maaz7409

Copy link
Copy Markdown
Author

@Maharshi-Paul it was intentional, because that lets you choose between 2-cores cpu and 4-cores cpu. ( When creating it by selecting New with Options ).
IMG_20260920_204550

And when you create directly without setting any options, Codespace defaults to 2-cores cpu in this case. However, explicitly defining it to be 2-core cpu will not let you choose 4-core cpu for heavy work and vice-versa. Hence dropping it was the flexible option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Storage Error when creating Codespace with current devcontainer configuration

2 participants