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

Fix for activating environment and installing packages properly #226

Merged
merged 3 commits into from May 3, 2021

Conversation

rajeee
Copy link
Contributor

@rajeee rajeee commented Apr 28, 2021

This fixes the ongoing issue where the environment is not properly created in eagle.

Pull Request Description

For some reason, if you run "module load conda" when an environment is already activated, the environment silently gets deactivated. And it can't be activated again by "source activate <path_to_env>" unless it is deactivated explicitly fist.

Evidence:

<log in to eagle>
[radhikar@el3 ~]$ which python
/nopt/nrel/apps/anaconda/mini_py37_4.8.3/bin/python
[radhikar@el3 ~]$ source activate /shared-projects/buildstock/envs/test_env6
(test_env6) [radhikar@el3 ~]$ which python
/shared-projects/buildstock/envs/test_env6/bin/python
<environment is activated>
(test_env6) [radhikar@el3 ~]$ module load conda
(test_env6) [radhikar@el3 ~]$ which python 
/nopt/nrel/apps/anaconda/mini_py37_4.8.3/bin/python
<environment got silently deactivated>
(test_env6) [radhikar@el3 ~]$ source activate /shared-projects/buildstock/envs/test_env6
(test_env6) [radhikar@el3 ~]$ which python
/nopt/nrel/apps/anaconda/mini_py37_4.8.3/bin/python
 <environment failed to get activated again>
(test_env6) [radhikar@el3 ~]$ source activate /shared-projects/buildstock/envs/test_env6
(test_env6) [radhikar@el3 ~]$ which python 
/nopt/nrel/apps/anaconda/mini_py37_4.8.3/bin/python
<environment failed to get activated again>
(test_env6) [radhikar@el3 ~]$ source deactivate
DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.
[radhikar@el3 ~]$ source activate /shared-projects/buildstock/envs/test_env6
(test_env6) [radhikar@el3 ~]$ which python
/shared-projects/buildstock/envs/test_env6/bin/python
<environment can be activated again after explicit deactivation>

Checklist

Not all may apply

  • Code changes (must work)
  • Tests exercising your feature/bug fix (check coverage report on CircleCI build -> Artifacts)
  • All other unit tests passing
  • Update validation for project config yaml file changes
  • Update existing documentation
  • Run a small batch run to make sure it all works (local is fine, unless an Eagle specific feature)
  • Add to the changelog_dev.rst file and propose migration text in the pull request

@rajeee rajeee requested a review from nmerket April 28, 2021 23:29
Copy link
Member

@nmerket nmerket left a comment

Choose a reason for hiding this comment

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

This looks great. Thank you for figuring this out! Can you add something to changelog_dev.rst?

@rajeee rajeee requested a review from nmerket April 29, 2021 19:57
Copy link
Member

@nmerket nmerket left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'll port this over to make a 0.19.2 version as well. Of course we're in the middle of system time right now.

@nmerket nmerket merged commit 288f563 into develop May 3, 2021
@rajeee rajeee deleted the env_create_fix branch August 9, 2021 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants