use of com.hubspot.singularity.config.MesosConfiguration in project Singularity by HubSpot.
the class SingularityAuthorizationHelperTest method buildAuthDisabledConfig.
public static SingularityConfiguration buildAuthDisabledConfig() {
AuthConfiguration authConfiguration = new AuthConfiguration();
authConfiguration.setEnabled(false);
SingularityConfiguration configuration = new SingularityConfiguration();
configuration.setAuthConfiguration(authConfiguration);
configuration.setMesosConfiguration(new MesosConfiguration());
return configuration;
}
use of com.hubspot.singularity.config.MesosConfiguration in project Singularity by HubSpot.
the class SingularityMesosSchedulerImpl method start.
public void start() throws Exception {
MesosConfiguration mesosConfiguration = configuration.getMesosConfiguration();
// If more than one host is provided choose at random, we will be redirected if the host is not the master
List<String> masters = Arrays.asList(mesosConfiguration.getMaster().split(","));
String masterUrl;
if (mesosConfiguration.getMesosUsername().isPresent() && mesosConfiguration.getMesosPassword().isPresent()) {
masterUrl = String.format(SCHEDULER_API_URL_CREDENTIALS_FORMAT, mesosConfiguration.getMasterProtocol(), mesosConfiguration.getMesosUsername().get(), mesosConfiguration.getMesosPassword().get(), masters.get(new Random().nextInt(masters.size())));
} else {
masterUrl = String.format(SCHEDULER_API_URL_FORMAT, mesosConfiguration.getMasterProtocol(), masters.get(new Random().nextInt(masters.size())));
}
mesosSchedulerClient.subscribe(masterUrl, this);
}
use of com.hubspot.singularity.config.MesosConfiguration in project Singularity by HubSpot.
the class SingularityAuthorizationHelperTest method buildAuthEnabledConfig.
public static SingularityConfiguration buildAuthEnabledConfig(Set<String> requiredGroups, Set<String> adminGroups, Set<String> jitaGroups) {
AuthConfiguration authConfiguration = new AuthConfiguration();
authConfiguration.setEnabled(true);
authConfiguration.setRequiredGroups(requiredGroups);
authConfiguration.setAdminGroups(adminGroups);
authConfiguration.setJitaGroups(jitaGroups);
SingularityConfiguration configuration = new SingularityConfiguration();
configuration.setAuthConfiguration(authConfiguration);
configuration.setMesosConfiguration(new MesosConfiguration());
return configuration;
}
use of com.hubspot.singularity.config.MesosConfiguration in project Singularity by HubSpot.
the class SingularityTestModule method getSingularityConfigurationForTestingServer.
private static SingularityConfiguration getSingularityConfigurationForTestingServer(final TestingServer ts) {
SingularityConfiguration config = new SingularityConfiguration();
config.setLoadBalancerUri("test");
MesosConfiguration mc = new MesosConfiguration();
mc.setDefaultCpus(1);
mc.setDefaultMemory(128);
mc.setDefaultDisk(1024);
config.setMesosConfiguration(mc);
config.setSmtpConfiguration(new SMTPConfiguration());
ZooKeeperConfiguration zookeeperConfiguration = new ZooKeeperConfiguration();
zookeeperConfiguration.setQuorum(ts.getConnectString());
config.setZooKeeperConfiguration(zookeeperConfiguration);
config.setConsiderTaskHealthyAfterRunningForSeconds(0);
return config;
}
Aggregations