Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Add HiveD scheduler config adapter for CA #4868

Merged
merged 4 commits into from
Sep 12, 2020

Conversation

abuccts
Copy link
Member

@abuccts abuccts commented Sep 2, 2020

Add HiveD scheduler config adapter for Cluster Autoscaler.

Add HiveD scheduler config patcher for Cluster Autoscaler.
@coveralls
Copy link

coveralls commented Sep 2, 2020

Coverage Status

Coverage decreased (-0.05%) to 34.801% when pulling e18365f on xiongyf/ca-add-hived-config-patcher into c5d6692 on master.

@fanyangCS
Copy link
Contributor

fanyangCS commented Sep 2, 2020

maybe adapter is a more appropriate name than patcher?

self.__init_hived_config()
self.__init_kube_client()
self.__nodes = []
self.__fake_nodes = ["fake{}".format(self.base36(i)) for i in range(max_nodes)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just i instead of base36(i), for easy read and parse

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to keep consistent with vmss naming format, six digits base 36

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, but seems no benifts to keep this consistent


def watch_nodes(self):
w = watch.Watch()
for event in w.stream(self.__client.list_node, _request_timeout=30):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the _request_timeout?
If no events during the timeout, will the for loop exit?
Shall we increase it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the _request_timeout?

It's used in single list_node api, reference.

If no events during the timeout, will the for loop exit?

No, there's another timeout_seconds parameter.

Shall we increase it?

I think it's fine, the example uses 60.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So let's make timeout_seconds longer ?
See kubernetes-client/python#124

Update HiveD config patcher.
@abuccts abuccts marked this pull request as ready for review September 3, 2020 11:09
class HiveDConfigPatcher(object):
def __init__(
self,
min_nodes=None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min_nodes [](start = 12, length = 9)

Seems we do not use min_nodes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's an attribute of CA like max_nodes, included here in case we need it in the future

Copy link
Member

@yqwang-ms yqwang-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Rename to adapter and update deployment.
@abuccts abuccts changed the title Add HiveD scheduler config patcher for CA Add HiveD scheduler config adapter for CA Sep 4, 2020
Workaround for resource calculation.
@scarlett2018 scarlett2018 mentioned this pull request Sep 10, 2020
31 tasks
@abuccts abuccts merged commit 0a573c8 into master Sep 12, 2020
@abuccts abuccts deleted the xiongyf/ca-add-hived-config-patcher branch September 21, 2020 03:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants