Skip to content

[WB-7940] Fix excess warning span if requested WANDB_DIR/root_dir is not writable#3304

Merged
dmitryduev merged 35 commits intomasterfrom
wb7940
Mar 15, 2022
Merged

[WB-7940] Fix excess warning span if requested WANDB_DIR/root_dir is not writable#3304
dmitryduev merged 35 commits intomasterfrom
wb7940

Conversation

@dmitryduev
Copy link
Copy Markdown
Member

@dmitryduev dmitryduev commented Feb 26, 2022

Fixes WB-7940

Description

In this PR:

  • When you call, for example, wandb.login() (or wandb.setup()) before wandb.init(), the singleton will already be set up and so if e.g. env vars are set/changed in between, they will be ignored, which might not be what the user expects.
    When running wandb.init() we will now first check if the singleton exists and if so, check if the environment vars have changed and notify the user if they did.

image

  • Prevent the terminal output from exploding if requested path (WANDB_DIR/root_dir) is not writable:

image

Testing

Added a yea test.

@dmitryduev dmitryduev changed the title [WB-7940] Do not repeat termwarm if requested WANDB_DIR/root_dir is not writable DNM - [WB-7940] Do not repeat termwarm if requested WANDB_DIR/root_dir is not writable Feb 26, 2022
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2022

Codecov Report

Merging #3304 (ba5ab94) into master (c744450) will increase coverage by 0.02%.
The diff coverage is 82.35%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3304      +/-   ##
==========================================
+ Coverage   81.39%   81.41%   +0.02%     
==========================================
  Files         234      234              
  Lines       28709    28719      +10     
==========================================
+ Hits        23367    23383      +16     
+ Misses       5342     5336       -6     
Flag Coverage Δ
functest 58.32% <82.35%> (+0.07%) ⬆️
unittest 71.59% <70.58%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
wandb/old/core.py 58.46% <0.00%> (-16.93%) ⬇️
wandb/sdk/lib/_wburls_generated.py 0.00% <0.00%> (ø)
wandb/sdk/lib/wburls.py 100.00% <ø> (ø)
wandb/sdk/wandb_login.py 95.51% <ø> (ø)
wandb/sdk/wandb_run.py 89.48% <ø> (ø)
wandb/sdk/wandb_settings.py 94.87% <0.00%> (ø)
wandb/sdk/wandb_init.py 85.39% <100.00%> (+0.30%) ⬆️
wandb/sdk/wandb_setup.py 89.56% <100.00%> (ø)
wandb/sdk/lib/git.py 76.35% <0.00%> (ø)
... and 6 more

@dmitryduev dmitryduev requested a review from raubitsj February 26, 2022 10:31
@dmitryduev dmitryduev changed the title DNM - [WB-7940] Do not repeat termwarm if requested WANDB_DIR/root_dir is not writable [WB-7940] wandb.init() and singleton + do not repeat termwarm if requested WANDB_DIR/root_dir is not writable Feb 26, 2022
Copy link
Copy Markdown
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 marked this pull request as draft March 3, 2022 00:53
@dmitryduev dmitryduev marked this pull request as ready for review March 3, 2022 07:37
@dmitryduev dmitryduev requested a review from kptkin March 15, 2022 20:39
- wandb
tag:
skips:
- platform: win
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just curious why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

heh, I don't know actually, it was there already, I just move it to a separate yea file :)

- wandb
tag:
skips:
- platform: win
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same... as previous

Comment thread wandb/sdk/wandb_setup.py
_instance = None

def __init__(self, settings=None):
def __init__(self, settings=None) -> None:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: do you want to type settings?

Comment thread wandb/sdk/wandb_setup.py


def _setup(settings=None, _reset=None):
def _setup(settings=None, _reset: bool = False) -> Optional["_WandbSetup"]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same

Comment thread wandb/sdk/wandb_setup.py Outdated
def setup(settings=None):
def setup(settings=None) -> Optional["_WandbSetup"]:
ret = _setup(settings=settings)
# wandb.termlog("`wandb` session started.", repeat=False)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do you want to remove commented out code?

Comment thread wandb/sdk/wandb_setup.py


def setup(settings=None):
def setup(settings=None) -> Optional["_WandbSetup"]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same do you want to type this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This file is still not type-annotated :( I would leave it for a future PR, we should organize a type-annotation sprint or something.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yeah that's why i nitted it haha

Copy link
Copy Markdown
Collaborator

@kptkin kptkin left a comment

Choose a reason for hiding this comment

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

Awesome! Such a pleasure to review your PRs!!!

Comment thread wandb/sdk/wandb_setup.py Outdated
@dmitryduev dmitryduev merged commit 7242134 into master Mar 15, 2022
@dmitryduev dmitryduev deleted the wb7940 branch March 15, 2022 23:14
@raubitsj raubitsj changed the title [WB-7940] wandb.init() and singleton + do not repeat termwarm if requested WANDB_DIR/root_dir is not writable [WB-7940] Fix excess warning span if requested WANDB_DIR/root_dir is not writable Apr 5, 2022
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.

3 participants