Skip to content

Make submit check use same code as scheduling_algo to construct nodedb - #5119

Merged
JamesMurkin merged 3 commits into
masterfrom
improve_submitcheck
Aug 18, 2026
Merged

Make submit check use same code as scheduling_algo to construct nodedb#5119
JamesMurkin merged 3 commits into
masterfrom
improve_submitcheck

Conversation

@JamesMurkin

Copy link
Copy Markdown
Contributor

The submitcheck needs a nodedb to see if a job is considered schedulable by the scheduler

However currently it gets this nodedb in a bespoke way which is sub-optimal:

  • Builds a nodedb per executor (rather than per pool as the scheduler does)
  • Has to reconfigure the nodedb constantly, as different pools set different nodedb scheduling configs
  • Cannot check if some valid gangs are schedulable, submitcheck does not allow cross-cluster gangs but the scheduler does
  • We always need to remember any changes to building the nodedb for the scheduler also need to be applied to the submitcheck

Now we do away with these problems by:

  • Using the same code to build the nodedb in the submitcheck and the core scheduler
  • Create a nodedb per pool to match how the scheduler does it

This should keep the 2 paths more inline and reduce burden going forward

  • We should probably improve the current code path for instantiating a nodedb, but that is one for a separate PR

The submitcheck needs a nodedb to see if a job is considered schedulable by the scheduler

However currently it gets this nodedb in a bespoke way which is sub-optimal:
 - Builds a nodedb per executor (rather than per pool as the scheduler does)
 - Has to reconfigure the nodedb constantly, as different pools set different nodedb scheduling configs
 - Cannot check if some valid gangs are schedulable, submitcheck does not allow cross-cluster gangs  but the scheduler does
 - We always need to remember any changes to building the nodedb for the scheduler also need to be applied to the submitcheck

Now we do away with these problems by:
 - Using the same code to build the nodedb in the submitcheck and the core scheduler
 - Create a nodedb per pool to match how the scheduler does it

This should keep the 2 paths more inline and reduce burden going forward
 - We should probably improve the current code path for instantiating a nodedb, but that is one for a separate PR

Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>
@JamesMurkin
JamesMurkin marked this pull request as ready for review August 17, 2026 16:41
@datadog-armadaproject

datadog-armadaproject Bot commented Aug 17, 2026

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b3cf04a | Docs | Datadog PR Page | Give us feedback!

@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR consolidates NodeDb construction between submit checking and the scheduling algorithm and changes submit checking from per-executor to per-pool evaluation.

  • Extracts shared NodeDb index configuration and construction.
  • Builds submit-check NodeDbs from combined home- and away-pool nodes.
  • Adds coverage for gangs distributed across multiple executors.

Confidence Score: 5/5

The PR appears safe to merge because no eligible blocking failure or outstanding prior finding remains.

No blocking failure remains within the scope of this follow-up review.

Important Files Changed

Filename Overview
internal/scheduler/configuration/configuration.go Adds a PoolConfig helper exposing the enabled state of cross-pool-first preemption.
internal/scheduler/scheduling/scheduling_algo.go Extracts reusable NodeDb construction and moves scheduling-option configuration into that shared path.
internal/scheduler/submitcheck.go Replaces per-executor NodeDbs with per-pool NodeDbs combining home and configured away-pool nodes.
internal/scheduler/submitcheck_test.go Adds submit-check coverage for a gang whose members fit across multiple executors.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  E[Executor snapshots] --> N[Convert executor nodes]
  N --> G[Group nodes by pool]
  G --> H[Combine home and configured away-pool nodes]
  H --> C[Shared ConstructNodeDb]
  C --> D[Per-pool NodeDb]
  D --> S[Submit-check gang scheduling]
  C --> A[Core scheduling algorithm]
Loading

Reviews (3): Last reviewed commit: "Make ShouldPreemptCrossPoolJobsFirst fun..." | Re-trigger Greptile

Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>
Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>
@mergify

mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@JamesMurkin
JamesMurkin merged commit 90c96a7 into master Aug 18, 2026
27 of 29 checks passed
@JamesMurkin
JamesMurkin deleted the improve_submitcheck branch August 18, 2026 13:24
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