Skip to content

Commit

Permalink
Revert "the dev of [FEATURE]Auto reload model when cluster rebooted/n…
Browse files Browse the repository at this point in the history
…ode rejoin (opensearch-project#711)"

This reverts commit 7a51dcc.

Signed-off-by: Yaliang Wu <ylwu@amazon.com>
  • Loading branch information
ylwu-amzn committed Feb 21, 2023
1 parent 2488b27 commit 1fc5ba4
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 1,169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ public class CommonValue {
public static final String ML_TASK_INDEX = ".plugins-ml-task";
public static final Integer ML_MODEL_INDEX_SCHEMA_VERSION = 3;
public static final Integer ML_TASK_INDEX_SCHEMA_VERSION = 1;

public static final String ML_MODEL_RELOAD_INDEX = ".plugins-ml-model-reload";
public static final String NODE_ID_FIELD = "node_id";
public static final String MODEL_LOAD_RETRY_TIMES_FIELD = "retry_times";
public static final String USER_FIELD_MAPPING = " \""
+ CommonValue.USER
+ "\": {\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
import org.opensearch.ml.engine.algorithms.sample.LocalSampleCalculator;
import org.opensearch.ml.indices.MLIndicesHandler;
import org.opensearch.ml.indices.MLInputDatasetHandler;
import org.opensearch.ml.model.MLModelAutoReloader;
import org.opensearch.ml.model.MLModelCacheHelper;
import org.opensearch.ml.model.MLModelManager;
import org.opensearch.ml.rest.RestMLCreateModelMetaAction;
Expand Down Expand Up @@ -176,8 +175,6 @@ public class MachineLearningPlugin extends Plugin implements ActionPlugin {
private MLModelChunkUploader mlModelChunkUploader;
private MLEngine mlEngine;

private MLModelAutoReloader mlModelAutoReloader;

private Client client;
private ClusterService clusterService;
private ThreadPool threadPool;
Expand Down Expand Up @@ -355,9 +352,6 @@ public Collection<Object> createComponents(
mlIndicesHandler
);

mlModelAutoReloader = new MLModelAutoReloader(clusterService, threadPool, client, xContentRegistry, nodeHelper, settings);
mlModelAutoReloader.autoReloadModel();

return ImmutableList
.of(
mlEngine,
Expand All @@ -379,8 +373,7 @@ public Collection<Object> createComponents(
modelHelper,
mlCommonsClusterEventListener,
clusterManagerEventListener,
mlCircuitBreakerService,
mlModelAutoReloader
mlCircuitBreakerService
);
}

Expand Down Expand Up @@ -520,9 +513,7 @@ public List<Setting<?>> getSettings() {
MLCommonsSettings.ML_COMMONS_MAX_ML_TASK_PER_NODE,
MLCommonsSettings.ML_COMMONS_MAX_LOAD_MODEL_TASKS_PER_NODE,
MLCommonsSettings.ML_COMMONS_TRUSTED_URL_REGEX,
MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD,
MLCommonsSettings.ML_COMMONS_MODEL_AUTO_RELOAD_ENABLE,
MLCommonsSettings.ML_MODEL_RELOAD_MAX_RETRY_TIMES
MLCommonsSettings.ML_COMMONS_NATIVE_MEM_THRESHOLD
);
return settings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,4 @@ private MLCommonsSettings() {}

public static final Setting<Integer> ML_COMMONS_NATIVE_MEM_THRESHOLD = Setting
.intSetting("plugins.ml_commons.native_memory_threshold", 90, 0, 100, Setting.Property.NodeScope, Setting.Property.Dynamic);

public static final Setting<Boolean> ML_COMMONS_MODEL_AUTO_RELOAD_ENABLE = Setting
.boolSetting("plugins.ml_commons.model.autoreload.enable", false, Setting.Property.NodeScope, Setting.Property.Dynamic);

public static final Setting<Integer> ML_MODEL_RELOAD_MAX_RETRY_TIMES = Setting
.intSetting("plugins.ml_commons.model.autoreload.retrytimes", 3, Setting.Property.NodeScope, Setting.Property.Dynamic);
}
Loading

0 comments on commit 1fc5ba4

Please sign in to comment.