feat(datalayer): extend file-discovery to support cluster endpoints#1927
feat(datalayer): extend file-discovery to support cluster endpoints#1927liavweiss wants to merge 1 commit into
Conversation
fa14ebc to
e487397
Compare
|
/assign @ezrasilvera |
e487397 to
b465ebb
Compare
|
Thank you for the PR, overall, it looks good. I added a few comments inside. |
|
Please go over the README and update it according to your proposed changes. Few examples: This is not true anymore, hostnames are allowed now. Two more lines in the same file are also out of date:
|
|
nit: (for the future) The address/port checks are inline in the file plugin. When we add more discovery plugins, it may be better to move this into a shared helper so all plugins use the same rules (including the metricsPort check from comment inside). |
b465ebb to
4f32612
Compare
|
Thank you @ezrasilvera, I made the necessary changes. |
4f32612 to
1e6439e
Compare
elevran
left a comment
There was a problem hiding this comment.
Trying to get a high leve read on the goal first.
I believe this PR lays the ground work for treating remote cluster EPPs as endpoints for scheduling.
Not sure the end-to-end flow for this has been considered. The current file plugin populates "Pods" from a file instead of a k8s reconciler. They both feed into the same data store Endpoint abstraction. From the point of ingestion and onwards, file-discovery endpoints and pod-reconciler endpoints land in the exact same ds.pods map/fwkdl.Endpoint abstraction, and nothing downstream (scheduler, scorers, metrics collector) distinguishes "came from file" vs "came from a real Pod" except via the fields on EndpointMetadata itself (PodName, Address, MetricsHost).
My concern is that the use of hostname and metrics ports could potentially break that assumption.
|
|
||
| When `address` is an IPv4, the endpoint is treated as a pod (`PodName` is set | ||
| to the entry name). When `address` is a hostname, the endpoint is treated as a | ||
| cluster (`PodName` is empty), enabling multi-cluster hub mode. |
There was a problem hiding this comment.
Q: how is the podName fields used? What's the downside of setting it non-empty?
There was a problem hiding this comment.
PodName is used in three places:
datastore.PodDelete()- matches endpoints by PodName to delete them on pod lifecycle events. If we set PodName non-empty for cluster entries, a pod deletion event with a coincidentally matching name would accidentally remove a cluster endpoint from the datastore.metrics.go- used as a Prometheus label on schedulerAttemptsTotal. Blank means the label is empty for cluster entries, which is cosmetic.mmcacheaffinityscorer - used for debug logging only.
Setting it empty is intentional: it prevents PodDelete from accidentally matching cluster endpoints, and it's semantically correct since these entries represent clusters, not pods.
There was a problem hiding this comment.
IIUC, PodDelete is called from the reconciler and the EPP enables only one endpoint discovery mechanism at a time - either file based or k8s reconcilation, but not both.
| port: "8000" | ||
| ``` | ||
|
|
||
| A cluster endpoints file for multi-cluster hub mode: |
There was a problem hiding this comment.
nit: is multicluster the only mode where hostnames are used?
| A cluster endpoints file for multi-cluster hub mode: | |
| A cluster endpoints file with host names instead of IP addresses: |
| address: <IPv4> # required -- must be a valid IPv4 address | ||
| address: <string> # required -- IPv4 address or RFC 1123 hostname | ||
| port: <string> # required -- integer 1-65535 as a string | ||
| metricsPort: <string> # optional -- metrics scrape port (defaults to port) |
There was a problem hiding this comment.
is this value reflected into the datalayer's metrics collection?
An alternative path might be to define a new data source to scrape remote endpoints by providing a label/tag with the hostname:port.
I think that the current endpoints assume an inference server and you are scraping remote clusters (EPPs, I presume?), so the use of the current metrics data source and extractors seem at odds with your design/goal.
There was a problem hiding this comment.
Yes, metricsPort feeds into MetricsHost which the metrics scraper uses to connect. You're right that the current core-metrics-extractor assumes vLLM-format metrics - that's why a spoke-epp engine type is being added in PR #1928 to handle the different metric format from spoke EPPs. This PR only adds discovery support; it intentionally does not modify the metrics extraction logic.
There was a problem hiding this comment.
Thanks for confirming.
I would prefer we don't overload the engine type for this but instead define a new Extractor for EPP metrics (which are not the same as inference engine metrics). You are essentially extracting different metrics from different objects for slightly different use cases and the overload can be confusing (e.g., introduce logic into existing components to separate server and cluster instead of just creating a different extractor for cluster).
Left comments on #1928 with more detail.
There was a problem hiding this comment.
I agree with @elevran , les put the extra effort in here to make this feel more native and idiomatic.
|
Additional notes
Overall, I would recommend considering which data sources and plugins would be useful for the cross cluster case and validate if they carry no IP address or other assumptions that are violated by the use case's input. Either conform to the assumptions or create cross-cluster variants of the relevant plugins to prevent unexpected failures from broken assumptions, cc: @vMaroon @hexfusion |
Correct - plugins like Agreed that integration testing is needed. This PR only changes what gets stored in the datastore at ingest - the actual scraping behavior is unchanged. Full integration testing of the hub-mode scrape flow will be done in a follow-up PR after this one and #1928 are merged, since #1928 is the first PR that actually uses hostname+metricsPort for scraping. |
1e6439e to
b07e014
Compare
Signed-off-by: Liav Weiss <lweiss@redhat.com>
b07e014 to
39d2cbe
Compare
|
Hi @elevran , to address your concern about relying on empty |
what about an endpint "type" attribute that is set, instead of a label? The file plugin can set it on creation. I would prefer we give cluster endpoints a name (even if not a pod name). |
I am picking this up, hope this helps |
|
Ok, I'll wait for #2147 to merge, then rebase and adapt my PR to focus on the hostname acceptance and metricsPort support |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Extends the
file-discoveryplugin to accept hostname addresses (not just IPv4), enabling multi-cluster hub mode where entire clusters are treated as endpoints.Changes:
validation.IsDNS1123Subdomainfromk8s.io/apimachineryPodName = ""for hostname-based entries (cluster endpoints), preservingPodName = e.Namefor IPv4 entries (pod endpoints)metricsPortfield toEndpointEntryso the metrics scrape port can differ from the traffic port (needed when the spoke EPP metrics endpoint is on a separate port from the spoke gateway)Hub-mode YAML example:
Which issue(s) this PR fixes:
Fixes #1903
Note:
The
metricsPortfield is optional and backward compatible. When omitted,MetricsHostdefaults toAddress:Port(existing behavior). When set,MetricsHostusesAddress:metricsPort, allowing the hub EPP to scrape spoke EPP metrics on a different port than the traffic gateway port. This complements #1858 (mTLS scraper) and #1919 (mTLS metrics server).