Kubeflow Pipelines experiment run pagination default pageSize ordering gap
0 reputation · 22 Oct 2020, 18:00 UTC
0 reputation · 22 Oct 2020, 18:00 UTC
Kubeflow Pipelines experiment run listing now enforces `pageToken`-bounded pagination for datasets exceeding 100 results, phasing out the default-unrestricted `pageSize` across compatible client versions.
However, the default `pageSize` provides no guaranteed ordering, which risks duplicate or missed runs during concurrent modifications.
Across Kubeflow sub-projects, pagination primitives are inconsistent: Katib trial listing, Notebook file browsing, and Pipelines run traversal each employ distinct token or offset strategies, preventing a unified dataset traversal approach.
No cursor-based pagination alternative is officially provided, forcing implementers to rely on offset arithmetic that degrades performance and reliability beyond 10,000 item datasets. What ordering mechanism, if any, does the `pageToken` enforce across consecutive `listRuns` calls? How do disparate Kubeflow sub-project pagination implementations differ in token lifecycle and result consistency? Is there a deployment‑specific `pageSize` maximum that should be verified before scaling traversal beyond 10,000 runs?
35275 reputation · 22 Oct 2020, 23:55 UTC
The pageToken in Kubeflow Pipelines ListRuns does not enforce ordering by itself. Ordering is controlled exclusively by the sort_by parameter (e.g., created_at desc). Without an explicit sort_by, the backend returns results in an undefined order, and concurrent run creation or deletion during traversal can produce duplicates or gaps across pages. The token merely encodes the server-side query position for that specific sort_by + filter combination at the moment the token was issued.
pageToken is an opaque continuation token bound to the exact query snapshot (sort order, filter, page size) that produced it. It expires if the backend state changes significantly (e.g., index rebuild, cluster restart) or after an implementation-dependent TTL. Long pauses between requests risk token invalidation.sort_by, consecutive calls using the returned pageToken yield a stable, non-overlapping sequence for that snapshot. New runs inserted before the current cursor position in the sort order will not appear in subsequent pages; runs inserted after will appear. Deleted runs simply vanish.| Sub-project | Pagination Style | Token / Offset Semantics | Ordering Guarantee |
|---|---|---|---|
KFP Pipelines (ListRuns) | Token-based (page_token, page_size) | Opaque token bound to query snapshot | Only with explicit sort_by |
Katib (ListTrials) | Offset/limit (page_number, page_size) in v1beta1; token-based in newer versions | Offset is stateless but shifts on inserts/deletes | Requires sort_by for stability |
| Notebook Controller (file browsing) | Typically no server-side pagination; client-side slicing of full directory listing | N/A | Filesystem-dependent (usually lexicographic) |
There is no unified pagination primitive across Kubeflow. Katib has migrated toward token-based pagination in recent releases, but the token format and lifecycle differ from KFP. Notebook file browsing generally lacks server-side pagination entirely.
pageSize MaximumNo universal maximum exists in the KFP API specification. The effective limit is determined by:
Assuming a page size larger than ~1000 without verification is unsafe. Silent truncation or 413 Payload Too Large / ResourceExhausted errors are common when the limit is exceeded.
kubectl -n kubeflow port-forward svc/ml-pipeline 8888:8888 then curl localhost:8888/apis/v2beta1/openapi.json | jq '.paths."/apis/v2beta1/runs".get.parameters[] | select(.name=="page_size")' — look for maximum or x-kubernetes-max-items.curl -G "$ENDPOINT/apis/v2beta1/runs" --data-urlencode "page_size=5000" --data-urlencode "sort_by=created_at desc" -H "Authorization: Bearer $(kubectl -n kubeflow get secret ml-pipeline-token -o jsonpath='{.data.token}' | base64 -d)" — observe whether the response caps total_size, returns an error, or honors the request.ListRuns calls with the same sort_by and the first call's next_page_token; verify that run IDs are strictly monotonic per the sort order and that no ID appears twice.Which KFP backend version (or Kubeflow distribution + version) is deployed? The token encoding and default limits changed between v1 (Argo-based) and v2 (KFP-native) backends, and some managed services (Vertex AI Pipelines, AWS SageMaker Pipelines) impose their own caps.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.