File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,8 @@ def offer_received(self, offers):
140
140
if match_node_group :
141
141
cores = get_scalar (attributes , 'cores' )
142
142
cpus = get_scalar (offer_dict ['resources' ], 'cpus' )
143
- if cores == cpus :
143
+ # work around of MESOS-8631
144
+ if cpus >= cores - 0.1 :
144
145
if not self .heartbeat_table .check_fqdn_collision (offer_dict ['hostname' ]):
145
146
take_offer = True
146
147
if take_offer :
@@ -185,6 +186,13 @@ def accept_offer(self, offer):
185
186
task_id = uuid .uuid4 ().hex
186
187
cpus = get_scalar (offer_dict ['resources' ], 'cpus' )
187
188
189
+ # work around of MESOS-8631
190
+ if 'attributes' in offer_dict :
191
+ attributes = offer_dict ['attributes' ]
192
+ cores = get_scalar (attributes , 'cores' )
193
+ else :
194
+ cores = cpus
195
+
188
196
task = {
189
197
'name' : 'hpc pack mesos cn' ,
190
198
'task_id' : {'value' : task_id },
@@ -194,7 +202,7 @@ def accept_offer(self, offer):
194
202
'name' : 'cpus' ,
195
203
'type' : 'SCALAR' ,
196
204
# work around of MESOS-8631
197
- 'scalar' : {'value' : cpus - 0.1 }
205
+ 'scalar' : {'value' : cores - 0.1 }
198
206
},
199
207
{
200
208
'name' : 'mem' ,
You can’t perform that action at this time.
0 commit comments