Skip to content

Commit 4301e3d

Browse files
committed
Merge branch 'batch-with-workflow' of github.com:broadinstitute/sparklespray into batch-with-workflow
2 parents 324af51 + 864ed5a commit 4301e3d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cli/sparklespray/watch/resize.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@ def poll(self, state: ClusterStateQuery):
3737

3838
if additional_nodes > 0:
3939
# we haven't requested anything, so request something now
40-
self.cluster.add_nodes(additional_nodes, 3, additional_nodes >= self.max_preemptable_attempts)
40+
41+
# figure out how many nodes can be pre-emptable by looking at max_preemptable_attempts. The
42+
# rest will be non-preemptable
43+
additional_preemptable_nodes = min([additional_nodes, self.max_preemptable_attempts])
44+
additional_non_preemptable_nodes = additional_nodes - additional_preemptable_nodes
45+
46+
if additional_preemptable_nodes > 0:
47+
self.cluster.add_nodes(additional_nodes, 3, True)
48+
if additional_non_preemptable_nodes > 0:
49+
self.cluster.add_nodes(additional_nodes, 3, False)
50+
4151
modified = True
4252
return None
4353
# print("target_node_count > requested_nodes", target_node_count, requested_nodes)

0 commit comments

Comments
 (0)