mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 22:49:32 -02:30
simplify dynamic queue binding
we recently made a change so that instances no longer bind to instance-group specific queues, but now instead they each bind to a direct queue for their specific hostname (https://github.com/ansible/tower/pull/1922) Because of this, we shouldn't *need* to reconfigure the queue binds at runtime anymore when group membership changes. Under our new model, every celeryd listens on a queue named after its hostname; when the scheduler finds a task to run, it picks an Instance in the target Instance Group and sends the task to the queue for that Instance's hostname.
This commit is contained in:
@@ -212,6 +212,8 @@ class InstanceGroup(BaseModel, RelatedJobsMixin):
|
||||
def fit_task_to_most_remaining_capacity_instance(self, task):
|
||||
instance_most_capacity = None
|
||||
for i in self.instances.filter(capacity__gt=0).order_by('hostname'):
|
||||
if not i.enabled:
|
||||
continue
|
||||
if i.remaining_capacity >= task.task_impact and \
|
||||
(instance_most_capacity is None or
|
||||
i.remaining_capacity > instance_most_capacity.remaining_capacity):
|
||||
|
||||
Reference in New Issue
Block a user