Skip to content

Commit b8b9d95

Browse files
authored
Remove node info from ML team serverless responses (#2205)
Serverless will present the impression of having no underlying servers, so API responses in serverless should not contain any node information. To avoid changing the shape of responses, we still return node fields but always set to "serverless" in serverless. This avoids causing problems for users who want to use the stateful client with serverless. Trained model stats will be aggregated and reported as being for a virtual node called "serverless".
1 parent 4493266 commit b8b9d95

File tree

11 files changed

+124
-72
lines changed

11 files changed

+124
-72
lines changed

output/schema/schema.json

Lines changed: 84 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/ml/_types/Datafeed.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ export enum DatafeedState {
140140
export class DatafeedStats {
141141
assignment_explanation?: string
142142
datafeed_id: Id
143+
/**
144+
* @availability stack
145+
*/
143146
node?: DiscoveryNode
144147
state: DatafeedState
145148
timing_stats: DatafeedTimingStats

specification/ml/_types/DataframeAnalytics.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,10 @@ export class DataframeAnalytics {
332332
id: Id
333333
/** An object describing memory usage of the analytics. It is present only after the job is started and memory usage is reported. */
334334
memory_usage: DataframeAnalyticsStatsMemoryUsage
335-
/** Contains properties for the node that runs the job. This information is available only for running jobs. */
335+
/**
336+
* Contains properties for the node that runs the job. This information is available only for running jobs.
337+
* @availability stack
338+
*/
336339
node?: NodeAttributes
337340
/** The progress report of the data frame analytics job by phase. */
338341
progress: DataframeAnalyticsStatsProgress[]

specification/ml/_types/Job.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ export class JobStats {
109109
forecasts_stats: JobForecastStatistics
110110
job_id: string
111111
model_size_stats: ModelSizeStats
112+
/**
113+
* @availability stack
114+
*/
112115
node?: DiscoveryNode
113116
open_time?: DateTime
114117
state: JobState

specification/ml/_types/Model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ export class ModelSnapshotUpgrade {
4949
job_id: Id
5050
snapshot_id: Id
5151
state: SnapshotUpgradeState
52+
/**
53+
* @availability stack
54+
*/
5255
node: DiscoveryNode
5356
assignment_explanation: string
5457
}

specification/ml/_types/TrainedModel.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ export class TrainedModelDeploymentStats {
7171
inference_count: integer
7272
/** The unique identifier for the trained model. */
7373
model_id: Id
74-
/** The deployent stats for each node that currently has the model allocated. */
74+
/**
75+
* The deployment stats for each node that currently has the model allocated.
76+
* In serverless, stats are reported for a single unnamed virtual node.
77+
*/
7578
nodes: TrainedModelDeploymentNodesStats
7679
/** The number of allocations requested. */
7780
number_of_allocations: integer
@@ -136,7 +139,10 @@ export class TrainedModelDeploymentNodesStats {
136139
inference_count: integer
137140
/** The epoch time stamp of the last inference call for the model on this node. */
138141
last_access: long
139-
/** Information pertaining to the node. */
142+
/**
143+
* Information pertaining to the node.
144+
* @availability stack
145+
*/
140146
node: DiscoveryNode
141147
/**
142148
* The number of allocations assigned to this node.

specification/ml/open_job/MlOpenJobResponse.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import { NodeId } from '@_types/common'
2222
export class Response {
2323
body: {
2424
opened: boolean
25+
/**
26+
* The ID of the node that the job was started on. In serverless this will be the "serverless".
27+
* If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
28+
*/
2529
node: NodeId
2630
}
2731
}

specification/ml/start_data_frame_analytics/MlStartDataFrameAnalyticsResponse.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ import { NodeId } from '@_types/common'
2222
export class Response {
2323
body: {
2424
acknowledged: boolean
25-
/** The ID of the node that the job was started on. If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string. */
25+
/**
26+
* The ID of the node that the job was started on. If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
27+
* The node ID of the node the job has been assigned to, or
28+
* an empty string if it hasn't been assigned to a node. In
29+
* serverless if the job has been assigned to run then the
30+
* node ID will be "serverless".
31+
*/
2632
node: NodeId
2733
}
2834
}

specification/ml/start_datafeed/MlStartDatafeedResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import { NodeIds } from '@_types/common'
2222
export class Response {
2323
body: {
2424
/**
25-
* The ID of the node that the datafeed was started on. If the datafeed is allowed to open lazily and has not yet
26-
* been assigned to a node, this value is an empty string.
25+
* The ID of the node that the job was started on. In serverless this will be the "serverless".
26+
* If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
2727
*/
2828
node: NodeIds
2929
/**

specification/ml/upgrade_job_snapshot/MlUpgradeJobSnapshotResponse.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import { NodeId } from '@_types/common'
2121

2222
export class Response {
2323
body: {
24-
/** The ID of the assigned node for the upgrade task if it is still running. */
24+
/**
25+
* The ID of the node that the upgrade task was started on if it is still running. In serverless this will be the "serverless".
26+
*/
2527
node: NodeId
2628
/** When true, this means the task is complete. When false, it is still running. */
2729
completed: boolean

specification/transform/get_transform_stats/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export class TransformStats {
3232
checkpointing: Checkpointing
3333
health?: TransformStatsHealth
3434
id: Id
35+
/**
36+
* @availability stack
37+
*/
3538
node?: NodeAttributes
3639
reason?: string
3740
state: string

0 commit comments

Comments
 (0)