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:
parent
53a1b5d7cd
commit
272903ff9e
|
@ -277,7 +277,7 @@ the table are linked to more details elsewhere in the user guide.
|
|||
| `rexray_preempt`_ | - true | false |
|
||||
| | - false | |
|
||||
+---------------------------------------+--------------------+---------------+
|
||||
| `mesos_agent_isolation`_ | - filesystem/posix | "" |
|
||||
| `mesos_slave_isolation`_ | - filesystem/posix | "" |
|
||||
| | - filesystem/linux | |
|
||||
| | - filesystem/shared| |
|
||||
| | - posix/cpu | |
|
||||
|
@ -288,13 +288,13 @@ the table are linked to more details elsewhere in the user guide.
|
|||
| | - docker/runtime | |
|
||||
| | - namespaces/pid | |
|
||||
+---------------------------------------+--------------------+---------------+
|
||||
| `mesos_agent_image_providers`_ | - appc | "" |
|
||||
| `mesos_slave_image_providers`_ | - 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
|
||||
=====
|
||||
|
||||
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
|
||||
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
|
||||
accept user requests on their own endpoint, using their particular
|
||||
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:
|
||||
|
||||
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 Mesos master is run as a process on port 5050 and this is
|
||||
initiated by the upstart service 'mesos-master'. Zookeeper is also
|
||||
run on the master servers, initiated by the upstart service
|
||||
'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
|
||||
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
|
||||
agent is run as a process initiated by the upstart service
|
||||
'mesos-agent'.
|
||||
the upstart service 'marathon'. On the servers for slave, the Mesos
|
||||
slave is run as a process initiated by the upstart service
|
||||
'mesos-slave'.
|
||||
|
||||
Number of master (master-count)
|
||||
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)
|
||||
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
|
||||
host containers from users. The agents report their available
|
||||
will run as Mesos slave in the cluster. Docker daemon is run locally to
|
||||
host containers from users. The slaves report their available
|
||||
resources to the master and accept request from the master to deploy
|
||||
tasks from the frameworks. In this case, the tasks will be to
|
||||
run Docker containers.
|
||||
|
@ -1118,7 +1118,7 @@ Storage driver (docker-storage-driver)
|
|||
Image (image-id)
|
||||
|
||||
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
|
||||
the `ready-built image
|
||||
<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
|
||||
is False.
|
||||
|
||||
_`mesos_agent_isolation`
|
||||
This label corresponds to the Mesos parameter for agent
|
||||
_`mesos_slave_isolation`
|
||||
This label corresponds to the Mesos parameter for slave
|
||||
'--isolation'. The isolators are needed to provide proper isolation
|
||||
according to the runtime configurations specified in the container
|
||||
image. For more details, refer to the `Mesos configuration
|
||||
|
@ -1168,7 +1168,7 @@ _`mesos_agent_isolation`
|
|||
- docker/runtime
|
||||
- namespaces/pid
|
||||
|
||||
_`mesos_agent_image_providers`
|
||||
_`mesos_slave_image_providers`
|
||||
This label corresponds to the Mesos parameter for agent
|
||||
'--image_providers', which tells Mesos containerizer what
|
||||
types of container images are allowed.
|
||||
|
@ -1182,24 +1182,24 @@ _`mesos_agent_image_providers`
|
|||
- docker
|
||||
- appc,docker
|
||||
|
||||
_`mesos_agent_work_dir`
|
||||
This label corresponds to the Mesos parameter '--work_dir' for agent.
|
||||
_`mesos_slave_work_dir`
|
||||
This label corresponds to the Mesos parameter '--work_dir' for slave.
|
||||
For more details, refer to the `Mesos configuration
|
||||
<http://mesos.apache.org/documentation/latest/configuration/>`_.
|
||||
Valid value is a directory path to use as the work directory for
|
||||
the framework, for example::
|
||||
|
||||
mesos_agent_work_dir=/tmp/mesos
|
||||
mesos_slave_work_dir=/tmp/mesos
|
||||
|
||||
_`mesos_agent_executor_env_variables`
|
||||
This label corresponds to the Mesos parameter for agent
|
||||
_`mesos_slave_executor_env_variables`
|
||||
This label corresponds to the Mesos parameter for slave
|
||||
'--executor_environment_variables', which passes additional
|
||||
environment variables to the executor and subsequent tasks.
|
||||
For more details, refer to the `Mesos configuration
|
||||
<http://mesos.apache.org/documentation/latest/configuration/>`_.
|
||||
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::
|
||||
|
||||
|
@ -1208,7 +1208,7 @@ _`mesos_agent_executor_env_variables`
|
|||
"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.
|
||||
|
||||
|
||||
|
|
|
@ -109,14 +109,14 @@ def validate_labels(labels):
|
|||
|
||||
|
||||
def validate_labels_isolation(labels):
|
||||
"""Validate mesos_agent_isolation"""
|
||||
mesos_agent_isolation = labels.get('mesos_agent_isolation')
|
||||
mesos_agent_isolation_list = mesos_agent_isolation.split(',')
|
||||
unsupported_isolations = set(mesos_agent_isolation_list) - set(
|
||||
"""Validate mesos_slave_isolation"""
|
||||
mesos_slave_isolation = labels.get('mesos_slave_isolation')
|
||||
mesos_slave_isolation_list = mesos_slave_isolation.split(',')
|
||||
unsupported_isolations = set(mesos_slave_isolation_list) - set(
|
||||
SUPPORTED_ISOLATION)
|
||||
if (len(unsupported_isolations) > 0):
|
||||
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: '
|
||||
'%(supported_isolation)s') % {
|
||||
'isolation_val': ', '.join(list(unsupported_isolations)),
|
||||
|
@ -125,15 +125,15 @@ def validate_labels_isolation(labels):
|
|||
|
||||
|
||||
def validate_labels_image_providers(labels):
|
||||
"""Validate mesos_agent_image_providers"""
|
||||
mesos_agent_image_providers = labels.get('mesos_agent_image_providers')
|
||||
mesos_agent_image_providers_list = mesos_agent_image_providers.split(',')
|
||||
"""Validate mesos_slave_image_providers"""
|
||||
mesos_slave_image_providers = labels.get('mesos_slave_image_providers')
|
||||
mesos_slave_image_providers_list = mesos_slave_image_providers.split(',')
|
||||
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()
|
||||
if image_providers_val not in SUPPORTED_IMAGE_PROVIDERS:
|
||||
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 '
|
||||
'are: %(supported_image_providers)s') % {
|
||||
'image_providers': image_providers_val,
|
||||
|
@ -141,26 +141,26 @@ def validate_labels_image_providers(labels):
|
|||
SUPPORTED_IMAGE_PROVIDERS + ['unspecified'])})
|
||||
|
||||
if image_providers_val == 'docker':
|
||||
mesos_agent_isolation = labels.get('mesos_agent_isolation')
|
||||
if mesos_agent_isolation is not None:
|
||||
mesos_agent_isolation_list = mesos_agent_isolation.split(',')
|
||||
for isolations_val in mesos_agent_isolation_list:
|
||||
mesos_slave_isolation = labels.get('mesos_slave_isolation')
|
||||
if mesos_slave_isolation is not None:
|
||||
mesos_slave_isolation_list = mesos_slave_isolation.split(',')
|
||||
for isolations_val in mesos_slave_isolation_list:
|
||||
if isolations_val == 'docker/runtime':
|
||||
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(_(
|
||||
"Docker runtime isolator has to be specified if 'docker' "
|
||||
"is included in 'mesos_agent_image_providers' Please add "
|
||||
"'docker/runtime' to 'mesos_agent_isolation' labels "
|
||||
"is included in 'mesos_slave_image_providers' Please add "
|
||||
"'docker/runtime' to 'mesos_slave_isolation' labels "
|
||||
"flags"))
|
||||
|
||||
|
||||
def validate_labels_executor_env_variables(labels):
|
||||
"""Validate executor_environment_variables"""
|
||||
mesos_agent_executor_env_val = labels.get(
|
||||
'mesos_agent_executor_env_variables')
|
||||
mesos_slave_executor_env_val = labels.get(
|
||||
'mesos_slave_executor_env_variables')
|
||||
try:
|
||||
json.loads(mesos_agent_executor_env_val)
|
||||
json.loads(mesos_slave_executor_env_val)
|
||||
except ValueError:
|
||||
err = (_("Json format error"))
|
||||
raise exception.InvalidParameterValue(err)
|
||||
|
@ -194,8 +194,8 @@ validators = {'image_id': validate_image,
|
|||
'fixed_network': validate_fixed_network,
|
||||
'labels': validate_labels}
|
||||
|
||||
labels_validators = {'mesos_agent_isolation': validate_labels_isolation,
|
||||
'mesos_agent_image_providers':
|
||||
labels_validators = {'mesos_slave_isolation': validate_labels_isolation,
|
||||
'mesos_slave_image_providers':
|
||||
validate_labels_image_providers,
|
||||
'mesos_agent_executor_env_variables':
|
||||
'mesos_slave_executor_env_variables':
|
||||
validate_labels_executor_env_variables}
|
||||
|
|
|
@ -112,7 +112,7 @@ class Bay(base.APIBase):
|
|||
"""Api address of cluster master node"""
|
||||
|
||||
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)
|
||||
"""IP addresses of cluster master nodes"""
|
||||
|
|
|
@ -122,7 +122,7 @@ class Cluster(base.APIBase):
|
|||
"""Api address of cluster master node"""
|
||||
|
||||
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)
|
||||
"""IP addresses of cluster master nodes"""
|
||||
|
|
|
@ -51,11 +51,11 @@ class MesosMonitor(MonitorBase):
|
|||
path='/state')
|
||||
master = jsonutils.loads(urlfetch.get(mesos_master_url))
|
||||
if self._is_leader(master):
|
||||
for agent in master['agents']:
|
||||
self.data['mem_total'] += agent['resources']['mem']
|
||||
self.data['mem_used'] += agent['used_resources']['mem']
|
||||
self.data['cpu_total'] += agent['resources']['cpus']
|
||||
self.data['cpu_used'] += agent['used_resources']['cpus']
|
||||
for slave in master['slaves']:
|
||||
self.data['mem_total'] += slave['resources']['mem']
|
||||
self.data['mem_used'] += slave['used_resources']['mem']
|
||||
self.data['cpu_total'] += slave['resources']['cpus']
|
||||
self.data['cpu_used'] += slave['used_resources']['cpus']
|
||||
break
|
||||
|
||||
def compute_memory_util(self):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/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
|
||||
[ -f /etc/init/$service.conf ] && echo "manual" > /etc/init/$service.override
|
||||
done
|
||||
|
|
|
@ -28,11 +28,11 @@ class UbuntuMesosTemplateDefinition(template_def.BaseTemplateDefinition):
|
|||
self.add_parameter('external_network',
|
||||
baymodel_attr='external_network_id',
|
||||
required=True)
|
||||
self.add_parameter('number_of_agents',
|
||||
self.add_parameter('number_of_slaves',
|
||||
bay_attr='node_count')
|
||||
self.add_parameter('master_flavor',
|
||||
baymodel_attr='master_flavor_id')
|
||||
self.add_parameter('agent_flavor',
|
||||
self.add_parameter('slave_flavor',
|
||||
baymodel_attr='flavor_id')
|
||||
self.add_parameter('cluster_name',
|
||||
bay_attr='name')
|
||||
|
@ -45,9 +45,9 @@ class UbuntuMesosTemplateDefinition(template_def.BaseTemplateDefinition):
|
|||
bay_attr=None)
|
||||
self.add_output('mesos_master',
|
||||
bay_attr='master_addresses')
|
||||
self.add_output('mesos_agents_private',
|
||||
self.add_output('mesos_slaves_private',
|
||||
bay_attr=None)
|
||||
self.add_output('mesos_agents',
|
||||
self.add_output('mesos_slaves',
|
||||
bay_attr='node_addresses')
|
||||
|
||||
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['region_name'] = osc.cinder_region_name()
|
||||
|
||||
label_list = ['rexray_preempt', 'mesos_agent_isolation',
|
||||
'mesos_agent_image_providers',
|
||||
'mesos_agent_work_dir',
|
||||
'mesos_agent_executor_env_variables']
|
||||
label_list = ['rexray_preempt', 'mesos_slave_isolation',
|
||||
'mesos_slave_image_providers',
|
||||
'mesos_slave_work_dir',
|
||||
'mesos_slave_executor_env_variables']
|
||||
|
||||
for label in label_list:
|
||||
extra_params[label] = baymodel.labels.get(label)
|
||||
|
||||
scale_mgr = kwargs.pop('scale_manager', None)
|
||||
if scale_mgr:
|
||||
hosts = self.get_output('mesos_agents_private')
|
||||
extra_params['agents_to_remove'] = (
|
||||
hosts = self.get_output('mesos_slaves_private')
|
||||
extra_params['slaves_to_remove'] = (
|
||||
scale_mgr.get_removal_nodes(hosts))
|
||||
|
||||
return super(UbuntuMesosTemplateDefinition,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
. /etc/sysconfig/heat-params
|
||||
|
||||
echo "Configuring mesos (agent)"
|
||||
echo "Configuring mesos (slave)"
|
||||
|
||||
myip=$(ip addr show eth0 |
|
||||
awk '$1 == "inet" {print $2}' | cut -f1 -d/)
|
||||
|
@ -17,31 +17,31 @@ zk=${zk::-1}
|
|||
# Format: zk://host1:port1,...,hostN:portN/path
|
||||
echo "zk://${zk}/mesos" > /etc/mesos/zk
|
||||
|
||||
# The hostname the agent should report
|
||||
echo "$myip" > /etc/mesos-agent/hostname
|
||||
# The hostname the slave should report
|
||||
echo "$myip" > /etc/mesos-slave/hostname
|
||||
|
||||
# The IP address to listen on
|
||||
echo "$myip" > /etc/mesos-agent/ip
|
||||
echo "$myip" > /etc/mesos-slave/ip
|
||||
|
||||
# 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
|
||||
cat > /etc/mesos-agent/executor_registration_timeout <<EOF
|
||||
cat > /etc/mesos-slave/executor_registration_timeout <<EOF
|
||||
$EXECUTOR_REGISTRATION_TIMEOUT
|
||||
EOF
|
||||
|
||||
if [ -n "$ISOLATION" ]; then
|
||||
echo "$ISOLATION" > /etc/mesos-agent/isolation
|
||||
echo "$ISOLATION" > /etc/mesos-slave/isolation
|
||||
fi
|
||||
|
||||
if [ -n "$WORK_DIR" ]; then
|
||||
echo "$WORK_DIR" > /etc/mesos-agent/work_dir
|
||||
echo "$WORK_DIR" > /etc/mesos-slave/work_dir
|
||||
fi
|
||||
|
||||
if [ -n "$IMAGE_PROVIDERS" ]; then
|
||||
if [ -n "$ISOLATION" ]; then
|
||||
echo "$IMAGE_PROVIDERS" > /etc/mesos-agent/image_providers
|
||||
echo "$IMAGE_PROVIDERS" > /etc/mesos-slave/image_providers
|
||||
else
|
||||
echo "isolation doesn't exist, not setting image_providers"
|
||||
fi
|
||||
|
@ -49,5 +49,5 @@ fi
|
|||
|
||||
if [ -n "$EXECUTOR_ENVIRONMENT_VARIABLES" ]; then
|
||||
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
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Start agent services
|
||||
for service in docker mesos-agent; do
|
||||
# Start slave services
|
||||
for service in docker mesos-slave; do
|
||||
echo "starting service $service"
|
||||
service $service start
|
||||
rm -f /etc/init/$service.override
|
|
@ -2,8 +2,8 @@ heat_template_version: 2014-10-16
|
|||
|
||||
description: >
|
||||
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 the number_of_agents parameter, which
|
||||
(as specified by number_of_masters, default is 1) and one or more slaves
|
||||
(as specified by the number_of_slaves parameter, which
|
||||
defaults to 1).
|
||||
|
||||
parameters:
|
||||
|
@ -27,19 +27,19 @@ parameters:
|
|||
default: m1.small
|
||||
description: flavor to use when booting the master server
|
||||
|
||||
agent_flavor:
|
||||
slave_flavor:
|
||||
type: string
|
||||
default: m1.small
|
||||
description: flavor to use when booting the agent server
|
||||
description: flavor to use when booting the slave server
|
||||
|
||||
dns_nameserver:
|
||||
type: string
|
||||
description: address of a dns nameserver reachable in your environment
|
||||
default: 8.8.8.8
|
||||
|
||||
number_of_agents:
|
||||
number_of_slaves:
|
||||
type: number
|
||||
description: how many mesos agents to spawn initially
|
||||
description: how many mesos slaves to spawn initially
|
||||
default: 1
|
||||
|
||||
fixed_network_cidr:
|
||||
|
@ -61,7 +61,7 @@ parameters:
|
|||
executor_registration_timeout:
|
||||
type: string
|
||||
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
|
||||
default: 5mins
|
||||
|
||||
|
@ -156,7 +156,7 @@ parameters:
|
|||
type: string
|
||||
description: url for keystone
|
||||
|
||||
mesos_agent_isolation:
|
||||
mesos_slave_isolation:
|
||||
type: string
|
||||
description: >
|
||||
Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or
|
||||
|
@ -168,30 +168,30 @@ parameters:
|
|||
for the Mesos Containerizer.
|
||||
default: ""
|
||||
|
||||
mesos_agent_work_dir:
|
||||
mesos_slave_work_dir:
|
||||
type: string
|
||||
description: directory path to place framework work directories
|
||||
default: ""
|
||||
|
||||
mesos_agent_image_providers:
|
||||
mesos_slave_image_providers:
|
||||
type: string
|
||||
description: >
|
||||
Comma separated list of supported image providers e.g.,
|
||||
APPC,DOCKER
|
||||
default: ""
|
||||
|
||||
mesos_agent_executor_env_variables:
|
||||
mesos_slave_executor_env_variables:
|
||||
type: string
|
||||
description: >
|
||||
JSON object representing the environment variables that should be passed
|
||||
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: ""
|
||||
|
||||
agents_to_remove:
|
||||
slaves_to_remove:
|
||||
type: comma_delimited_list
|
||||
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']),
|
||||
(2) The private IP address ['10.0.0.4', '10.0.0.6']. Note: the list should
|
||||
be empty when doing a create.
|
||||
|
@ -410,23 +410,23 @@ resources:
|
|||
|
||||
######################################################################
|
||||
#
|
||||
# Mesos agents. This is a resource group that will initially
|
||||
# create <number_of_agents> agents, and needs to be manually scaled.
|
||||
# Mesos slaves. This is a resource group that will initially
|
||||
# create <number_of_slaves> slaves, and needs to be manually scaled.
|
||||
#
|
||||
|
||||
mesos_agents:
|
||||
mesos_slaves:
|
||||
type: OS::Heat::ResourceGroup
|
||||
depends_on:
|
||||
- extrouter_inside
|
||||
properties:
|
||||
count: {get_param: number_of_agents}
|
||||
removal_policies: [{resource_list: {get_param: agents_to_remove}}]
|
||||
count: {get_param: number_of_slaves}
|
||||
removal_policies: [{resource_list: {get_param: slaves_to_remove}}]
|
||||
resource_def:
|
||||
type: mesosagent.yaml
|
||||
type: mesosslave.yaml
|
||||
properties:
|
||||
ssh_key_name: {get_param: ssh_key_name}
|
||||
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_subnet: {get_resource: fixed_subnet}
|
||||
mesos_masters_ips: {list_join: [' ', {get_attr: [mesos_masters, mesos_master_ip]}]}
|
||||
|
@ -445,10 +445,10 @@ resources:
|
|||
region_name: {get_param: region_name}
|
||||
domain_name: {get_param: domain_name}
|
||||
rexray_preempt: {get_param: rexray_preempt}
|
||||
mesos_agent_isolation: {get_param: mesos_agent_isolation}
|
||||
mesos_agent_work_dir: {get_param: mesos_agent_work_dir}
|
||||
mesos_agent_image_providers: {get_param: mesos_agent_image_providers}
|
||||
mesos_agent_executor_env_variables: {get_param: mesos_agent_executor_env_variables}
|
||||
mesos_slave_isolation: {get_param: mesos_slave_isolation}
|
||||
mesos_slave_work_dir: {get_param: mesos_slave_work_dir}
|
||||
mesos_slave_image_providers: {get_param: mesos_slave_image_providers}
|
||||
mesos_slave_executor_env_variables: {get_param: mesos_slave_executor_env_variables}
|
||||
|
||||
outputs:
|
||||
|
||||
|
@ -470,12 +470,12 @@ outputs:
|
|||
log in to the Mesos master via ssh or to access the Mesos API
|
||||
from outside the cluster.
|
||||
|
||||
mesos_agent_private:
|
||||
value: {get_attr: [mesos_agents, mesos_agent_ip]}
|
||||
mesos_slave_private:
|
||||
value: {get_attr: [mesos_slaves, mesos_slave_ip]}
|
||||
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:
|
||||
value: {get_attr: [mesos_agents, mesos_agent_external_ip]}
|
||||
mesos_slaves:
|
||||
value: {get_attr: [mesos_slaves, mesos_slave_external_ip]}
|
||||
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.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
heat_template_version: 2014-10-16
|
||||
|
||||
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
|
||||
(mesoscluster.yaml).
|
||||
|
||||
|
@ -11,7 +11,7 @@ parameters:
|
|||
type: string
|
||||
description: glance image used to boot the server
|
||||
|
||||
agent_flavor:
|
||||
slave_flavor:
|
||||
type: string
|
||||
description: flavor to use when booting the server
|
||||
|
||||
|
@ -31,7 +31,7 @@ parameters:
|
|||
executor_registration_timeout:
|
||||
type: string
|
||||
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
|
||||
|
||||
http_proxy:
|
||||
|
@ -87,7 +87,7 @@ parameters:
|
|||
enables any host to take control of a volume irrespective of whether
|
||||
other hosts are using the volume
|
||||
|
||||
mesos_agent_isolation:
|
||||
mesos_slave_isolation:
|
||||
type: string
|
||||
description: >
|
||||
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
|
||||
for the Mesos Containerizer.
|
||||
|
||||
mesos_agent_work_dir:
|
||||
mesos_slave_work_dir:
|
||||
type: string
|
||||
description: directory path to place framework work directories
|
||||
|
||||
mesos_agent_image_providers:
|
||||
mesos_slave_image_providers:
|
||||
type: string
|
||||
description: >
|
||||
Comma separated list of supported image providers e.g.,
|
||||
APPC,DOCKER
|
||||
|
||||
mesos_agent_executor_env_variables:
|
||||
mesos_slave_executor_env_variables:
|
||||
type: string
|
||||
description: >
|
||||
JSON object representing the environment variables that should be passed
|
||||
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:
|
||||
type: string
|
||||
|
@ -133,14 +133,14 @@ parameters:
|
|||
|
||||
resources:
|
||||
|
||||
agent_wait_handle:
|
||||
slave_wait_handle:
|
||||
type: OS::Heat::WaitConditionHandle
|
||||
|
||||
agent_wait_condition:
|
||||
slave_wait_condition:
|
||||
type: OS::Heat::WaitCondition
|
||||
depends_on: mesos_agent
|
||||
depends_on: mesos_slave
|
||||
properties:
|
||||
handle: {get_resource: agent_wait_handle}
|
||||
handle: {get_resource: slave_wait_handle}
|
||||
timeout: {get_param: wait_condition_timeout}
|
||||
|
||||
secgroup_all_open:
|
||||
|
@ -178,24 +178,24 @@ resources:
|
|||
"$REGION_NAME": {get_param: region_name}
|
||||
"$DOMAIN_NAME": {get_param: domain_name}
|
||||
"$REXRAY_PREEMPT": {get_param: rexray_preempt}
|
||||
"$ISOLATION": {get_param: mesos_agent_isolation}
|
||||
"$WORK_DIR": {get_param: mesos_agent_work_dir}
|
||||
"$IMAGE_PROVIDERS": {get_param: mesos_agent_image_providers}
|
||||
"$EXECUTOR_ENVIRONMENT_VARIABLES": {get_param: mesos_agent_executor_env_variables}
|
||||
"$ISOLATION": {get_param: mesos_slave_isolation}
|
||||
"$WORK_DIR": {get_param: mesos_slave_work_dir}
|
||||
"$IMAGE_PROVIDERS": {get_param: mesos_slave_image_providers}
|
||||
"$EXECUTOR_ENVIRONMENT_VARIABLES": {get_param: mesos_slave_executor_env_variables}
|
||||
|
||||
configure_mesos_agent:
|
||||
configure_mesos_slave:
|
||||
type: OS::Heat::SoftwareConfig
|
||||
properties:
|
||||
group: ungrouped
|
||||
config: {get_file: fragments/configure-mesos-agent.sh}
|
||||
config: {get_file: fragments/configure-mesos-slave.sh}
|
||||
|
||||
start_services:
|
||||
type: OS::Heat::SoftwareConfig
|
||||
properties:
|
||||
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
|
||||
properties:
|
||||
group: ungrouped
|
||||
|
@ -205,7 +205,7 @@ resources:
|
|||
#!/bin/bash -v
|
||||
wc_notify --data-binary '{"status": "SUCCESS"}'
|
||||
params:
|
||||
wc_notify: {get_attr: [agent_wait_handle, curl_cli]}
|
||||
wc_notify: {get_attr: [slave_wait_handle, curl_cli]}
|
||||
|
||||
add_proxy:
|
||||
type: OS::Heat::SoftwareConfig
|
||||
|
@ -219,34 +219,34 @@ resources:
|
|||
group: ungrouped
|
||||
config: {get_file: fragments/volume-service.sh}
|
||||
|
||||
mesos_agent_init:
|
||||
mesos_slave_init:
|
||||
type: OS::Heat::MultipartMime
|
||||
properties:
|
||||
parts:
|
||||
- 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: volume_service}
|
||||
- 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
|
||||
properties:
|
||||
image: {get_param: server_image}
|
||||
flavor: {get_param: agent_flavor}
|
||||
flavor: {get_param: slave_flavor}
|
||||
key_name: {get_param: ssh_key_name}
|
||||
user_data_format: RAW
|
||||
user_data: {get_resource: mesos_agent_init}
|
||||
user_data: {get_resource: mesos_slave_init}
|
||||
networks:
|
||||
- port: {get_resource: mesos_agent_eth0}
|
||||
- port: {get_resource: mesos_slave_eth0}
|
||||
|
||||
mesos_agent_eth0:
|
||||
mesos_slave_eth0:
|
||||
type: OS::Neutron::Port
|
||||
properties:
|
||||
network: {get_param: fixed_network}
|
||||
|
@ -257,19 +257,19 @@ resources:
|
|||
- subnet: {get_param: fixed_subnet}
|
||||
replacement_policy: AUTO
|
||||
|
||||
mesos_agent_floating:
|
||||
mesos_slave_floating:
|
||||
type: OS::Neutron::FloatingIP
|
||||
properties:
|
||||
floating_network: {get_param: external_network}
|
||||
port_id: {get_resource: mesos_agent_eth0}
|
||||
port_id: {get_resource: mesos_slave_eth0}
|
||||
|
||||
outputs:
|
||||
|
||||
mesos_agent_ip:
|
||||
value: {get_attr: [mesos_agent_eth0, fixed_ips, 0, ip_address]}
|
||||
mesos_slave_ip:
|
||||
value: {get_attr: [mesos_slave_eth0, fixed_ips, 0, ip_address]}
|
||||
description: >
|
||||
This is the "private" address of the Mesos agent node.
|
||||
mesos_agent_external_ip:
|
||||
value: {get_attr: [mesos_agent_floating, floating_ip_address]}
|
||||
This is the "private" address of the Mesos slave node.
|
||||
mesos_slave_external_ip:
|
||||
value: {get_attr: [mesos_slave_floating, floating_ip_address]}
|
||||
description: >
|
||||
This is the "public" address of the Mesos agent node.
|
||||
This is the "public" address of the Mesos slave node.
|
|
@ -41,7 +41,7 @@ class BaseMagnumTest(base.BaseTestCase):
|
|||
|
||||
:param get_nodes_fn: function that takes no parameters and returns
|
||||
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
|
||||
"""
|
||||
def int_copy_logs(exec_info):
|
||||
|
@ -53,7 +53,7 @@ class BaseMagnumTest(base.BaseTestCase):
|
|||
nodes_addresses = get_nodes_fn()
|
||||
|
||||
master_nodes = nodes_addresses[0]
|
||||
agent_nodes = nodes_addresses[1]
|
||||
slave_nodes = nodes_addresses[1]
|
||||
|
||||
base_path = os.path.split(os.path.dirname(
|
||||
os.path.abspath(magnum.__file__)))[0]
|
||||
|
@ -88,7 +88,7 @@ class BaseMagnumTest(base.BaseTestCase):
|
|||
cls.LOG.exception(msg)
|
||||
|
||||
do_copy_logs('master', master_nodes)
|
||||
do_copy_logs('node', agent_nodes)
|
||||
do_copy_logs('node', slave_nodes)
|
||||
except Exception:
|
||||
cls.LOG.exception(msg)
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ extendedKeyUsage = clientAuth
|
|||
elif self.baymodel.coe == "swarm":
|
||||
output_keys = ["swarm_masters", "swarm_nodes"]
|
||||
elif self.baymodel.coe == "mesos":
|
||||
output_keys = ["mesos_master", "mesos_agents"]
|
||||
output_keys = ["mesos_master", "mesos_slaves"]
|
||||
for output in stack_outputs:
|
||||
for key in output_keys:
|
||||
if output['output_key'] == key:
|
||||
|
|
|
@ -117,58 +117,58 @@ class TestAttrValidator(base.BaseTestCase):
|
|||
attr_validator.validate_labels(fake_labels)
|
||||
|
||||
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,
|
||||
attr_validator.validate_labels,
|
||||
fake_labels)
|
||||
|
||||
def test_validate_labels_isolation_valid(self):
|
||||
fake_labels = {'mesos_agent_isolation':
|
||||
fake_labels = {'mesos_slave_isolation':
|
||||
'filesystem/posix,filesystem/linux'}
|
||||
attr_validator.validate_labels_isolation(fake_labels)
|
||||
|
||||
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,
|
||||
attr_validator.validate_labels,
|
||||
fake_labels)
|
||||
|
||||
def test_validate_labels_with_valid_providers_invalid_isolation(self):
|
||||
fake_labels = {'mesos_agent_image_providers': 'docker',
|
||||
'mesos_agent_isolation': 'abc'}
|
||||
fake_labels = {'mesos_slave_image_providers': 'docker',
|
||||
'mesos_slave_isolation': 'abc'}
|
||||
self.assertRaises(exception.RequiredParameterNotProvided,
|
||||
attr_validator.validate_labels_image_providers,
|
||||
fake_labels)
|
||||
|
||||
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)
|
||||
|
||||
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,
|
||||
attr_validator.validate_labels_image_providers,
|
||||
fake_labels)
|
||||
|
||||
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,
|
||||
attr_validator.validate_labels_image_providers,
|
||||
fake_labels)
|
||||
|
||||
def test_validate_labels_with_valid_providers_valid_isolation(self):
|
||||
fake_labels = {'mesos_agent_image_providers': 'docker',
|
||||
'mesos_agent_isolation': 'docker/runtime'}
|
||||
fake_labels = {'mesos_slave_image_providers': 'docker',
|
||||
'mesos_slave_isolation': 'docker/runtime'}
|
||||
attr_validator.validate_labels_image_providers(fake_labels)
|
||||
|
||||
def test_validate_labels_with_environment_variables_valid_json(self):
|
||||
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(
|
||||
fack_labels)
|
||||
|
||||
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(
|
||||
exception.InvalidParameterValue,
|
||||
"Json format error",
|
||||
|
@ -176,12 +176,12 @@ class TestAttrValidator(base.BaseTestCase):
|
|||
fack_labels)
|
||||
|
||||
def test_validate_labels_with_valid_isolation(self):
|
||||
fake_labels = {'mesos_agent_isolation':
|
||||
fake_labels = {'mesos_slave_isolation':
|
||||
'filesystem/posix,filesystem/linux'}
|
||||
attr_validator.validate_labels_isolation(fake_labels)
|
||||
|
||||
def test_validate_labels_isolation_invalid(self):
|
||||
fake_labels = {'mesos_agent_isolation': 'filesystem'}
|
||||
fake_labels = {'mesos_slave_isolation': 'filesystem'}
|
||||
self.assertRaises(exception.InvalidParameterValue,
|
||||
attr_validator.validate_labels_isolation,
|
||||
fake_labels)
|
||||
|
@ -283,7 +283,7 @@ class TestAttrValidator(base.BaseTestCase):
|
|||
@mock.patch('magnum.api.attr_validator.validate_labels')
|
||||
def test_validate_os_resources_with_label(self, mock_validate_labels,
|
||||
mock_os_cli):
|
||||
mock_baymodel = {'labels': {'mesos_agent_isolation': 'abc'}}
|
||||
mock_baymodel = {'labels': {'mesos_slave_isolation': 'abc'}}
|
||||
mock_context = mock.MagicMock()
|
||||
self.assertRaises(exception.InvalidParameterValue,
|
||||
attr_validator.validate_os_resources, mock_context,
|
||||
|
|
|
@ -40,11 +40,11 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
'server_type': 'vm',
|
||||
'volume_driver': 'volume_driver',
|
||||
'labels': {'rexray_preempt': 'False',
|
||||
'mesos_agent_isolation':
|
||||
'mesos_slave_isolation':
|
||||
'docker/runtime,filesystem/linux',
|
||||
'mesos_agent_image_providers': 'docker',
|
||||
'mesos_agent_executor_env_variables': '{}',
|
||||
'mesos_agent_work_dir': '/tmp/mesos/agent'
|
||||
'mesos_slave_image_providers': 'docker',
|
||||
'mesos_slave_executor_env_variables': '{}',
|
||||
'mesos_slave_work_dir': '/tmp/mesos/slave'
|
||||
},
|
||||
'master_lb_enabled': False,
|
||||
}
|
||||
|
@ -96,8 +96,8 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
'dns_nameserver': 'dns_nameserver',
|
||||
'server_image': 'image_id',
|
||||
'master_flavor': 'master_flavor_id',
|
||||
'agent_flavor': 'flavor_id',
|
||||
'number_of_agents': 1,
|
||||
'slave_flavor': 'flavor_id',
|
||||
'number_of_slaves': 1,
|
||||
'number_of_masters': 1,
|
||||
'http_proxy': 'http_proxy',
|
||||
'https_proxy': 'https_proxy',
|
||||
|
@ -115,10 +115,10 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
'tenant_name': 'admin',
|
||||
'domain_name': 'domainname',
|
||||
'rexray_preempt': 'False',
|
||||
'mesos_agent_executor_env_variables': '{}',
|
||||
'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
|
||||
'mesos_agent_work_dir': '/tmp/mesos/agent',
|
||||
'mesos_agent_image_providers': 'docker'
|
||||
'mesos_slave_executor_env_variables': '{}',
|
||||
'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
|
||||
'mesos_slave_work_dir': '/tmp/mesos/slave',
|
||||
'mesos_slave_image_providers': 'docker'
|
||||
}
|
||||
self.assertEqual(expected, definition)
|
||||
self.assertEqual(
|
||||
|
@ -147,7 +147,7 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
expected = {
|
||||
'ssh_key_name': 'keypair_id',
|
||||
'external_network': 'external_network_id',
|
||||
'number_of_agents': 1,
|
||||
'number_of_slaves': 1,
|
||||
'number_of_masters': 1,
|
||||
'cluster_name': 'bay1',
|
||||
'trustee_domain_id': self.mock_keystone.trustee_domain_id,
|
||||
|
@ -161,10 +161,10 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
'tenant_name': 'admin',
|
||||
'domain_name': 'domainname',
|
||||
'rexray_preempt': 'False',
|
||||
'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
|
||||
'mesos_agent_executor_env_variables': '{}',
|
||||
'mesos_agent_work_dir': '/tmp/mesos/agent',
|
||||
'mesos_agent_image_providers': 'docker'
|
||||
'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
|
||||
'mesos_slave_executor_env_variables': '{}',
|
||||
'mesos_slave_work_dir': '/tmp/mesos/slave',
|
||||
'mesos_slave_image_providers': 'docker'
|
||||
}
|
||||
self.assertEqual(expected, definition)
|
||||
self.assertEqual(
|
||||
|
@ -191,8 +191,8 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
'dns_nameserver': 'dns_nameserver',
|
||||
'server_image': 'image_id',
|
||||
'master_flavor': 'master_flavor_id',
|
||||
'agent_flavor': 'flavor_id',
|
||||
'number_of_agents': 1,
|
||||
'slave_flavor': 'flavor_id',
|
||||
'number_of_slaves': 1,
|
||||
'number_of_masters': 1,
|
||||
'http_proxy': 'http_proxy',
|
||||
'https_proxy': 'https_proxy',
|
||||
|
@ -210,10 +210,10 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
'tenant_name': 'admin',
|
||||
'domain_name': 'domainname',
|
||||
'rexray_preempt': 'False',
|
||||
'mesos_agent_executor_env_variables': '{}',
|
||||
'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
|
||||
'mesos_agent_work_dir': '/tmp/mesos/agent',
|
||||
'mesos_agent_image_providers': 'docker'
|
||||
'mesos_slave_executor_env_variables': '{}',
|
||||
'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
|
||||
'mesos_slave_work_dir': '/tmp/mesos/slave',
|
||||
'mesos_slave_image_providers': 'docker'
|
||||
}
|
||||
self.assertEqual(expected, definition)
|
||||
self.assertEqual(
|
||||
|
@ -241,8 +241,8 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
'dns_nameserver': 'dns_nameserver',
|
||||
'server_image': 'image_id',
|
||||
'master_flavor': 'master_flavor_id',
|
||||
'agent_flavor': 'flavor_id',
|
||||
'number_of_agents': 1,
|
||||
'slave_flavor': 'flavor_id',
|
||||
'number_of_slaves': 1,
|
||||
'number_of_masters': 2,
|
||||
'http_proxy': 'http_proxy',
|
||||
'https_proxy': 'https_proxy',
|
||||
|
@ -260,10 +260,10 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
'tenant_name': 'admin',
|
||||
'domain_name': 'domainname',
|
||||
'rexray_preempt': 'False',
|
||||
'mesos_agent_executor_env_variables': '{}',
|
||||
'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
|
||||
'mesos_agent_work_dir': '/tmp/mesos/agent',
|
||||
'mesos_agent_image_providers': 'docker'
|
||||
'mesos_slave_executor_env_variables': '{}',
|
||||
'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
|
||||
'mesos_slave_work_dir': '/tmp/mesos/slave',
|
||||
'mesos_slave_image_providers': 'docker'
|
||||
}
|
||||
self.assertEqual(expected, definition)
|
||||
self.assertEqual(
|
||||
|
@ -289,7 +289,7 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
def test_poll_node_count(self):
|
||||
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
|
||||
poller.poll_and_check()
|
||||
|
||||
|
@ -298,7 +298,7 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||
def test_poll_node_count_by_update(self):
|
||||
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
|
||||
self.assertRaises(loopingcall.LoopingCallDone, poller.poll_and_check)
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ class MonitorsTestCase(base.TestCase):
|
|||
state_json = {
|
||||
'leader': 'master@10.0.0.6:5050',
|
||||
'pid': 'master@10.0.0.6:5050',
|
||||
'agents': [{
|
||||
'slaves': [{
|
||||
'resources': {
|
||||
'mem': 100,
|
||||
'cpus': 1,
|
||||
|
@ -281,7 +281,7 @@ class MonitorsTestCase(base.TestCase):
|
|||
state_json = {
|
||||
'leader': 'master@10.0.0.6:5050',
|
||||
'pid': 'master@1.1.1.1:5050',
|
||||
'agents': []
|
||||
'slaves': []
|
||||
}
|
||||
self._test_mesos_monitor_pull_data(mock_url_get, state_json,
|
||||
0, 0, 0, 0)
|
||||
|
|
|
@ -783,13 +783,13 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
|
|||
mock_baymodel = mock.MagicMock()
|
||||
mock_baymodel.tls_disabled = False
|
||||
rexray_preempt = mock_baymodel.labels.get('rexray_preempt')
|
||||
mesos_agent_isolation = mock_baymodel.labels.get(
|
||||
'mesos_agent_isolation')
|
||||
mesos_agent_work_dir = mock_baymodel.labels.get('mesos_agent_work_dir')
|
||||
mesos_agent_image_providers = mock_baymodel.labels.get(
|
||||
mesos_slave_isolation = mock_baymodel.labels.get(
|
||||
'mesos_slave_isolation')
|
||||
mesos_slave_work_dir = mock_baymodel.labels.get('mesos_slave_work_dir')
|
||||
mesos_slave_image_providers = mock_baymodel.labels.get(
|
||||
'image_providers')
|
||||
mesos_agent_executor_env_variables = mock_baymodel.labels.get(
|
||||
'mesos_agent_executor_env_variables')
|
||||
mesos_slave_executor_env_variables = mock_baymodel.labels.get(
|
||||
'mesos_slave_executor_env_variables')
|
||||
mock_bay = mock.MagicMock()
|
||||
mock_bay.uuid = '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'
|
||||
del mock_bay.stack_id
|
||||
|
@ -813,12 +813,12 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
|
|||
'tenant_name': 'admin',
|
||||
'domain_name': 'domainname',
|
||||
'rexray_preempt': rexray_preempt,
|
||||
'mesos_agent_isolation': mesos_agent_isolation,
|
||||
'mesos_agent_work_dir': mesos_agent_work_dir,
|
||||
'mesos_agent_executor_env_variables':
|
||||
mesos_agent_executor_env_variables,
|
||||
'mesos_agent_image_providers': mesos_agent_image_providers,
|
||||
'agents_to_remove': removal_nodes}}
|
||||
'mesos_slave_isolation': mesos_slave_isolation,
|
||||
'mesos_slave_work_dir': mesos_slave_work_dir,
|
||||
'mesos_slave_executor_env_variables':
|
||||
mesos_slave_executor_env_variables,
|
||||
'mesos_slave_image_providers': mesos_slave_image_providers,
|
||||
'slaves_to_remove': removal_nodes}}
|
||||
mock_get_params.assert_called_once_with(mock_context, mock_baymodel,
|
||||
mock_bay, **expected_kwargs)
|
||||
|
||||
|
@ -826,7 +826,7 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
|
|||
mesos_def = mesos_tdef.UbuntuMesosTemplateDefinition()
|
||||
|
||||
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')
|
||||
self.assertEqual('number_of_masters', heat_param)
|
||||
|
@ -835,7 +835,7 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
|
|||
mesos_def = mesos_tdef.UbuntuMesosTemplateDefinition()
|
||||
|
||||
expected_api_address = 'updated_address'
|
||||
expected_node_addresses = ['ex_agent', 'address']
|
||||
expected_node_addresses = ['ex_slave', 'address']
|
||||
expected_master_addresses = ['ex_master', 'address']
|
||||
|
||||
outputs = [
|
||||
|
@ -850,10 +850,10 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
|
|||
"output_key": "mesos_master"},
|
||||
{"output_value": ['any', 'output'],
|
||||
"description": "No description given",
|
||||
"output_key": "mesos_agents_private"},
|
||||
"output_key": "mesos_slaves_private"},
|
||||
{"output_value": expected_node_addresses,
|
||||
"description": "No description given",
|
||||
"output_key": "mesos_agents"},
|
||||
"output_key": "mesos_slaves"},
|
||||
]
|
||||
mock_stack = mock.MagicMock()
|
||||
mock_stack.to_dict.return_value = {'outputs': outputs}
|
||||
|
|
Loading…
Reference in New Issue