-
Notifications
You must be signed in to change notification settings - Fork 32
✨♻️Autoscaling/dask nthreads2 🚨 🚨 🚨 #8558
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
base: master
Are you sure you want to change the base?
✨♻️Autoscaling/dask nthreads2 🚨 🚨 🚨 #8558
Conversation
…ker is computed for autoscaling 🚨🚨🚨 (ITISFoundation#8423) Co-authored-by: Copilot <[email protected]>
4c40854 to
e3d2a06
Compare
This reverts commit e3d2a06.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8558 +/- ##
==========================================
- Coverage 87.52% 87.44% -0.08%
==========================================
Files 2011 1608 -403
Lines 78612 66977 -11635
Branches 1351 764 -587
==========================================
- Hits 68802 58566 -10236
+ Misses 9406 8158 -1248
+ Partials 404 253 -151
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
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.
thx!
| def as_flat_dict(self) -> dict[str, int | float | str]: | ||
| """Like model_dump, but flattens generic_resources to top level keys""" | ||
| base = self.model_dump() | ||
| base.update(base.pop("generic_resources")) |
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.
MIONR: just as a precaution in case one day you add another object-like field , here i would do it in a more general fashion. I know right now is perhaps an overkill, but it might be handy to add some helpers like this in common_library.dict_tools so that afterwards we could do something like
common_library.dict_tools.flatten(self.model_dump(mode='json'))A draft courtesy of chatty (double check first!)
def _flatten(obj, prefix=""):
items = {}
if isinstance(obj, dict):
for k, v in obj.items():
items.update(_flatten(v, f"{prefix}{k}." if prefix else k))
elif isinstance(obj, list):
for i, v in enumerate(obj):
items.update(_flatten(v, f"{prefix}{i}." if prefix else f"{i}"))
else:
items[prefix] = obj
return items
def as_flat_dict(self) -> dict[str, int | float | str]:
"""Recursively flattens all nested dicts/lists into a single-level dict."""
return _flatten(self.model_dump(mode='json'))


What do these changes do?
Second trial at refactoring autoscaling like in #8423
Re-revert #8557
The problem was due to an infortunate refactoring in
services/autoscaling/src/simcore_service_autoscaling/models.py/.Added a note and an issue for refactoring that problem:
#8559
Related issue/s
How to test
Dev-ops