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

fix type issues #9

Conversation

danking
Copy link

@danking danking commented Oct 26, 2021

No description provided.

T = TypeVar('T')


class CloudResourceManager(Generic[T]):
Copy link
Author

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
Copy link
Author

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 = {
Copy link
Author

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.

@jigold jigold merged commit d91f181 into jigold:batch-cloud-agnostic-rewrite-all Oct 27, 2021
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.

2 participants