Repository navigation
[pipeline-manager] Check pipeline storage limits in the api-server - #7712
Conversation
32dc194 to
451b7da
Compare
--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.
451b7da to
5aeda0d
Compare
| } | ||
|
|
||
| /// 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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
|
What I ran
Gates: tests, docs, changelog and actionable error messages are all in place. There is no Missing tests (medium):
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 Breaking (low, documented): |
The API accepted a
runtime_configwith 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
InvalidRuntimeConfigfor:resources.storage_class--enable-storage-classes-allowlist,--storage-classesresources.volume_attributes_class(empty is unset)--enable-volume-attributes-classes-allowlist,--volume-attributes-classesresources.storage_min,resources.storage_max--upper-limit-storage-megabytestorage_min>storage_maxThe flags take the same values as the runner; the Helm chart passes them in feldera/cloud. Without them, only
storage_min>storage_maxis refused. Stored configs still load: only request bodies are checked.Commits:
Not in this PR: PATCH
deployment_config(#7656). Whichever PR merges second callsApiServerConfig::check_storagethere.Tests:
check_storage_refuses_what_the_runner_refusesandruntime_config_storage_requests. Each check and each handler call, disabled on its own, fails them.