Skip to content

Conversation

@mkosiba
Copy link
Contributor

@mkosiba mkosiba commented Nov 21, 2025

No description provided.

Martin Kosiba added 2 commits November 20, 2025 15:45
This allows an external service to act as a plugin to the scheduler's
action routing mechanism.
@aspect-workflows
Copy link

aspect-workflows bot commented Nov 21, 2025

Test

1 test target passed

Targets
//pkg/scheduler/routing:routing_test [k8-fastbuild]                 140ms

Total test execution time was 140ms. 18 tests (94.7%) were fully cached saving 2s.

Copy link
Contributor

@moroten moroten left a comment

Choose a reason for hiding this comment

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

Very nice idea! As the remote action routing is a blocking call, actions can potentially be stuck in the state of getting routed. Do we need another Prometheus histogram for how long actions are in the routing state?

@mkosiba mkosiba marked this pull request as ready for review December 3, 2025 12:44
Copy link
Contributor Author

@mkosiba mkosiba left a comment

Choose a reason for hiding this comment

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

ok, I think I addressed all of the review feedback with the exception of adding the scope field.

I implemented a simple service that uses this protocol and good news is that even if the remote action router takes minutes, Bazel doesn't time out and fail the build, so I think this is OK as a starting point.

},
[]string{"instance_name_prefix", "platform", "size_class", "outcome"})

inMemoryBuildQueueRequestRoutingDuration = prometheus.NewHistogramVec(
Copy link
Member

Choose a reason for hiding this comment

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

Do we really think that adding this metric is necessary? Doesn't grpc_client_handled_... already provide this information?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I plan on having a separate set of metrics on the remote action, so I'm ok to not to have a separate one.

@moroten, you ok with that?

Copy link
Member

Choose a reason for hiding this comment

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

Other action router implementations tend to be so primitive that they don't contribute to the execution times in a meaningful way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Grpc client metrics should be fine.

Copy link
Member

@EdSchouten EdSchouten left a comment

Choose a reason for hiding this comment

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

Looking good! Just some small remaining remarks, and this is good to merge.

},
[]string{"instance_name_prefix", "platform", "size_class", "outcome"})

inMemoryBuildQueueRequestRoutingDuration = prometheus.NewHistogramVec(
Copy link
Member

Choose a reason for hiding this comment

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

Other action router implementations tend to be so primitive that they don't contribute to the execution times in a meaningful way.

@EdSchouten EdSchouten merged commit babfe8f into buildbarn:main Dec 8, 2025
3 checks passed
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.

3 participants