Revert "Update mesos slave to mesos agent"

This reverts commit 15162ce33a.

Mesos services were not working, so reverted the patch
which renamed slave to agent.

Change-Id: I94a9a36e649f48f8e31386226226261ef459ce25
Closes-Bug: #1617407
This commit is contained in:
yatin 2016-08-27 00:22:12 +05:30
parent 53a1b5d7cd
commit 272903ff9e
17 changed files with 212 additions and 212 deletions

View File

@ -277,7 +277,7 @@ the table are linked to more details elsewhere in the user guide.
| `rexray_preempt`_ | - true | false | | `rexray_preempt`_ | - true | false |
| | - false | | | | - false | |
+---------------------------------------+--------------------+---------------+ +---------------------------------------+--------------------+---------------+
| `mesos_agent_isolation`_ | - filesystem/posix | "" | | `mesos_slave_isolation`_ | - filesystem/posix | "" |
| | - filesystem/linux | | | | - filesystem/linux | |
| | - filesystem/shared| | | | - filesystem/shared| |
| | - posix/cpu | | | | - posix/cpu | |
@ -288,13 +288,13 @@ the table are linked to more details elsewhere in the user guide.
| | - docker/runtime | | | | - docker/runtime | |
| | - namespaces/pid | | | | - namespaces/pid | |
+---------------------------------------+--------------------+---------------+ +---------------------------------------+--------------------+---------------+
| `mesos_agent_image_providers`_ | - appc | "" | | `mesos_slave_image_providers`_ | - appc | "" |
| | - docker | | | | - docker | |
| | - appc,docker | | | | - appc,docker | |
+---------------------------------------+--------------------+---------------+ +---------------------------------------+--------------------+---------------+
| `mesos_agent_work_dir`_ | (directory name) | "" | | `mesos_slave_work_dir`_ | (directory name) | "" |
+---------------------------------------+--------------------+---------------+ +---------------------------------------+--------------------+---------------+
| `mesos_agent_executor_env_variables`_ | (file name) | "" | | `mesos_slave_executor_env_variables`_ | (file name) | "" |
+---------------------------------------+--------------------+---------------+ +---------------------------------------+--------------------+---------------+
@ -1038,9 +1038,9 @@ Log into the servers
Mesos Mesos
===== =====
A Mesos cluster consists of a pool of servers running as Mesos agents, A Mesos cluster consists of a pool of servers running as Mesos slaves,
managed by a set of servers running as Mesos masters. Mesos manages managed by a set of servers running as Mesos masters. Mesos manages
the resources from the agents but does not itself deploy containers. the resources from the slaves but does not itself deploy containers.
Instead, one of more Mesos frameworks running on the Mesos cluster would Instead, one of more Mesos frameworks running on the Mesos cluster would
accept user requests on their own endpoint, using their particular accept user requests on their own endpoint, using their particular
API. These frameworks would then negotiate the resources with Mesos API. These frameworks would then negotiate the resources with Mesos
@ -1067,18 +1067,18 @@ Refer to the `ClusterTemplate`_ and `Cluster`_ sections for the full list of
parameters. Following are further details relevant to Mesos: parameters. Following are further details relevant to Mesos:
What runs on the servers What runs on the servers
There are two types of servers in the Mesos cluster: masters and agents. There are two types of servers in the Mesos cluster: masters and slaves.
The Docker daemon runs on all servers. On the servers for master, The Docker daemon runs on all servers. On the servers for master,
the Mesos master is run as a process on port 5050 and this is the Mesos master is run as a process on port 5050 and this is
initiated by the upstart service 'mesos-master'. Zookeeper is also initiated by the upstart service 'mesos-master'. Zookeeper is also
run on the master servers, initiated by the upstart service run on the master servers, initiated by the upstart service
'zookeeper'. Zookeeper is used by the master servers for electing 'zookeeper'. Zookeeper is used by the master servers for electing
the leader among the masters, and by the agent servers and the leader among the masters, and by the slave servers and
frameworks to determine the current leader. The framework Marathon frameworks to determine the current leader. The framework Marathon
is run as a process on port 8080 on the master servers, initiated by is run as a process on port 8080 on the master servers, initiated by
the upstart service 'marathon'. On the servers for agent, the Mesos the upstart service 'marathon'. On the servers for slave, the Mesos
agent is run as a process initiated by the upstart service slave is run as a process initiated by the upstart service
'mesos-agent'. 'mesos-slave'.
Number of master (master-count) Number of master (master-count)
Specified in the cluster-create command to indicate how many servers Specified in the cluster-create command to indicate how many servers
@ -1091,8 +1091,8 @@ Number of master (master-count)
Number of agents (node-count) Number of agents (node-count)
Specified in the cluster-create command to indicate how many servers Specified in the cluster-create command to indicate how many servers
will run as Mesos agent in the cluster. Docker daemon is run locally to will run as Mesos slave in the cluster. Docker daemon is run locally to
host containers from users. The agents report their available host containers from users. The slaves report their available
resources to the master and accept request from the master to deploy resources to the master and accept request from the master to deploy
tasks from the frameworks. In this case, the tasks will be to tasks from the frameworks. In this case, the tasks will be to
run Docker containers. run Docker containers.
@ -1118,7 +1118,7 @@ Storage driver (docker-storage-driver)
Image (image-id) Image (image-id)
Specified in the ClusterTemplate to indicate the image to boot the servers Specified in the ClusterTemplate to indicate the image to boot the servers
for the Mesos master and agent. The image binary is loaded in for the Mesos master and slave. The image binary is loaded in
Glance with the attribute 'os_distro = ubuntu'. You can download Glance with the attribute 'os_distro = ubuntu'. You can download
the `ready-built image the `ready-built image
<https://fedorapeople.org/groups/magnum/ubuntu-14.04.3-mesos-0.25.0.qcow2>`_, <https://fedorapeople.org/groups/magnum/ubuntu-14.04.3-mesos-0.25.0.qcow2>`_,
@ -1147,8 +1147,8 @@ _`rexray_preempt`
safety for locking the volume before remounting. The default value safety for locking the volume before remounting. The default value
is False. is False.
_`mesos_agent_isolation` _`mesos_slave_isolation`
This label corresponds to the Mesos parameter for agent This label corresponds to the Mesos parameter for slave
'--isolation'. The isolators are needed to provide proper isolation '--isolation'. The isolators are needed to provide proper isolation
according to the runtime configurations specified in the container according to the runtime configurations specified in the container
image. For more details, refer to the `Mesos configuration image. For more details, refer to the `Mesos configuration
@ -1168,7 +1168,7 @@ _`mesos_agent_isolation`
- docker/runtime - docker/runtime
- namespaces/pid - namespaces/pid
_`mesos_agent_image_providers` _`mesos_slave_image_providers`
This label corresponds to the Mesos parameter for agent This label corresponds to the Mesos parameter for agent
'--image_providers', which tells Mesos containerizer what '--image_providers', which tells Mesos containerizer what
types of container images are allowed. types of container images are allowed.
@ -1182,24 +1182,24 @@ _`mesos_agent_image_providers`
- docker - docker
- appc,docker - appc,docker
_`mesos_agent_work_dir` _`mesos_slave_work_dir`
This label corresponds to the Mesos parameter '--work_dir' for agent. This label corresponds to the Mesos parameter '--work_dir' for slave.
For more details, refer to the `Mesos configuration For more details, refer to the `Mesos configuration
<http://mesos.apache.org/documentation/latest/configuration/>`_. <http://mesos.apache.org/documentation/latest/configuration/>`_.
Valid value is a directory path to use as the work directory for Valid value is a directory path to use as the work directory for
the framework, for example:: the framework, for example::
mesos_agent_work_dir=/tmp/mesos mesos_slave_work_dir=/tmp/mesos
_`mesos_agent_executor_env_variables` _`mesos_slave_executor_env_variables`
This label corresponds to the Mesos parameter for agent This label corresponds to the Mesos parameter for slave
'--executor_environment_variables', which passes additional '--executor_environment_variables', which passes additional
environment variables to the executor and subsequent tasks. environment variables to the executor and subsequent tasks.
For more details, refer to the `Mesos configuration For more details, refer to the `Mesos configuration
<http://mesos.apache.org/documentation/latest/configuration/>`_. <http://mesos.apache.org/documentation/latest/configuration/>`_.
Valid value is the name of a json file, for example:: Valid value is the name of a json file, for example::
mesos_agent_executor_env_variables=/home/ubuntu/test.json mesos_slave_executor_env_variables=/home/ubuntu/test.json
The json file should contain environment variables, for example:: The json file should contain environment variables, for example::
@ -1208,7 +1208,7 @@ _`mesos_agent_executor_env_variables`
"LD_LIBRARY_PATH": "/usr/local/lib" "LD_LIBRARY_PATH": "/usr/local/lib"
} }
By default the executor will inherit the agent's environment By default the executor will inherit the slave's environment
variables. variables.

View File

@ -109,14 +109,14 @@ def validate_labels(labels):
def validate_labels_isolation(labels): def validate_labels_isolation(labels):
"""Validate mesos_agent_isolation""" """Validate mesos_slave_isolation"""
mesos_agent_isolation = labels.get('mesos_agent_isolation') mesos_slave_isolation = labels.get('mesos_slave_isolation')
mesos_agent_isolation_list = mesos_agent_isolation.split(',') mesos_slave_isolation_list = mesos_slave_isolation.split(',')
unsupported_isolations = set(mesos_agent_isolation_list) - set( unsupported_isolations = set(mesos_slave_isolation_list) - set(
SUPPORTED_ISOLATION) SUPPORTED_ISOLATION)
if (len(unsupported_isolations) > 0): if (len(unsupported_isolations) > 0):
raise exception.InvalidParameterValue(_( raise exception.InvalidParameterValue(_(
'property "labels/mesos_agent_isolation" with value ' 'property "labels/mesos_slave_isolation" with value '
'"%(isolation_val)s" is not supported, supported values are: ' '"%(isolation_val)s" is not supported, supported values are: '
'%(supported_isolation)s') % { '%(supported_isolation)s') % {
'isolation_val': ', '.join(list(unsupported_isolations)), 'isolation_val': ', '.join(list(unsupported_isolations)),
@ -125,15 +125,15 @@ def validate_labels_isolation(labels):
def validate_labels_image_providers(labels): def validate_labels_image_providers(labels):
"""Validate mesos_agent_image_providers""" """Validate mesos_slave_image_providers"""
mesos_agent_image_providers = labels.get('mesos_agent_image_providers') mesos_slave_image_providers = labels.get('mesos_slave_image_providers')
mesos_agent_image_providers_list = mesos_agent_image_providers.split(',') mesos_slave_image_providers_list = mesos_slave_image_providers.split(',')
isolation_with_valid_data = False isolation_with_valid_data = False
for image_providers_val in mesos_agent_image_providers_list: for image_providers_val in mesos_slave_image_providers_list:
image_providers_val = image_providers_val.lower() image_providers_val = image_providers_val.lower()
if image_providers_val not in SUPPORTED_IMAGE_PROVIDERS: if image_providers_val not in SUPPORTED_IMAGE_PROVIDERS:
raise exception.InvalidParameterValue(_( raise exception.InvalidParameterValue(_(
'property "labels/mesos_agent_image_providers" with value ' 'property "labels/mesos_slave_image_providers" with value '
'"%(image_providers)s" is not supported, supported values ' '"%(image_providers)s" is not supported, supported values '
'are: %(supported_image_providers)s') % { 'are: %(supported_image_providers)s') % {
'image_providers': image_providers_val, 'image_providers': image_providers_val,
@ -141,26 +141,26 @@ def validate_labels_image_providers(labels):
SUPPORTED_IMAGE_PROVIDERS + ['unspecified'])}) SUPPORTED_IMAGE_PROVIDERS + ['unspecified'])})
if image_providers_val == 'docker': if image_providers_val == 'docker':
mesos_agent_isolation = labels.get('mesos_agent_isolation') mesos_slave_isolation = labels.get('mesos_slave_isolation')
if mesos_agent_isolation is not None: if mesos_slave_isolation is not None:
mesos_agent_isolation_list = mesos_agent_isolation.split(',') mesos_slave_isolation_list = mesos_slave_isolation.split(',')
for isolations_val in mesos_agent_isolation_list: for isolations_val in mesos_slave_isolation_list:
if isolations_val == 'docker/runtime': if isolations_val == 'docker/runtime':
isolation_with_valid_data = True isolation_with_valid_data = True
if mesos_agent_isolation is None or not isolation_with_valid_data: if mesos_slave_isolation is None or not isolation_with_valid_data:
raise exception.RequiredParameterNotProvided(_( raise exception.RequiredParameterNotProvided(_(
"Docker runtime isolator has to be specified if 'docker' " "Docker runtime isolator has to be specified if 'docker' "
"is included in 'mesos_agent_image_providers' Please add " "is included in 'mesos_slave_image_providers' Please add "
"'docker/runtime' to 'mesos_agent_isolation' labels " "'docker/runtime' to 'mesos_slave_isolation' labels "
"flags")) "flags"))
def validate_labels_executor_env_variables(labels): def validate_labels_executor_env_variables(labels):
"""Validate executor_environment_variables""" """Validate executor_environment_variables"""
mesos_agent_executor_env_val = labels.get( mesos_slave_executor_env_val = labels.get(
'mesos_agent_executor_env_variables') 'mesos_slave_executor_env_variables')
try: try:
json.loads(mesos_agent_executor_env_val) json.loads(mesos_slave_executor_env_val)
except ValueError: except ValueError:
err = (_("Json format error")) err = (_("Json format error"))
raise exception.InvalidParameterValue(err) raise exception.InvalidParameterValue(err)
@ -194,8 +194,8 @@ validators = {'image_id': validate_image,
'fixed_network': validate_fixed_network, 'fixed_network': validate_fixed_network,
'labels': validate_labels} 'labels': validate_labels}
labels_validators = {'mesos_agent_isolation': validate_labels_isolation, labels_validators = {'mesos_slave_isolation': validate_labels_isolation,
'mesos_agent_image_providers': 'mesos_slave_image_providers':
validate_labels_image_providers, validate_labels_image_providers,
'mesos_agent_executor_env_variables': 'mesos_slave_executor_env_variables':
validate_labels_executor_env_variables} validate_labels_executor_env_variables}

View File

@ -112,7 +112,7 @@ class Bay(base.APIBase):
"""Api address of cluster master node""" """Api address of cluster master node"""
node_addresses = wsme.wsattr([wtypes.text], readonly=True) node_addresses = wsme.wsattr([wtypes.text], readonly=True)
"""IP addresses of cluster agent nodes""" """IP addresses of cluster slave nodes"""
master_addresses = wsme.wsattr([wtypes.text], readonly=True) master_addresses = wsme.wsattr([wtypes.text], readonly=True)
"""IP addresses of cluster master nodes""" """IP addresses of cluster master nodes"""

View File

@ -122,7 +122,7 @@ class Cluster(base.APIBase):
"""Api address of cluster master node""" """Api address of cluster master node"""
node_addresses = wsme.wsattr([wtypes.text], readonly=True) node_addresses = wsme.wsattr([wtypes.text], readonly=True)
"""IP addresses of cluster agent nodes""" """IP addresses of cluster slave nodes"""
master_addresses = wsme.wsattr([wtypes.text], readonly=True) master_addresses = wsme.wsattr([wtypes.text], readonly=True)
"""IP addresses of cluster master nodes""" """IP addresses of cluster master nodes"""

View File

@ -51,11 +51,11 @@ class MesosMonitor(MonitorBase):
path='/state') path='/state')
master = jsonutils.loads(urlfetch.get(mesos_master_url)) master = jsonutils.loads(urlfetch.get(mesos_master_url))
if self._is_leader(master): if self._is_leader(master):
for agent in master['agents']: for slave in master['slaves']:
self.data['mem_total'] += agent['resources']['mem'] self.data['mem_total'] += slave['resources']['mem']
self.data['mem_used'] += agent['used_resources']['mem'] self.data['mem_used'] += slave['used_resources']['mem']
self.data['cpu_total'] += agent['resources']['cpus'] self.data['cpu_total'] += slave['resources']['cpus']
self.data['cpu_used'] += agent['used_resources']['cpus'] self.data['cpu_used'] += slave['used_resources']['cpus']
break break
def compute_memory_util(self): def compute_memory_util(self):

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
for service in zookeeper mesos-agent mesos-master marathon; do for service in zookeeper mesos-slave mesos-master marathon; do
service $service stop service $service stop
[ -f /etc/init/$service.conf ] && echo "manual" > /etc/init/$service.override [ -f /etc/init/$service.conf ] && echo "manual" > /etc/init/$service.override
done done

View File

@ -28,11 +28,11 @@ class UbuntuMesosTemplateDefinition(template_def.BaseTemplateDefinition):
self.add_parameter('external_network', self.add_parameter('external_network',
baymodel_attr='external_network_id', baymodel_attr='external_network_id',
required=True) required=True)
self.add_parameter('number_of_agents', self.add_parameter('number_of_slaves',
bay_attr='node_count') bay_attr='node_count')
self.add_parameter('master_flavor', self.add_parameter('master_flavor',
baymodel_attr='master_flavor_id') baymodel_attr='master_flavor_id')
self.add_parameter('agent_flavor', self.add_parameter('slave_flavor',
baymodel_attr='flavor_id') baymodel_attr='flavor_id')
self.add_parameter('cluster_name', self.add_parameter('cluster_name',
bay_attr='name') bay_attr='name')
@ -45,9 +45,9 @@ class UbuntuMesosTemplateDefinition(template_def.BaseTemplateDefinition):
bay_attr=None) bay_attr=None)
self.add_output('mesos_master', self.add_output('mesos_master',
bay_attr='master_addresses') bay_attr='master_addresses')
self.add_output('mesos_agents_private', self.add_output('mesos_slaves_private',
bay_attr=None) bay_attr=None)
self.add_output('mesos_agents', self.add_output('mesos_slaves',
bay_attr='node_addresses') bay_attr='node_addresses')
def get_params(self, context, baymodel, bay, **kwargs): def get_params(self, context, baymodel, bay, **kwargs):
@ -62,18 +62,18 @@ class UbuntuMesosTemplateDefinition(template_def.BaseTemplateDefinition):
extra_params['domain_name'] = context.domain_name extra_params['domain_name'] = context.domain_name
extra_params['region_name'] = osc.cinder_region_name() extra_params['region_name'] = osc.cinder_region_name()
label_list = ['rexray_preempt', 'mesos_agent_isolation', label_list = ['rexray_preempt', 'mesos_slave_isolation',
'mesos_agent_image_providers', 'mesos_slave_image_providers',
'mesos_agent_work_dir', 'mesos_slave_work_dir',
'mesos_agent_executor_env_variables'] 'mesos_slave_executor_env_variables']
for label in label_list: for label in label_list:
extra_params[label] = baymodel.labels.get(label) extra_params[label] = baymodel.labels.get(label)
scale_mgr = kwargs.pop('scale_manager', None) scale_mgr = kwargs.pop('scale_manager', None)
if scale_mgr: if scale_mgr:
hosts = self.get_output('mesos_agents_private') hosts = self.get_output('mesos_slaves_private')
extra_params['agents_to_remove'] = ( extra_params['slaves_to_remove'] = (
scale_mgr.get_removal_nodes(hosts)) scale_mgr.get_removal_nodes(hosts))
return super(UbuntuMesosTemplateDefinition, return super(UbuntuMesosTemplateDefinition,

View File

@ -2,7 +2,7 @@
. /etc/sysconfig/heat-params . /etc/sysconfig/heat-params
echo "Configuring mesos (agent)" echo "Configuring mesos (slave)"
myip=$(ip addr show eth0 | myip=$(ip addr show eth0 |
awk '$1 == "inet" {print $2}' | cut -f1 -d/) awk '$1 == "inet" {print $2}' | cut -f1 -d/)
@ -17,31 +17,31 @@ zk=${zk::-1}
# Format: zk://host1:port1,...,hostN:portN/path # Format: zk://host1:port1,...,hostN:portN/path
echo "zk://${zk}/mesos" > /etc/mesos/zk echo "zk://${zk}/mesos" > /etc/mesos/zk
# The hostname the agent should report # The hostname the slave should report
echo "$myip" > /etc/mesos-agent/hostname echo "$myip" > /etc/mesos-slave/hostname
# The IP address to listen on # The IP address to listen on
echo "$myip" > /etc/mesos-agent/ip echo "$myip" > /etc/mesos-slave/ip
# List of containerizer implementations # List of containerizer implementations
echo "docker,mesos" > /etc/mesos-agent/containerizers echo "docker,mesos" > /etc/mesos-slave/containerizers
# Amount of time to wait for an executor to register # Amount of time to wait for an executor to register
cat > /etc/mesos-agent/executor_registration_timeout <<EOF cat > /etc/mesos-slave/executor_registration_timeout <<EOF
$EXECUTOR_REGISTRATION_TIMEOUT $EXECUTOR_REGISTRATION_TIMEOUT
EOF EOF
if [ -n "$ISOLATION" ]; then if [ -n "$ISOLATION" ]; then
echo "$ISOLATION" > /etc/mesos-agent/isolation echo "$ISOLATION" > /etc/mesos-slave/isolation
fi fi
if [ -n "$WORK_DIR" ]; then if [ -n "$WORK_DIR" ]; then
echo "$WORK_DIR" > /etc/mesos-agent/work_dir echo "$WORK_DIR" > /etc/mesos-slave/work_dir
fi fi
if [ -n "$IMAGE_PROVIDERS" ]; then if [ -n "$IMAGE_PROVIDERS" ]; then
if [ -n "$ISOLATION" ]; then if [ -n "$ISOLATION" ]; then
echo "$IMAGE_PROVIDERS" > /etc/mesos-agent/image_providers echo "$IMAGE_PROVIDERS" > /etc/mesos-slave/image_providers
else else
echo "isolation doesn't exist, not setting image_providers" echo "isolation doesn't exist, not setting image_providers"
fi fi
@ -49,5 +49,5 @@ fi
if [ -n "$EXECUTOR_ENVIRONMENT_VARIABLES" ]; then if [ -n "$EXECUTOR_ENVIRONMENT_VARIABLES" ]; then
echo "$EXECUTOR_ENVIRONMENT_VARIABLES" > /etc/executor_environment_variables echo "$EXECUTOR_ENVIRONMENT_VARIABLES" > /etc/executor_environment_variables
echo "file:///etc/executor_environment_variables" > /etc/mesos-agent/executor_environment_variables echo "file:///etc/executor_environment_variables" > /etc/mesos-slave/executor_environment_variables
fi fi

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Start agent services # Start slave services
for service in docker mesos-agent; do for service in docker mesos-slave; do
echo "starting service $service" echo "starting service $service"
service $service start service $service start
rm -f /etc/init/$service.override rm -f /etc/init/$service.override

View File

@ -2,8 +2,8 @@ heat_template_version: 2014-10-16
description: > description: >
This template will boot a Mesos cluster with one or more masters This template will boot a Mesos cluster with one or more masters
(as specified by number_of_masters, default is 1) and one or more agents (as specified by number_of_masters, default is 1) and one or more slaves
(as specified by the number_of_agents parameter, which (as specified by the number_of_slaves parameter, which
defaults to 1). defaults to 1).
parameters: parameters:
@ -27,19 +27,19 @@ parameters:
default: m1.small default: m1.small
description: flavor to use when booting the master server description: flavor to use when booting the master server
agent_flavor: slave_flavor:
type: string type: string
default: m1.small default: m1.small
description: flavor to use when booting the agent server description: flavor to use when booting the slave server
dns_nameserver: dns_nameserver:
type: string type: string
description: address of a dns nameserver reachable in your environment description: address of a dns nameserver reachable in your environment
default: 8.8.8.8 default: 8.8.8.8
number_of_agents: number_of_slaves:
type: number type: number
description: how many mesos agents to spawn initially description: how many mesos slaves to spawn initially
default: 1 default: 1
fixed_network_cidr: fixed_network_cidr:
@ -61,7 +61,7 @@ parameters:
executor_registration_timeout: executor_registration_timeout:
type: string type: string
description: > description: >
Amount of time to wait for an executor to register with the agent before Amount of time to wait for an executor to register with the slave before
considering it hung and shutting it down considering it hung and shutting it down
default: 5mins default: 5mins
@ -156,7 +156,7 @@ parameters:
type: string type: string
description: url for keystone description: url for keystone
mesos_agent_isolation: mesos_slave_isolation:
type: string type: string
description: > description: >
Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or
@ -168,30 +168,30 @@ parameters:
for the Mesos Containerizer. for the Mesos Containerizer.
default: "" default: ""
mesos_agent_work_dir: mesos_slave_work_dir:
type: string type: string
description: directory path to place framework work directories description: directory path to place framework work directories
default: "" default: ""
mesos_agent_image_providers: mesos_slave_image_providers:
type: string type: string
description: > description: >
Comma separated list of supported image providers e.g., Comma separated list of supported image providers e.g.,
APPC,DOCKER APPC,DOCKER
default: "" default: ""
mesos_agent_executor_env_variables: mesos_slave_executor_env_variables:
type: string type: string
description: > description: >
JSON object representing the environment variables that should be passed JSON object representing the environment variables that should be passed
to the executor, and thus subsequently task(s). By default the executor, to the executor, and thus subsequently task(s). By default the executor,
executor will inherit the agent's environment variables. executor will inherit the slave's environment variables.
default: "" default: ""
agents_to_remove: slaves_to_remove:
type: comma_delimited_list type: comma_delimited_list
description: > description: >
List of agents to be removed when doing an update. Individual agent may List of slaves to be removed when doing an update. Individual slave may
be referenced several ways: (1) The resource name (e.g.['1', '3']), be referenced several ways: (1) The resource name (e.g.['1', '3']),
(2) The private IP address ['10.0.0.4', '10.0.0.6']. Note: the list should (2) The private IP address ['10.0.0.4', '10.0.0.6']. Note: the list should
be empty when doing a create. be empty when doing a create.
@ -410,23 +410,23 @@ resources:
###################################################################### ######################################################################
# #
# Mesos agents. This is a resource group that will initially # Mesos slaves. This is a resource group that will initially
# create <number_of_agents> agents, and needs to be manually scaled. # create <number_of_slaves> slaves, and needs to be manually scaled.
# #
mesos_agents: mesos_slaves:
type: OS::Heat::ResourceGroup type: OS::Heat::ResourceGroup
depends_on: depends_on:
- extrouter_inside - extrouter_inside
properties: properties:
count: {get_param: number_of_agents} count: {get_param: number_of_slaves}
removal_policies: [{resource_list: {get_param: agents_to_remove}}] removal_policies: [{resource_list: {get_param: slaves_to_remove}}]
resource_def: resource_def:
type: mesosagent.yaml type: mesosslave.yaml
properties: properties:
ssh_key_name: {get_param: ssh_key_name} ssh_key_name: {get_param: ssh_key_name}
server_image: {get_param: server_image} server_image: {get_param: server_image}
agent_flavor: {get_param: agent_flavor} slave_flavor: {get_param: slave_flavor}
fixed_network: {get_resource: fixed_network} fixed_network: {get_resource: fixed_network}
fixed_subnet: {get_resource: fixed_subnet} fixed_subnet: {get_resource: fixed_subnet}
mesos_masters_ips: {list_join: [' ', {get_attr: [mesos_masters, mesos_master_ip]}]} mesos_masters_ips: {list_join: [' ', {get_attr: [mesos_masters, mesos_master_ip]}]}
@ -445,10 +445,10 @@ resources:
region_name: {get_param: region_name} region_name: {get_param: region_name}
domain_name: {get_param: domain_name} domain_name: {get_param: domain_name}
rexray_preempt: {get_param: rexray_preempt} rexray_preempt: {get_param: rexray_preempt}
mesos_agent_isolation: {get_param: mesos_agent_isolation} mesos_slave_isolation: {get_param: mesos_slave_isolation}
mesos_agent_work_dir: {get_param: mesos_agent_work_dir} mesos_slave_work_dir: {get_param: mesos_slave_work_dir}
mesos_agent_image_providers: {get_param: mesos_agent_image_providers} mesos_slave_image_providers: {get_param: mesos_slave_image_providers}
mesos_agent_executor_env_variables: {get_param: mesos_agent_executor_env_variables} mesos_slave_executor_env_variables: {get_param: mesos_slave_executor_env_variables}
outputs: outputs:
@ -470,12 +470,12 @@ outputs:
log in to the Mesos master via ssh or to access the Mesos API log in to the Mesos master via ssh or to access the Mesos API
from outside the cluster. from outside the cluster.
mesos_agent_private: mesos_slave_private:
value: {get_attr: [mesos_agents, mesos_agent_ip]} value: {get_attr: [mesos_slaves, mesos_slave_ip]}
description: > description: >
This is a list of the "private" addresses of all the Mesos agents. This is a list of the "private" addresses of all the Mesos slaves.
mesos_agents: mesos_slaves:
value: {get_attr: [mesos_agents, mesos_agent_external_ip]} value: {get_attr: [mesos_slaves, mesos_slave_external_ip]}
description: > description: >
This is a list of the "public" addresses of all the Mesos agents. This is a list of the "public" addresses of all the Mesos slaves.

View File

@ -1,7 +1,7 @@
heat_template_version: 2014-10-16 heat_template_version: 2014-10-16
description: > description: >
This is a nested stack that defines a single Mesos agent, This stack is This is a nested stack that defines a single Mesos slave, This stack is
included by a ResourceGroup resource in the parent template included by a ResourceGroup resource in the parent template
(mesoscluster.yaml). (mesoscluster.yaml).
@ -11,7 +11,7 @@ parameters:
type: string type: string
description: glance image used to boot the server description: glance image used to boot the server
agent_flavor: slave_flavor:
type: string type: string
description: flavor to use when booting the server description: flavor to use when booting the server
@ -31,7 +31,7 @@ parameters:
executor_registration_timeout: executor_registration_timeout:
type: string type: string
description: > description: >
Amount of time to wait for an executor to register with the agent before Amount of time to wait for an executor to register with the slave before
considering it hung and shutting it down considering it hung and shutting it down
http_proxy: http_proxy:
@ -87,7 +87,7 @@ parameters:
enables any host to take control of a volume irrespective of whether enables any host to take control of a volume irrespective of whether
other hosts are using the volume other hosts are using the volume
mesos_agent_isolation: mesos_slave_isolation:
type: string type: string
description: > description: >
Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or
@ -98,22 +98,22 @@ parameters:
module using the `--modules` flag. Note that this flag is only relevant module using the `--modules` flag. Note that this flag is only relevant
for the Mesos Containerizer. for the Mesos Containerizer.
mesos_agent_work_dir: mesos_slave_work_dir:
type: string type: string
description: directory path to place framework work directories description: directory path to place framework work directories
mesos_agent_image_providers: mesos_slave_image_providers:
type: string type: string
description: > description: >
Comma separated list of supported image providers e.g., Comma separated list of supported image providers e.g.,
APPC,DOCKER APPC,DOCKER
mesos_agent_executor_env_variables: mesos_slave_executor_env_variables:
type: string type: string
description: > description: >
JSON object representing the environment variables that should be passed JSON object representing the environment variables that should be passed
to the executor, and thus subsequently task(s). By default the executor, to the executor, and thus subsequently task(s). By default the executor,
executor will inherit the agent's environment variables. executor will inherit the slave's environment variables.
mesos_masters_ips: mesos_masters_ips:
type: string type: string
@ -133,14 +133,14 @@ parameters:
resources: resources:
agent_wait_handle: slave_wait_handle:
type: OS::Heat::WaitConditionHandle type: OS::Heat::WaitConditionHandle
agent_wait_condition: slave_wait_condition:
type: OS::Heat::WaitCondition type: OS::Heat::WaitCondition
depends_on: mesos_agent depends_on: mesos_slave
properties: properties:
handle: {get_resource: agent_wait_handle} handle: {get_resource: slave_wait_handle}
timeout: {get_param: wait_condition_timeout} timeout: {get_param: wait_condition_timeout}
secgroup_all_open: secgroup_all_open:
@ -178,24 +178,24 @@ resources:
"$REGION_NAME": {get_param: region_name} "$REGION_NAME": {get_param: region_name}
"$DOMAIN_NAME": {get_param: domain_name} "$DOMAIN_NAME": {get_param: domain_name}
"$REXRAY_PREEMPT": {get_param: rexray_preempt} "$REXRAY_PREEMPT": {get_param: rexray_preempt}
"$ISOLATION": {get_param: mesos_agent_isolation} "$ISOLATION": {get_param: mesos_slave_isolation}
"$WORK_DIR": {get_param: mesos_agent_work_dir} "$WORK_DIR": {get_param: mesos_slave_work_dir}
"$IMAGE_PROVIDERS": {get_param: mesos_agent_image_providers} "$IMAGE_PROVIDERS": {get_param: mesos_slave_image_providers}
"$EXECUTOR_ENVIRONMENT_VARIABLES": {get_param: mesos_agent_executor_env_variables} "$EXECUTOR_ENVIRONMENT_VARIABLES": {get_param: mesos_slave_executor_env_variables}
configure_mesos_agent: configure_mesos_slave:
type: OS::Heat::SoftwareConfig type: OS::Heat::SoftwareConfig
properties: properties:
group: ungrouped group: ungrouped
config: {get_file: fragments/configure-mesos-agent.sh} config: {get_file: fragments/configure-mesos-slave.sh}
start_services: start_services:
type: OS::Heat::SoftwareConfig type: OS::Heat::SoftwareConfig
properties: properties:
group: ungrouped group: ungrouped
config: {get_file: fragments/start-services-agent.sh} config: {get_file: fragments/start-services-slave.sh}
agent_wc_notify: slave_wc_notify:
type: OS::Heat::SoftwareConfig type: OS::Heat::SoftwareConfig
properties: properties:
group: ungrouped group: ungrouped
@ -205,7 +205,7 @@ resources:
#!/bin/bash -v #!/bin/bash -v
wc_notify --data-binary '{"status": "SUCCESS"}' wc_notify --data-binary '{"status": "SUCCESS"}'
params: params:
wc_notify: {get_attr: [agent_wait_handle, curl_cli]} wc_notify: {get_attr: [slave_wait_handle, curl_cli]}
add_proxy: add_proxy:
type: OS::Heat::SoftwareConfig type: OS::Heat::SoftwareConfig
@ -219,34 +219,34 @@ resources:
group: ungrouped group: ungrouped
config: {get_file: fragments/volume-service.sh} config: {get_file: fragments/volume-service.sh}
mesos_agent_init: mesos_slave_init:
type: OS::Heat::MultipartMime type: OS::Heat::MultipartMime
properties: properties:
parts: parts:
- config: {get_resource: write_heat_params} - config: {get_resource: write_heat_params}
- config: {get_resource: configure_mesos_agent} - config: {get_resource: configure_mesos_slave}
- config: {get_resource: add_proxy} - config: {get_resource: add_proxy}
- config: {get_resource: volume_service} - config: {get_resource: volume_service}
- config: {get_resource: start_services} - config: {get_resource: start_services}
- config: {get_resource: agent_wc_notify} - config: {get_resource: slave_wc_notify}
###################################################################### ######################################################################
# #
# a single Mesos agent. # a single Mesos slave.
# #
mesos_agent: mesos_slave:
type: OS::Nova::Server type: OS::Nova::Server
properties: properties:
image: {get_param: server_image} image: {get_param: server_image}
flavor: {get_param: agent_flavor} flavor: {get_param: slave_flavor}
key_name: {get_param: ssh_key_name} key_name: {get_param: ssh_key_name}
user_data_format: RAW user_data_format: RAW
user_data: {get_resource: mesos_agent_init} user_data: {get_resource: mesos_slave_init}
networks: networks:
- port: {get_resource: mesos_agent_eth0} - port: {get_resource: mesos_slave_eth0}
mesos_agent_eth0: mesos_slave_eth0:
type: OS::Neutron::Port type: OS::Neutron::Port
properties: properties:
network: {get_param: fixed_network} network: {get_param: fixed_network}
@ -257,19 +257,19 @@ resources:
- subnet: {get_param: fixed_subnet} - subnet: {get_param: fixed_subnet}
replacement_policy: AUTO replacement_policy: AUTO
mesos_agent_floating: mesos_slave_floating:
type: OS::Neutron::FloatingIP type: OS::Neutron::FloatingIP
properties: properties:
floating_network: {get_param: external_network} floating_network: {get_param: external_network}
port_id: {get_resource: mesos_agent_eth0} port_id: {get_resource: mesos_slave_eth0}
outputs: outputs:
mesos_agent_ip: mesos_slave_ip:
value: {get_attr: [mesos_agent_eth0, fixed_ips, 0, ip_address]} value: {get_attr: [mesos_slave_eth0, fixed_ips, 0, ip_address]}
description: > description: >
This is the "private" address of the Mesos agent node. This is the "private" address of the Mesos slave node.
mesos_agent_external_ip: mesos_slave_external_ip:
value: {get_attr: [mesos_agent_floating, floating_ip_address]} value: {get_attr: [mesos_slave_floating, floating_ip_address]}
description: > description: >
This is the "public" address of the Mesos agent node. This is the "public" address of the Mesos slave node.

View File

@ -41,7 +41,7 @@ class BaseMagnumTest(base.BaseTestCase):
:param get_nodes_fn: function that takes no parameters and returns :param get_nodes_fn: function that takes no parameters and returns
a list of node IPs which are in such form: a list of node IPs which are in such form:
[[master_nodes], [agent_nodes]]. [[master_nodes], [slave_nodes]].
:param coe: the COE type of the nodes :param coe: the COE type of the nodes
""" """
def int_copy_logs(exec_info): def int_copy_logs(exec_info):
@ -53,7 +53,7 @@ class BaseMagnumTest(base.BaseTestCase):
nodes_addresses = get_nodes_fn() nodes_addresses = get_nodes_fn()
master_nodes = nodes_addresses[0] master_nodes = nodes_addresses[0]
agent_nodes = nodes_addresses[1] slave_nodes = nodes_addresses[1]
base_path = os.path.split(os.path.dirname( base_path = os.path.split(os.path.dirname(
os.path.abspath(magnum.__file__)))[0] os.path.abspath(magnum.__file__)))[0]
@ -88,7 +88,7 @@ class BaseMagnumTest(base.BaseTestCase):
cls.LOG.exception(msg) cls.LOG.exception(msg)
do_copy_logs('master', master_nodes) do_copy_logs('master', master_nodes)
do_copy_logs('node', agent_nodes) do_copy_logs('node', slave_nodes)
except Exception: except Exception:
cls.LOG.exception(msg) cls.LOG.exception(msg)

View File

@ -305,7 +305,7 @@ extendedKeyUsage = clientAuth
elif self.baymodel.coe == "swarm": elif self.baymodel.coe == "swarm":
output_keys = ["swarm_masters", "swarm_nodes"] output_keys = ["swarm_masters", "swarm_nodes"]
elif self.baymodel.coe == "mesos": elif self.baymodel.coe == "mesos":
output_keys = ["mesos_master", "mesos_agents"] output_keys = ["mesos_master", "mesos_slaves"]
for output in stack_outputs: for output in stack_outputs:
for key in output_keys: for key in output_keys:
if output['output_key'] == key: if output['output_key'] == key:

View File

@ -117,58 +117,58 @@ class TestAttrValidator(base.BaseTestCase):
attr_validator.validate_labels(fake_labels) attr_validator.validate_labels(fake_labels)
def test_validate_labels_main_isolation_invalid_label(self): def test_validate_labels_main_isolation_invalid_label(self):
fake_labels = {'mesos_agent_isolation': 'abc'} fake_labels = {'mesos_slave_isolation': 'abc'}
self.assertRaises(exception.InvalidParameterValue, self.assertRaises(exception.InvalidParameterValue,
attr_validator.validate_labels, attr_validator.validate_labels,
fake_labels) fake_labels)
def test_validate_labels_isolation_valid(self): def test_validate_labels_isolation_valid(self):
fake_labels = {'mesos_agent_isolation': fake_labels = {'mesos_slave_isolation':
'filesystem/posix,filesystem/linux'} 'filesystem/posix,filesystem/linux'}
attr_validator.validate_labels_isolation(fake_labels) attr_validator.validate_labels_isolation(fake_labels)
def test_validate_labels_main_with_valid_providers_none_isolation(self): def test_validate_labels_main_with_valid_providers_none_isolation(self):
fake_labels = {'mesos_agent_image_providers': 'docker'} fake_labels = {'mesos_slave_image_providers': 'docker'}
self.assertRaises(exception.RequiredParameterNotProvided, self.assertRaises(exception.RequiredParameterNotProvided,
attr_validator.validate_labels, attr_validator.validate_labels,
fake_labels) fake_labels)
def test_validate_labels_with_valid_providers_invalid_isolation(self): def test_validate_labels_with_valid_providers_invalid_isolation(self):
fake_labels = {'mesos_agent_image_providers': 'docker', fake_labels = {'mesos_slave_image_providers': 'docker',
'mesos_agent_isolation': 'abc'} 'mesos_slave_isolation': 'abc'}
self.assertRaises(exception.RequiredParameterNotProvided, self.assertRaises(exception.RequiredParameterNotProvided,
attr_validator.validate_labels_image_providers, attr_validator.validate_labels_image_providers,
fake_labels) fake_labels)
def test_validate_labels_with_valid_providers_invalid_providers(self): def test_validate_labels_with_valid_providers_invalid_providers(self):
fake_labels = {'mesos_agent_image_providers': 'appc'} fake_labels = {'mesos_slave_image_providers': 'appc'}
attr_validator.validate_labels_image_providers(fake_labels) attr_validator.validate_labels_image_providers(fake_labels)
def test_validate_labels_with_invalid_providers(self): def test_validate_labels_with_invalid_providers(self):
fake_labels = {'mesos_agent_image_providers': 'abc'} fake_labels = {'mesos_slave_image_providers': 'abc'}
self.assertRaises(exception.InvalidParameterValue, self.assertRaises(exception.InvalidParameterValue,
attr_validator.validate_labels_image_providers, attr_validator.validate_labels_image_providers,
fake_labels) fake_labels)
def test_validate_labels_with_valid_providers_none_isolation(self): def test_validate_labels_with_valid_providers_none_isolation(self):
fake_labels = {'mesos_agent_image_providers': 'docker'} fake_labels = {'mesos_slave_image_providers': 'docker'}
self.assertRaises(exception.RequiredParameterNotProvided, self.assertRaises(exception.RequiredParameterNotProvided,
attr_validator.validate_labels_image_providers, attr_validator.validate_labels_image_providers,
fake_labels) fake_labels)
def test_validate_labels_with_valid_providers_valid_isolation(self): def test_validate_labels_with_valid_providers_valid_isolation(self):
fake_labels = {'mesos_agent_image_providers': 'docker', fake_labels = {'mesos_slave_image_providers': 'docker',
'mesos_agent_isolation': 'docker/runtime'} 'mesos_slave_isolation': 'docker/runtime'}
attr_validator.validate_labels_image_providers(fake_labels) attr_validator.validate_labels_image_providers(fake_labels)
def test_validate_labels_with_environment_variables_valid_json(self): def test_validate_labels_with_environment_variables_valid_json(self):
contents = '{"step": "upgrade", "interface": "deploy"}' contents = '{"step": "upgrade", "interface": "deploy"}'
fack_labels = {'mesos_agent_executor_env_variables': contents} fack_labels = {'mesos_slave_executor_env_variables': contents}
attr_validator.validate_labels_executor_env_variables( attr_validator.validate_labels_executor_env_variables(
fack_labels) fack_labels)
def test_validate_labels_with_environment_variables_bad_json(self): def test_validate_labels_with_environment_variables_bad_json(self):
fack_labels = {'mesos_agent_executor_env_variables': 'step'} fack_labels = {'mesos_slave_executor_env_variables': 'step'}
self.assertRaisesRegex( self.assertRaisesRegex(
exception.InvalidParameterValue, exception.InvalidParameterValue,
"Json format error", "Json format error",
@ -176,12 +176,12 @@ class TestAttrValidator(base.BaseTestCase):
fack_labels) fack_labels)
def test_validate_labels_with_valid_isolation(self): def test_validate_labels_with_valid_isolation(self):
fake_labels = {'mesos_agent_isolation': fake_labels = {'mesos_slave_isolation':
'filesystem/posix,filesystem/linux'} 'filesystem/posix,filesystem/linux'}
attr_validator.validate_labels_isolation(fake_labels) attr_validator.validate_labels_isolation(fake_labels)
def test_validate_labels_isolation_invalid(self): def test_validate_labels_isolation_invalid(self):
fake_labels = {'mesos_agent_isolation': 'filesystem'} fake_labels = {'mesos_slave_isolation': 'filesystem'}
self.assertRaises(exception.InvalidParameterValue, self.assertRaises(exception.InvalidParameterValue,
attr_validator.validate_labels_isolation, attr_validator.validate_labels_isolation,
fake_labels) fake_labels)
@ -283,7 +283,7 @@ class TestAttrValidator(base.BaseTestCase):
@mock.patch('magnum.api.attr_validator.validate_labels') @mock.patch('magnum.api.attr_validator.validate_labels')
def test_validate_os_resources_with_label(self, mock_validate_labels, def test_validate_os_resources_with_label(self, mock_validate_labels,
mock_os_cli): mock_os_cli):
mock_baymodel = {'labels': {'mesos_agent_isolation': 'abc'}} mock_baymodel = {'labels': {'mesos_slave_isolation': 'abc'}}
mock_context = mock.MagicMock() mock_context = mock.MagicMock()
self.assertRaises(exception.InvalidParameterValue, self.assertRaises(exception.InvalidParameterValue,
attr_validator.validate_os_resources, mock_context, attr_validator.validate_os_resources, mock_context,

View File

@ -40,11 +40,11 @@ class TestBayConductorWithMesos(base.TestCase):
'server_type': 'vm', 'server_type': 'vm',
'volume_driver': 'volume_driver', 'volume_driver': 'volume_driver',
'labels': {'rexray_preempt': 'False', 'labels': {'rexray_preempt': 'False',
'mesos_agent_isolation': 'mesos_slave_isolation':
'docker/runtime,filesystem/linux', 'docker/runtime,filesystem/linux',
'mesos_agent_image_providers': 'docker', 'mesos_slave_image_providers': 'docker',
'mesos_agent_executor_env_variables': '{}', 'mesos_slave_executor_env_variables': '{}',
'mesos_agent_work_dir': '/tmp/mesos/agent' 'mesos_slave_work_dir': '/tmp/mesos/slave'
}, },
'master_lb_enabled': False, 'master_lb_enabled': False,
} }
@ -96,8 +96,8 @@ class TestBayConductorWithMesos(base.TestCase):
'dns_nameserver': 'dns_nameserver', 'dns_nameserver': 'dns_nameserver',
'server_image': 'image_id', 'server_image': 'image_id',
'master_flavor': 'master_flavor_id', 'master_flavor': 'master_flavor_id',
'agent_flavor': 'flavor_id', 'slave_flavor': 'flavor_id',
'number_of_agents': 1, 'number_of_slaves': 1,
'number_of_masters': 1, 'number_of_masters': 1,
'http_proxy': 'http_proxy', 'http_proxy': 'http_proxy',
'https_proxy': 'https_proxy', 'https_proxy': 'https_proxy',
@ -115,10 +115,10 @@ class TestBayConductorWithMesos(base.TestCase):
'tenant_name': 'admin', 'tenant_name': 'admin',
'domain_name': 'domainname', 'domain_name': 'domainname',
'rexray_preempt': 'False', 'rexray_preempt': 'False',
'mesos_agent_executor_env_variables': '{}', 'mesos_slave_executor_env_variables': '{}',
'mesos_agent_isolation': 'docker/runtime,filesystem/linux', 'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
'mesos_agent_work_dir': '/tmp/mesos/agent', 'mesos_slave_work_dir': '/tmp/mesos/slave',
'mesos_agent_image_providers': 'docker' 'mesos_slave_image_providers': 'docker'
} }
self.assertEqual(expected, definition) self.assertEqual(expected, definition)
self.assertEqual( self.assertEqual(
@ -147,7 +147,7 @@ class TestBayConductorWithMesos(base.TestCase):
expected = { expected = {
'ssh_key_name': 'keypair_id', 'ssh_key_name': 'keypair_id',
'external_network': 'external_network_id', 'external_network': 'external_network_id',
'number_of_agents': 1, 'number_of_slaves': 1,
'number_of_masters': 1, 'number_of_masters': 1,
'cluster_name': 'bay1', 'cluster_name': 'bay1',
'trustee_domain_id': self.mock_keystone.trustee_domain_id, 'trustee_domain_id': self.mock_keystone.trustee_domain_id,
@ -161,10 +161,10 @@ class TestBayConductorWithMesos(base.TestCase):
'tenant_name': 'admin', 'tenant_name': 'admin',
'domain_name': 'domainname', 'domain_name': 'domainname',
'rexray_preempt': 'False', 'rexray_preempt': 'False',
'mesos_agent_isolation': 'docker/runtime,filesystem/linux', 'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
'mesos_agent_executor_env_variables': '{}', 'mesos_slave_executor_env_variables': '{}',
'mesos_agent_work_dir': '/tmp/mesos/agent', 'mesos_slave_work_dir': '/tmp/mesos/slave',
'mesos_agent_image_providers': 'docker' 'mesos_slave_image_providers': 'docker'
} }
self.assertEqual(expected, definition) self.assertEqual(expected, definition)
self.assertEqual( self.assertEqual(
@ -191,8 +191,8 @@ class TestBayConductorWithMesos(base.TestCase):
'dns_nameserver': 'dns_nameserver', 'dns_nameserver': 'dns_nameserver',
'server_image': 'image_id', 'server_image': 'image_id',
'master_flavor': 'master_flavor_id', 'master_flavor': 'master_flavor_id',
'agent_flavor': 'flavor_id', 'slave_flavor': 'flavor_id',
'number_of_agents': 1, 'number_of_slaves': 1,
'number_of_masters': 1, 'number_of_masters': 1,
'http_proxy': 'http_proxy', 'http_proxy': 'http_proxy',
'https_proxy': 'https_proxy', 'https_proxy': 'https_proxy',
@ -210,10 +210,10 @@ class TestBayConductorWithMesos(base.TestCase):
'tenant_name': 'admin', 'tenant_name': 'admin',
'domain_name': 'domainname', 'domain_name': 'domainname',
'rexray_preempt': 'False', 'rexray_preempt': 'False',
'mesos_agent_executor_env_variables': '{}', 'mesos_slave_executor_env_variables': '{}',
'mesos_agent_isolation': 'docker/runtime,filesystem/linux', 'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
'mesos_agent_work_dir': '/tmp/mesos/agent', 'mesos_slave_work_dir': '/tmp/mesos/slave',
'mesos_agent_image_providers': 'docker' 'mesos_slave_image_providers': 'docker'
} }
self.assertEqual(expected, definition) self.assertEqual(expected, definition)
self.assertEqual( self.assertEqual(
@ -241,8 +241,8 @@ class TestBayConductorWithMesos(base.TestCase):
'dns_nameserver': 'dns_nameserver', 'dns_nameserver': 'dns_nameserver',
'server_image': 'image_id', 'server_image': 'image_id',
'master_flavor': 'master_flavor_id', 'master_flavor': 'master_flavor_id',
'agent_flavor': 'flavor_id', 'slave_flavor': 'flavor_id',
'number_of_agents': 1, 'number_of_slaves': 1,
'number_of_masters': 2, 'number_of_masters': 2,
'http_proxy': 'http_proxy', 'http_proxy': 'http_proxy',
'https_proxy': 'https_proxy', 'https_proxy': 'https_proxy',
@ -260,10 +260,10 @@ class TestBayConductorWithMesos(base.TestCase):
'tenant_name': 'admin', 'tenant_name': 'admin',
'domain_name': 'domainname', 'domain_name': 'domainname',
'rexray_preempt': 'False', 'rexray_preempt': 'False',
'mesos_agent_executor_env_variables': '{}', 'mesos_slave_executor_env_variables': '{}',
'mesos_agent_isolation': 'docker/runtime,filesystem/linux', 'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
'mesos_agent_work_dir': '/tmp/mesos/agent', 'mesos_slave_work_dir': '/tmp/mesos/slave',
'mesos_agent_image_providers': 'docker' 'mesos_slave_image_providers': 'docker'
} }
self.assertEqual(expected, definition) self.assertEqual(expected, definition)
self.assertEqual( self.assertEqual(
@ -289,7 +289,7 @@ class TestBayConductorWithMesos(base.TestCase):
def test_poll_node_count(self): def test_poll_node_count(self):
mock_heat_stack, bay, poller = self.setup_poll_test() mock_heat_stack, bay, poller = self.setup_poll_test()
mock_heat_stack.parameters = {'number_of_agents': 1} mock_heat_stack.parameters = {'number_of_slaves': 1}
mock_heat_stack.stack_status = bay_status.CREATE_IN_PROGRESS mock_heat_stack.stack_status = bay_status.CREATE_IN_PROGRESS
poller.poll_and_check() poller.poll_and_check()
@ -298,7 +298,7 @@ class TestBayConductorWithMesos(base.TestCase):
def test_poll_node_count_by_update(self): def test_poll_node_count_by_update(self):
mock_heat_stack, bay, poller = self.setup_poll_test() mock_heat_stack, bay, poller = self.setup_poll_test()
mock_heat_stack.parameters = {'number_of_agents': 2} mock_heat_stack.parameters = {'number_of_slaves': 2}
mock_heat_stack.stack_status = bay_status.UPDATE_COMPLETE mock_heat_stack.stack_status = bay_status.UPDATE_COMPLETE
self.assertRaises(loopingcall.LoopingCallDone, poller.poll_and_check) self.assertRaises(loopingcall.LoopingCallDone, poller.poll_and_check)

View File

@ -262,7 +262,7 @@ class MonitorsTestCase(base.TestCase):
state_json = { state_json = {
'leader': 'master@10.0.0.6:5050', 'leader': 'master@10.0.0.6:5050',
'pid': 'master@10.0.0.6:5050', 'pid': 'master@10.0.0.6:5050',
'agents': [{ 'slaves': [{
'resources': { 'resources': {
'mem': 100, 'mem': 100,
'cpus': 1, 'cpus': 1,
@ -281,7 +281,7 @@ class MonitorsTestCase(base.TestCase):
state_json = { state_json = {
'leader': 'master@10.0.0.6:5050', 'leader': 'master@10.0.0.6:5050',
'pid': 'master@1.1.1.1:5050', 'pid': 'master@1.1.1.1:5050',
'agents': [] 'slaves': []
} }
self._test_mesos_monitor_pull_data(mock_url_get, state_json, self._test_mesos_monitor_pull_data(mock_url_get, state_json,
0, 0, 0, 0) 0, 0, 0, 0)

View File

@ -783,13 +783,13 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
mock_baymodel = mock.MagicMock() mock_baymodel = mock.MagicMock()
mock_baymodel.tls_disabled = False mock_baymodel.tls_disabled = False
rexray_preempt = mock_baymodel.labels.get('rexray_preempt') rexray_preempt = mock_baymodel.labels.get('rexray_preempt')
mesos_agent_isolation = mock_baymodel.labels.get( mesos_slave_isolation = mock_baymodel.labels.get(
'mesos_agent_isolation') 'mesos_slave_isolation')
mesos_agent_work_dir = mock_baymodel.labels.get('mesos_agent_work_dir') mesos_slave_work_dir = mock_baymodel.labels.get('mesos_slave_work_dir')
mesos_agent_image_providers = mock_baymodel.labels.get( mesos_slave_image_providers = mock_baymodel.labels.get(
'image_providers') 'image_providers')
mesos_agent_executor_env_variables = mock_baymodel.labels.get( mesos_slave_executor_env_variables = mock_baymodel.labels.get(
'mesos_agent_executor_env_variables') 'mesos_slave_executor_env_variables')
mock_bay = mock.MagicMock() mock_bay = mock.MagicMock()
mock_bay.uuid = '5d12f6fd-a196-4bf0-ae4c-1f639a523a52' mock_bay.uuid = '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'
del mock_bay.stack_id del mock_bay.stack_id
@ -813,12 +813,12 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
'tenant_name': 'admin', 'tenant_name': 'admin',
'domain_name': 'domainname', 'domain_name': 'domainname',
'rexray_preempt': rexray_preempt, 'rexray_preempt': rexray_preempt,
'mesos_agent_isolation': mesos_agent_isolation, 'mesos_slave_isolation': mesos_slave_isolation,
'mesos_agent_work_dir': mesos_agent_work_dir, 'mesos_slave_work_dir': mesos_slave_work_dir,
'mesos_agent_executor_env_variables': 'mesos_slave_executor_env_variables':
mesos_agent_executor_env_variables, mesos_slave_executor_env_variables,
'mesos_agent_image_providers': mesos_agent_image_providers, 'mesos_slave_image_providers': mesos_slave_image_providers,
'agents_to_remove': removal_nodes}} 'slaves_to_remove': removal_nodes}}
mock_get_params.assert_called_once_with(mock_context, mock_baymodel, mock_get_params.assert_called_once_with(mock_context, mock_baymodel,
mock_bay, **expected_kwargs) mock_bay, **expected_kwargs)
@ -826,7 +826,7 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
mesos_def = mesos_tdef.UbuntuMesosTemplateDefinition() mesos_def = mesos_tdef.UbuntuMesosTemplateDefinition()
heat_param = mesos_def.get_heat_param(bay_attr='node_count') heat_param = mesos_def.get_heat_param(bay_attr='node_count')
self.assertEqual('number_of_agents', heat_param) self.assertEqual('number_of_slaves', heat_param)
heat_param = mesos_def.get_heat_param(bay_attr='master_count') heat_param = mesos_def.get_heat_param(bay_attr='master_count')
self.assertEqual('number_of_masters', heat_param) self.assertEqual('number_of_masters', heat_param)
@ -835,7 +835,7 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
mesos_def = mesos_tdef.UbuntuMesosTemplateDefinition() mesos_def = mesos_tdef.UbuntuMesosTemplateDefinition()
expected_api_address = 'updated_address' expected_api_address = 'updated_address'
expected_node_addresses = ['ex_agent', 'address'] expected_node_addresses = ['ex_slave', 'address']
expected_master_addresses = ['ex_master', 'address'] expected_master_addresses = ['ex_master', 'address']
outputs = [ outputs = [
@ -850,10 +850,10 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
"output_key": "mesos_master"}, "output_key": "mesos_master"},
{"output_value": ['any', 'output'], {"output_value": ['any', 'output'],
"description": "No description given", "description": "No description given",
"output_key": "mesos_agents_private"}, "output_key": "mesos_slaves_private"},
{"output_value": expected_node_addresses, {"output_value": expected_node_addresses,
"description": "No description given", "description": "No description given",
"output_key": "mesos_agents"}, "output_key": "mesos_slaves"},
] ]
mock_stack = mock.MagicMock() mock_stack = mock.MagicMock()
mock_stack.to_dict.return_value = {'outputs': outputs} mock_stack.to_dict.return_value = {'outputs': outputs}