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

[WB-6500] fixes CondaEnvExportError by redirecting stderr #2814

Merged
merged 3 commits into from
Oct 24, 2021
Merged

Conversation

charlesfrye
Copy link
Contributor

https://wandb.atlassian.net/browse/WB-6500

Description

When users have conda installed on their system and are in the root directory, our conda env export call to produce an environment.yml fails and prints an error. This is despite the fact that we try to catch exceptions with except Exception, because the error occurs in a subprocess call.

This issue can happen in, e.g., the environment of JarvisLabs, which provides cloud GPUs and credits and may be a first W&B experience for some users. See JIRA for more context.

The issue occurs right when you call wandb.init, so it's not putting our best foot forward!

Testing

I checked that, post-fix, the error on wandb.init call no longer occurs in an environment on JarvisLabs.

I also checked that the CondaEnvExportError is still triggered by a bare conda env export call in the same environment.

The solution uses subprocess.DEVNULL, which is Python>=3.3.

Release Notes

Below, please enter user-facing release notes as one or more bullet points.
If your change is not user-visible, write NO RELEASE NOTES instead, with no bullet points.

------------- BEGIN RELEASE NOTES ------------------

NO RELEASE NOTES

------------- END RELEASE NOTES --------------------

@codecov
Copy link

codecov bot commented Oct 21, 2021

Codecov Report

Merging #2814 (9c67e49) into master (50c7895) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2814   +/-   ##
=======================================
  Coverage   76.29%   76.29%           
=======================================
  Files         178      178           
  Lines       26548    26548           
=======================================
+ Hits        20254    20256    +2     
+ Misses       6294     6292    -2     
Flag Coverage Δ
functest 51.06% <0.00%> (+<0.01%) ⬆️
unittest 70.49% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
wandb/sdk/internal/meta.py 90.18% <100.00%> (+3.06%) ⬆️
wandb/sdk/internal/file_stream.py 82.26% <0.00%> (-1.51%) ⬇️
wandb/sdk/lib/redirect.py 86.53% <0.00%> (-0.18%) ⬇️
wandb/sdk/lib/git.py 75.86% <0.00%> (ø)
wandb/sdk/internal/sender.py 91.79% <0.00%> (+0.13%) ⬆️
wandb/filesync/step_prepare.py 94.28% <0.00%> (+1.42%) ⬆️

Copy link
Contributor

@adrnswanberg adrnswanberg left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

Copy link
Contributor

@vanpelt vanpelt left a comment

Choose a reason for hiding this comment

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

🔥

@raubitsj raubitsj merged commit 3172f6f into master Oct 24, 2021
@raubitsj raubitsj deleted the WB-6500 branch October 24, 2021 16:31
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

4 participants