use of com.spotify.helios.master.MasterMain in project helios by spotify.
the class SystemTestBase method startMaster.
protected MasterMain startMaster(final String... args) throws Exception {
final MasterMain main = new MasterMain(args);
main.startAsync().awaitRunning();
services.add(main);
return main;
}
use of com.spotify.helios.master.MasterMain in project helios by spotify.
the class SystemTestBase method startDefaultMaster.
protected MasterMain startDefaultMaster(final int offset, final String... args) throws Exception {
final List<String> argsList = setupDefaultMaster(offset, args);
if (argsList == null) {
return null;
}
final MasterMain master = startMaster(argsList.toArray(new String[argsList.size()]));
waitForMasterToBeFullyUp();
return master;
}
use of com.spotify.helios.master.MasterMain in project helios by spotify.
the class SystemTestBase method startMaster.
MasterMain startMaster(final CuratorClientFactory curatorClientFactory, final String... args) throws Exception {
final MasterMain main = new MasterMain(curatorClientFactory, args);
main.startAsync().awaitRunning();
services.add(main);
return main;
}
use of com.spotify.helios.master.MasterMain in project helios by spotify.
the class SystemTestBase method startDefaultMasters.
protected Map<String, MasterMain> startDefaultMasters(final int numMasters, String... args) throws Exception {
final Map<String, MasterMain> masters = Maps.newHashMap();
for (int i = 0; i < numMasters; i++) {
final String name = TEST_MASTER + i;
final List<String> argsList = Lists.newArrayList(args);
argsList.addAll(asList("--name", name));
masters.put(name, startDefaultMaster(i, argsList.toArray(new String[argsList.size()])));
}
return masters;
}
use of com.spotify.helios.master.MasterMain in project helios by spotify.
the class DeploymentGroupTest method testRollingUpdateCoordination.
@Test
public void testRollingUpdateCoordination() throws Exception {
// stop the default master
master.stopAsync().awaitTerminated();
// start a bunch of masters and agents
final Map<String, MasterMain> masters = startDefaultMasters(3);
final Map<String, AgentMain> agents = Maps.newLinkedHashMap();
for (int i = 0; i < 20; i++) {
final String name = TEST_HOST + i;
agents.put(name, startDefaultAgent(name, "--labels", TEST_LABEL));
}
// create a deployment group and start rolling out
cli("create-deployment-group", "--json", TEST_GROUP, TEST_LABEL);
final JobId jobId = createJob(testJobName, testJobVersion, BUSYBOX, IDLE_COMMAND);
cli("rolling-update", "--async", "--par", String.valueOf(agents.size()), testJobNameAndVersion, TEST_GROUP);
// wait until the task is running on the final agent
awaitTaskState(jobId, getLast(agents.keySet()), TaskStatus.State.RUNNING);
// ensure that all masters were involved
final Set<String> deployingMasters = Sets.newHashSet();
final Map<String, HostStatus> hostStatuses = defaultClient().hostStatuses(Lists.newArrayList(agents.keySet())).get();
for (final HostStatus status : hostStatuses.values()) {
for (final Deployment deployment : status.getJobs().values()) {
deployingMasters.add(deployment.getDeployerMaster());
}
}
assertEquals(masters.size(), deployingMasters.size());
}
Aggregations