-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix type issues #9
fix type issues #9
Conversation
T = TypeVar('T') | ||
|
||
|
||
class CloudResourceManager(Generic[T]): |
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 isn't quite right. The structure we have is a bit complicated and prepare_vm and create_vm really shouldn't be two separate functions.
@@ -91,6 +91,7 @@ def get_zone(self, cores: int, worker_local_ssd_data_disk: bool, worker_pd_ssd_d | |||
global_live_total_cores_mcpu = self.inst_coll_manager.global_live_total_cores_mcpu | |||
if global_live_total_cores_mcpu // 1000 < 1_000: | |||
return self.resource_manager.default_location | |||
assert self.region_info is not None # FIXME: this reveals a race condition: if update_region_quotas does not run before we get_zone this will fail |
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 should really be fixed by using an async factory method to ensure reg_info is never None
@@ -61,7 +62,7 @@ def create_instance_config( | |||
) | |||
assert unreserved_disk_storage_gb >= 0 | |||
|
|||
vm_config = { | |||
vm_config: Any = { |
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 an escape hatch. I accidentally fell into rabbit hole of cleaning up the instance config situation so that it was both easier to read and easier to type, but it was a rather large change so I abandoned it.
No description provided.