Search in sources :

Example 11 with BashCommand

use of com.hazelcast.simulator.utils.BashCommand in project hazelcast-simulator by hazelcast.

the class ScriptExecutor method newBashScriptCallable.

private Callable<String> newBashScriptCallable(final String command) {
    Callable<String> task;
    task = new Callable<String>() {

        @Override
        public String call() throws Exception {
            Map<String, Object> environment = new HashMap<String, Object>();
            environment.put("PID", NativeUtils.getPID());
            return new BashCommand(command).setDirectory(getUserDir()).addEnvironment(environment).setThrowsException(true).execute();
        }
    };
    return task;
}
Also used : BashCommand(com.hazelcast.simulator.utils.BashCommand) Map(java.util.Map) HashMap(java.util.HashMap)

Example 12 with BashCommand

use of com.hazelcast.simulator.utils.BashCommand in project hazelcast-simulator by hazelcast.

the class HazelcastDriver method install.

@Override
public void install() {
    String cloud = get("CLOUD_PROVIDER");
    if ("embedded".equals(cloud)) {
        return;
    }
    String versionSpec = get("VERSION_SPEC");
    LOGGER.info("Installing versionSpec [" + versionSpec + "] on " + agents.size() + " agents...");
    String publicIps = "";
    if (!"local".equals(cloud)) {
        publicIps = AgentData.publicAddressesString(agents);
    }
    String vendor = get("VENDOR");
    String installFile = getConfigurationFile("install-" + vendor + ".sh").getPath();
    LOGGER.info("Installing '" + vendor + "' version '" + versionSpec + "' on Agents using " + installFile);
    new BashCommand(installFile).addParams(get("SESSION_ID"), versionSpec, publicIps).addEnvironment(properties).execute();
    LOGGER.info("Successfully installed '" + vendor + "'");
    LOGGER.info("Install successful!");
}
Also used : BashCommand(com.hazelcast.simulator.utils.BashCommand)

Aggregations

BashCommand (com.hazelcast.simulator.utils.BashCommand)12 AgentData.publicAddressesString (com.hazelcast.simulator.coordinator.registry.AgentData.publicAddressesString)4 AgentData (com.hazelcast.simulator.coordinator.registry.AgentData)2 CommandLineExitException (com.hazelcast.simulator.utils.CommandLineExitException)2 UuidUtil.newUnsecureUuidString (com.hazelcast.simulator.utils.UuidUtil.newUnsecureUuidString)2 AgentsFile (com.hazelcast.simulator.common.AgentsFile)1 ProvisionerUtils.getInitScriptFile (com.hazelcast.simulator.provisioner.ProvisionerUtils.getInitScriptFile)1 FileUtils.getConfigurationFile (com.hazelcast.simulator.utils.FileUtils.getConfigurationFile)1 FileUtils.newFile (com.hazelcast.simulator.utils.FileUtils.newFile)1 File (java.io.File)1 Collections.singletonList (java.util.Collections.singletonList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 Future (java.util.concurrent.Future)1