Skip to content

DEV: Fix shell configuration in devcontainer #23076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2023
Merged

DEV: Fix shell configuration in devcontainer #23076

merged 1 commit into from
Jan 24, 2023

Conversation

jungaretti
Copy link
Contributor

@jungaretti jungaretti commented Jan 23, 2023

This PR moves our repo setup to onCreateCommand from postCreateCommand in order to resolve a race condition between conda init and the default shell in VS Code. You can test this new devcontainer.json by creating a codespace for my fork/branch: https://github.com/codespaces/new?hide_repo_select=true&ref=jungaretti%2Fupdate-devcontainer&repo=576410652

postCreateCommand doesn't block interaction with your codespace. You can use other terminals and move around editors while it runs. On the other hand, onCreateCommand runs before you interact with your codespace. You won't be able to open a terminal until it finishes. onCreateCommand is a better choice for running our setup script because we need to run conda init before using the terminal.

Setting up your codespace

@seberg
Copy link
Member

seberg commented Jan 24, 2023

Seems reasonable, so lets get it in, thanks.

@jungaretti do you think we could set this up to use mamba? That may be much faster to run all the conda initialization.

@rgommers
Copy link
Member

@jungaretti do you think we could set this up to use mamba? That may be much faster to run all the conda initialization.

I looked at this, but upgrading to conda 22.11 so we get the libmamba solver or installing mamba directly in the base env is both not a smooth or fast experience. So I think we'll have to wait until the base image gets an update here.

@rgommers
Copy link
Member

Follow-up in gh-23411 - using micromamba works smoothly, and is ~2x faster.

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.

3 participants