Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Worker-Specific Task Assignment Capabilities. #1174

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tejaschauhan373
Copy link

Bug / Requirement Description

  • Implemented Worker-Specific Task Assignment Capabilities.

Solution description

  • Added default parameter workers_name to store uid of workers in Task.
  • Added variable is_picked_up to keep track of task assignment in Task.
  • Added dictionary queue_map in TaskQueue to keep separate task queue for all workers in case of need, or else it will be stored in default queue.
  • If there is non-empty workers_name given in Task object, means task needs to run by given uid workers only, else it can be run by anyone.
  • Create separate queue for each uid of workers_name & manage it through queue_map.
  • While assigning Task to Worker and popping from queue, check if task is picked up by another worker already or not through Task.is_picked_up variable.
  • If Task.is_picked_up is True then don't assign anything for that pull request, else assign it & mark Task.is_picked_up True.
  • While _handle_taskresults, _decommission_worker, _discard_task, discard_pending_tasks, mark Task.is_picked_up False.

Checklist:

  • Test

@tejaschauhan373 tejaschauhan373 requested a review from a team as a code owner January 14, 2025 18:47
@Pyifan
Copy link
Contributor

Pyifan commented Jan 17, 2025

Generally speaking, doing worker-specific task assignment is against pool design principle. With pool execution, we expect all workers are equivalent, and all tasks isolated.

@Pyifan
Copy link
Contributor

Pyifan commented Jan 17, 2025

I'm open to have traits on both worker & task as assignment constraints (like jenkins selector), if we have a valid use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants