-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds ML start and stop trained model deployment specifications (#1061)
- Loading branch information
Showing
8 changed files
with
723 additions
and
11 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
71 changes: 71 additions & 0 deletions
71
specification/ml/start_trained_model_deployment/MlStartTrainedModelDeploymentRequest.ts
This file contains 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,71 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { RequestBase } from '@_types/Base' | ||
import { Id } from '@_types/common' | ||
import { integer } from '@_types/Numeric' | ||
import { Time } from '@_types/Time' | ||
import { DeploymentState } from '../_types/TrainedModel' | ||
|
||
/** | ||
* Starts a trained model deployment, which allocates the model to every machine learning node. | ||
* @rest_spec_name ml.start_trained_model_deployment | ||
* @since 8.0.0 | ||
* @stability experimental | ||
* @cluster_privileges manage_ml | ||
*/ | ||
export interface Request extends RequestBase { | ||
path_parts: { | ||
/** | ||
* The unique identifier of the trained model. Currently, only PyTorch models are supported. | ||
*/ | ||
model_id: Id | ||
} | ||
query_parameters: { | ||
/** | ||
* Specifies the number of threads that are used by the inference process. If you increase this value, inference | ||
* speed generally increases. However, the actual number of threads is limited by the number of available CPU | ||
* cores. | ||
* @server_default 1 | ||
*/ | ||
inference_threads?: integer | ||
/** | ||
* Specifies the number of threads that are used when sending inference requests to the model. If you increase this value, | ||
* throughput generally increases. | ||
* @server_default 1 | ||
*/ | ||
model_threads?: integer | ||
/** | ||
* Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds | ||
* this value, new requests are rejected with a 429 error. | ||
* @server_default 1024 | ||
*/ | ||
queue_capacity?: integer | ||
/** | ||
* Specifies the amount of time to wait for the model to deploy. | ||
* @server_default 20s | ||
*/ | ||
timeout?: Time | ||
/** | ||
* Specifies the allocation status to wait for before returning. | ||
* @server_default started | ||
*/ | ||
wait_for?: DeploymentState | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
specification/ml/start_trained_model_deployment/MlStartTrainedModelDeploymentResponse.ts
This file contains 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,26 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { TrainedModelAllocation } from '../_types/TrainedModel' | ||
|
||
export class Response { | ||
body: { | ||
allocation: TrainedModelAllocation | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
specification/ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentRequest.ts
This file contains 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,58 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { RequestBase } from '@_types/Base' | ||
import { Id } from '@_types/common' | ||
/* | ||
import { UserDefinedValue } from '@spec_utils/UserDefinedValue' | ||
import { InferenceConfigContainer } from '@_types/aggregations/pipeline' | ||
import { Definition, Input } from './types' | ||
import { TrainedModelType } from '../_types/TrainedModel' | ||
*/ | ||
/** | ||
* Stops a trained model deployment. | ||
* @rest_spec_name ml.stop_trained_model_deployment | ||
* @since 8.0.0 | ||
* @stability experimental | ||
* @cluster_privileges manage_ml | ||
*/ | ||
export interface Request extends RequestBase { | ||
path_parts: { | ||
/** | ||
* The unique identifier of the trained model. | ||
*/ | ||
model_id: Id | ||
} | ||
query_parameters: { | ||
/** | ||
* Specifies what to do when the request: contains wildcard expressions and there are no deployments that match; | ||
* contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and | ||
* there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches. | ||
* If `false`, the request returns a 404 status code when there are no matches or only partial matches. | ||
* @server_default true | ||
*/ | ||
allow_no_match?: boolean | ||
/** | ||
* Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you | ||
* restart the model deployment. | ||
* @server_default false | ||
*/ | ||
force?: boolean | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
specification/ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentResponse.ts
This file contains 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,22 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
export class Response { | ||
body: { stopped: boolean } | ||
} |