private StopAgentTask(Logger logger, Bash bash, SimulatorProperties properties, AgentData agentData, String startHarakiriMonitorCommand) { this.logger = logger; this.bash = bash; this.runMode = CloudProviderUtils.runMode(properties); this.ip = agentData.getPublicAddress(); this.startHarakiriMonitorCommand = startHarakiriMonitorCommand; }
public void run() { if (runMode(simulatorProperties) == RunMode.Embedded) { return; } String ipString = ""; if (runMode(simulatorProperties) == RunMode.Remote) { ipString = join(publicIps, ","); } String vendor = simulatorProperties.get("VENDOR"); String installFile = getConfigurationFile("install-" + vendor + ".sh").getPath(); for (String versionSpec : versionSpecs) { LOGGER.info("Installing '" + vendor + "' version '" + versionSpec + "' on Agents using " + installFile); new BashCommand(installFile) .addParams(sessionId, versionSpec, ipString) .addEnvironment(simulatorProperties.asMap()) .execute(); LOGGER.info("Successfully installed '" + vendor + "'"); } } }
private StartAgentTask(Logger logger, Bash bash, SimulatorProperties properties, AgentData agentData, int agentPort) { this.logger = logger; this.bash = bash; this.runMode = CloudProviderUtils.runMode(properties); this.ip = agentData.getPublicAddress(); this.mandatoryParameters = format("--addressIndex %d --publicAddress %s --port %s", agentData.getAddressIndex(), ip, agentPort); this.optionalParameters = format(" --threadPoolSize %d --workerLastSeenTimeoutSeconds %d", properties.getAgentThreadPoolSize(), properties.getWorkerLastSeenTimeoutSeconds()); if (isEC2(properties)) { this.ec2Parameters = format(" --cloudProvider %s --cloudIdentity %s --cloudCredential %s", properties.getCloudProvider(), properties.getCloudIdentity(), properties.getCloudCredential()); } else { this.ec2Parameters = ""; } }
public static void checkInstallation(Bash bash, SimulatorProperties properties, ComponentRegistry registry) { if (runMode(properties) != RunMode.Remote) { return; } ThreadSpawner spawner = new ThreadSpawner("checkInstallation", true); for (AgentData agentData : registry.getAgents()) { spawner.spawn(new CheckAgentInstallationTask(agentData, bash)); } spawner.awaitCompletion(); }