Skip to content

[Frontend] Runtime form: autoscaler block, inheritance and lossless edits - #61

Open
pallasathena92 wants to merge 7 commits into
yifeliu/service-formfrom
yifeliu/runtime-form
Open

pallasathena92 wants to merge 7 commits into
yifeliu/service-formfrom
yifeliu/runtime-form

Conversation

@pallasathena92

Copy link
Copy Markdown
Contributor

What this PR does

Plan Phase 1.2: the ServingRuntime / ClusterServingRuntime form follows the v1.3 API and edits are lossless.

  • Engine, decoder and router use the shared ComponentExtensionFields from [Frontend] Rebuild the deploy form for v1.3 with a YAML tab #58 (min/max replicas, autoscaler class, HPA CPU target, KEDA timing and triggers, autoscalerPolicyRef); ScalingConfig with the removed scaleTarget/scaleMetric is gone. MultiNodeConfig (leader/worker) stays; turning multi-node off clears leader/worker instead of submitting them unseen.
  • New spec.scalingPolicy section (mode from ScalingPolicyModeValues, proportional anchor and follower ratios, with the API doc comments as help); modelSizeRange validated as <number>[M|B|T] with an uppercase suffix (OME reads 4b as 0); ome.io/inherit-from as a select among the runtimes of the same scope (a ServingRuntime sees its namespace first, then the cluster runtimes it does not shadow; never itself); ome.io/runtime-profile as a toggle that forces disabled: true.
  • Create mode has a scope radio (ClusterServingRuntime, or ServingRuntime with a namespace select); edit and clone work for namespaced runtimes through ?namespace=; clone preselects the source's scope and strips server-managed metadata.
  • Lossless edit: the form resets with the whole stored object minus status, runtime-schema.ts is z.looseObject throughout, and buildRuntime lays only the form-owned fields over the stored spec, keeping resourceVersion, labels, env[].valueFrom, tolerations, probes, HPA behaviour and anything the form has no input for. Every submit runs the API server dry run first (422 causes through ErrorState); a "Validate (dry run)" button stops there.
  • Fixes found on the way: ModelFormatsSection writes modelFormat{name,version} and modelFramework{name,version} (the v1.3 CRD requires both; legacy name-only entries are mapped on load); VolumeForm wrote a volumeType field the API does not have and now writes the real volume sources; the router config map was bound to a string and is now a JSON map field; valueAsNumber inputs produced NaN and use the shared optionalNumber.
  • runtimesApi.create/update accept { dryRun: true }.

POST /runtimes and PUT /runtimes/:name ignore ?dryRun today, so a dry run of a ClusterServingRuntime would persist; the backend fix for that is a separate PR on top of #56. Stacked on #58.

Why we need it

The runtime form wrote removed fields, dropped most of a runtime's spec on edit, had no autoscaler, scaling policy, inheritance or profile support, and could not create or edit namespaced runtimes.

How to test

  • cd frontend && npm run typecheck && npm run lint && npm run format:check && npm run gen:types:check && npm test pass (95 tests; new: runtime-schema.test.ts, runtimeFormValues.test.ts, RuntimeForm.test.tsx covering the lossless edit round trip with a dry run first, a namespaced create with the autoscaler under engineConfig, 422 causes stopping the write, and form errors listed before any request).
  • Against a cluster: edit a runtime that has env[].valueFrom and labels and check kubectl diff shows no loss; create a ServingRuntime in a namespace; set ome.io/inherit-from and see the chain on the detail page ([Frontend] Render v1.3 status for services, runtimes and models #53).

Checklist

  • Tests added/updated (if applicable)
  • Docs updated (if applicable) — N/A
  • make test passes locally — frontend; backend untouched in this PR

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Team
  • Run ID: b2df3799-cb8d-4819-8234-39721672e302

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added frontend Frontend/UI changes tests Test changes labels Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Frontend/UI changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant