Skip to content
This repository has been archived by the owner on Jun 22, 2018. It is now read-only.

Commit

Permalink
Adding support for agent attributes
Browse files Browse the repository at this point in the history
Added the ability to define attributes for each mesos agent. Useful for
testing constraints.
  • Loading branch information
mberkow committed Mar 15, 2017
1 parent 1f85acb commit 8b46603
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ class MesosAgentConfig extends MesosContainerConfig {

public static final String MESOS_AGENT_IMAGE = "containersol/mesos-agent"
public static final int DEFAULT_MESOS_AGENT_PORT = 5051
public static final String DEFAULT_MESOS_ATTRIBUTES = ""

int portNumber = DEFAULT_MESOS_AGENT_PORT
String attributes = DEFAULT_MESOS_ATTRIBUTES

AgentResourcesConfig resources = new AgentResourcesConfig()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public String getResources() {
return config.getResources().asMesosString();
}

public String getAttributeString(){
return config.getAttributes();
}

public MesosAgentConfig getConfig() {
return config;
}
Expand Down Expand Up @@ -117,6 +121,7 @@ private Map<String, String> getMesosAgentEnvVars() {
envs.put("MESOS_ISOLATION", "filesystem/linux,docker/runtime,cgroups/cpu,cgroups/mem");
envs.put("MESOS_IMAGE_PROVIDERS", "docker");
envs.put("MESOS_SYSTEMD_ENABLE_SUPPORT", "false");
envs.put("MESOS_ATTRIBUTES", getAttributeString());
envs.put("MESOS_PORT", String.valueOf(getServicePort()));
envs.put("MESOS_MASTER", getFormattedZKAddress());
envs.put("MESOS_SWITCH_USER", "false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ minimesos {
imageTag = "1.0.0-0.1.0"
loggingLevel = "# INHERIT FROM CLUSTER"
portNumber = 5051
attributes = "az:0a"

resources {

Expand Down

0 comments on commit 8b46603

Please sign in to comment.