Skip to content

Commit

Permalink
[8.x] [ML] Redesign start/update model deployment dialog (#190243) (#…
Browse files Browse the repository at this point in the history
…194143)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] Redesign start/update model deployment dialog
(#190243)](#190243)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-26T13:26:31Z","message":"[ML]
Redesign start/update model deployment dialog (#190243)\n\n##
Summary\r\n\r\n#### Notes for
reviewers\r\n\r\nhttps://github.com/elastic/elasticsearch/pull/113455 PR
has to be merged\r\nfirst to support `min_number_of_allocation: 0`. At
the moment it's not\r\npossible to start a `Low` vCPUs usage deployment
from the UI.\r\n\r\nResolves #189975\r\n\r\n- Updates the Start/Update
model deployment dialogue, replacing\r\nallocation and threading params
with use cases and advanced settings\r\nwith vCPUs/VCUs
controls.\r\n\r\nThe vCPUs (or VCUs for serverless env) are derived from
the number of\r\nallocations times threads per
allocation.\r\n\r\n_Optimised for ingest_ sets 1 thread per
allocation.\r\n_Optimised for search_ for low vCPUs level sets 2 threads
per\r\nallocation, and the maximum available number of threads for
medium and\r\nhigh. This value is limited to the
`max_single_ml_node_processors`.\r\n\r\nvCPUs control acts differently
depending on \"Adaptive resources\". \r\n\r\n- When On, it enables
`adaptive_allocations` and sets the range\r\n`min_number_of_allocations`
and `max_number_of_allocations` based on the\r\nuse-case (threads per
allocation) and cluster configuration.\r\n- For cloud deployments with
enabled ML autoscaling, vCPUs ranges are 1\r\n-2 for, 2-32, 33-max\r\n-
For on-prem deployments and cloud deployments with
disabled\r\nautoscaling, vCPUs ranges are based on the hardware
limitations. E.g.\r\nwith `total_ml_processors` = 32, and
`max_single_ml_node_processors` =\r\n16 ranges are 1-2, 3-16,
17-32.\r\n- When Off, it sets a static `number_of_allocations`. The
number of\r\nallocations is an upper bound of the ranges mentioned
above.\r\n\r\nFor serverless deployments adaptive resources are enabled
at all times,\r\nand control is hidden.\r\n\r\n<img width=\"795\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/20b2528f-b631-49f9-82f8-fef6175873fd\">\r\n\r\n-
Start deployment modal checks if there is a deployment optimized for
a\r\ncertain use case, and sets another use case by default. E.g. If
an\r\noptimized deployment for a certain use case (e.g., ingestion) is
found,\r\nthe modal will set a different use case (e.g., search) as the
default\r\nupon opening.\r\n\r\n- For the cloud deployments, also
display a message about vCPU values in\r\nthe Cloud Console and a link
to edit the deployment:\r\n<img width=\"791\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/2f98ebca-579e-43c1-ab78-e0dd38ce4786\">\r\n\r\n-
For Serverless, the \"Adaptive Resources\" control is hidden,
as\r\nadaptive allocations are enabled at all times.\r\n<img
width=\"659\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/8133ebf9-6b2b-4fea-95f1-7351cfcf85b6\">\r\n\r\n-
Update action was updated accordingly. As it is not possible to
update\r\nthreads per allocation, the optimize control is disabled.
Advanced\r\nsettings are expanded by default and allows the user to
adjust vCPUs\r\nlevel and enable/disable adaptive resources.\r\n<img
width=\"785\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/13c3f0bc-4436-4528-8641-d33eb5384ea2\">\r\n\r\n\r\n-
Indicate if adaptive allocations are enabled in the expanded row
\r\n<img width=\"1322\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/894916df-4c77-4e75-b175-229131b8ecc8\">\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [x] Any UI
touched in this PR does not create any new axe failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>\r\nCo-authored-by: István
Zoltán Szabó
<[email protected]>","sha":"718444fec14ae2d22894cca1349a7e577443dd99","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement",":ml","v9.0.0","Feature:3rd
Party Models","Team:ML","v8.16.0","backport:version"],"title":"[ML]
Redesign start/update model deployment dialog
","number":190243,"url":"https://github.com/elastic/kibana/pull/190243","mergeCommit":{"message":"[ML]
Redesign start/update model deployment dialog (#190243)\n\n##
Summary\r\n\r\n#### Notes for
reviewers\r\n\r\nhttps://github.com/elastic/elasticsearch/pull/113455 PR
has to be merged\r\nfirst to support `min_number_of_allocation: 0`. At
the moment it's not\r\npossible to start a `Low` vCPUs usage deployment
from the UI.\r\n\r\nResolves #189975\r\n\r\n- Updates the Start/Update
model deployment dialogue, replacing\r\nallocation and threading params
with use cases and advanced settings\r\nwith vCPUs/VCUs
controls.\r\n\r\nThe vCPUs (or VCUs for serverless env) are derived from
the number of\r\nallocations times threads per
allocation.\r\n\r\n_Optimised for ingest_ sets 1 thread per
allocation.\r\n_Optimised for search_ for low vCPUs level sets 2 threads
per\r\nallocation, and the maximum available number of threads for
medium and\r\nhigh. This value is limited to the
`max_single_ml_node_processors`.\r\n\r\nvCPUs control acts differently
depending on \"Adaptive resources\". \r\n\r\n- When On, it enables
`adaptive_allocations` and sets the range\r\n`min_number_of_allocations`
and `max_number_of_allocations` based on the\r\nuse-case (threads per
allocation) and cluster configuration.\r\n- For cloud deployments with
enabled ML autoscaling, vCPUs ranges are 1\r\n-2 for, 2-32, 33-max\r\n-
For on-prem deployments and cloud deployments with
disabled\r\nautoscaling, vCPUs ranges are based on the hardware
limitations. E.g.\r\nwith `total_ml_processors` = 32, and
`max_single_ml_node_processors` =\r\n16 ranges are 1-2, 3-16,
17-32.\r\n- When Off, it sets a static `number_of_allocations`. The
number of\r\nallocations is an upper bound of the ranges mentioned
above.\r\n\r\nFor serverless deployments adaptive resources are enabled
at all times,\r\nand control is hidden.\r\n\r\n<img width=\"795\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/20b2528f-b631-49f9-82f8-fef6175873fd\">\r\n\r\n-
Start deployment modal checks if there is a deployment optimized for
a\r\ncertain use case, and sets another use case by default. E.g. If
an\r\noptimized deployment for a certain use case (e.g., ingestion) is
found,\r\nthe modal will set a different use case (e.g., search) as the
default\r\nupon opening.\r\n\r\n- For the cloud deployments, also
display a message about vCPU values in\r\nthe Cloud Console and a link
to edit the deployment:\r\n<img width=\"791\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/2f98ebca-579e-43c1-ab78-e0dd38ce4786\">\r\n\r\n-
For Serverless, the \"Adaptive Resources\" control is hidden,
as\r\nadaptive allocations are enabled at all times.\r\n<img
width=\"659\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/8133ebf9-6b2b-4fea-95f1-7351cfcf85b6\">\r\n\r\n-
Update action was updated accordingly. As it is not possible to
update\r\nthreads per allocation, the optimize control is disabled.
Advanced\r\nsettings are expanded by default and allows the user to
adjust vCPUs\r\nlevel and enable/disable adaptive resources.\r\n<img
width=\"785\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/13c3f0bc-4436-4528-8641-d33eb5384ea2\">\r\n\r\n\r\n-
Indicate if adaptive allocations are enabled in the expanded row
\r\n<img width=\"1322\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/894916df-4c77-4e75-b175-229131b8ecc8\">\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [x] Any UI
touched in this PR does not create any new axe failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>\r\nCo-authored-by: István
Zoltán Szabó
<[email protected]>","sha":"718444fec14ae2d22894cca1349a7e577443dd99"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/190243","number":190243,"mergeCommit":{"message":"[ML]
Redesign start/update model deployment dialog (#190243)\n\n##
Summary\r\n\r\n#### Notes for
reviewers\r\n\r\nhttps://github.com/elastic/elasticsearch/pull/113455 PR
has to be merged\r\nfirst to support `min_number_of_allocation: 0`. At
the moment it's not\r\npossible to start a `Low` vCPUs usage deployment
from the UI.\r\n\r\nResolves #189975\r\n\r\n- Updates the Start/Update
model deployment dialogue, replacing\r\nallocation and threading params
with use cases and advanced settings\r\nwith vCPUs/VCUs
controls.\r\n\r\nThe vCPUs (or VCUs for serverless env) are derived from
the number of\r\nallocations times threads per
allocation.\r\n\r\n_Optimised for ingest_ sets 1 thread per
allocation.\r\n_Optimised for search_ for low vCPUs level sets 2 threads
per\r\nallocation, and the maximum available number of threads for
medium and\r\nhigh. This value is limited to the
`max_single_ml_node_processors`.\r\n\r\nvCPUs control acts differently
depending on \"Adaptive resources\". \r\n\r\n- When On, it enables
`adaptive_allocations` and sets the range\r\n`min_number_of_allocations`
and `max_number_of_allocations` based on the\r\nuse-case (threads per
allocation) and cluster configuration.\r\n- For cloud deployments with
enabled ML autoscaling, vCPUs ranges are 1\r\n-2 for, 2-32, 33-max\r\n-
For on-prem deployments and cloud deployments with
disabled\r\nautoscaling, vCPUs ranges are based on the hardware
limitations. E.g.\r\nwith `total_ml_processors` = 32, and
`max_single_ml_node_processors` =\r\n16 ranges are 1-2, 3-16,
17-32.\r\n- When Off, it sets a static `number_of_allocations`. The
number of\r\nallocations is an upper bound of the ranges mentioned
above.\r\n\r\nFor serverless deployments adaptive resources are enabled
at all times,\r\nand control is hidden.\r\n\r\n<img width=\"795\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/20b2528f-b631-49f9-82f8-fef6175873fd\">\r\n\r\n-
Start deployment modal checks if there is a deployment optimized for
a\r\ncertain use case, and sets another use case by default. E.g. If
an\r\noptimized deployment for a certain use case (e.g., ingestion) is
found,\r\nthe modal will set a different use case (e.g., search) as the
default\r\nupon opening.\r\n\r\n- For the cloud deployments, also
display a message about vCPU values in\r\nthe Cloud Console and a link
to edit the deployment:\r\n<img width=\"791\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/2f98ebca-579e-43c1-ab78-e0dd38ce4786\">\r\n\r\n-
For Serverless, the \"Adaptive Resources\" control is hidden,
as\r\nadaptive allocations are enabled at all times.\r\n<img
width=\"659\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/8133ebf9-6b2b-4fea-95f1-7351cfcf85b6\">\r\n\r\n-
Update action was updated accordingly. As it is not possible to
update\r\nthreads per allocation, the optimize control is disabled.
Advanced\r\nsettings are expanded by default and allows the user to
adjust vCPUs\r\nlevel and enable/disable adaptive resources.\r\n<img
width=\"785\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/13c3f0bc-4436-4528-8641-d33eb5384ea2\">\r\n\r\n\r\n-
Indicate if adaptive allocations are enabled in the expanded row
\r\n<img width=\"1322\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/894916df-4c77-4e75-b175-229131b8ecc8\">\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [x] Any UI
touched in this PR does not create any new axe failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>\r\nCo-authored-by: István
Zoltán Szabó
<[email protected]>","sha":"718444fec14ae2d22894cca1349a7e577443dd99"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <[email protected]>
  • Loading branch information
kibanamachine and darnautov authored Sep 26, 2024
1 parent ef7048f commit e72fd8f
Show file tree
Hide file tree
Showing 25 changed files with 1,751 additions and 496 deletions.
10 changes: 10 additions & 0 deletions x-pack/packages/ml/agg_utils/src/validate_number.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
import { numberValidator } from './validate_number';

describe('numberValidator', () => {
it('should allow an empty value if not required', () => {
const validator = numberValidator({ min: 1, integerOnly: true, required: false });
expect(validator(undefined)).toStrictEqual(null);
});

it('should not allow an empty value if required', () => {
const validator = numberValidator({ min: 1, integerOnly: true, required: true });
expect(validator(undefined)).toStrictEqual({ required: true });
});

it('should only allow integers above zero', () => {
const integerOnlyValidator = numberValidator({ min: 1, integerOnly: true });
// invalid
Expand Down
24 changes: 18 additions & 6 deletions x-pack/packages/ml/agg_utils/src/validate_number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import { isPopulatedObject } from '@kbn/ml-is-populated-object';
* Represents the result of number validation.
* @interface
*/
export interface NumberValidationResult {
export type NumberValidationResult = { [key: string]: boolean } & {
/** The minimum allowed value. */
min: boolean;
min?: boolean;

/** The maximum allowed value. */
max: boolean;
max?: boolean;

/** Boolean flag to allow integer values only. */
integerOnly: boolean;
}
integerOnly?: boolean;
};

/**
* An interface describing conditions for validating numbers.
Expand All @@ -42,6 +42,8 @@ interface NumberValidatorConditions {
* Indicates whether only integer values are valid.
*/
integerOnly?: boolean;

required?: boolean;
}

/**
Expand All @@ -60,8 +62,18 @@ export function numberValidator(conditions?: NumberValidatorConditions) {
throw new Error('Invalid validator conditions');
}

return memoize((value: number): NumberValidationResult | null => {
return memoize((value: number | undefined): NumberValidationResult | null => {
const result = {} as NumberValidationResult;

if (value === undefined) {
if (conditions?.required) {
result.required = true;
return result;
} else {
return null;
}
}

if (conditions?.min !== undefined && value < conditions.min) {
result.min = true;
}
Expand Down
78 changes: 40 additions & 38 deletions x-pack/plugins/ml/common/types/trained_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { DeploymentState, TrainedModelType } from '@kbn/ml-trained-models-utils';
import type { TrainedModelType } from '@kbn/ml-trained-models-utils';
import type {
DataFrameAnalyticsConfig,
FeatureImportanceBaseline,
Expand Down Expand Up @@ -141,48 +141,46 @@ export interface InferenceConfigResponse {
trained_model_configs: TrainedModelConfigResponse[];
}

export interface TrainedModelDeploymentStatsResponse {
model_id: string;
deployment_id: string;
inference_threads: number;
model_threads: number;
state: DeploymentState;
type NodesDeploymentStats = Array<{
node: Record<
string,
{
transport_address: string;
roles: string[];
name: string;
attributes: {
'ml.machine_memory': string;
'xpack.installed': string;
'ml.max_open_jobs': string;
'ml.max_jvm_size': string;
};
ephemeral_id: string;
}
>;
inference_count: number;
routing_state: { routing_state: string };
average_inference_time_ms: number;
last_access: number;
number_of_pending_requests: number;
start_time: number;
throughput_last_minute: number;
threads_per_allocation: number;
number_of_allocations: number;
allocation_status: { target_allocation_count: number; state: string; allocation_count: number };
nodes: Array<{
node: Record<
string,
{
transport_address: string;
roles: string[];
name: string;
attributes: {
'ml.machine_memory': string;
'xpack.installed': string;
'ml.max_open_jobs': string;
'ml.max_jvm_size': string;
};
ephemeral_id: string;
}
>;
inference_count: number;
routing_state: { routing_state: string };
average_inference_time_ms: number;
last_access: number;
number_of_pending_requests: number;
start_time: number;
throughput_last_minute: number;
threads_per_allocation: number;
number_of_allocations: number;
}>;
reason?: string;
}
}>;

export type TrainedModelDeploymentStatsResponse = estypes.MlTrainedModelDeploymentStats & {
nodes: NodesDeploymentStats;
// TODO update types in elasticsearch-specification
adaptive_allocations?: {
enabled: boolean;
min_number_of_allocations?: number;
max_number_of_allocations?: number;
};
};

export interface AllocatedModel {
key: string;
deployment_id: string;
inference_threads: number;
allocation_status: {
target_allocation_count: number;
state: string;
Expand All @@ -195,7 +193,6 @@ export interface AllocatedModel {
*/
model_id?: string;
state: string;
model_threads: number;
model_size_bytes: number;
required_native_memory_bytes: number;
node: {
Expand All @@ -217,6 +214,11 @@ export interface AllocatedModel {
threads_per_allocation?: number;
error_count?: number;
};
adaptive_allocations?: {
enabled: boolean;
min_number_of_allocations?: number;
max_number_of_allocations?: number;
};
}

export interface NodeDeploymentStatsResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ const MLJobsAwaitingNodeWarning: FC<Props> = ({ jobIds }) => {
cloudId,
isCloudTrial,
deploymentId: cloudId === null ? null : extractDeploymentId(cloudId),
isMlAutoscalingEnabled: resp.isMlAutoscalingEnabled,
cloudUrl: resp.cloudUrl ?? null,
});
} catch (error) {
setCloudInfo(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ const defaultCloudInfo: CloudInfo = {
isCloud: false,
isCloudTrial: false,
deploymentId: null,
cloudUrl: null,
isMlAutoscalingEnabled: false,
};

export function useCloudCheck() {
Expand All @@ -85,6 +87,8 @@ export function useCloudCheck() {
isCloud: resp.cloudId !== undefined,
isCloudTrial: resp.isCloudTrial === true,
deploymentId: !resp.cloudId ? null : extractDeploymentId(resp.cloudId),
cloudUrl: resp.cloudUrl ?? null,
isMlAutoscalingEnabled: resp.isMlAutoscalingEnabled,
});
} catch (error) {
if (error.statusCode === 403) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,30 @@ export const AllocatedModels: FC<AllocatedModelsProps> = ({
) {
return '-';
}
return `${v.node.number_of_allocations} * ${v.node.threads_per_allocation}`;

let adaptiveAllocations = null;
if (v.adaptive_allocations?.enabled) {
adaptiveAllocations = (
<EuiToolTip
content={i18n.translate(
'xpack.ml.trainedModels.nodesList.modelsList.adaptiveAllocationsTooltip',
{
defaultMessage: 'Adaptive allocations enabled',
}
)}
>
<EuiIcon size="l" color="warning" type="scale" />
</EuiToolTip>
);
}
return (
<>
<>
{v.node.number_of_allocations} * {v.node.threads_per_allocation}
</>
{adaptiveAllocations}
</>
);
},
},
{
Expand Down
Loading

0 comments on commit e72fd8f

Please sign in to comment.