Skip to content

Commit

Permalink
adding necessary checks and starting sync_up cron in auto redeployer
Browse files Browse the repository at this point in the history
Signed-off-by: Bhavana Goud Ramaram <[email protected]>
  • Loading branch information
rbhavna committed Jan 10, 2025
1 parent b145834 commit e740eb3
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ private void triggerAutoDeployModels(List<String> addedNodes) {
modelAutoRedeployArrangements.add(modelAutoRedeployArrangement);
});
redeployAModel();
} else {
log.info("Could not find any models in the index, not performing auto reloading!");
startCronjobAndClearListener();
}
}, e -> {
if (e instanceof IndexNotFoundException) {
Expand Down Expand Up @@ -215,7 +218,7 @@ private void triggerUndeployModelsOnDataNodes(List<String> dataNodeIds) {
client.execute(MLUndeployModelAction.INSTANCE, undeployModelNodesRequest, undeployModelListener);
}
}
}, e -> { log.error("Failed to query need undeploy models, no action will be performed"); });
}, e -> { log.error("Failed to query need undeploy models, no action will be performed", e); });
queryRunningModels(listener);
}

Expand Down Expand Up @@ -255,6 +258,11 @@ private void queryRunningModels(ActionListener<SearchResponse> listener) {

@SuppressWarnings("unchecked")
private void triggerModelRedeploy(ModelAutoRedeployArrangement modelAutoRedeployArrangement) {
if (modelAutoRedeployArrangement == null) {
log.info("No more models in arrangement, skipping the redeployment");
startCronjobAndClearListener();
return;
}
String modelId = modelAutoRedeployArrangement.getSearchResponse().getId();
List<String> addedNodes = modelAutoRedeployArrangement.getAddedNodes();
List<String> planningWorkerNodes = (List<String>) modelAutoRedeployArrangement
Expand Down Expand Up @@ -286,6 +294,7 @@ private void triggerModelRedeploy(ModelAutoRedeployArrangement modelAutoRedeploy
.info(
"Allow custom deployment plan is true and deploy to all nodes is false and added nodes are not in planning worker nodes list, not to auto redeploy the model to the new nodes!"
);
redeployAModel();
return;
}

Expand Down

0 comments on commit e740eb3

Please sign in to comment.