Search in sources :

Example 1 with CommandLineFacade

use of com.netflix.titus.testkit.util.cli.CommandLineFacade in project titus-control-plane by Netflix.

the class EmbeddedTitusStackRunner method main.

public static void main(String[] args) throws InterruptedException {
    CommandLineFacade cliFacade = buildCliFacade(args);
    EmbeddedTitusMaster titusMaster = EmbeddedTitusMaster.aTitusMaster().withEmbeddedKubeCluster(EmbeddedKubeClusters.basicCluster(2)).withApiPort(8080).withGrpcPort(7104).withEnableDisruptionBudget(true).build();
    boolean federationEnabled = cliFacade.isEnabled("f");
    EmbeddedTitusCell cell = EmbeddedTitusCell.aTitusCell().withMaster(titusMaster).withGateway(EmbeddedTitusGateway.aDefaultTitusGateway().withMasterEndpoint("localhost", 8090, 8080).withHttpPort(8081).withGrpcPort(8091).withProperty("titus.relocation.grpcClient.grpcPort", "7105").withProperty("titus.feature.mergingTaskMigrationPlanInGatewayEnabled", "true").build(), !federationEnabled).build();
    cell.boot();
    if (federationEnabled) {
        EmbeddedTitusFederation stack = EmbeddedTitusFederation.aDefaultTitusFederation().withCell(".*", cell).withHttpPort(8082).withGrpcPort(8092).build();
        stack.boot();
    }
    System.out.println("TitusStack started");
    Thread.sleep(24 * 60 * 60 * 1000L);
}
Also used : EmbeddedTitusFederation(com.netflix.titus.testkit.embedded.federation.EmbeddedTitusFederation) EmbeddedTitusMaster(com.netflix.titus.testkit.embedded.cell.master.EmbeddedTitusMaster) CommandLineFacade(com.netflix.titus.testkit.util.cli.CommandLineFacade) EmbeddedTitusCell(com.netflix.titus.testkit.embedded.cell.EmbeddedTitusCell)

Example 2 with CommandLineFacade

use of com.netflix.titus.testkit.util.cli.CommandLineFacade in project titus-control-plane by Netflix.

the class EmbeddedTitusStackRunner method buildCliFacade.

private static CommandLineFacade buildCliFacade(String[] args) {
    CommandLineFacade cliFacade = CommandLineBuilder.newApacheCli().withHostAndPortOption("Simulator/GRPC").withOption(Option.builder("f").longOpt("federation").argName("federation_enabled").hasArg(false).desc("Run TitusFederation").build()).build(args);
    if (cliFacade.hasHelpOption()) {
        cliFacade.printHelp("EmbeddedTitusStackRunner");
        System.exit(-1);
    }
    return cliFacade;
}
Also used : CommandLineFacade(com.netflix.titus.testkit.util.cli.CommandLineFacade)

Aggregations

CommandLineFacade (com.netflix.titus.testkit.util.cli.CommandLineFacade)2 EmbeddedTitusCell (com.netflix.titus.testkit.embedded.cell.EmbeddedTitusCell)1 EmbeddedTitusMaster (com.netflix.titus.testkit.embedded.cell.master.EmbeddedTitusMaster)1 EmbeddedTitusFederation (com.netflix.titus.testkit.embedded.federation.EmbeddedTitusFederation)1