Search in sources :

Example 1 with Environment

use of io.pravega.test.system.framework.Environment in project pravega by pravega.

the class ControllerFailoverTest method setup.

@Environment
public static void setup() throws MarathonException, ExecutionException {
    // 1. check if zk is running, if not start it
    Service zkService = Utils.createZookeeperService();
    if (!zkService.isRunning()) {
        zkService.start(true);
    }
    List<URI> zkUris = zkService.getServiceDetails();
    log.debug("zookeeper service details: {}", zkUris);
    // get the zk ip details and pass it to bk, host, controller
    URI zkUri = zkUris.get(0);
    // 2, check if bk is running, otherwise start, get the zk ip
    Service bkService = Utils.createBookkeeperService(zkUri);
    if (!bkService.isRunning()) {
        bkService.start(true);
    }
    List<URI> bkUris = bkService.getServiceDetails();
    log.debug("bookkeeper service details: {}", bkUris);
    // 3. start controller
    Service controllerService = Utils.createPravegaControllerService(zkUri);
    if (!controllerService.isRunning()) {
        controllerService.start(true);
    }
    Futures.getAndHandleExceptions(controllerService.scaleService(2), ExecutionException::new);
    List<URI> conUris = controllerService.getServiceDetails();
    log.info("conuris {} {}", conUris.get(0), conUris.get(1));
    log.debug("Pravega Controller service  details: {}", conUris);
    // Fetch all the RPC endpoints and construct the client URIs.
    final List<String> uris = conUris.stream().filter(uri -> Utils.DOCKER_BASED ? uri.getPort() == Utils.DOCKER_CONTROLLER_PORT : uri.getPort() == Utils.MARATHON_CONTROLLER_PORT).map(URI::getAuthority).collect(Collectors.toList());
    URI controllerURI = URI.create("tcp://" + String.join(",", uris));
    log.info("Controller Service direct URI: {}", controllerURI);
    // 4.start host
    Service segService = Utils.createPravegaSegmentStoreService(zkUri, conUris.get(0));
    if (!segService.isRunning()) {
        segService.start(true);
    }
    List<URI> segUris = segService.getServiceDetails();
    log.debug("pravega host service details: {}", segUris);
}
Also used : Service(io.pravega.test.system.framework.services.Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ExecutionException(java.util.concurrent.ExecutionException) URI(java.net.URI) Environment(io.pravega.test.system.framework.Environment)

Example 2 with Environment

use of io.pravega.test.system.framework.Environment in project pravega by pravega.

the class MultiControllerTest method setup.

@Environment
public static void setup() throws MarathonException, ExecutionException {
    Service zkService = Utils.createZookeeperService();
    if (!zkService.isRunning()) {
        zkService.start(true);
    }
    List<URI> zkUris = zkService.getServiceDetails();
    log.info("zookeeper service details: {}", zkUris);
    Service controllerService = Utils.createPravegaControllerService(zkUris.get(0));
    if (!controllerService.isRunning()) {
        controllerService.start(true);
    }
    Futures.getAndHandleExceptions(controllerService.scaleService(3), ExecutionException::new);
    List<URI> conUris = controllerService.getServiceDetails();
    log.info("conuris {} {}", conUris.get(0), conUris.get(1));
    log.debug("Pravega Controller service  details: {}", conUris);
    // Fetch all the RPC endpoints and construct the client URIs.
    final List<String> uris = conUris.stream().filter(uri -> DOCKER_BASED ? uri.getPort() == Utils.DOCKER_CONTROLLER_PORT : uri.getPort() == Utils.MARATHON_CONTROLLER_PORT).map(URI::getAuthority).collect(Collectors.toList());
    URI controllerURI = URI.create("tcp://" + String.join(",", uris));
    log.info("Controller Service direct URI: {}", controllerURI);
}
Also used : Service(io.pravega.test.system.framework.services.Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ExecutionException(java.util.concurrent.ExecutionException) URI(java.net.URI) Environment(io.pravega.test.system.framework.Environment)

Example 3 with Environment

use of io.pravega.test.system.framework.Environment in project pravega by pravega.

the class ControllerRestApiTest method setup.

/**
 * This is used to setup the various services required by the system test framework.
 *
 * @throws InterruptedException If interrupted
 * @throws MarathonException    when error in setup
 * @throws URISyntaxException   If URI is invalid
 */
@Environment
public static void setup() throws MarathonException {
    // 1. check if zk is running, if not start it
    Service zkService = Utils.createZookeeperService();
    if (!zkService.isRunning()) {
        zkService.start(true);
    }
    List<URI> zkUris = zkService.getServiceDetails();
    log.debug("zookeeper service details: {}", zkUris);
    // get the zk ip details and pass it to bk, host, controller
    URI zkUri = zkUris.get(0);
    // 2, check if bk is running, otherwise start, get the zk ip
    Service bkService = Utils.createBookkeeperService(zkUri);
    if (!bkService.isRunning()) {
        bkService.start(true);
    }
    List<URI> bkUris = bkService.getServiceDetails();
    log.debug("bookkeeper service details: {}", bkUris);
    // 3. start controller
    Service conService = Utils.createPravegaControllerService(zkUri);
    if (!conService.isRunning()) {
        conService.start(true);
    }
    List<URI> conUris = conService.getServiceDetails();
    log.debug("Pravega Controller service details: {}", conUris);
    // 4.start host
    Service segService = Utils.createPravegaSegmentStoreService(zkUri, conUris.get(0));
    if (!segService.isRunning()) {
        segService.start(true);
    }
    List<URI> segUris = segService.getServiceDetails();
    log.debug("pravega host service details: {}", segUris);
}
Also used : Service(io.pravega.test.system.framework.services.Service) URI(java.net.URI) Environment(io.pravega.test.system.framework.Environment)

Example 4 with Environment

use of io.pravega.test.system.framework.Environment in project pravega by pravega.

the class PravegaControllerTest method setup.

/**
 * This is used to setup the various services required by the system test framework.
 *
 * @throws MarathonException if error in setup
 */
@Environment
public static void setup() throws MarathonException {
    Service zk = Utils.createZookeeperService();
    if (!zk.isRunning()) {
        zk.start(true);
    }
    Service con = Utils.createPravegaControllerService(zk.getServiceDetails().get(0));
    if (!con.isRunning()) {
        con.start(true);
    }
}
Also used : Service(io.pravega.test.system.framework.services.Service) Environment(io.pravega.test.system.framework.Environment)

Example 5 with Environment

use of io.pravega.test.system.framework.Environment in project pravega by pravega.

the class StreamsAndScopesManagementTest method initialize.

/**
 * This is used to setup the services required by the system test framework.
 *
 * @throws MarathonException When error in setup.
 */
@Environment
public static void initialize() throws MarathonException {
    URI zkUri = startZookeeperInstance();
    startBookkeeperInstances(zkUri);
    URI controllerUri = ensureControllerRunning(zkUri);
    ensureSegmentStoreRunning(zkUri, controllerUri);
}
Also used : URI(java.net.URI) Environment(io.pravega.test.system.framework.Environment)

Aggregations

Environment (io.pravega.test.system.framework.Environment)35 URI (java.net.URI)29 Service (io.pravega.test.system.framework.services.Service)11 ExecutionException (java.util.concurrent.ExecutionException)3 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)3 PravegaControllerService (io.pravega.test.system.framework.services.marathon.PravegaControllerService)1