Search in sources :

Example 1 with GRPCServer

use of com.netflix.conductor.grpc.server.GRPCServer in project conductor by Netflix.

the class MySQLGrpcEndToEndTest method setup.

@BeforeClass
public static void setup() throws Exception {
    TestEnvironment.setup();
    System.setProperty(GRPCServerConfiguration.ENABLED_PROPERTY_NAME, "true");
    System.setProperty(GRPCServerConfiguration.PORT_PROPERTY_NAME, "8094");
    System.setProperty(ElasticSearchConfiguration.EMBEDDED_PORT_PROPERTY_NAME, "9204");
    System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_URL_PROPERTY_NAME, "localhost:9304");
    System.setProperty(Configuration.EXECUTION_LOCK_ENABLED_PROPERTY_NAME, "false");
    Injector bootInjector = Guice.createInjector(new BootstrapModule());
    Injector serverInjector = Guice.createInjector(bootInjector.getInstance(ModulesProvider.class).get());
    search = serverInjector.getInstance(EmbeddedElasticSearchProvider.class).get().get();
    search.start();
    Optional<GRPCServer> server = serverInjector.getInstance(GRPCServerProvider.class).get();
    assertTrue("failed to instantiate GRPCServer", server.isPresent());
    server.get().start();
    taskClient = new TaskClient("localhost", SERVER_PORT);
    workflowClient = new WorkflowClient("localhost", SERVER_PORT);
    metadataClient = new MetadataClient("localhost", SERVER_PORT);
}
Also used : GRPCServerProvider(com.netflix.conductor.grpc.server.GRPCServerProvider) TaskClient(com.netflix.conductor.client.grpc.TaskClient) GRPCServer(com.netflix.conductor.grpc.server.GRPCServer) MetadataClient(com.netflix.conductor.client.grpc.MetadataClient) Injector(com.google.inject.Injector) WorkflowClient(com.netflix.conductor.client.grpc.WorkflowClient) EmbeddedElasticSearchProvider(com.netflix.conductor.elasticsearch.EmbeddedElasticSearchProvider) BootstrapModule(com.netflix.conductor.bootstrap.BootstrapModule) BeforeClass(org.junit.BeforeClass)

Example 2 with GRPCServer

use of com.netflix.conductor.grpc.server.GRPCServer in project conductor by Netflix.

the class Main method main.

public static void main(String[] args) throws Exception {
    BootstrapUtil.loadConfigFile(args.length > 0 ? args[0] : System.getenv("CONDUCTOR_CONFIG_FILE"));
    if (args.length == 2) {
        System.out.println("Using log4j config " + args[1]);
        PropertyConfigurator.configure(new FileInputStream(new File(args[1])));
    }
    Injector bootstrapInjector = Guice.createInjector(new BootstrapModule());
    ModulesProvider modulesProvider = bootstrapInjector.getInstance(ModulesProvider.class);
    Injector serverInjector = Guice.createInjector(modulesProvider.get());
    Optional<EmbeddedElasticSearch> embeddedElasticSearch = serverInjector.getInstance(EmbeddedElasticSearchProvider.class).get();
    embeddedElasticSearch.ifPresent(BootstrapUtil::startEmbeddedElasticsearchServer);
    BootstrapUtil.setupIndex(serverInjector.getInstance(IndexDAO.class));
    try {
        serverInjector.getInstance(IndexDAO.class).setup();
    } catch (Exception e) {
        e.printStackTrace(System.err);
        System.exit(3);
    }
    BootstrapUtil.configureSummaryUtil(serverInjector.getInstance(Configuration.class));
    System.out.println("\n\n\n");
    System.out.println("                     _            _             ");
    System.out.println("  ___ ___  _ __   __| |_   _  ___| |_ ___  _ __ ");
    System.out.println(" / __/ _ \\| '_ \\ / _` | | | |/ __| __/ _ \\| '__|");
    System.out.println("| (_| (_) | | | | (_| | |_| | (__| || (_) | |   ");
    System.out.println(" \\___\\___/|_| |_|\\__,_|\\__,_|\\___|\\__\\___/|_|   ");
    System.out.println("\n\n\n");
    Optional<GRPCServer> grpcServer = serverInjector.getInstance(GRPCServerProvider.class).get();
    grpcServer.ifPresent(BootstrapUtil::startGRPCServer);
    serverInjector.getInstance(JettyServerProvider.class).get().ifPresent(server -> {
        try {
            server.start();
        } catch (Exception ioe) {
            ioe.printStackTrace(System.err);
            System.exit(3);
        }
    });
}
Also used : GRPCServerProvider(com.netflix.conductor.grpc.server.GRPCServerProvider) Configuration(com.netflix.conductor.core.config.Configuration) EmbeddedElasticSearchProvider(com.netflix.conductor.elasticsearch.EmbeddedElasticSearchProvider) FileInputStream(java.io.FileInputStream) IndexDAO(com.netflix.conductor.dao.IndexDAO) GRPCServer(com.netflix.conductor.grpc.server.GRPCServer) EmbeddedElasticSearch(com.netflix.conductor.elasticsearch.EmbeddedElasticSearch) Injector(com.google.inject.Injector) File(java.io.File)

Example 3 with GRPCServer

use of com.netflix.conductor.grpc.server.GRPCServer in project conductor by Netflix.

the class GrpcEndToEndTest method setup.

@BeforeClass
public static void setup() throws Exception {
    TestEnvironment.setup();
    System.setProperty(GRPCServerConfiguration.ENABLED_PROPERTY_NAME, "true");
    System.setProperty(GRPCServerConfiguration.PORT_PROPERTY_NAME, "8092");
    System.setProperty(ElasticSearchConfiguration.EMBEDDED_PORT_PROPERTY_NAME, "9202");
    System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_URL_PROPERTY_NAME, "localhost:9302");
    System.setProperty(Configuration.EXECUTION_LOCK_ENABLED_PROPERTY_NAME, "false");
    Injector bootInjector = Guice.createInjector(new BootstrapModule());
    Injector serverInjector = Guice.createInjector(bootInjector.getInstance(ModulesProvider.class).get());
    search = serverInjector.getInstance(EmbeddedElasticSearchProvider.class).get().get();
    search.start();
    Optional<GRPCServer> server = serverInjector.getInstance(GRPCServerProvider.class).get();
    assertTrue("failed to instantiate GRPCServer", server.isPresent());
    server.get().start();
    taskClient = new TaskClient("localhost", SERVER_PORT);
    workflowClient = new WorkflowClient("localhost", SERVER_PORT);
    metadataClient = new MetadataClient("localhost", SERVER_PORT);
}
Also used : GRPCServerProvider(com.netflix.conductor.grpc.server.GRPCServerProvider) TaskClient(com.netflix.conductor.client.grpc.TaskClient) GRPCServer(com.netflix.conductor.grpc.server.GRPCServer) MetadataClient(com.netflix.conductor.client.grpc.MetadataClient) Injector(com.google.inject.Injector) WorkflowClient(com.netflix.conductor.client.grpc.WorkflowClient) EmbeddedElasticSearchProvider(com.netflix.conductor.elasticsearch.EmbeddedElasticSearchProvider) BootstrapModule(com.netflix.conductor.bootstrap.BootstrapModule) BeforeClass(org.junit.BeforeClass)

Aggregations

Injector (com.google.inject.Injector)3 EmbeddedElasticSearchProvider (com.netflix.conductor.elasticsearch.EmbeddedElasticSearchProvider)3 GRPCServer (com.netflix.conductor.grpc.server.GRPCServer)3 GRPCServerProvider (com.netflix.conductor.grpc.server.GRPCServerProvider)3 BootstrapModule (com.netflix.conductor.bootstrap.BootstrapModule)2 MetadataClient (com.netflix.conductor.client.grpc.MetadataClient)2 TaskClient (com.netflix.conductor.client.grpc.TaskClient)2 WorkflowClient (com.netflix.conductor.client.grpc.WorkflowClient)2 BeforeClass (org.junit.BeforeClass)2 Configuration (com.netflix.conductor.core.config.Configuration)1 IndexDAO (com.netflix.conductor.dao.IndexDAO)1 EmbeddedElasticSearch (com.netflix.conductor.elasticsearch.EmbeddedElasticSearch)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1