mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 04:58:59 +00:00
(query-service) Create new empty 'query-service' service
This commit is contained in:
parent
cf366c602f
commit
89c6d85f2f
@ -10,6 +10,7 @@ public class SearchServiceDescriptors {
|
|||||||
public static ServiceDescriptors descriptors = new ServiceDescriptors(
|
public static ServiceDescriptors descriptors = new ServiceDescriptors(
|
||||||
List.of(new ServiceDescriptor(ServiceId.Api, 5004),
|
List.of(new ServiceDescriptor(ServiceId.Api, 5004),
|
||||||
new ServiceDescriptor(ServiceId.Index, 5021),
|
new ServiceDescriptor(ServiceId.Index, 5021),
|
||||||
|
new ServiceDescriptor(ServiceId.Query, 5022),
|
||||||
new ServiceDescriptor(ServiceId.Search, 5023),
|
new ServiceDescriptor(ServiceId.Search, 5023),
|
||||||
new ServiceDescriptor(ServiceId.Assistant, 5025),
|
new ServiceDescriptor(ServiceId.Assistant, 5025),
|
||||||
new ServiceDescriptor(ServiceId.Dating, 5070),
|
new ServiceDescriptor(ServiceId.Dating, 5070),
|
||||||
|
@ -6,6 +6,7 @@ public enum ServiceId {
|
|||||||
Api("api-service"),
|
Api("api-service"),
|
||||||
Search("search-service"),
|
Search("search-service"),
|
||||||
Index("index-service"),
|
Index("index-service"),
|
||||||
|
Query("query-service"),
|
||||||
|
|
||||||
Control("control-service"),
|
Control("control-service"),
|
||||||
|
|
||||||
|
45
code/services-core/query-service/build.gradle
Normal file
45
code/services-core/query-service/build.gradle
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
plugins {
|
||||||
|
id 'java'
|
||||||
|
|
||||||
|
id 'com.palantir.docker' version '0.35.0'
|
||||||
|
id 'application'
|
||||||
|
id 'jvm-test-suite'
|
||||||
|
}
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClass = 'nu.marginalia.query.QueryMain'
|
||||||
|
applicationName = 'query-service'
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.distZip.enabled = false
|
||||||
|
|
||||||
|
apply from: "$rootProject.projectDir/docker-service.gradle"
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion.set(JavaLanguageVersion.of(21))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':code:common:config')
|
||||||
|
implementation project(':code:common:model')
|
||||||
|
implementation project(':code:common:db')
|
||||||
|
implementation project(':code:common:service')
|
||||||
|
implementation project(':code:api:index-api')
|
||||||
|
implementation project(':code:common:service-discovery')
|
||||||
|
|
||||||
|
implementation libs.bundles.slf4j
|
||||||
|
|
||||||
|
implementation libs.prometheus
|
||||||
|
implementation libs.notnull
|
||||||
|
implementation libs.guice
|
||||||
|
implementation libs.protobuf
|
||||||
|
implementation libs.rxjava
|
||||||
|
|
||||||
|
testImplementation libs.bundles.slf4j.test
|
||||||
|
testImplementation libs.bundles.junit
|
||||||
|
testImplementation libs.mockito
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
|||||||
|
package nu.marginalia.query;
|
||||||
|
|
||||||
|
import com.google.inject.Guice;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Injector;
|
||||||
|
import nu.marginalia.service.MainClass;
|
||||||
|
import nu.marginalia.service.SearchServiceDescriptors;
|
||||||
|
import nu.marginalia.service.id.ServiceId;
|
||||||
|
import nu.marginalia.service.module.ConfigurationModule;
|
||||||
|
import nu.marginalia.service.module.DatabaseModule;
|
||||||
|
import nu.marginalia.service.server.Initialization;
|
||||||
|
|
||||||
|
public class QueryMain extends MainClass {
|
||||||
|
private final QueryService service;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public QueryMain(QueryService service) {
|
||||||
|
this.service = service;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String... args) {
|
||||||
|
init(ServiceId.Query, args);
|
||||||
|
|
||||||
|
Injector injector = Guice.createInjector(
|
||||||
|
new QueryModule(),
|
||||||
|
new DatabaseModule(),
|
||||||
|
new ConfigurationModule(SearchServiceDescriptors.descriptors, ServiceId.Query)
|
||||||
|
);
|
||||||
|
|
||||||
|
injector.getInstance(QueryMain.class);
|
||||||
|
injector.getInstance(Initialization.class).setReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package nu.marginalia.query;
|
||||||
|
|
||||||
|
import com.google.inject.AbstractModule;
|
||||||
|
|
||||||
|
public class QueryModule extends AbstractModule {
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package nu.marginalia.query;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import nu.marginalia.service.server.BaseServiceParams;
|
||||||
|
import nu.marginalia.service.server.Service;
|
||||||
|
|
||||||
|
public class QueryService extends Service {
|
||||||
|
@Inject
|
||||||
|
public QueryService(BaseServiceParams params) {
|
||||||
|
super(params);
|
||||||
|
}
|
||||||
|
}
|
@ -54,6 +54,16 @@ services:
|
|||||||
- "127.0.0.1:7004:4000"
|
- "127.0.0.1:7004:4000"
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
- mariadb
|
||||||
|
query-service:
|
||||||
|
<<: *service
|
||||||
|
image: "marginalia.nu/query-service"
|
||||||
|
container_name: "query-service"
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:5022:5022"
|
||||||
|
- "127.0.0.1:4022:5000"
|
||||||
|
- "127.0.0.1:7022:4000"
|
||||||
|
depends_on:
|
||||||
|
- mariadb
|
||||||
dating-service:
|
dating-service:
|
||||||
<<: *service
|
<<: *service
|
||||||
image: "marginalia.nu/dating-service"
|
image: "marginalia.nu/dating-service"
|
||||||
|
@ -4,6 +4,7 @@ include 'code:services-core:index-service'
|
|||||||
include 'code:services-core:assistant-service'
|
include 'code:services-core:assistant-service'
|
||||||
include 'code:services-core:search-service'
|
include 'code:services-core:search-service'
|
||||||
include 'code:services-core:control-service'
|
include 'code:services-core:control-service'
|
||||||
|
include 'code:services-core:query-service'
|
||||||
|
|
||||||
include 'code:services-satellite:api-service'
|
include 'code:services-satellite:api-service'
|
||||||
include 'code:services-satellite:dating-service'
|
include 'code:services-satellite:dating-service'
|
||||||
|
Loading…
Reference in New Issue
Block a user