Skip to content

Commit 802a806

Browse files
committed
updated README and high level diagram
Signed-off-by: Nir Rozenbaum <[email protected]>
1 parent 9991808 commit 802a806

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

docs/proposals/0845-scheduler-architecture-proposal/README.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,22 @@ The Scheduling Subsystem is a framework used to implement scheduling algorithms.
1414
- The entry & exit points should be defined by the framework, acting as the API surface of the system
1515
- Multiple scheduling 'profiles' should be able to be ran for a single request.
1616
- They can be conditionally dependent on previous runs, or in parallel
17-
- Plugin state is managed by the plugin itself
17+
- State management
18+
- State per request: This is managed by what we are calling CycleState and its lifecycle is tied to the request.
19+
Cycle state is created internally by the Scheduler per request and its pointer is passed as argument.
20+
- State managed by the plugin struct itself: The lifecycle of this state is tied to the plugin, and since plugins will be instantiated once,
21+
it is a state that plugins can use across requests (like prefix-cache index).
22+
- State managed by the data layer: each endpoint will be associated with state (currently metrics) that a data layer plugin can add to it.
23+
A data layer plugin could be one that scrapes v1/models from the endpoint for example.
1824

1925
## Definitions
2026
- **Scheduling Framework** - The system created to allow for a pluggable scheduling algorithm.
21-
- **Scheduling Profile** - A named, specific set of Filter(s), Scorer(s), & Picker used to select endpoints.
22-
- **Scheduler** - An extensible implementation of a scheduling algorithm. Including logic to select Scheduling Profiles, the Scheduling Profiles themselves, & logic to interpret the result.
23-
- **Scheduling Cycle** - A single run of a Scheduler through the Scheduling Framework.
27+
- **Scheduler Profile** - A named, specific set of Filter(s), Scorer(s), & Picker used to select endpoints.
28+
- **Scheduler Profile Run** - a one time run of the Scheduler Profile filters, scorers and picker given a request.
29+
- **Scheduler** - An extensible implementation of a scheduling algorithm. Including logic to select Scheduler Profiles iteratively,
30+
the Scheduler Profiles themselves, & logic to interpret the result.
31+
- **Scheduling Cycle** - A single run of a Scheduler through the Scheduling Framework. a scheduling cycle includes one or
32+
more Scheduler Profile runs (at least one).
2433
- **Plugin** - Implementation of framework-defined interface(s) to add or extend logic across the framework.
2534

2635
## Proposal
@@ -33,23 +42,24 @@ The Scheduling System can loosely be defined into 3 sections:
3342
- A *configuration API* to define the Scheduler, Profile(s), & the plugins used within those profiles
3443

3544
A sketch of the System, with extension points is here:
36-
<img src="./images/scheduler_subsystem.svg" alt="Scheduling Algorithm" width="1000" />
45+
<img src="./images/scheduler_cycle.png" alt="Scheduling Algorithm" width="1000" />
3746

3847
Describing the interface extension points & flow is the simplest way to convey the intent of what the framework should enable:
3948

40-
### PreSchedule
49+
### ProfileSelect (or ProfilePick)
4150

42-
PreSchedule is the entry point into the scheduling cycle (called by the framework). PreSchedule, selects profiles conditionally based on:
51+
ProfilePick is the entry point into the scheduling cycle (called by the framework).
52+
ProfileSelect, selects profiles conditionally based on:
4353

4454
- Request data
45-
- Results
55+
- Results of previously executed SchedulerProfiles
4656
- Cycle State
4757

48-
PreSchedule will be continuously called so long as profiles are returned; multiple profiles may be returned in a single call. Only a single PreSchedule function may be defined per scheduler.
58+
ProfileSelect will be continuously called so long as profiles are returned; multiple profiles may be returned in a single call. Only a single ProfileSelect function may be defined per scheduler.
4959

50-
### Profile Cycle
60+
### Scheduler Profile Run
5161

52-
The profile cycle consists of 3 defined functions `Filter`, `Score`, & `Pick`
62+
The SchedulerPprofile run consists of 3 defined phases `Filter`, `Score`, & `Pick`
5363

5464
*Profile Constraints*
5565
- A profile can have any number of `Filter` plugins registered (including zero)
@@ -61,16 +71,16 @@ The profile cycle consists of 3 defined functions `Filter`, `Score`, & `Pick`
6171
Filter runs before any scoring, and remove endpoints that are not fit for selection. The framework will return an error to the client if the endpoints are filtered to zero.
6272

6373
#### Score
64-
Score applies a score to each remaining endpoint provided. Scorers SHOULD keep their score values in a normalized range: [0-1]. Any weighting should be added at the SchedulingProfile configuration level.
74+
Score applies a score to each remaining endpoint provided. Scorers SHOULD keep their score values in a normalized range: [0-1]. Any weighting should be added at the SchedulerProfile configuration level.
6575

6676
#### Pick
6777
Picker selects the endpoint(s) from the provided list of scored endpoints. Picker MUST return, one endpoint at minimum.
6878

6979

70-
### PostSchedule
71-
PostSchedule receives the output of the result(s) of the scheduling cycle(s) and makes sense of the data to be consumed by the calling system.
80+
### ProcessProfilesResults
81+
ProcessProfilesResults recieves the output of the result(s) of the scheduler profile(s) and makes sense of the data to be consumed by the calling system.
7282

73-
### PostResponse
83+
### PostResponse (Out of Scheduler and mentioned here for completeness only)
7484
PostResponse is a special case extension that can optionally be implemented by a plugin that needs to augment its state based on response or request data. This should only be implemented for plugins that need to update state outside of the scheduling cycle. PostResponse is ran at the time of processing a response.
7585

7686
## ConfigurationAPI
181 KB
Loading

0 commit comments

Comments
 (0)