Skip to content

[rust/scheduler] Distributed Scheduler#2104

Merged
DiegoTavares merged 4 commits into
masterfrom
new-scheduler
Dec 16, 2025
Merged

[rust/scheduler] Distributed Scheduler#2104
DiegoTavares merged 4 commits into
masterfrom
new-scheduler

Conversation

@DiegoTavares

Copy link
Copy Markdown
Collaborator

This PR introduces a new module called "scheduler." This module is responsible for the booking aspect of Cuebot and is designed to offload this feature from the central module.

Rationale: Cuebot's booking logic depends on responding to each HostReport with a new task that searches for layers to dispatch to the reporting host. Consequently, each request generates a BookingQuery, which significantly impacts the database. As a result, scaling Cuebot is limited by the need to optimize database capacity to handle complex queries. This new module alleviates the booking workload from Cuebot.

Booking on the Scheduler is not triggered by host reports; instead, it operates through an internal loop that searches for pending jobs and seeks suitable matches from a cached view of the hosts in the database. The scheduler organizes layers and hosts into clusters, with each cluster representing a group of show and allocation combinations. This structure allows multiple instances of the scheduler to share the load without competing for work, which is a significant issue in Cuebot.

To enable Cuebot and the Scheduler to run concurrently without competing for work, a new feature was added to Cuebot, as detailed in #2087. This feature allows for the addition of an exclusion list containing show and allocations that should not be booked, or it can halt booking for all shows altogether.

DiegoTavares added a commit that referenced this pull request Dec 12, 2025
Minor change to force a new actions execution on the #2104

Signed-off-by: Diego Tavares <dtavares@imageworks.com>
@ramonfigueiredo ramonfigueiredo changed the title Distributed Scheduler [rust/scheduler] Distributed Scheduler Dec 12, 2025
@ramonfigueiredo

Copy link
Copy Markdown
Collaborator

All your Rust files are missing the OpenCue code comment: // Copyright Contributors to the OpenCue Project. Please include the following comment in all rust files:

// Copyright Contributors to the OpenCue Project
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under
// the License.

Comment thread rust/config/rqd.dummy.cuebot.yaml Outdated
Comment thread rust/config/rqd.dummy.cuebot.yaml Outdated
Comment thread rust/AGENTS.md Outdated

@ramonfigueiredo ramonfigueiredo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, @DiegoTavares

Approve with minor suggestions.

Comment thread rust/crates/scheduler/src/main.rs Outdated
Comment thread rust/crates/scheduler/src/pipeline/matcher.rs Outdated
Comment thread rust/crates/scheduler/src/dao/host_dao.rs Outdated
Comment thread rust/crates/scheduler/src/config/mod.rs Outdated
Comment thread rust/crates/scheduler/src/dao/host_dao.rs Outdated
Comment thread rust/crates/scheduler/src/config/mod.rs Outdated
Comment thread rust/crates/scheduler/src/host_cache/cache.rs Outdated
Comment thread rust/crates/scheduler/src/main.rs
Comment thread rust/config/scheduler.yaml Outdated
This PR introduces a new module called "scheduler." This module is
responsible for the booking aspect of Cuebot and is designed to offload
this feature from the central module.

Rationale: Cuebot's booking logic depends on responding to each
HostReport with a new task that searches for layers to dispatch to the
reporting host. Consequently, each request generates a
[BookingQuery](https://github.com/AcademySoftwareFoundation/OpenCue/blob/master/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java),
which significantly impacts the database. As a result, scaling Cuebot is
limited by the need to optimize database capacity to handle complex
queries. This new module alleviates the booking workload from Cuebot.

Booking on the Scheduler is not triggered by host reports; instead, it
operates through an internal loop that searches for pending jobs and
seeks suitable matches from a cached view of the hosts in the database.
The scheduler organizes layers and hosts into clusters, with each
cluster representing a group of show and allocation combinations. This
structure allows multiple instances of the scheduler to share the load
without competing for work, which is a significant issue in Cuebot.

To enable Cuebot and the Scheduler to run concurrently without competing
for work, a new feature was added to Cuebot, as detailed in
#2087. This
feature allows for the addition of an exclusion list containing show and
allocations that should not be booked, or it can halt booking for all
shows altogether.

---------

Signed-off-by: Diego Tavares <dtavares@imageworks.com>
Minor change to force a new actions execution on the #2104

Signed-off-by: Diego Tavares <dtavares@imageworks.com>
@DiegoTavares

Copy link
Copy Markdown
Collaborator Author

All your Rust files are missing the OpenCue code comment: // Copyright Contributors to the OpenCue Project. Please include the following comment in all rust files:

// Copyright Contributors to the OpenCue Project
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under
// the License.

As this will impact multiple modules, I'm creating a new PR to handle it.

@DiegoTavares DiegoTavares merged commit 515b701 into master Dec 16, 2025
22 checks passed
DiegoTavares added a commit to DiegoTavares/OpenCue that referenced this pull request Dec 16, 2025
This PR introduces a new module called "scheduler." This module is
responsible for the booking aspect of Cuebot and is designed to offload
this feature from the central module.

Rationale: Cuebot's booking logic depends on responding to each
HostReport with a new task that searches for layers to dispatch to the
reporting host. Consequently, each request generates a
[BookingQuery](https://github.com/AcademySoftwareFoundation/OpenCue/blob/master/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java),
which significantly impacts the database. As a result, scaling Cuebot is
limited by the need to optimize database capacity to handle complex
queries. This new module alleviates the booking workload from Cuebot.

Booking on the Scheduler is not triggered by host reports; instead, it
operates through an internal loop that searches for pending jobs and
seeks suitable matches from a cached view of the hosts in the database.
The scheduler organizes layers and hosts into clusters, with each
cluster representing a group of show and allocation combinations. This
structure allows multiple instances of the scheduler to share the load
without competing for work, which is a significant issue in Cuebot.

To enable Cuebot and the Scheduler to run concurrently without competing
for work, a new feature was added to Cuebot, as detailed in
AcademySoftwareFoundation#2087. This
feature allows for the addition of an exclusion list containing show and
allocations that should not be booked, or it can halt booking for all
shows altogether.

---------

Signed-off-by: Diego Tavares <dtavares@imageworks.com>
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