Skip to content
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

New conda environments in ~/.conda/ by default #348

Merged
merged 2 commits into from
Jan 4, 2023
Merged

Conversation

danielhollas
Copy link
Contributor

@danielhollas danielhollas commented Dec 30, 2022

In the current image, when a user creates a new conda environment with conda create --name new-env, it will be created in /opt/conda/envs, but that's no good since it will not be persisted between container invocation.

In the QeApp, this is solved by specifying the full path to the environment like this:

conda create -p ~/.conda/envs/quantum-espresso

https://github.com/aiidalab/aiidalab-qe/blob/d6b6d046d42b186be60bbd34ca8d001a3fc4060a/aiidalab_qe/setup_codes.py#L44
But the disadvantage is that to activate this environment, one needs to provide the full path as well, which is clumsy.

In this PR I modify the conda config so that the new environments are created in ~/.conda/envs/ by default.
This change actually makes the behavior consistent with the old docker stack image, so it should make migration easier for AiiDAlab app developers.

Closes #352

Copy link
Member

@yakutovicha yakutovicha left a comment

Choose a reason for hiding this comment

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

LGTM!

@yakutovicha yakutovicha merged commit e957633 into main Jan 4, 2023
@yakutovicha yakutovicha deleted the conda-home-path branch January 4, 2023 12:21
@unkcpz
Copy link
Member

unkcpz commented Jan 4, 2023

Just a reminder, we need to be careful to add more configurations to home folder. As mentioned in #347 (comment), when starting the image by singleuser.sh by spawner in production deployment, the mounted home volume will be wiped.

@yakutovicha
Copy link
Member

Just a reminder, we need to be careful to add more configurations to home folder. As mentioned in #347 (comment), when starting the image by singleuser.sh by spawner in production deployment, the mounted home volume will be wiped.

I am not sure how #347 (comment) is related to this PR. For sure, the bug needs to be fixed.

Unrelated to that, keeping the conda environment in the home folder seems the right choice.

@unkcpz
Copy link
Member

unkcpz commented Jan 4, 2023

Unrelated to that, keeping the conda environment in the home folder seems the right choice.

My concern is even in this PR the ~/.conda is added to the home folder, I think is the production development by Jupyterhub, the files will not exist after the container started.
Instead, everything added to the HOME should add by a script in before-notebook.d.

P.S I'll give this change a test by using the new image in THEOS deployment.

@unkcpz
Copy link
Member

unkcpz commented Jan 4, 2023

Sorry, I was wrong about this, I didn't look carefully at the change. This PR didn't make any modifications to the home folder.

@danielhollas
Copy link
Contributor Author

@unkcpz indeed.Here I only modified the global conda configuration, which is itself stored I believe in /opt/conda/.condarc

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.

New conda environments are created in /opt/conda by default
3 participants