Package org.jclouds.scriptbuilder.domain

Examples of org.jclouds.scriptbuilder.domain.Statement


  private void installAllKnownModules(ClusterActionEvent event) throws IOException {
    Map<String, String> moduleProps = ModulePropertiesFromConfiguration.INSTANCE.apply(event.getClusterSpec()
          .getConfigurationForKeysWithPrefix(PUPPET));

    StatementToInstallModule statementMaker = getStatementToInstallModuleForAction.apply(event);
    Statement installModules = new InstallAllModulesStatementFromProperties(statementMaker).apply(moduleProps);

    event.getStatementBuilder().addStatement(installModules);
    LOG.debug("Puppet finished installing modules for " + event.getInstanceTemplate());
  }
View Full Code Here


    LOG.info("Finished running {} phase scripts on all cluster instances", phaseName);
  }
 
  public ListenableFuture<ExecResponse> runStatementOnInstanceInCluster(StatementBuilder statementBuilder,
      Instance instance, ClusterSpec clusterSpec, RunScriptOptions options) {
    Statement statement = statementBuilder.name(getAction() + "-"
          + Joiner.on('_').join(instance.getRoles())).build(clusterSpec, instance);
    ComputeService compute = getCompute().apply(clusterSpec).getComputeService();
    return compute.submitScriptOnNode(
              instance.getId(),
              statement,
View Full Code Here

    LOG.info("Configuring template for {}", name);

    statementBuilder.name(name);
    ensureUserExistsAndAuthorizeSudo(statementBuilder, clusterSpec.getClusterUser(),
        clusterSpec.getPublicKey(), clusterSpec.getPrivateKey());
    Statement bootstrap = statementBuilder.build(clusterSpec);

    if (LOG.isDebugEnabled()) {
      LOG.debug("Running script {}:\n{}", name, bootstrap.render(OsFamily.UNIX));
    }

    TemplateBuilder templateBuilder = computeService.templateBuilder().from(
        instanceTemplate.getTemplate() != null ? instanceTemplate.getTemplate() :
        clusterSpec.getTemplate());
View Full Code Here

   * {@link ClusterActionEvent}.
   */
  public static void addRunUrl(ClusterActionEvent event, String runUrl,
                               String... args)
    throws IOException {
    Statement statement = new RunUrlStatement(
                                              event.getClusterSpec().getRunUrlBase(), runUrl, args);
    addStatement(event, statement);
  }
View Full Code Here

   }

   @Test(dependsOnMethods = "testCanUpdateRunList")
   public void testRunNodesWithBootstrap() throws IOException {

      Statement bootstrap = view.getChefService().createBootstrapScriptForGroup(group);

      try {
         nodes = computeContext.getComputeService().createNodesInGroup(group, 1, runScript(bootstrap));
      } catch (RunNodesException e) {
         nodes = concat(e.getSuccessfulNodes(), e.getNodeErrors().keySet());
View Full Code Here

    controller.destroyCluster(clusterSpec);
  }

  @Test
  public void testVersion() throws Exception {
    Statement checkVersion = Statements.exec("ls /etc/alternatives/hadoop-lib");
    Map<? extends NodeMetadata, ExecResponse> responses =
       controller.runScriptOnNodesMatching(clusterSpec, ALL, checkVersion);

    printResponses(checkVersion, responses);
    assertResponsesContain(responses, checkVersion, "cdh3");
View Full Code Here

    LOG.info("Configuring template for {}", name);

    statementBuilder.name(name);
    ensureUserExistsAndAuthorizeSudo(statementBuilder, clusterSpec.getClusterUser(),
        clusterSpec.getPublicKey(), clusterSpec.getPrivateKey());
    Statement bootstrap = statementBuilder.build(clusterSpec);

    if (LOG.isDebugEnabled()) {
      LOG.debug("Running script {}:\n{}", name, bootstrap.render(OsFamily.UNIX));
    }

    TemplateBuilder templateBuilder = computeService.templateBuilder().from(
        instanceTemplate.getTemplate() != null ? instanceTemplate.getTemplate() :
        clusterSpec.getTemplate());
View Full Code Here

   * {@link ClusterActionEvent}.
   */
  public static void addRunUrl(ClusterActionEvent event, String runUrl,
      String... args)
      throws IOException {
    Statement statement = new RunUrlStatement(
        event.getClusterSpec().getRunUrlBase(), runUrl, args);
    addStatement(event, statement);
  }
View Full Code Here

    LOG.info("Configuring template for {}", name);

    statementBuilder.name(name);
    ensureUserExistsAndAuthorizeSudo(statementBuilder, clusterSpec.getClusterUser(),
        clusterSpec.getPublicKey(), clusterSpec.getPrivateKey());
    Statement bootstrap = statementBuilder.build(clusterSpec);

    if (LOG.isDebugEnabled()) {
      LOG.debug("Running script {}:\n{}", name, bootstrap.render(OsFamily.UNIX));
    }

    TemplateBuilder templateBuilder = computeService.templateBuilder().from(
        instanceTemplate.getTemplate() != null ? instanceTemplate.getTemplate() :
        clusterSpec.getTemplate());
View Full Code Here

    LOG.info("Finished running {} phase scripts on all cluster instances", phaseName);
  }
 
  public ListenableFuture<ExecResponse> runStatementOnInstanceInCluster(StatementBuilder statementBuilder,
      Instance instance, ClusterSpec clusterSpec, RunScriptOptions options) {
    Statement statement = statementBuilder.name(getAction() + "-"
          + Joiner.on('_').join(instance.getRoles())).build(clusterSpec, instance);
    ComputeService compute = getCompute().apply(clusterSpec).getComputeService();
    return compute.submitScriptOnNode(
              instance.getId(),
              statement,
View Full Code Here

TOP

Related Classes of org.jclouds.scriptbuilder.domain.Statement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.