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

refactor(artifacts): add programmatic alias addition/removal from SDK on artifacts #4429

Merged
merged 22 commits into from Nov 9, 2022

Conversation

vwrj
Copy link
Contributor

@vwrj vwrj commented Nov 2, 2022

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

Description

Current behavior:

Design doc: https://www.notion.so/wandbai/Programmatic-Aliases-Model-Registry-Artifacts-5275e2daca4c4405a525a871d1ff586f

image

Behavior after the PR (SDK portion):

image

Testing

How was this PR tested?
Test with Relay.

Checklist

  • Include reference to internal ticket "Fixes WB-NNNN" and/or GitHub issue "Fixes #NNNN" (if applicable)
  • Ensure PR title compliance with the conventional commits standards

@vwrj vwrj changed the title refactor(artifacts): re-add programmatic alias addition/removal from SDK on artifacts refactor(artifacts): Re-add programmatic alias addition/removal from SDK on artifacts Nov 2, 2022
@vwrj vwrj requested a review from tssweeney November 2, 2022 17:42
@vwrj vwrj requested a review from kptkin November 2, 2022 19:13
wandb/apis/public.py Outdated Show resolved Hide resolved
wandb/apis/public.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Merging #4429 (4217298) into main (a49d918) will increase coverage by 0.01%.
The diff coverage is 92.30%.

❗ Current head 4217298 differs from pull request most recent head 6f77e26. Consider uploading reports for the commit 6f77e26 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4429      +/-   ##
==========================================
+ Coverage   83.01%   83.02%   +0.01%     
==========================================
  Files         258      258              
  Lines       32871    32891      +20     
==========================================
+ Hits        27288    27308      +20     
  Misses       5583     5583              
Flag Coverage Δ
functest 56.85% <12.00%> (+0.04%) ⬆️
unittest 73.15% <92.30%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
wandb/apis/public.py 82.16% <92.30%> (+0.12%) ⬆️
wandb/integration/tensorboard/monkeypatch.py 87.65% <0.00%> (-4.94%) ⬇️
wandb/sdk/interface/interface_shared.py 86.56% <0.00%> (-0.78%) ⬇️
wandb/sdk/lib/mailbox.py 93.15% <0.00%> (-0.35%) ⬇️
wandb/sdk/wandb_run.py 90.73% <0.00%> (-0.18%) ⬇️
wandb/sdk/launch/utils.py 92.48% <0.00%> (-0.11%) ⬇️
wandb/sdk/internal/system/assets/ipu.py 95.74% <0.00%> (-0.05%) ⬇️
wandb/sdk/wandb_settings.py 94.57% <0.00%> (+0.13%) ⬆️
wandb/sdk/service/streams.py 94.75% <0.00%> (+0.37%) ⬆️
wandb/sdk/lib/git.py 79.01% <0.00%> (+0.61%) ⬆️
... and 3 more

@vwrj vwrj requested a review from tssweeney November 2, 2022 23:11
wandb/apis/public.py Outdated Show resolved Hide resolved
wandb/apis/public.py Outdated Show resolved Hide resolved
Copy link
Contributor

@tssweeney tssweeney 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, but made a few comments. Overall, reading this again, it seems like we could put this logic in the updateArtifact gorilla resolver and reduce this back to a single call. for example, we could extend the UpdateArtifact input schema:

input ArtifactAliasInput {
  artifactCollectionName: String!
  alias: String! @constraints(max: 128)
  entityName: String # new, optional field
  projectName: String # new, optional field
}

Then in the gorilla resolver, if entityName or projectName are null, then we use the current logic. Else, if present, we calculate the delta and call add/remove aliases internally. This would mean the python client code does not need to do all this extra stuff (other than add new fields if the backend supports it)

@vwrj vwrj enabled auto-merge (squash) November 9, 2022 23:29
@vwrj vwrj merged commit 12fc330 into main Nov 9, 2022
@vwrj vwrj deleted the modelreg/update-aliases-on-artifacts branch November 9, 2022 23:41
@vwrj vwrj added this to the sdk-2022-11.2 milestone Nov 13, 2022
vwrj added a commit that referenced this pull request Nov 29, 2022
…SDK on artifacts (#4429)

* add update_aliases method and relevant gql mutations

* wip test

* added test for public api

* removed relay call

* code nit

* changed to alias updates in pythonic list form rather than separate method

* modify test

* backwards compatibility

* format

* collection name

* format

* modified test to ensure collection-specific alias changes occurred

* nit
andrewtruong pushed a commit that referenced this pull request Dec 2, 2022
…SDK on artifacts (#4429)

* add update_aliases method and relevant gql mutations

* wip test

* added test for public api

* removed relay call

* code nit

* changed to alias updates in pythonic list form rather than separate method

* modify test

* backwards compatibility

* format

* collection name

* format

* modified test to ensure collection-specific alias changes occurred

* nit
@kptkin kptkin changed the title refactor(artifacts): Re-add programmatic alias addition/removal from SDK on artifacts refactor(artifacts): add programmatic alias addition/removal from SDK on artifacts Dec 6, 2022
@kptkin kptkin modified the milestones: sdk-2022-11.2, sdk-2022-12.1 Sep 22, 2023
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.

None yet

3 participants