Skip to content

Commit 2d04fee

Browse files
committed
pass priority
1 parent d986d08 commit 2d04fee

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

x-pack/plugins/ml/public/application/services/ml_api_service/trained_models.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ export function trainedModelsApiProvider(httpService: HttpService) {
126126

127127
startModelAllocation(
128128
modelId: string,
129-
queryParams?: { number_of_allocations: number; threads_per_allocation: number }
129+
queryParams?: {
130+
number_of_allocations: number;
131+
threads_per_allocation: number;
132+
priority: 'low' | 'normal';
133+
}
130134
) {
131135
return httpService.http<{ acknowledge: boolean }>({
132136
path: `${apiBasePath}/trained_models/${modelId}/deployment/_start`,

x-pack/plugins/ml/public/application/trained_models/models_management/model_actions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export function useModelActions({
167167
await trainedModelsApiService.startModelAllocation(item.model_id, {
168168
number_of_allocations: threadingParams.numOfAllocations,
169169
threads_per_allocation: threadingParams.threadsPerAllocations!,
170+
priority: threadingParams.priority!,
170171
});
171172
displaySuccessToast(
172173
i18n.translate('xpack.ml.trainedModels.modelsList.startSuccess', {

x-pack/plugins/ml/server/routes/schemas/inference_schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const threadingParamsSchema = schema.maybe(
1818
schema.object({
1919
number_of_allocations: schema.number(),
2020
threads_per_allocation: schema.number(),
21+
priority: schema.oneOf([schema.literal('low'), schema.literal('normal')]),
2122
})
2223
);
2324

0 commit comments

Comments
 (0)