-
Notifications
You must be signed in to change notification settings - Fork 467
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
Separate stack persistence from repo implementation #462
Separate stack persistence from repo implementation #462
Conversation
…epo-implementation
…epo-implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a few minor comments, but looks great overall!
src/zenml/utils/enum_utils.py
Outdated
@@ -27,3 +27,8 @@ def __str__(self) -> str: | |||
def list(cls) -> List[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really part of your change, but does it make sense to rename this to names()
now that we added a values()
equivalent?
orchestrator: str | ||
metadata_store: str | ||
artifact_store: str | ||
container_registry: Optional[str] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a reminder to make sure the step operator doesn't get lost in some merge here
|
||
@property | ||
def root(self) -> Path: | ||
"""The root directory of this repository.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""The root directory of this repository.""" | |
"""The root directory of this stack store.""" |
StackConfiguration, | ||
) | ||
|
||
# from sqlalchemy import select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably be removed?
# permissions and limitations under the License. | ||
|
||
# type: ignore | ||
# ^ this is needed here in order to keep SQLModel from blowing up mypy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What errors do you get from mypy when uncommenting this line? We might be able to add some sqlmodel.*
ignore in pyproject.toml
to ignore some errors for this specific package or disable type checking for it entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a weird one. it doesn't just error in the sense that I could ignore that, the entire mypy run fails before checking a single file in the project.
± mypy src
Traceback (most recent call last):
File "/Users/jwb/Developer/zenml/venvs/zenintel3/bin/mypy", line 8, in <module>
sys.exit(console_entry())
File "/Users/jwb/Developer/zenml/venvs/zenintel3/lib/python3.8/site-packages/mypy/__main__.py", line 12, in console_entry
main(None, sys.stdout, sys.stderr)
File "mypy/main.py", line 96, in main
File "mypy/main.py", line 173, in run_build
File "mypy/build.py", line 180, in build
File "mypy/build.py", line 256, in _build
File "mypy/build.py", line 2717, in dispatch
File "mypy/build.py", line 3048, in process_graph
File "mypy/build.py", line 3165, in process_stale_scc
File "mypy/build.py", line 2308, in write_cache
File "mypy/build.py", line 1490, in write_cache
File "mypy/nodes.py", line 334, in serialize
File "mypy/nodes.py", line 3330, in serialize
File "mypy/nodes.py", line 3267, in serialize
File "mypy/nodes.py", line 941, in serialize
File "mypy/types.py", line 1386, in serialize
File "mypy/types.py", line 541, in serialize
File "mypy/types.py", line 984, in serialize
File "mypy/nodes.py", line 2642, in fullname
AttributeError: attribute '_fullname' of 'TypeInfo' undefined
Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea, really weird that it's an actual mypy internal crash. I'll see if the same happens for me or if I can find a solution to it
26603b0
to
673c89d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work ! I thoroughly tested it during my ZenProfile adventures, everything works really nice. The legacy repo migration was a particularly nice touch. If there was one thing I'd ask of this PR, it would be that those nasty SQLAlchemy warnings would go away, but not a big deal right now.
7dc125e
to
5aa67e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Just found two tiny details in one log message and license, other than that good to go
src/zenml/repository.py
Outdated
@@ -128,15 +99,38 @@ def __init__(self, root: Optional[Path] = None): | |||
) | |||
|
|||
self._root = Repository.find_repository(root) | |||
logger.debug(" + Initializing %s repo at %s", storage_type, self._root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to still be there :D
Co-authored-by: Michael Schuster <schustmi@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the notes from Michael and Stefan and a really small detail, everything looks really great. This unlocks a lot of potential regarding how we store the stacks.
Perhaps a small question. What do you think about how this will evolve in the future? With the switch between development and deployment, and the collaboration of people within a team, I feel there are a lot of things to unlock here. |
Regarding your small detail -- I was aware of it an it's fixed in my follow-up PR, but since stefan is actually removing that option again in his current PR, I thought there's no need to "backport" it to this one. given that it will be gone by tomororw, I'd prefer to avoid giving stefan more merge conflicts :) |
Ooops, did not mean to close this. |
Describe changes
Creates a
BaseStackStore
abstract interface to handle the persistence of stacks and stack components, and defers all direct persistence operations in the Repository class to this interface. Introduces newpydantic
models wrapping/describing stacks and components to provide an easily serializable object for the interface to the stack store.Provides 2 implementations of the
BaseStackStore
: a LocalStackStore that mimics the existing.yaml
persistence in the Repository (but in a separate file from the repositoryconfig.yaml
) and a SQL implementation usingSQLModel
backend.This is a purely internal change that should not affect the user at all, but paves the way for the separation of stack storage backend into a service.
Pre-requisites
Please ensure you have done the following:
Types of changes