Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public class MlAssignmentPlannerUpgradeIT extends AbstractUpgradeTestCase {
RAW_MODEL_SIZE = Base64.getDecoder().decode(BASE_64_ENCODED_MODEL).length;
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/101926")
public void testMlAssignmentPlannerUpgrade() throws Exception {
assumeFalse("This test deploys multiple models which cannot be accommodated on a single processor", IS_SINGLE_PROCESSOR_TEST);

Expand Down Expand Up @@ -186,12 +185,12 @@ private void setupDeployments() throws Exception {
createTrainedModel("old_memory_format", 0, 0);
putModelDefinition("old_memory_format");
putVocabulary(List.of("these", "are", "my", "words"), "old_memory_format");
startDeployment("old_memory_format");
startDeployment("old_memory_format", "started", "low");

createTrainedModel("new_memory_format", ByteSizeValue.ofMb(300).getBytes(), ByteSizeValue.ofMb(10).getBytes());
putModelDefinition("new_memory_format");
putVocabulary(List.of("these", "are", "my", "words"), "new_memory_format");
startDeployment("new_memory_format");
startDeployment("new_memory_format", "started", "low");
}

private void cleanupDeployments() throws IOException {
Expand Down Expand Up @@ -247,10 +246,14 @@ private void deleteTrainedModel(String modelId) throws IOException {
}

private Response startDeployment(String modelId) throws IOException {
return startDeployment(modelId, "started");
return startDeployment(modelId, "started", "normal");
}

private Response startDeployment(String modelId, String waitForState) throws IOException {
return startDeployment(modelId, waitForState, "normal");
}

private Response startDeployment(String modelId, String waitForState, String priority) throws IOException {
String inferenceThreadParamName = "threads_per_allocation";
String modelThreadParamName = "number_of_allocations";
String compatibleHeader = null;
Expand All @@ -270,7 +273,8 @@ private Response startDeployment(String modelId, String waitForState) throws IOE
+ inferenceThreadParamName
+ "=1&"
+ modelThreadParamName
+ "=1"
+ "=1&priority="
+ priority
);
if (compatibleHeader != null) {
request.setOptions(request.getOptions().toBuilder().addHeader("Accept", compatibleHeader).build());
Expand Down