Skip to content

Commit c7a5c59

Browse files
[ML] Removing Custom Service Feature Flag (#129780)
* Removing feature flag * Removing missed references
1 parent 2f3b2b3 commit c7a5c59

File tree

6 files changed

+3
-42
lines changed

6 files changed

+3
-42
lines changed

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/FeatureFlag.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public enum FeatureFlag {
2020
SUB_OBJECTS_AUTO_ENABLED("es.sub_objects_auto_feature_flag_enabled=true", Version.fromString("8.16.0"), null),
2121
DOC_VALUES_SKIPPER("es.doc_values_skipper_feature_flag_enabled=true", Version.fromString("8.18.1"), null),
2222
USE_LUCENE101_POSTINGS_FORMAT("es.use_lucene101_postings_format_feature_flag_enabled=true", Version.fromString("9.1.0"), null),
23-
INFERENCE_CUSTOM_SERVICE_ENABLED("es.inference_custom_service_feature_flag_enabled=true", Version.fromString("8.19.0"), null),
2423
IVF_FORMAT("es.ivf_format_feature_flag_enabled=true", Version.fromString("9.1.0"), null),
2524
LOGS_STREAM("es.logs_stream_feature_flag_enabled=true", Version.fromString("9.1.0"), null);
2625

x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/BaseMockEISAuthServerTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.elasticsearch.common.util.concurrent.ThreadContext;
1515
import org.elasticsearch.core.TimeValue;
1616
import org.elasticsearch.test.cluster.ElasticsearchCluster;
17-
import org.elasticsearch.test.cluster.FeatureFlag;
1817
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
1918
import org.elasticsearch.test.rest.ESRestTestCase;
2019
import org.junit.ClassRule;
@@ -45,7 +44,6 @@ public class BaseMockEISAuthServerTest extends ESRestTestCase {
4544
// This plugin is located in the inference/qa/test-service-plugin package, look for TestInferenceServicePlugin
4645
.plugin("inference-service-test")
4746
.user("x_pack_rest_user", "x-pack-test-password")
48-
.feature(FeatureFlag.INFERENCE_CUSTOM_SERVICE_ENABLED)
4947
.build();
5048

5149
// The reason we're doing this is to make sure the mock server is initialized first so we can get the address before communicating

x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceBaseRestTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.elasticsearch.core.Nullable;
2121
import org.elasticsearch.inference.TaskType;
2222
import org.elasticsearch.test.cluster.ElasticsearchCluster;
23-
import org.elasticsearch.test.cluster.FeatureFlag;
2423
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
2524
import org.elasticsearch.test.rest.ESRestTestCase;
2625
import org.elasticsearch.xcontent.XContentBuilder;
@@ -51,7 +50,6 @@ public class InferenceBaseRestTest extends ESRestTestCase {
5150
.setting("xpack.security.enabled", "true")
5251
.plugin("inference-service-test")
5352
.user("x_pack_rest_user", "x-pack-test-password")
54-
.feature(FeatureFlag.INFERENCE_CUSTOM_SERVICE_ENABLED)
5553
.build();
5654

5755
@ClassRule

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/CustomServiceFeatureFlag.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceNamedWriteablesProvider.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@
121121
import java.util.ArrayList;
122122
import java.util.List;
123123

124-
import static org.elasticsearch.xpack.inference.CustomServiceFeatureFlag.CUSTOM_SERVICE_FEATURE_FLAG;
125-
126124
public class InferenceNamedWriteablesProvider {
127125

128126
private InferenceNamedWriteablesProvider() {}
@@ -186,10 +184,6 @@ public static List<NamedWriteableRegistry.Entry> getNamedWriteables() {
186184
}
187185

188186
private static void addCustomNamedWriteables(List<NamedWriteableRegistry.Entry> namedWriteables) {
189-
if (CUSTOM_SERVICE_FEATURE_FLAG.isEnabled() == false) {
190-
return;
191-
}
192-
193187
namedWriteables.add(
194188
new NamedWriteableRegistry.Entry(ServiceSettings.class, CustomServiceSettings.NAME, CustomServiceSettings::new)
195189
);

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferencePlugin.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,8 @@
149149
import java.util.Set;
150150
import java.util.function.Predicate;
151151
import java.util.function.Supplier;
152-
import java.util.stream.Stream;
153152

154153
import static java.util.Collections.singletonList;
155-
import static org.elasticsearch.xpack.inference.CustomServiceFeatureFlag.CUSTOM_SERVICE_FEATURE_FLAG;
156154
import static org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilter.INDICES_INFERENCE_BATCH_SIZE;
157155
import static org.elasticsearch.xpack.inference.common.InferenceAPIClusterAwareRateLimitingFeature.INFERENCE_API_CLUSTER_AWARE_RATE_LIMITING_FEATURE_FLAG;
158156

@@ -384,11 +382,7 @@ public void loadExtensions(ExtensionLoader loader) {
384382
}
385383

386384
public List<InferenceServiceExtension.Factory> getInferenceServiceFactories() {
387-
List<InferenceServiceExtension.Factory> conditionalServices = CUSTOM_SERVICE_FEATURE_FLAG.isEnabled()
388-
? List.of(context -> new CustomService(httpFactory.get(), serviceComponents.get()))
389-
: List.of();
390-
391-
List<InferenceServiceExtension.Factory> availableServices = List.of(
385+
return List.of(
392386
context -> new HuggingFaceElserService(httpFactory.get(), serviceComponents.get()),
393387
context -> new HuggingFaceService(httpFactory.get(), serviceComponents.get()),
394388
context -> new OpenAiService(httpFactory.get(), serviceComponents.get()),
@@ -405,10 +399,9 @@ public List<InferenceServiceExtension.Factory> getInferenceServiceFactories() {
405399
context -> new JinaAIService(httpFactory.get(), serviceComponents.get()),
406400
context -> new VoyageAIService(httpFactory.get(), serviceComponents.get()),
407401
context -> new DeepSeekService(httpFactory.get(), serviceComponents.get()),
408-
ElasticsearchInternalService::new
402+
ElasticsearchInternalService::new,
403+
context -> new CustomService(httpFactory.get(), serviceComponents.get())
409404
);
410-
411-
return Stream.concat(availableServices.stream(), conditionalServices.stream()).toList();
412405
}
413406

414407
@Override

0 commit comments

Comments
 (0)