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

Improve serde #11

Merged
merged 10 commits into from
Jan 31, 2022
Merged

Improve serde #11

merged 10 commits into from
Jan 31, 2022

Conversation

aguschin
Copy link
Contributor

@aguschin aguschin commented Jan 24, 2022

Closes #8

@aguschin
Copy link
Contributor Author

aguschin commented Jan 31, 2022

This PR makes dumping registry state possible. E.g. if you run

bash showcase.sh
ipython -c "from gitops import init_registry; reg = init_registry(); import json; reg.state.dict()"

You'll get something like

{'objects': [{'category': 'model',
   'name': 'models/random-forest.pkl',
   'versions': [{'category': 'model',
     'object': 'models/random-forest.pkl',
     'name': 'v1',
     'creation_date': datetime.datetime(2022, 1, 24, 14, 53, 46),
     'author': 'Alexander Guschin',
     'commit_hexsha': '77c2f7ede42c0c71d2d2de55a1f864ab33d8d161',
     'unregistered_date': None},
    {'category': 'model',
     'object': 'models/random-forest.pkl',
     'name': 'v2',
     'creation_date': datetime.datetime(2022, 1, 24, 14, 53, 49),
     'author': 'Alexander Guschin',
     'commit_hexsha': '80c29c5b63133703c1c76ec3062a718637a0b58e',
     'unregistered_date': None}],
   'labels': [{'category': 'model',
     'object': 'models/random-forest.pkl',
     'version': 'v1',
     'name': 'production',
     'creation_date': datetime.datetime(2022, 1, 24, 14, 53, 52),
     'author': 'Alexander Guschin',
     'commit_hexsha': '77c2f7ede42c0c71d2d2de55a1f864ab33d8d161',
     'unregistered_date': None},
    {'category': 'model',
     'object': 'models/random-forest.pkl',
     'version': 'v2',
     'name': 'staging',
     'creation_date': datetime.datetime(2022, 1, 24, 14, 53, 54),
     'author': 'Alexander Guschin',
     'commit_hexsha': '80c29c5b63133703c1c76ec3062a718637a0b58e',
     'unregistered_date': None},
    {'category': 'model',
     'object': 'models/random-forest.pkl',
     'version': 'v2',
     'name': 'production',
     'creation_date': datetime.datetime(2022, 1, 24, 14, 53, 55),
     'author': 'Alexander Guschin',
     'commit_hexsha': '80c29c5b63133703c1c76ec3062a718637a0b58e',
     'unregistered_date': None},
    {'category': 'model',
     'object': 'models/random-forest.pkl',
     'version': 'v1',
     'name': 'production',
     'creation_date': datetime.datetime(2022, 1, 24, 14, 53, 57),
     'author': 'Alexander Guschin',
     'commit_hexsha': '77c2f7ede42c0c71d2d2de55a1f864ab33d8d161',
     'unregistered_date': None}]},
  {'category': 'model',
   'name': 'models/neural-network.pkl',
   'versions': [{'category': 'model',
     'object': 'models/neural-network.pkl',
     'name': 'v1',
     'creation_date': datetime.datetime(2022, 1, 24, 14, 53, 47),
     'author': 'Alexander Guschin',
     'commit_hexsha': '77c2f7ede42c0c71d2d2de55a1f864ab33d8d161',
     'unregistered_date': None}],
   'labels': [{'category': 'model',
     'object': 'models/neural-network.pkl',
     'version': 'v1',
     'name': 'staging',
     'creation_date': datetime.datetime(2022, 1, 24, 14, 53, 50),
     'author': 'Alexander Guschin',
     'commit_hexsha': '77c2f7ede42c0c71d2d2de55a1f864ab33d8d161',
     'unregistered_date': None}]}]}

Some information is missing (e.g. user email, or tagging message), but can be added.

Also, as the next step, we should try to match this with branch-based and file-based approaches to see how it works out.

@aguschin aguschin merged commit bbf7f58 into main Jan 31, 2022
@aguschin aguschin deleted the improve-serde branch January 31, 2022 17:04
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.

Serialize Registry properly
1 participant