Skip to content

Commit

Permalink
Test autoscaler fix by williamma12
Browse files Browse the repository at this point in the history
  • Loading branch information
ls-daniel committed May 7, 2019
1 parent cfe66ef commit 61e2026
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion python/ray/autoscaler/autoscaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@ def __init__(self):

def update(self, ip, static_resources, dynamic_resources):
self.static_resources_by_ip[ip] = static_resources
self.dynamic_resources_by_ip[ip] = dynamic_resources

# TODO(romilb): This is a hotfix to make autoscaler work with #4555
dynamic_resources_update = dynamic_resources.copy()
for resource_name, capacity in static_resources.items():
if resource_name not in dynamic_resources_update:
dynamic_resources_update[resource_name] = 0.0
self.dynamic_resources_by_ip[ip] = dynamic_resources_update

now = time.time()
if ip not in self.last_used_time_by_ip or \
static_resources != dynamic_resources:
Expand Down
2 changes: 1 addition & 1 deletion python/ray/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def xray_heartbeat_batch_handler(self, unused_channel, data):
for j in range(message.BatchLength()):
heartbeat_message = message.Batch(j)

num_resources = heartbeat_message.ResourcesAvailableLabelLength()
num_resources = heartbeat_message.ResourcesTotalLabelLength()
static_resources = {}
dynamic_resources = {}
for i in range(num_resources):
Expand Down

0 comments on commit 61e2026

Please sign in to comment.