Skip to content

Pull and push utask_main tasks to Swarming queues#5283

Draft
IvanBM18 wants to merge 4 commits into
masterfrom
feature/swarming/utask_main_queue
Draft

Pull and push utask_main tasks to Swarming queues#5283
IvanBM18 wants to merge 4 commits into
masterfrom
feature/swarming/utask_main_queue

Conversation

@IvanBM18
Copy link
Copy Markdown
Collaborator

@IvanBM18 IvanBM18 commented May 18, 2026

Description

This change updates run_bot.py to fetch tasks from both the default UTASK_MAIN_QUEUE and the corresponding Swarming queue if the SWARMING_REMOTE_EXECUTION feature flag is enabled. This allows bots to process tasks intended for Swarming execution.

It also introduces get_target_runtime to determine the appropriate execution environment (Batch, Swarming, or Kata Container) for a given job based on its environment variables. This information is now included in the task's extra_info.

  • Why: This was added so that the Pub/Sub queue can automatically filter messages into the appropriate Swarming subscription based on the target runtime.

Changes

  • run_bot.py: Fetch from both default and swarming queues if feature flag is enabled.
  • tasks.py: Added get_target_runtime and updated add_task to include target_runtime in extra_info.
  • Tests: Added unit tests for get_target_runtime and verified run_bot behavior with both queues.

Test

  • Run unit tests: python butler.py py_unittest -t core -p tasks_test.py and run_bot_test.py.

Note

This PR is a draft because their changes are dependant on this other pr so please go ahead and review that one first

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.

1 participant