diff --git a/common/src/main/java/org/opensearch/ml/common/controller/MLModelController.java b/common/src/main/java/org/opensearch/ml/common/controller/MLModelController.java index 269a875f57..67f5d6cdda 100644 --- a/common/src/main/java/org/opensearch/ml/common/controller/MLModelController.java +++ b/common/src/main/java/org/opensearch/ml/common/controller/MLModelController.java @@ -32,7 +32,7 @@ public class MLModelController implements ToXContentObject, Writeable { public static final String MODEL_ID_FIELD = "model_id"; // mandatory - public static final String USER_RATE_LIMITER_CONFIG = "user_rate_limiter_config"; + public static final String USER_RATE_LIMITER_CONFIG = "user_rate_limiter"; @Getter private String modelId; diff --git a/common/src/main/java/org/opensearch/ml/common/transport/controller/MLCreateModelControllerResponse.java b/common/src/main/java/org/opensearch/ml/common/transport/controller/MLCreateModelControllerResponse.java index 531aa4daf7..8e1d43ef31 100644 --- a/common/src/main/java/org/opensearch/ml/common/transport/controller/MLCreateModelControllerResponse.java +++ b/common/src/main/java/org/opensearch/ml/common/transport/controller/MLCreateModelControllerResponse.java @@ -22,7 +22,7 @@ @Getter public class MLCreateModelControllerResponse extends ActionResponse implements ToXContentObject { - public static final String MODEL_ID_FIELD = "model_id"; + public static final String CONTROLLER_ID_FIELD = "controller_id"; public static final String STATUS_FIELD = "status"; @Getter @@ -50,7 +50,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); - builder.field(MODEL_ID_FIELD, modelId); + builder.field(CONTROLLER_ID_FIELD, modelId); builder.field(STATUS_FIELD, status); builder.endObject(); return builder; diff --git a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/RemoteModel.java b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/RemoteModel.java index aea6821334..b01adebcbe 100644 --- a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/RemoteModel.java +++ b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/RemoteModel.java @@ -60,7 +60,7 @@ public MLOutput predict(MLInput mlInput) { try { return connectorExecutor.executePredict(mlInput); } catch (RuntimeException e) { - log.error("Failed to call remote model.", e); + log.debug("Failed to call remote model.", e); throw e; } catch (Throwable e) { log.error("Failed to call remote model.", e); diff --git a/plugin/src/main/java/org/opensearch/ml/action/controller/CreateModelControllerTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/controller/CreateModelControllerTransportAction.java index ece13bcd3b..e70552ebbe 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/controller/CreateModelControllerTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/controller/CreateModelControllerTransportAction.java @@ -171,7 +171,6 @@ private void indexAndCreateModelController( MLModelController modelController, ActionListener actionListener ) { - log.info("Indexing the model controller into system index"); mlIndicesHandler.initMLModelControllerIndex(ActionListener.wrap(indexCreated -> { if (!indexCreated) { actionListener.onFailure(new RuntimeException("Failed to create model controller index.")); diff --git a/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java b/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java index 570db1bc42..a578b852a9 100644 --- a/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java @@ -7,6 +7,7 @@ import static org.opensearch.ml.settings.MLCommonsSettings.ML_COMMONS_MONITORING_REQUEST_COUNT; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -298,6 +299,11 @@ public Long getMemEstGPU(String modelId) { */ public synchronized boolean isModelDeployed(String modelId) { MLModelCache modelCache = modelCaches.get(modelId); + if (modelCache != null) { + log.info("ylwudebug1 --------- model cache state: {}", modelCache.getModelState(), Arrays.toString(modelCache.getWorkerNodes())); + } else { + log.info("ylwudebug1 -------- model cache is null"); + } return modelCache != null && modelCache.getModelState() == MLModelState.DEPLOYED; } diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateModelControllerAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateModelControllerAction.java index b6f180e49a..f22b2bb289 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateModelControllerAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLCreateModelControllerAction.java @@ -44,7 +44,7 @@ public String getName() { public List routes() { return ImmutableList .of( - new Route(RestRequest.Method.POST, String.format(Locale.ROOT, "%s/model_controllers/{%s}", ML_BASE_URI, PARAMETER_MODEL_ID)) + new Route(RestRequest.Method.POST, String.format(Locale.ROOT, "%s/controllers/{%s}", ML_BASE_URI, PARAMETER_MODEL_ID)) ); } diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelControllerAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelControllerAction.java index 51208a82f0..fe48dc2712 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelControllerAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLDeleteModelControllerAction.java @@ -40,7 +40,7 @@ public List routes() { .of( new Route( RestRequest.Method.DELETE, - String.format(Locale.ROOT, "%s/model_controllers/{%s}", ML_BASE_URI, PARAMETER_MODEL_ID) + String.format(Locale.ROOT, "%s/controllers/{%s}", ML_BASE_URI, PARAMETER_MODEL_ID) ) ); } diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelControllerAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelControllerAction.java index d4946ec2e1..bbbafc19a6 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelControllerAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLGetModelControllerAction.java @@ -41,7 +41,7 @@ public String getName() { public List routes() { return ImmutableList .of( - new Route(RestRequest.Method.GET, String.format(Locale.ROOT, "%s/model_controllers/{%s}", ML_BASE_URI, PARAMETER_MODEL_ID)) + new Route(RestRequest.Method.GET, String.format(Locale.ROOT, "%s/controllers/{%s}", ML_BASE_URI, PARAMETER_MODEL_ID)) ); } diff --git a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelControllerAction.java b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelControllerAction.java index b64d3e37e7..557bf6d8bb 100644 --- a/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelControllerAction.java +++ b/plugin/src/main/java/org/opensearch/ml/rest/RestMLUpdateModelControllerAction.java @@ -44,7 +44,7 @@ public String getName() { public List routes() { return ImmutableList .of( - new Route(RestRequest.Method.PUT, String.format(Locale.ROOT, "%s/model_controllers/{%s}", ML_BASE_URI, PARAMETER_MODEL_ID)) + new Route(RestRequest.Method.PUT, String.format(Locale.ROOT, "%s/controllers/{%s}", ML_BASE_URI, PARAMETER_MODEL_ID)) ); }