[ML] Removing global isServerless flag (#166651)

Removed `isServerless` flag which lived in our global context and had to
be passed about to the various components which create their own version
of the context using `getMlGlobalServices`
This PR adds a new context which contains flags for all of the features
which can be toggled when in serverless mode.
Flags added:
```
 showNodeInfo
 showMLNavMenu
 showLicenseInfo
 isADEnabled
 isDFAEnabled
 isNLPEnabled
```
The enabled features flags are now read from the config file client
side, rather than using capabilities.

Additional changes:
- Changes the wording of the awaiting ML node callout in serverless.
- In the search project, the default ML page is the trained models list
and not Overview
- Reenables the Memory Usage page for all projects

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
James Gowdy 2023-09-27 09:32:17 +01:00 committed by GitHub
parent e522f0a178
commit c18513e23d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 399 additions and 379 deletions

View file

@ -19,6 +19,7 @@ import {
type MapElements,
} from '@kbn/ml-data-frame-analytics-utils';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import type { MlFeatures } from '../../../common/constants/app';
import type { ModelService } from '../model_management/models_provider';
import { modelsProvider } from '../model_management';
import {
@ -36,7 +37,6 @@ import {
isTransformLinkReturnType,
} from './types';
import type { MlClient } from '../../lib/ml_client';
import type { MlFeatures } from '../../types';
import { DEFAULT_TRAINED_MODELS_PAGE_SIZE } from '../../routes/trained_models';
export class AnalyticsManager {

View file

@ -9,6 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import numeral from '@elastic/numeral';
import { pick } from 'lodash';
import { isDefined } from '@kbn/ml-is-defined';
import type { MlFeatures } from '../../../common/constants/app';
import type {
MemoryUsageInfo,
TrainedModelStatsResponse,
@ -22,7 +23,6 @@ import type {
NodeDeploymentStatsResponse,
NodesOverviewResponse,
} from '../../../common/types/trained_models';
import type { MlFeatures } from '../../types';
// @ts-expect-error numeral missing value
const AD_EXTRA_MEMORY = numeral('10MB').value();

View file

@ -7,6 +7,7 @@
import { IScopedClusterClient } from '@kbn/core/server';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { MlFeatures } from '../../../common/constants/app';
import type { MLSavedObjectService } from '../../saved_objects';
import type { NotificationItem, NotificationSource } from '../../../common/types/notifications';
import { ML_NOTIFICATION_INDEX_PATTERN } from '../../../common/constants/index_patterns';
@ -19,7 +20,6 @@ import type {
NotificationsCountResponse,
NotificationsSearchResponse,
} from '../../../common/types/notifications';
import type { MlFeatures } from '../../types';
const MAX_NOTIFICATIONS_SIZE = 10000;