Add Slate-aware config generation#355
Conversation
PR Validation PassedPR description validation passed |
WalkthroughAdds a new boolean field Changes
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/EditInferflowConfigModal.jsx (1)
254-256:⚠️ Potential issue | 🟠 MajorUse lowercase
inferflowin the deployable lookup.This request still sends
service_name=InferFlow. If the discovery filter is case-sensitive, the host list comes back empty and operators cannot pick an Inferflow host.Suggested fix
- `${URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL}/api/v1/horizon/deployable-discovery/deployables?service_name=InferFlow`, + `${URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL}/api/v1/horizon/deployable-discovery/deployables?service_name=inferflow`,Based on learnings: Within the BharatMLStack horizon codebase, ensure that service names (inferflow, predator, numerix) are stored in lowercase in database tables and are consistently used in lowercase throughout the code.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/EditInferflowConfigModal.jsx` around lines 254 - 256, The request building in EditInferflowConfigModal.jsx uses a capitalized service_name parameter ("InferFlow") which can cause empty results if the discovery filter is case-sensitive; update the axios.get call that constructs the URL (the template string invoking URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL and path /api/v1/horizon/deployable-discovery/deployables) to use service_name=inferflow (lowercase) instead, and search the component for any other occurrences of "InferFlow" to replace with lowercase "inferflow" for consistency with the horizon DB naming convention.trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/OnboardInferflowConfigModal.jsx (1)
177-179:⚠️ Potential issue | 🟠 MajorUse lowercase
inferflowfor host discovery.This lookup is still filtering deployables with
service_name=InferFlow. If the backend expects normalized lowercase service names, onboarding will fail to populate the host dropdown.Suggested fix
- `${URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL}/api/v1/horizon/deployable-discovery/deployables?service_name=InferFlow`, + `${URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL}/api/v1/horizon/deployable-discovery/deployables?service_name=inferflow`,Based on learnings: Within the BharatMLStack horizon codebase, ensure that service names (inferflow, predator, numerix) are stored in lowercase in database tables and are consistently used in lowercase throughout the code.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/OnboardInferflowConfigModal.jsx` around lines 177 - 179, The host discovery request filters by service name using a capitalized value; update the axios GET call in OnboardInferflowConfigModal.jsx (the request that builds the URL via URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL and calls axios.get) to use the normalized lowercase service name "inferflow" for the service_name query parameter (or derive the value via .toLowerCase() from any variable used) so the backend matches stored lowercase service names; also sweep other deployable/service_name usages in this component to ensure they consistently use lowercase.trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/CloneInferflowConfigModal.jsx (1)
247-249:⚠️ Potential issue | 🟠 MajorQuery deployables with lowercase
inferflow.The clone modal uses
service_name=InferFlowhere as well. If the filter is case-sensitive, cloned configs won't be able to resolve available Inferflow hosts.Suggested fix
- `${URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL}/api/v1/horizon/deployable-discovery/deployables?service_name=InferFlow`, + `${URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL}/api/v1/horizon/deployable-discovery/deployables?service_name=inferflow`,Based on learnings: Within the BharatMLStack horizon codebase, ensure that service names (inferflow, predator, numerix) are stored in lowercase in database tables and are consistently used in lowercase throughout the code.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/CloneInferflowConfigModal.jsx` around lines 247 - 249, The query in CloneInferflowConfigModal uses service_name=InferFlow which can fail if the Horizon API is case-sensitive; update the axios.get call that builds the URL (the code using URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL and axios.get) to use a lowercase service_name value ("inferflow") and audit any other uses of "InferFlow" in this component (or nearby functions) to consistently pass "inferflow" so database/API filters match canonical lowercase service names.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In
`@trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/CloneInferflowConfigModal.jsx`:
- Around line 247-249: The query in CloneInferflowConfigModal uses
service_name=InferFlow which can fail if the Horizon API is case-sensitive;
update the axios.get call that builds the URL (the code using
URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL and axios.get) to use a lowercase
service_name value ("inferflow") and audit any other uses of "InferFlow" in this
component (or nearby functions) to consistently pass "inferflow" so database/API
filters match canonical lowercase service names.
In
`@trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/EditInferflowConfigModal.jsx`:
- Around line 254-256: The request building in EditInferflowConfigModal.jsx uses
a capitalized service_name parameter ("InferFlow") which can cause empty results
if the discovery filter is case-sensitive; update the axios.get call that
constructs the URL (the template string invoking
URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL and path
/api/v1/horizon/deployable-discovery/deployables) to use service_name=inferflow
(lowercase) instead, and search the component for any other occurrences of
"InferFlow" to replace with lowercase "inferflow" for consistency with the
horizon DB naming convention.
In
`@trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/OnboardInferflowConfigModal.jsx`:
- Around line 177-179: The host discovery request filters by service name using
a capitalized value; update the axios GET call in
OnboardInferflowConfigModal.jsx (the request that builds the URL via
URL_CONSTANTS.REACT_APP_HORIZON_BASE_URL and calls axios.get) to use the
normalized lowercase service name "inferflow" for the service_name query
parameter (or derive the value via .toLowerCase() from any variable used) so the
backend matches stored lowercase service names; also sweep other
deployable/service_name usages in this component to ensure they consistently use
lowercase.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 000df829-eccb-4437-a927-9c618ce072aa
📒 Files selected for processing (10)
horizon/internal/inferflow/etcd/models.gohorizon/internal/inferflow/handler/adaptor.gohorizon/internal/inferflow/handler/config_builder.gohorizon/internal/inferflow/handler/models.gohorizon/internal/repositories/sql/inferflow/models.gohorizon/pkg/configschemaclient/types.gotrufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/CloneInferflowConfigModal.jsxtrufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/EditInferflowConfigModal.jsxtrufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/InferflowConfigForm.jsxtrufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/OnboardInferflowConfigModal.jsx
There was a problem hiding this comment.
🧹 Nitpick comments (1)
trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/OnboardInferflowConfigModal.jsx (1)
33-40: Extract default ranker/re-ranker factories to avoid schema drift.These shapes now need to stay in sync across the initial state and the add handlers. Centralizing them in small factory helpers will make the next payload-field change much harder to miss.
Proposed refactor
+ const createEmptyRanker = () => ({ + model_name: '', + end_point: '', + calibration: '', + batch_size: '', + deadline: '110', + entity_id: [], + slate_component: false, + inputs: [{ + name: '', + features: [], + data_type: '', + dims: '' + }], + outputs: [{ + name: '', + data_type: '', + model_scores_dims: '', + model_scores: [] + }] + }); + + const createEmptyReRanker = () => ({ + eq_variables: {}, + score: '', + data_type: 'DataTypeFP32', + eq_id: '', + entity_id: [], + slate_component: false + }); + const [formData, setFormData] = useState({ real_estate: '', tenant: '', config_identifier: '', - rankers: [{ - model_name: '', - end_point: '', - calibration: '', - batch_size: '', - deadline: '110', - entity_id: [], - slate_component: false, - inputs: [{ - name: '', - features: [], - data_type: '', - dims: '' - }], - outputs: [{ - name: '', - data_type: '', - model_scores_dims: '', - model_scores: [] - }] - }], + rankers: [createEmptyRanker()], re_rankers: [], response: { prism_logging_perc: 1, @@ const addRanker = () => { const newIndex = formData.rankers.length; setFormData(prev => ({ ...prev, - rankers: [...prev.rankers, { - model_name: '', - end_point: '', - calibration: '', - batch_size: '', - deadline: '110', - entity_id: [], - slate_component: false, - inputs: [{ - name: '', - features: [], - data_type: '', - dims: '' - }], - outputs: [{ - name: '', - data_type: '', - model_scores_dims: '', - model_scores: [] - }] - }] + rankers: [...prev.rankers, createEmptyRanker()] })); @@ const addReRanker = () => { const newIndex = formData.re_rankers.length; setFormData(prev => ({ ...prev, - re_rankers: [...prev.re_rankers, { - eq_variables: {}, - score: '', - data_type: 'DataTypeFP32', - eq_id: '', - entity_id: [], - slate_component: false - }] + re_rankers: [...prev.re_rankers, createEmptyReRanker()] }));Also applies to: 431-438, 472-478
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/OnboardInferflowConfigModal.jsx` around lines 33 - 40, The ranker/re-ranker default object literal used in the component state and add handlers (the rankers array with keys model_name, end_point, calibration, batch_size, deadline, entity_id, slate_component) should be centralized into small factory helpers (e.g., createDefaultRanker(), createDefaultReranker()) and imported/used wherever the initial state and the add-item handlers reference those shapes (including the add handlers around the existing blocks at ~lines 431-438 and 472-478) so the schema is defined in one place and both the initial rankers in OnboardInferflowConfigModal and the functions that push new items use the same factory to avoid drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/OnboardInferflowConfigModal.jsx`:
- Around line 33-40: The ranker/re-ranker default object literal used in the
component state and add handlers (the rankers array with keys model_name,
end_point, calibration, batch_size, deadline, entity_id, slate_component) should
be centralized into small factory helpers (e.g., createDefaultRanker(),
createDefaultReranker()) and imported/used wherever the initial state and the
add-item handlers reference those shapes (including the add handlers around the
existing blocks at ~lines 431-438 and 472-478) so the schema is defined in one
place and both the initial rankers in OnboardInferflowConfigModal and the
functions that push new items use the same factory to avoid drift.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c19f7d3c-cb67-4ef0-ae72-8f74feaa44fd
📒 Files selected for processing (3)
trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/CloneInferflowConfigModal.jsxtrufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/EditInferflowConfigModal.jsxtrufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/OnboardInferflowConfigModal.jsx
🚧 Files skipped from review as they are similar to previous changes (2)
- trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/CloneInferflowConfigModal.jsx
- trufflebox-ui/src/pages/InferFlow/DiscoveryRegistry/InferflowRegistry/EditInferflowConfigModal.jsx
What type of PR is this?
Description
🔁 Pull Request Template – BharatMLStack
Context:
Inferflow already supports a slate_component boolean on PredatorComponentConfig and NumerixComponentConfig that controls whether a component operates at the target level (individual items) or slate level (grouped items). However, Horizon's config onboarding flow had no awareness of this field — it was missing from every layer (UI, API structs, config builder, DB models, etcd models, adaptors, and shared schema client), causing it to always default to false and making it impossible to onboard slate-aware components through Horizon.
Describe your changes:
Added the slate_component boolean field across all layers of Horizon's Inferflow config onboarding pipeline, React UI (toggle switches in Onboard, Edit, and Clone modals), handler request structs (Ranker, ReRanker, PredatorComponent, NumerixComponent), config builder (GetPredatorComponents, GetNumerixComponents), SQL DB models, etcd models, all 8 adaptor functions, and the shared configschemaclient types, ensuring the flag is correctly propagated end-to-end from user input to the final etcd config that Inferflow consumes. No DB or etcd migration is needed since configs are stored as JSON and the missing field defaults to false.
Horizon (backend)
SlateComponent booltoRanker,ReRanker,NumerixComponent, and Predator-related structs in:horizon/internal/inferflow/handler/models.gohorizon/internal/inferflow/etcd/models.gohorizon/internal/repositories/sql/inferflow/models.gohorizon/pkg/configschemaclient/types.go(NumerixComponent, PredatorComponent)SlateComponentin:horizon/internal/inferflow/handler/adaptor.go(when mapping to config schema client types)horizon/internal/inferflow/handler/config_builder.go(when building config from DB/etcd)Trufflebox UI (frontend)
ranker.slate_componentandreRanker.slate_componentand included in submit payloads.slate_component: falsefor rankers and re-rankers when initializing or transforming payloads so existing flows remain unchanged and new configs can opt in to slate component.Checklist before requesting a review
📂 Modules Affected
horizon(Real-time systems / networking)online-feature-store(Feature serving infra)trufflebox-ui(Admin panel / UI)infra(Docker, CI/CD, GCP/AWS setup)docs(Documentation updates)___________✅ Type of Change
___________📊 Benchmark / Metrics (if applicable)
Key Requirement Doc
Pod Type:
Why KRD is not required?
KRD is not required for this change
Added Tests
If yes, what is the strategy?
Summary by CodeRabbit
Release Notes
New Features
Updates