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

Invalidating artifact/metadata store if there is a change in one of them #719

Merged
merged 45 commits into from Jul 21, 2022

Conversation

bcdurak
Copy link
Contributor

@bcdurak bcdurak commented Jun 23, 2022

Describe changes

I implemented a mechanism that puts a stop to any operation if the corresponding artifact store/metadata store pair is not properly associated.

It works as follows:

  • The ZenStore now features an association table.
  • Once you register a stack, the uuids of the artifact- and metadata stores are saved in pairs in this table.
  • Stacks get validated through a validate method when you run a pipeline, register/update stacks, etc. This method now also checks whether the stack in question has the correct entry in this table for its artifact- metadata store pair.
  • It is possible to bypass this by using a flag -r when creating/updating stack over the CLI, which will reset the previous associations of these components and establish a new one.

TODO:

  • There are some failing tests. I am working on it at the moment.

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • If my change requires a change to docs, I have updated the documentation accordingly.
  • If I have added an integration, I have updated the integrations table.
  • I have added tests to cover my changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

@github-actions github-actions bot added internal To filter out internal PRs and issues bug Something isn't working labels Jun 23, 2022
@github-actions
Copy link
Contributor

@htahir1, @schustmi, @safoinme
1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.

4 similar comments
@github-actions
Copy link
Contributor

@htahir1, @schustmi, @safoinme
1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.

@github-actions
Copy link
Contributor

@htahir1, @schustmi, @safoinme
1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.

@github-actions
Copy link
Contributor

@htahir1, @schustmi, @safoinme
1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.

@github-actions
Copy link
Contributor

@htahir1, @schustmi, @safoinme
1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.

@github-actions
Copy link
Contributor

@htahir1, @schustmi, @safoinme
1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.

1 similar comment
@github-actions
Copy link
Contributor

@htahir1, @schustmi, @safoinme
1.25 (one and twenty-five hundredths) business days have passed since the review started. Pretty please review the PR.

@bcdurak
Copy link
Contributor Author

bcdurak commented Jul 7, 2022

@AlexejPenner @fa9r I have fixed the issue regarding the UUIDs and the SQL ZenStore, added new tests, and updated the docs accordingly.

@bcdurak bcdurak requested review from fa9r and AlexejPenner and removed request for schustmi and safoinme July 7, 2022 13:27
Copy link
Contributor

@fa9r fa9r left a comment

Choose a reason for hiding this comment

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

Great changes, love the new argument name and descriptions, very clear now!

docs/book/advanced-guide/stacks-components-flavors.md Outdated Show resolved Hide resolved
tests/unit/cli/test_stack.py Show resolved Hide resolved
Copy link
Collaborator

@AlexejPenner AlexejPenner left a comment

Choose a reason for hiding this comment

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

LGTM - just out of curiosity, how does this interact with existing stacks? Is this a breaking change?

src/zenml/stack/stack.py Outdated Show resolved Hide resolved
@@ -500,7 +499,7 @@ def requirements(
]
return set.union(*requirements) if requirements else set()

def validate(self) -> None:
def validate(self, decouple_stores: bool = False) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Functionality-wise your implementation looks great, the only thing I'm a little concerned about is that the functionality of resetting the store associations doesn't really belong in the validation.

I'd see it more as a method on the BaseZenStore, e.g.

class BaseZenStore:
    def decouple_stores(artifact_store_uuid, metadata_store_uuid):
        ...
        
class Repository:
    def register_stack(stack, decouple):
        if decouple:
            self.zen_store.decouple_stores(...)
        self.zen_store.register_stack(...)

I know this is quite late in the review and I just randomly took a look, feel free to ignore it in this PR but I think it makes sense to split it up longterm.

@bcdurak bcdurak merged commit bec7dc8 into develop Jul 21, 2022
@bcdurak bcdurak deleted the bugfix/ENG-796-invalidating-stores branch July 21, 2022 08:10
fa9r added a commit that referenced this pull request Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal To filter out internal PRs and issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants