Skip to content
Merged
Show file tree
Hide file tree
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 @@ -16,12 +16,7 @@
*/
public enum FeatureFlag {
TIME_SERIES_MODE("es.index_mode_feature_flag_registered=true", Version.fromString("8.0.0"), null),
FAILURE_STORE_ENABLED("es.failure_store_feature_flag_enabled=true", Version.fromString("8.12.0"), null),
INFERENCE_ADAPTIVE_ALLOCATIONS_ENABLED(
"es.inference_adaptive_allocations_feature_flag_enabled=true",
Version.fromString("8.16.0"),
null
);
FAILURE_STORE_ENABLED("es.failure_store_feature_flag_enabled=true", Version.fromString("8.12.0"), null);

public final String systemProperty;
public final Version from;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.elasticsearch.xcontent.XContentParser;
import org.elasticsearch.xpack.core.ml.MlConfigVersion;
import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsFeatureFlag;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsSettings;
import org.elasticsearch.xpack.core.ml.inference.assignment.AllocationStatus;
import org.elasticsearch.xpack.core.ml.inference.assignment.Priority;
Expand Down Expand Up @@ -120,14 +119,12 @@ public static class Request extends MasterNodeRequest<Request> implements ToXCon
ObjectParser.ValueType.VALUE
);
PARSER.declareString(Request::setPriority, PRIORITY);
if (AdaptiveAllocationsFeatureFlag.isEnabled()) {
PARSER.declareObjectOrNull(
Request::setAdaptiveAllocationsSettings,
(p, c) -> AdaptiveAllocationsSettings.PARSER.parse(p, c).build(),
null,
ADAPTIVE_ALLOCATIONS
);
}
PARSER.declareObjectOrNull(
Request::setAdaptiveAllocationsSettings,
(p, c) -> AdaptiveAllocationsSettings.PARSER.parse(p, c).build(),
null,
ADAPTIVE_ALLOCATIONS
);
}

public static Request parseRequest(String modelId, String deploymentId, XContentParser parser) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.elasticsearch.xcontent.ToXContentObject;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentParser;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsFeatureFlag;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsSettings;
import org.elasticsearch.xpack.core.ml.job.messages.Messages;
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
Expand Down Expand Up @@ -50,14 +49,12 @@ public static class Request extends AcknowledgedRequest<Request> implements ToXC
static {
PARSER.declareString(Request::setDeploymentId, MODEL_ID);
PARSER.declareInt(Request::setNumberOfAllocations, NUMBER_OF_ALLOCATIONS);
if (AdaptiveAllocationsFeatureFlag.isEnabled()) {
PARSER.declareObjectOrNull(
Request::setAdaptiveAllocationsSettings,
(p, c) -> AdaptiveAllocationsSettings.PARSER.parse(p, c).build(),
AdaptiveAllocationsSettings.RESET_PLACEHOLDER,
ADAPTIVE_ALLOCATIONS
);
}
PARSER.declareObjectOrNull(
Request::setAdaptiveAllocationsSettings,
(p, c) -> AdaptiveAllocationsSettings.PARSER.parse(p, c).build(),
AdaptiveAllocationsSettings.RESET_PLACEHOLDER,
ADAPTIVE_ALLOCATIONS
);
PARSER.declareString((r, val) -> r.ackTimeout(TimeValue.parseTimeValue(val, TIMEOUT.getPreferredName())), TIMEOUT);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.elasticsearch.test.ESSingleNodeTestCase;
import org.elasticsearch.xcontent.ToXContentObject;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsFeatureFlag;
import org.elasticsearch.xpack.inference.InferencePlugin;
import org.elasticsearch.xpack.inference.registry.ModelRegistry;
import org.elasticsearch.xpack.inference.services.elser.ElserInternalModel;
Expand Down Expand Up @@ -102,7 +101,6 @@ public void testStoreModelWithUnknownFields() throws Exception {
}

public void testGetModel() throws Exception {
assumeTrue("Only if 'inference_adaptive_allocations' feature flag is enabled", AdaptiveAllocationsFeatureFlag.isEnabled());
String inferenceEntityId = "test-get-model";
Model model = buildElserModelConfig(inferenceEntityId, TaskType.SPARSE_EMBEDDING);
AtomicReference<Boolean> putModelHolder = new AtomicReference<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.elasticsearch.xpack.core.inference.action.InferenceAction;
import org.elasticsearch.xpack.core.inference.results.InferenceTextEmbeddingFloatResults;
import org.elasticsearch.xpack.core.inference.results.TextEmbedding;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsFeatureFlag;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsSettings;
import org.elasticsearch.xpack.inference.services.settings.ApiKeySecrets;

Expand Down Expand Up @@ -137,9 +136,6 @@ public static AdaptiveAllocationsSettings removeAsAdaptiveAllocationsSettings(
String key,
ValidationException validationException
) {
if (AdaptiveAllocationsFeatureFlag.isEnabled() == false) {
return null;
}
Map<String, Object> settingsMap = ServiceUtils.removeFromMap(sourceMap, key);
if (settingsMap == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.elasticsearch.inference.ServiceSettings;
import org.elasticsearch.xcontent.ToXContentObject;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsFeatureFlag;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsSettings;
import org.elasticsearch.xpack.inference.services.ServiceUtils;

Expand Down Expand Up @@ -88,18 +87,12 @@ protected static ElasticsearchInternalServiceSettings.Builder fromMap(
String modelId = extractOptionalString(map, MODEL_ID, ModelConfigurations.SERVICE_SETTINGS, validationException);

if (numAllocations == null && adaptiveAllocationsSettings == null) {
if (AdaptiveAllocationsFeatureFlag.isEnabled()) {
validationException.addValidationError(
ServiceUtils.missingOneOfSettingsErrorMsg(
List.of(NUM_ALLOCATIONS, ADAPTIVE_ALLOCATIONS),
ModelConfigurations.SERVICE_SETTINGS
)
);
} else {
validationException.addValidationError(
ServiceUtils.missingSettingErrorMsg(NUM_ALLOCATIONS, ModelConfigurations.SERVICE_SETTINGS)
);
}
validationException.addValidationError(
ServiceUtils.missingOneOfSettingsErrorMsg(
List.of(NUM_ALLOCATIONS, ADAPTIVE_ALLOCATIONS),
ModelConfigurations.SERVICE_SETTINGS
)
);
}

// if an error occurred while parsing, we'll set these to an invalid value, so we don't accidentally get a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xpack.core.inference.results.InferenceTextEmbeddingByteResults;
import org.elasticsearch.xpack.core.inference.results.InferenceTextEmbeddingFloatResults;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsFeatureFlag;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsSettings;
import org.elasticsearch.xpack.inference.results.InferenceTextEmbeddingByteResultsTests;
import org.elasticsearch.xpack.inference.results.TextEmbeddingResultsTests;
Expand Down Expand Up @@ -290,8 +289,6 @@ public void testRemoveAsOneOfTypesMissingReturnsNull() {
}

public void testRemoveAsAdaptiveAllocationsSettings() {
assumeTrue("Should only run if adaptive allocations feature flag is enabled", AdaptiveAllocationsFeatureFlag.isEnabled());

Map<String, Object> map = new HashMap<>(
Map.of("settings", new HashMap<>(Map.of("enabled", true, "min_number_of_allocations", 7, "max_number_of_allocations", 42)))
);
Expand All @@ -314,8 +311,6 @@ public void testRemoveAsAdaptiveAllocationsSettings() {
}

public void testRemoveAsAdaptiveAllocationsSettings_exceptions() {
assumeTrue("Should only run if adaptive allocations feature flag is enabled", AdaptiveAllocationsFeatureFlag.isEnabled());

Map<String, Object> map = new HashMap<>(
Map.of("settings", new HashMap<>(Map.of("enabled", "YES!", "blah", 42, "max_number_of_allocations", -7)))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.elasticsearch.telemetry.metric.MeterRegistry;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.xpack.core.ml.annotations.AnnotationIndex;
import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsFeatureFlag;
import org.elasticsearch.xpack.ml.inference.adaptiveallocations.AdaptiveAllocationsScalerService;
import org.elasticsearch.xpack.ml.notifications.InferenceAuditor;

Expand Down Expand Up @@ -126,17 +125,13 @@ public void beforeStop() {

public void onMaster() {
mlDailyMaintenanceService.start();
if (AdaptiveAllocationsFeatureFlag.isEnabled()) {
adaptiveAllocationsScalerService.start();
}
adaptiveAllocationsScalerService.start();
threadPool.executor(MachineLearning.UTILITY_THREAD_POOL_NAME).execute(this::makeMlInternalIndicesHidden);
}

public void offMaster() {
mlDailyMaintenanceService.stop();
if (AdaptiveAllocationsFeatureFlag.isEnabled()) {
adaptiveAllocationsScalerService.stop();
}
adaptiveAllocationsScalerService.stop();
}

@Override
Expand Down
Loading