← 输入框|github.com|刷新
Skip to content

[pipeline-manager] Check pipeline storage limits in the api-server - #7712

Merged
xiasongh merged 2 commits into
mainfrom
song/api-storage-validation
Oct 30, 2026
Merged

xiasongh merged 2 commits into
mainfrom
song/api-storage-validation

Conversation

@xiasongh

Copy link
Copy Markdown
Contributor

The API accepted a runtime_config with a storage class, volume attributes class, or storage size that the Kubernetes runner refuses, and the next start failed (for example "Volume attributes class iops-4000 is not supported").

POST, PUT, and PATCH now return 400 InvalidRuntimeConfig for:

Field Limit
resources.storage_class --enable-storage-classes-allowlist, --storage-classes
resources.volume_attributes_class (empty is unset) --enable-volume-attributes-classes-allowlist, --volume-attributes-classes
resources.storage_min, resources.storage_max --upper-limit-storage-megabyte
storage_min > storage_max always

The flags take the same values as the runner; the Helm chart passes them in feldera/cloud. Without them, only storage_min > storage_max is refused. Stored configs still load: only request bodies are checked.

Commits:

  1. Add the api-server flags. Nothing reads them.
  2. Check requests against them. Tests, docs, and changelog.

Not in this PR: PATCH deployment_config (#7656). Whichever PR merges second calls ApiServerConfig::check_storage there.

Tests: check_storage_refuses_what_the_runner_refuses and runtime_config_storage_requests. Each check and each handler call, disabled on its own, fails them.

@xiasongh
xiasongh force-pushed the song/api-storage-validation branch from 32dc194 to 451b7da Compare October 29, 2026 18:57
@xiasongh
xiasongh marked this pull request as ready for review October 30, 2026 10:53
@xiasongh
xiasongh requested a review from gz October 30, 2026 10:53
@xiasongh xiasongh changed the title [pipeline-manager] Refuse runtime_config storage that the runner refuses [pipeline-manager] Check pipeline storage settings against the runner's limits Oct 30, 2026
@xiasongh xiasongh changed the title [pipeline-manager] Check pipeline storage settings against the runner's limits [pipeline-manager] Check pipeline storage limits in the api-server Oct 30, 2026
--enable-storage-classes-allowlist, --storage-classes,
--enable-volume-attributes-classes-allowlist, --volume-attributes-classes,
and --upper-limit-storage-megabyte take the same values as the Kubernetes
runner. Nothing reads them yet.
POST, PUT, and PATCH return 400 InvalidRuntimeConfig for a storage class,
volume attributes class, or storage size outside the limits that the
api-server shares with the runner, and for storage_min above storage_max.
Before, the next start failed. Stored configs still load.
@xiasongh
xiasongh force-pushed the song/api-storage-validation branch from 451b7da to 5aeda0d Compare October 30, 2026 11:06
}

/// Refuses a `runtime_config` with storage that the runner refuses at start, so that it fails
/// now instead of at the next start. Only new values are checked: stored ones still load.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pitfall (medium): The comment says "Only new values are checked", but the request body is checked whether or not it changed. I tested this: after the limits are set, PUT /pipelines/old with only program_code changed and the same stored runtime_config (storage_class: io2) returns 400. The Python SDK's create_or_replace and other PUT-everything clients therefore can't edit the program of such a pipeline. Either skip the check when runtime_config matches the stored value, or fix the comment and docs and add this case to runtime_config_storage_requests.

"resources.{field} ({amount}) is more than the maximum of {upper_limit}M on this installation. Lower it, or ask an administrator to raise kubernetesRunner.upperLimitStorageMegabyte."
));
}
if let Some(class) = &resources.storage_class

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pitfall (medium): An empty volume_attributes_class counts as unset, but an empty storage_class does not. I tested it: {"storage_class": ""} with the allowlist on returns 400 '' is not allowed. If the runner also treats an empty storage class as unset, this refuses something the runner accepts. Please check against the runner and add a test for "" either way.

@mythical-fred-oss

Copy link
Copy Markdown
Contributor

What I ran

Check Result
cargo test --locked -p pipeline-manager --lib -- check_storage runtime_config_storage ✅ 2 passed
pre-commit run on the changed files (clippy, fmt, machete, OpenAPI, docs) ✅ passed
Extra case: re-PUT of an unchanged stored storage_class: io2 with only the program edited returns 400 (see inline comment)
Extra case: storage_class: "" with the allowlist on returns 400, while an empty volume_attributes_class is accepted (see inline comment)

Gates: tests, docs, changelog and actionable error messages are all in place. There is no unsafe, no new dependency and no CI change.

Missing tests (medium):

  • A re-PUT or full PATCH of an unchanged stored config, plus a decision on whether it should pass.
  • An empty storage_class.
  • A PUT or PATCH on a running pipeline with a refused value. The new 400 now comes before the "update restricted to stopped" error, so the user sees the storage error first.

Pitfall (medium): The parity with the Kubernetes runner can't be checked in this repo, so the tests only check that the api-server matches itself. Please confirm in the PR description that the MB units (10^6 bytes, the upper_limit as u64 cast) and the empty-name handling match the runner.

Breaking (low, documented): storage_min > storage_max is now refused on every installation, including OSS. It is in the changelog, so this is fine.

@xiasongh
xiasongh added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 9c79856 Oct 30, 2026
1 check passed
@xiasongh
xiasongh deleted the song/api-storage-validation branch October 30, 2026 23:36
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