-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[ML] Inference endpoints UI serverless: Enables adaptive allocations and allow user to set max allocations #222726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alvarezmelissa87
merged 25 commits into
elastic:main
from
alvarezmelissa87:ml-inference-endpoints-remove-allocations-fields
Jun 27, 2025
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d143501
add ability to hide internal specified fields
alvarezmelissa87 ee4c273
ensure fields are in config but hidden in UI
alvarezmelissa87 0971e5b
add helptext callout for max allocations
alvarezmelissa87 757c886
always enable adaptive allocations for elasticsearch service on serve…
alvarezmelissa87 33cb73e
ensure AiConnector shows changes for es service on serverless
alvarezmelissa87 12d2156
[CI] Auto-commit changed files from 'node scripts/styled_components_m…
kibanamachine 30c35bf
implement final design for max allocations
alvarezmelissa87 ff20071
Merge branch 'main' into ml-inference-endpoints-remove-allocations-fi…
elasticmachine 8b4f714
remove unused file
alvarezmelissa87 43a6ef2
remove serverless from connector context and pass as prop
alvarezmelissa87 508f511
ensure number field min is 0 and fix type
alvarezmelissa87 e62853c
Merge branch 'main' into ml-inference-endpoints-remove-allocations-fi…
elasticmachine ebff5bc
update isServerless naming. Add titular component registry
alvarezmelissa87 6b7b65e
ensure updates apply to index management endpoint flyout
alvarezmelissa87 df79a52
fix circular dependency
alvarezmelissa87 7fd43eb
remove function reference for function that no longer exists
alvarezmelissa87 253730d
ensure data is always defined
alvarezmelissa87 f19094a
update jest tests
alvarezmelissa87 6a18001
Merge branch 'main' into ml-inference-endpoints-remove-allocations-fi…
elasticmachine 2c9edf2
use props instead of custom css in text component
alvarezmelissa87 a47f4c4
ensure values show correctly on edit
alvarezmelissa87 1e4dd5a
change to isServerless. data manipulation to serializer/deserializer.…
alvarezmelissa87 82c3ef5
fix types
alvarezmelissa87 670417b
remove unused prop
alvarezmelissa87 df866a8
Merge branch 'main' into ml-inference-endpoints-remove-allocations-fi…
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
...-inference-endpoint-ui-common/src/components/configuration/adaptive_allocations_title.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import React, { FC, useState } from 'react'; | ||
| import { | ||
| EuiButtonIcon, | ||
| EuiFlexGroup, | ||
| EuiFlexItem, | ||
| EuiPopover, | ||
| EuiPopoverTitle, | ||
| EuiSpacer, | ||
| EuiTitle, | ||
| EuiText, | ||
| } from '@elastic/eui'; | ||
| import { FormattedMessage } from '@kbn/i18n-react'; | ||
| import { i18n } from '@kbn/i18n'; | ||
|
|
||
| export const AdaptiveAllocationsTitle: FC = () => { | ||
| const [isPopoverOpen, setIsPopoverOpen] = useState(false); | ||
|
|
||
| return ( | ||
| <> | ||
| <EuiFlexGroup alignItems="center" gutterSize="none"> | ||
| <EuiFlexItem grow={false}> | ||
| <EuiTitle size="xxs" data-test-subj="maxNumberOfAllocationsDetailsLabel"> | ||
| <h5> | ||
| <FormattedMessage | ||
| id="xpack.inferenceEndpointUICommon.components.adaptiveResourcesTitle" | ||
| defaultMessage="Adaptive resources" | ||
| /> | ||
| </h5> | ||
| </EuiTitle> | ||
| </EuiFlexItem> | ||
| <EuiFlexItem grow={false}> | ||
| <EuiPopover | ||
| anchorPosition="upCenter" | ||
| button={ | ||
| <EuiButtonIcon | ||
| color="text" | ||
| size="xs" | ||
| onClick={() => setIsPopoverOpen(!isPopoverOpen)} | ||
| iconType="info" | ||
| aria-label={i18n.translate( | ||
| 'xpack.inferenceEndpointUICommon.components.adaptiveResourcesAriaLabel', | ||
| { | ||
| defaultMessage: 'Open adaptive resources information popover', | ||
| } | ||
| )} | ||
| /> | ||
| } | ||
| isOpen={isPopoverOpen} | ||
| closePopover={() => setIsPopoverOpen(false)} | ||
| > | ||
| <EuiPopoverTitle> | ||
| <FormattedMessage | ||
| id="xpack.inferenceEndpointUICommon.components.sectionPopoverTitle" | ||
| defaultMessage="Adaptive resources" | ||
| /> | ||
| </EuiPopoverTitle> | ||
| <div style={{ width: '300px' }}> | ||
| <EuiText size="s"> | ||
| <p> | ||
| <FormattedMessage | ||
| id="xpack.inferenceEndpointUICommon.components.sectionPopoverFirstParagraph" | ||
| defaultMessage="The number of allocations scales automatically, based on load. Resources scale up when the load increases and scale down when the load decreases. We scale down to 0 <bold>after 24 hours of no inference calls</bold> to the endpoint to <bold>optimize cost and performance</bold>." | ||
| values={{ | ||
| bold: (str) => <strong>{str}</strong>, | ||
| }} | ||
| /> | ||
| </p> | ||
| <p> | ||
| <FormattedMessage | ||
| id="xpack.inferenceEndpointUICommon.components.sectionPopoverSecondParagraph" | ||
| defaultMessage="Subsequent inference calls may return errors for a few second, until resources are available again to service inference requests." | ||
| /> | ||
| </p> | ||
| <p> | ||
| <FormattedMessage | ||
| id="xpack.inferenceEndpointUICommon.components.sectionPopoverThirdParagraph" | ||
| defaultMessage="You can optionally set the maximum number of allocations. Autoscaling will occur dynamically between zero and maximum available or the user set maximum." | ||
| /> | ||
| </p> | ||
| </EuiText> | ||
| </div> | ||
| </EuiPopover> | ||
| </EuiFlexItem> | ||
| </EuiFlexGroup> | ||
| <EuiText color="subdued" size="xs"> | ||
| <FormattedMessage | ||
| id="xpack.inferenceEndpointUICommon.components.adaptiveResourcesDescription" | ||
| defaultMessage="The number of allocations scales automatically, based on load." | ||
| /> | ||
| </EuiText> | ||
| <EuiSpacer size="m" /> | ||
| </> | ||
| ); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...-inference-endpoint-ui-common/src/components/configuration/titular_component_registry.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import React, { FC } from 'react'; | ||
| import { MAX_NUMBER_OF_ALLOCATIONS } from '../../constants'; | ||
| import { AdaptiveAllocationsTitle } from './adaptive_allocations_title'; | ||
|
|
||
| const titularComponents: Record<string, FC> = { | ||
| [MAX_NUMBER_OF_ALLOCATIONS]: AdaptiveAllocationsTitle, | ||
| }; | ||
|
|
||
| export const ConfigFieldTitularComponent = ({ configKey }: { configKey: string }) => { | ||
| const Component = titularComponents[configKey]; | ||
|
|
||
| if (!Component) { | ||
| return null; | ||
| } | ||
| return <Component /> ?? null; | ||
|
Samiul-TheSoccerFan marked this conversation as resolved.
|
||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.