Merge "Update mesos slave to mesos agent"
This commit is contained in:
commit
7a66c1cf56
@ -144,12 +144,12 @@ You can ssh into that server as the ``ubuntu`` user:
|
|||||||
|
|
||||||
$ ssh ubuntu@192.168.200.86
|
$ ssh ubuntu@192.168.200.86
|
||||||
|
|
||||||
You can log into your slaves using the ``ubuntu`` user as well. You can
|
You can log into your agents using the ``ubuntu`` user as well. You can
|
||||||
get a list of slaves addresses by running:
|
get a list of agents addresses by running:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
$ heat output-show my-mesos-cluster mesos_slaves
|
$ heat output-show my-mesos-cluster mesos_agents
|
||||||
[
|
[
|
||||||
"192.168.200.182"
|
"192.168.200.182"
|
||||||
]
|
]
|
||||||
|
@ -109,14 +109,14 @@ def validate_labels(labels):
|
|||||||
|
|
||||||
|
|
||||||
def validate_labels_isolation(labels):
|
def validate_labels_isolation(labels):
|
||||||
"""Validate mesos_slave_isolation"""
|
"""Validate mesos_agent_isolation"""
|
||||||
mesos_slave_isolation = labels.get('mesos_slave_isolation')
|
mesos_agent_isolation = labels.get('mesos_agent_isolation')
|
||||||
mesos_slave_isolation_list = mesos_slave_isolation.split(',')
|
mesos_agent_isolation_list = mesos_agent_isolation.split(',')
|
||||||
unsupported_isolations = set(mesos_slave_isolation_list) - set(
|
unsupported_isolations = set(mesos_agent_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_salve_isolation" with value '
|
'property "labels/mesos_agent_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_slave_image_providers"""
|
"""Validate mesos_agent_image_providers"""
|
||||||
mesos_slave_image_providers = labels.get('mesos_slave_image_providers')
|
mesos_agent_image_providers = labels.get('mesos_agent_image_providers')
|
||||||
mesos_slave_image_providers_list = mesos_slave_image_providers.split(',')
|
mesos_agent_image_providers_list = mesos_agent_image_providers.split(',')
|
||||||
isolation_with_valid_data = False
|
isolation_with_valid_data = False
|
||||||
for image_providers_val in mesos_slave_image_providers_list:
|
for image_providers_val in mesos_agent_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_slave_image_providers" with value '
|
'property "labels/mesos_agent_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_slave_isolation = labels.get('mesos_slave_isolation')
|
mesos_agent_isolation = labels.get('mesos_agent_isolation')
|
||||||
if mesos_slave_isolation is not None:
|
if mesos_agent_isolation is not None:
|
||||||
mesos_slave_isolation_list = mesos_slave_isolation.split(',')
|
mesos_agent_isolation_list = mesos_agent_isolation.split(',')
|
||||||
for isolations_val in mesos_slave_isolation_list:
|
for isolations_val in mesos_agent_isolation_list:
|
||||||
if isolations_val == 'docker/runtime':
|
if isolations_val == 'docker/runtime':
|
||||||
isolation_with_valid_data = True
|
isolation_with_valid_data = True
|
||||||
if mesos_slave_isolation is None or not isolation_with_valid_data:
|
if mesos_agent_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_slave_image_providers' Please add "
|
"is included in 'mesos_agent_image_providers' Please add "
|
||||||
"'docker/runtime' to 'mesos_slave_isolation' labels "
|
"'docker/runtime' to 'mesos_agent_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_slave_executor_env_val = labels.get(
|
mesos_agent_executor_env_val = labels.get(
|
||||||
'mesos_slave_executor_env_variables')
|
'mesos_agent_executor_env_variables')
|
||||||
try:
|
try:
|
||||||
json.loads(mesos_slave_executor_env_val)
|
json.loads(mesos_agent_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_slave_isolation': validate_labels_isolation,
|
labels_validators = {'mesos_agent_isolation': validate_labels_isolation,
|
||||||
'mesos_slave_image_providers':
|
'mesos_agent_image_providers':
|
||||||
validate_labels_image_providers,
|
validate_labels_image_providers,
|
||||||
'mesos_slave_executor_env_variables':
|
'mesos_agent_executor_env_variables':
|
||||||
validate_labels_executor_env_variables}
|
validate_labels_executor_env_variables}
|
||||||
|
@ -118,7 +118,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 slave nodes"""
|
"""IP addresses of cluster agent 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"""
|
||||||
|
@ -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 slave in master['slaves']:
|
for agent in master['agents']:
|
||||||
self.data['mem_total'] += slave['resources']['mem']
|
self.data['mem_total'] += agent['resources']['mem']
|
||||||
self.data['mem_used'] += slave['used_resources']['mem']
|
self.data['mem_used'] += agent['used_resources']['mem']
|
||||||
self.data['cpu_total'] += slave['resources']['cpus']
|
self.data['cpu_total'] += agent['resources']['cpus']
|
||||||
self.data['cpu_used'] += slave['used_resources']['cpus']
|
self.data['cpu_used'] += agent['used_resources']['cpus']
|
||||||
break
|
break
|
||||||
|
|
||||||
def compute_memory_util(self):
|
def compute_memory_util(self):
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
for service in zookeeper mesos-slave mesos-master marathon; do
|
for service in zookeeper mesos-agent 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
|
||||||
|
@ -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_slaves',
|
self.add_parameter('number_of_agents',
|
||||||
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('slave_flavor',
|
self.add_parameter('agent_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_slaves_private',
|
self.add_output('mesos_agents_private',
|
||||||
bay_attr=None)
|
bay_attr=None)
|
||||||
self.add_output('mesos_slaves',
|
self.add_output('mesos_agents',
|
||||||
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_slave_isolation',
|
label_list = ['rexray_preempt', 'mesos_agent_isolation',
|
||||||
'mesos_slave_image_providers',
|
'mesos_agent_image_providers',
|
||||||
'mesos_slave_work_dir',
|
'mesos_agent_work_dir',
|
||||||
'mesos_slave_executor_env_variables']
|
'mesos_agent_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_slaves_private')
|
hosts = self.get_output('mesos_agents_private')
|
||||||
extra_params['slaves_to_remove'] = (
|
extra_params['agents_to_remove'] = (
|
||||||
scale_mgr.get_removal_nodes(hosts))
|
scale_mgr.get_removal_nodes(hosts))
|
||||||
|
|
||||||
return super(UbuntuMesosTemplateDefinition,
|
return super(UbuntuMesosTemplateDefinition,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. /etc/sysconfig/heat-params
|
. /etc/sysconfig/heat-params
|
||||||
|
|
||||||
echo "Configuring mesos (slave)"
|
echo "Configuring mesos (agent)"
|
||||||
|
|
||||||
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 slave should report
|
# The hostname the agent should report
|
||||||
echo "$myip" > /etc/mesos-slave/hostname
|
echo "$myip" > /etc/mesos-agent/hostname
|
||||||
|
|
||||||
# The IP address to listen on
|
# The IP address to listen on
|
||||||
echo "$myip" > /etc/mesos-slave/ip
|
echo "$myip" > /etc/mesos-agent/ip
|
||||||
|
|
||||||
# List of containerizer implementations
|
# List of containerizer implementations
|
||||||
echo "docker,mesos" > /etc/mesos-slave/containerizers
|
echo "docker,mesos" > /etc/mesos-agent/containerizers
|
||||||
|
|
||||||
# Amount of time to wait for an executor to register
|
# Amount of time to wait for an executor to register
|
||||||
cat > /etc/mesos-slave/executor_registration_timeout <<EOF
|
cat > /etc/mesos-agent/executor_registration_timeout <<EOF
|
||||||
$EXECUTOR_REGISTRATION_TIMEOUT
|
$EXECUTOR_REGISTRATION_TIMEOUT
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ -n "$ISOLATION" ]; then
|
if [ -n "$ISOLATION" ]; then
|
||||||
echo "$ISOLATION" > /etc/mesos-slave/isolation
|
echo "$ISOLATION" > /etc/mesos-agent/isolation
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$WORK_DIR" ]; then
|
if [ -n "$WORK_DIR" ]; then
|
||||||
echo "$WORK_DIR" > /etc/mesos-slave/work_dir
|
echo "$WORK_DIR" > /etc/mesos-agent/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-slave/image_providers
|
echo "$IMAGE_PROVIDERS" > /etc/mesos-agent/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-slave/executor_environment_variables
|
echo "file:///etc/executor_environment_variables" > /etc/mesos-agent/executor_environment_variables
|
||||||
fi
|
fi
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Start slave services
|
# Start agent services
|
||||||
for service in docker mesos-slave; do
|
for service in docker mesos-agent; 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
|
@ -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 slave, This stack is
|
This is a nested stack that defines a single Mesos agent, 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
|
||||||
|
|
||||||
slave_flavor:
|
agent_flavor:
|
||||||
type: string
|
type: string
|
||||||
description: flavor to use when booting the server
|
description: flavor to use when booting the server
|
||||||
|
|
||||||
@ -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_slave_isolation:
|
mesos_agent_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,17 +98,17 @@ 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_slave_work_dir:
|
mesos_agent_work_dir:
|
||||||
type: string
|
type: string
|
||||||
description: directory path to place framework work directories
|
description: directory path to place framework work directories
|
||||||
|
|
||||||
mesos_slave_image_providers:
|
mesos_agent_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_slave_executor_env_variables:
|
mesos_agent_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
|
||||||
@ -133,14 +133,14 @@ parameters:
|
|||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
|
||||||
slave_wait_handle:
|
agent_wait_handle:
|
||||||
type: OS::Heat::WaitConditionHandle
|
type: OS::Heat::WaitConditionHandle
|
||||||
|
|
||||||
slave_wait_condition:
|
agent_wait_condition:
|
||||||
type: OS::Heat::WaitCondition
|
type: OS::Heat::WaitCondition
|
||||||
depends_on: mesos_slave
|
depends_on: mesos_agent
|
||||||
properties:
|
properties:
|
||||||
handle: {get_resource: slave_wait_handle}
|
handle: {get_resource: agent_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_slave_isolation}
|
"$ISOLATION": {get_param: mesos_agent_isolation}
|
||||||
"$WORK_DIR": {get_param: mesos_slave_work_dir}
|
"$WORK_DIR": {get_param: mesos_agent_work_dir}
|
||||||
"$IMAGE_PROVIDERS": {get_param: mesos_slave_image_providers}
|
"$IMAGE_PROVIDERS": {get_param: mesos_agent_image_providers}
|
||||||
"$EXECUTOR_ENVIRONMENT_VARIABLES": {get_param: mesos_slave_executor_env_variables}
|
"$EXECUTOR_ENVIRONMENT_VARIABLES": {get_param: mesos_agent_executor_env_variables}
|
||||||
|
|
||||||
configure_mesos_slave:
|
configure_mesos_agent:
|
||||||
type: OS::Heat::SoftwareConfig
|
type: OS::Heat::SoftwareConfig
|
||||||
properties:
|
properties:
|
||||||
group: ungrouped
|
group: ungrouped
|
||||||
config: {get_file: fragments/configure-mesos-slave.sh}
|
config: {get_file: fragments/configure-mesos-agent.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-slave.sh}
|
config: {get_file: fragments/start-services-agent.sh}
|
||||||
|
|
||||||
slave_wc_notify:
|
agent_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: [slave_wait_handle, curl_cli]}
|
wc_notify: {get_attr: [agent_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_slave_init:
|
mesos_agent_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_slave}
|
- config: {get_resource: configure_mesos_agent}
|
||||||
- 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: slave_wc_notify}
|
- config: {get_resource: agent_wc_notify}
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
# a single Mesos agent.
|
# a single Mesos agent.
|
||||||
#
|
#
|
||||||
|
|
||||||
mesos_slave:
|
mesos_agent:
|
||||||
type: OS::Nova::Server
|
type: OS::Nova::Server
|
||||||
properties:
|
properties:
|
||||||
image: {get_param: server_image}
|
image: {get_param: server_image}
|
||||||
flavor: {get_param: slave_flavor}
|
flavor: {get_param: agent_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_slave_init}
|
user_data: {get_resource: mesos_agent_init}
|
||||||
networks:
|
networks:
|
||||||
- port: {get_resource: mesos_slave_eth0}
|
- port: {get_resource: mesos_agent_eth0}
|
||||||
|
|
||||||
mesos_slave_eth0:
|
mesos_agent_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_slave_floating:
|
mesos_agent_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_slave_eth0}
|
port_id: {get_resource: mesos_agent_eth0}
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
|
|
||||||
mesos_slave_ip:
|
mesos_agent_ip:
|
||||||
value: {get_attr: [mesos_slave_eth0, fixed_ips, 0, ip_address]}
|
value: {get_attr: [mesos_agent_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 agent node.
|
||||||
mesos_slave_external_ip:
|
mesos_agent_external_ip:
|
||||||
value: {get_attr: [mesos_slave_floating, floating_ip_address]}
|
value: {get_attr: [mesos_agent_floating, floating_ip_address]}
|
||||||
description: >
|
description: >
|
||||||
This is the "public" address of the Mesos agent node.
|
This is the "public" address of the Mesos agent node.
|
@ -3,7 +3,7 @@ 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 agents
|
||||||
(as specified by the number_of_slaves parameter, which
|
(as specified by the number_of_agents parameter, which
|
||||||
defaults to 1).
|
defaults to 1).
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
@ -27,7 +27,7 @@ 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
|
||||||
|
|
||||||
slave_flavor:
|
agent_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 agent server
|
||||||
@ -37,9 +37,9 @@ parameters:
|
|||||||
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_slaves:
|
number_of_agents:
|
||||||
type: number
|
type: number
|
||||||
description: how many mesos slaves to spawn initially
|
description: how many mesos agents 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 slave before
|
Amount of time to wait for an executor to register with the agent 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_slave_isolation:
|
mesos_agent_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,19 +168,19 @@ parameters:
|
|||||||
for the Mesos Containerizer.
|
for the Mesos Containerizer.
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
mesos_slave_work_dir:
|
mesos_agent_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_slave_image_providers:
|
mesos_agent_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_slave_executor_env_variables:
|
mesos_agent_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
|
||||||
@ -188,10 +188,10 @@ parameters:
|
|||||||
executor will inherit the agent's environment variables.
|
executor will inherit the agent's environment variables.
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
slaves_to_remove:
|
agents_to_remove:
|
||||||
type: comma_delimited_list
|
type: comma_delimited_list
|
||||||
description: >
|
description: >
|
||||||
List of slaves to be removed when doing an update. Individual slave may
|
List of agents to be removed when doing an update. Individual agent 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 slaves. This is a resource group that will initially
|
# Mesos agents. This is a resource group that will initially
|
||||||
# create <number_of_slaves> slaves, and needs to be manually scaled.
|
# create <number_of_agents> agents, and needs to be manually scaled.
|
||||||
#
|
#
|
||||||
|
|
||||||
mesos_slaves:
|
mesos_agents:
|
||||||
type: OS::Heat::ResourceGroup
|
type: OS::Heat::ResourceGroup
|
||||||
depends_on:
|
depends_on:
|
||||||
- extrouter_inside
|
- extrouter_inside
|
||||||
properties:
|
properties:
|
||||||
count: {get_param: number_of_slaves}
|
count: {get_param: number_of_agents}
|
||||||
removal_policies: [{resource_list: {get_param: slaves_to_remove}}]
|
removal_policies: [{resource_list: {get_param: agents_to_remove}}]
|
||||||
resource_def:
|
resource_def:
|
||||||
type: mesosslave.yaml
|
type: mesosagent.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}
|
||||||
slave_flavor: {get_param: slave_flavor}
|
agent_flavor: {get_param: agent_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_slave_isolation: {get_param: mesos_slave_isolation}
|
mesos_agent_isolation: {get_param: mesos_agent_isolation}
|
||||||
mesos_slave_work_dir: {get_param: mesos_slave_work_dir}
|
mesos_agent_work_dir: {get_param: mesos_agent_work_dir}
|
||||||
mesos_slave_image_providers: {get_param: mesos_slave_image_providers}
|
mesos_agent_image_providers: {get_param: mesos_agent_image_providers}
|
||||||
mesos_slave_executor_env_variables: {get_param: mesos_slave_executor_env_variables}
|
mesos_agent_executor_env_variables: {get_param: mesos_agent_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_slaves_private:
|
mesos_agent_private:
|
||||||
value: {get_attr: [mesos_slaves, mesos_slave_ip]}
|
value: {get_attr: [mesos_agents, mesos_agent_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 agents.
|
||||||
|
|
||||||
mesos_slaves:
|
mesos_agents:
|
||||||
value: {get_attr: [mesos_slaves, mesos_slave_external_ip]}
|
value: {get_attr: [mesos_agents, mesos_agent_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 agents.
|
||||||
|
53
magnum/templates/mesos/fragments/configure-mesos-agent.sh
Normal file
53
magnum/templates/mesos/fragments/configure-mesos-agent.sh
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /etc/sysconfig/heat-params
|
||||||
|
|
||||||
|
echo "Configuring mesos (agent)"
|
||||||
|
|
||||||
|
myip=$(ip addr show eth0 |
|
||||||
|
awk '$1 == "inet" {print $2}' | cut -f1 -d/)
|
||||||
|
|
||||||
|
zk=""
|
||||||
|
for master_ip in $MESOS_MASTERS_IPS; do
|
||||||
|
zk="${zk}${master_ip}:2181,"
|
||||||
|
done
|
||||||
|
# Remove last ','
|
||||||
|
zk=${zk::-1}
|
||||||
|
# Zookeeper URL. This specifies how to connect to a quorum of masters
|
||||||
|
# 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 IP address to listen on
|
||||||
|
echo "$myip" > /etc/mesos-agent/ip
|
||||||
|
|
||||||
|
# List of containerizer implementations
|
||||||
|
echo "docker,mesos" > /etc/mesos-agent/containerizers
|
||||||
|
|
||||||
|
# Amount of time to wait for an executor to register
|
||||||
|
cat > /etc/mesos-agent/executor_registration_timeout <<EOF
|
||||||
|
$EXECUTOR_REGISTRATION_TIMEOUT
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ -n "$ISOLATION" ]; then
|
||||||
|
echo "$ISOLATION" > /etc/mesos-agent/isolation
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$WORK_DIR" ]; then
|
||||||
|
echo "$WORK_DIR" > /etc/mesos-agent/work_dir
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$IMAGE_PROVIDERS" ]; then
|
||||||
|
if [ -n "$ISOLATION" ]; then
|
||||||
|
echo "$IMAGE_PROVIDERS" > /etc/mesos-agent/image_providers
|
||||||
|
else
|
||||||
|
echo "isolation doesn't exist, not setting image_providers"
|
||||||
|
fi
|
||||||
|
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
|
||||||
|
fi
|
8
magnum/templates/mesos/fragments/start-services-agent.sh
Normal file
8
magnum/templates/mesos/fragments/start-services-agent.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Start agent services
|
||||||
|
for service in docker mesos-agent; do
|
||||||
|
echo "starting service $service"
|
||||||
|
service $service start
|
||||||
|
rm -f /etc/init/$service.override
|
||||||
|
done
|
275
magnum/templates/mesos/mesosagent.yaml
Normal file
275
magnum/templates/mesos/mesosagent.yaml
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
heat_template_version: 2014-10-16
|
||||||
|
|
||||||
|
description: >
|
||||||
|
This is a nested stack that defines a single Mesos agent, This stack is
|
||||||
|
included by a ResourceGroup resource in the parent template
|
||||||
|
(mesoscluster.yaml).
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
|
||||||
|
server_image:
|
||||||
|
type: string
|
||||||
|
description: glance image used to boot the server
|
||||||
|
|
||||||
|
agent_flavor:
|
||||||
|
type: string
|
||||||
|
description: flavor to use when booting the server
|
||||||
|
|
||||||
|
ssh_key_name:
|
||||||
|
type: string
|
||||||
|
description: name of ssh key to be provisioned on our server
|
||||||
|
|
||||||
|
external_network:
|
||||||
|
type: string
|
||||||
|
description: uuid/name of a network to use for floating ip addresses
|
||||||
|
|
||||||
|
wait_condition_timeout:
|
||||||
|
type: number
|
||||||
|
description : >
|
||||||
|
timeout for the Wait Conditions
|
||||||
|
|
||||||
|
executor_registration_timeout:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
Amount of time to wait for an executor to register with the agent before
|
||||||
|
considering it hung and shutting it down
|
||||||
|
|
||||||
|
http_proxy:
|
||||||
|
type: string
|
||||||
|
description: http proxy address for docker
|
||||||
|
|
||||||
|
https_proxy:
|
||||||
|
type: string
|
||||||
|
description: https proxy address for docker
|
||||||
|
|
||||||
|
no_proxy:
|
||||||
|
type: string
|
||||||
|
description: no proxies for docker
|
||||||
|
|
||||||
|
auth_url:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
url for mesos to authenticate before sending request
|
||||||
|
|
||||||
|
username:
|
||||||
|
type: string
|
||||||
|
description: user name
|
||||||
|
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
user password, not set in current implementation, only used to
|
||||||
|
fill in for Kubernetes config file
|
||||||
|
hidden: true
|
||||||
|
|
||||||
|
tenant_name:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
tenant_name is used to isolate access to Compute resources
|
||||||
|
|
||||||
|
volume_driver:
|
||||||
|
type: string
|
||||||
|
description: volume driver to use for container storage
|
||||||
|
|
||||||
|
region_name:
|
||||||
|
type: string
|
||||||
|
description: A logically separate section of the cluster
|
||||||
|
|
||||||
|
domain_name:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
domain is to define the administrative boundaries for management
|
||||||
|
of Keystone entities
|
||||||
|
|
||||||
|
rexray_preempt:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
enables any host to take control of a volume irrespective of whether
|
||||||
|
other hosts are using the volume
|
||||||
|
|
||||||
|
mesos_agent_isolation:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or
|
||||||
|
`cgroups/cpu,cgroups/mem`, or network/port_mapping (configure with flag:
|
||||||
|
`--with-network-isolator` to enable), or `cgroups/devices/gpus/nvidia`
|
||||||
|
for nvidia specific gpu isolation (configure with flag: `--enable-nvidia
|
||||||
|
-gpu-support` to enable), or `external`, or load an alternate isolator
|
||||||
|
module using the `--modules` flag. Note that this flag is only relevant
|
||||||
|
for the Mesos Containerizer.
|
||||||
|
|
||||||
|
mesos_agent_work_dir:
|
||||||
|
type: string
|
||||||
|
description: directory path to place framework work directories
|
||||||
|
|
||||||
|
mesos_agent_image_providers:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
Comma separated list of supported image providers e.g.,
|
||||||
|
APPC,DOCKER
|
||||||
|
|
||||||
|
mesos_agent_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.
|
||||||
|
|
||||||
|
mesos_masters_ips:
|
||||||
|
type: string
|
||||||
|
description: IP addresses of the Mesos master servers.
|
||||||
|
|
||||||
|
fixed_network:
|
||||||
|
type: string
|
||||||
|
description: Network from which to allocate fixed addresses.
|
||||||
|
|
||||||
|
fixed_subnet:
|
||||||
|
type: string
|
||||||
|
description: Subnet from which to allocate fixed addresses.
|
||||||
|
|
||||||
|
secgroup_base_id:
|
||||||
|
type: string
|
||||||
|
description: ID of the security group for base.
|
||||||
|
|
||||||
|
resources:
|
||||||
|
|
||||||
|
agent_wait_handle:
|
||||||
|
type: OS::Heat::WaitConditionHandle
|
||||||
|
|
||||||
|
agent_wait_condition:
|
||||||
|
type: OS::Heat::WaitCondition
|
||||||
|
depends_on: mesos_agent
|
||||||
|
properties:
|
||||||
|
handle: {get_resource: agent_wait_handle}
|
||||||
|
timeout: {get_param: wait_condition_timeout}
|
||||||
|
|
||||||
|
secgroup_all_open:
|
||||||
|
type: OS::Neutron::SecurityGroup
|
||||||
|
properties:
|
||||||
|
rules:
|
||||||
|
- protocol: icmp
|
||||||
|
- protocol: tcp
|
||||||
|
- protocol: udp
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
#
|
||||||
|
# software configs. these are components that are combined into
|
||||||
|
# a multipart MIME user-data archive.
|
||||||
|
#
|
||||||
|
|
||||||
|
write_heat_params:
|
||||||
|
type: OS::Heat::SoftwareConfig
|
||||||
|
properties:
|
||||||
|
group: ungrouped
|
||||||
|
config:
|
||||||
|
str_replace:
|
||||||
|
template: {get_file: fragments/write-heat-params.yaml}
|
||||||
|
params:
|
||||||
|
"$MESOS_MASTERS_IPS": {get_param: mesos_masters_ips}
|
||||||
|
"$EXECUTOR_REGISTRATION_TIMEOUT": {get_param: executor_registration_timeout}
|
||||||
|
"$HTTP_PROXY": {get_param: http_proxy}
|
||||||
|
"$HTTPS_PROXY": {get_param: https_proxy}
|
||||||
|
"$NO_PROXY": {get_param: no_proxy}
|
||||||
|
"$AUTH_URL": {get_param: auth_url}
|
||||||
|
"$USERNAME": {get_param: username}
|
||||||
|
"$PASSWORD": {get_param: password}
|
||||||
|
"$TENANT_NAME": {get_param: tenant_name}
|
||||||
|
"$VOLUME_DRIVER": {get_param: volume_driver}
|
||||||
|
"$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}
|
||||||
|
|
||||||
|
configure_mesos_agent:
|
||||||
|
type: OS::Heat::SoftwareConfig
|
||||||
|
properties:
|
||||||
|
group: ungrouped
|
||||||
|
config: {get_file: fragments/configure-mesos-agent.sh}
|
||||||
|
|
||||||
|
start_services:
|
||||||
|
type: OS::Heat::SoftwareConfig
|
||||||
|
properties:
|
||||||
|
group: ungrouped
|
||||||
|
config: {get_file: fragments/start-services-agent.sh}
|
||||||
|
|
||||||
|
agent_wc_notify:
|
||||||
|
type: OS::Heat::SoftwareConfig
|
||||||
|
properties:
|
||||||
|
group: ungrouped
|
||||||
|
config:
|
||||||
|
str_replace:
|
||||||
|
template: |
|
||||||
|
#!/bin/bash -v
|
||||||
|
wc_notify --data-binary '{"status": "SUCCESS"}'
|
||||||
|
params:
|
||||||
|
wc_notify: {get_attr: [agent_wait_handle, curl_cli]}
|
||||||
|
|
||||||
|
add_proxy:
|
||||||
|
type: OS::Heat::SoftwareConfig
|
||||||
|
properties:
|
||||||
|
group: ungrouped
|
||||||
|
config: {get_file: fragments/add-proxy.sh}
|
||||||
|
|
||||||
|
volume_service:
|
||||||
|
type: OS::Heat::SoftwareConfig
|
||||||
|
properties:
|
||||||
|
group: ungrouped
|
||||||
|
config: {get_file: fragments/volume-service.sh}
|
||||||
|
|
||||||
|
mesos_agent_init:
|
||||||
|
type: OS::Heat::MultipartMime
|
||||||
|
properties:
|
||||||
|
parts:
|
||||||
|
- config: {get_resource: write_heat_params}
|
||||||
|
- config: {get_resource: configure_mesos_agent}
|
||||||
|
- config: {get_resource: add_proxy}
|
||||||
|
- config: {get_resource: volume_service}
|
||||||
|
- config: {get_resource: start_services}
|
||||||
|
- config: {get_resource: agent_wc_notify}
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
#
|
||||||
|
# a single Mesos agent.
|
||||||
|
#
|
||||||
|
|
||||||
|
mesos_agent:
|
||||||
|
type: OS::Nova::Server
|
||||||
|
properties:
|
||||||
|
image: {get_param: server_image}
|
||||||
|
flavor: {get_param: agent_flavor}
|
||||||
|
key_name: {get_param: ssh_key_name}
|
||||||
|
user_data_format: RAW
|
||||||
|
user_data: {get_resource: mesos_agent_init}
|
||||||
|
networks:
|
||||||
|
- port: {get_resource: mesos_agent_eth0}
|
||||||
|
|
||||||
|
mesos_agent_eth0:
|
||||||
|
type: OS::Neutron::Port
|
||||||
|
properties:
|
||||||
|
network: {get_param: fixed_network}
|
||||||
|
security_groups:
|
||||||
|
- get_resource: secgroup_all_open
|
||||||
|
- get_param: secgroup_base_id
|
||||||
|
fixed_ips:
|
||||||
|
- subnet: {get_param: fixed_subnet}
|
||||||
|
replacement_policy: AUTO
|
||||||
|
|
||||||
|
mesos_agent_floating:
|
||||||
|
type: OS::Neutron::FloatingIP
|
||||||
|
properties:
|
||||||
|
floating_network: {get_param: external_network}
|
||||||
|
port_id: {get_resource: mesos_agent_eth0}
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
|
||||||
|
mesos_agent_ip:
|
||||||
|
value: {get_attr: [mesos_agent_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]}
|
||||||
|
description: >
|
||||||
|
This is the "public" address of the Mesos agent node.
|
@ -176,7 +176,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], [slave_nodes]].
|
[[master_nodes], [agent_nodes]].
|
||||||
:param coe: the COE type of the nodes
|
:param coe: the COE type of the nodes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -192,7 +192,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]
|
||||||
slave_nodes = nodes_addresses[1]
|
agent_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]
|
||||||
@ -221,7 +221,7 @@ class BaseMagnumTest(base.BaseTestCase):
|
|||||||
log_name, node_address))
|
log_name, node_address))
|
||||||
|
|
||||||
do_copy_logs('master', master_nodes)
|
do_copy_logs('master', master_nodes)
|
||||||
do_copy_logs('node', slave_nodes)
|
do_copy_logs('node', agent_nodes)
|
||||||
except Exception:
|
except Exception:
|
||||||
cls.LOG.exception(msg)
|
cls.LOG.exception(msg)
|
||||||
|
|
||||||
|
@ -294,7 +294,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_slaves"]
|
output_keys = ["mesos_master", "mesos_agents"]
|
||||||
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:
|
||||||
|
@ -101,54 +101,54 @@ class TestAttrValidator(base.BaseTestCase):
|
|||||||
mock_os_cli, 'test_keypair')
|
mock_os_cli, 'test_keypair')
|
||||||
|
|
||||||
def test_validate_labels_main_isolation_invalid(self):
|
def test_validate_labels_main_isolation_invalid(self):
|
||||||
fake_labels = {'mesos_slave_isolation': 'abc'}
|
fake_labels = {'mesos_agent_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_slave_isolation':
|
fake_labels = {'mesos_agent_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_slave_image_providers': 'docker'}
|
fake_labels = {'mesos_agent_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_slave_image_providers': 'docker',
|
fake_labels = {'mesos_agent_image_providers': 'docker',
|
||||||
'mesos_slave_isolation': 'abc'}
|
'mesos_agent_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_invalid_providers(self):
|
def test_validate_labels_with_invalid_providers(self):
|
||||||
fake_labels = {'mesos_slave_image_providers': 'abc'}
|
fake_labels = {'mesos_agent_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_slave_image_providers': 'docker'}
|
fake_labels = {'mesos_agent_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_slave_image_providers': 'docker',
|
fake_labels = {'mesos_agent_image_providers': 'docker',
|
||||||
'mesos_slave_isolation': 'docker/runtime'}
|
'mesos_agent_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_slave_executor_env_variables': contents}
|
fack_labels = {'mesos_agent_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_slave_executor_env_variables': 'step'}
|
fack_labels = {'mesos_agent_executor_env_variables': 'step'}
|
||||||
self.assertRaisesRegex(
|
self.assertRaisesRegex(
|
||||||
exception.InvalidParameterValue,
|
exception.InvalidParameterValue,
|
||||||
"Json format error",
|
"Json format error",
|
||||||
@ -156,12 +156,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_slave_isolation':
|
fake_labels = {'mesos_agent_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_slave_isolation': 'filesystem'}
|
fake_labels = {'mesos_agent_isolation': 'filesystem'}
|
||||||
self.assertRaises(exception.InvalidParameterValue,
|
self.assertRaises(exception.InvalidParameterValue,
|
||||||
attr_validator.validate_labels_isolation,
|
attr_validator.validate_labels_isolation,
|
||||||
fake_labels)
|
fake_labels)
|
||||||
|
@ -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_slave_isolation':
|
'mesos_agent_isolation':
|
||||||
'docker/runtime,filesystem/linux',
|
'docker/runtime,filesystem/linux',
|
||||||
'mesos_slave_image_providers': 'docker',
|
'mesos_agent_image_providers': 'docker',
|
||||||
'mesos_slave_executor_env_variables': '{}',
|
'mesos_agent_executor_env_variables': '{}',
|
||||||
'mesos_slave_work_dir': '/tmp/mesos/slave'
|
'mesos_agent_work_dir': '/tmp/mesos/agent'
|
||||||
},
|
},
|
||||||
'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',
|
||||||
'slave_flavor': 'flavor_id',
|
'agent_flavor': 'flavor_id',
|
||||||
'number_of_slaves': 1,
|
'number_of_agents': 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_slave_executor_env_variables': '{}',
|
'mesos_agent_executor_env_variables': '{}',
|
||||||
'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
|
'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
|
||||||
'mesos_slave_work_dir': '/tmp/mesos/slave',
|
'mesos_agent_work_dir': '/tmp/mesos/agent',
|
||||||
'mesos_slave_image_providers': 'docker'
|
'mesos_agent_image_providers': 'docker'
|
||||||
}
|
}
|
||||||
self.assertEqual(expected, definition)
|
self.assertEqual(expected, definition)
|
||||||
self.assertEqual(['environments/no_master_lb.yaml'], env_files)
|
self.assertEqual(['environments/no_master_lb.yaml'], env_files)
|
||||||
@ -145,7 +145,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_slaves': 1,
|
'number_of_agents': 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,
|
||||||
@ -159,10 +159,10 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||||||
'tenant_name': 'admin',
|
'tenant_name': 'admin',
|
||||||
'domain_name': 'domainname',
|
'domain_name': 'domainname',
|
||||||
'rexray_preempt': 'False',
|
'rexray_preempt': 'False',
|
||||||
'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
|
'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
|
||||||
'mesos_slave_executor_env_variables': '{}',
|
'mesos_agent_executor_env_variables': '{}',
|
||||||
'mesos_slave_work_dir': '/tmp/mesos/slave',
|
'mesos_agent_work_dir': '/tmp/mesos/agent',
|
||||||
'mesos_slave_image_providers': 'docker'
|
'mesos_agent_image_providers': 'docker'
|
||||||
}
|
}
|
||||||
self.assertEqual(expected, definition)
|
self.assertEqual(expected, definition)
|
||||||
self.assertEqual(['environments/no_master_lb.yaml'], env_files)
|
self.assertEqual(['environments/no_master_lb.yaml'], env_files)
|
||||||
@ -187,8 +187,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',
|
||||||
'slave_flavor': 'flavor_id',
|
'agent_flavor': 'flavor_id',
|
||||||
'number_of_slaves': 1,
|
'number_of_agents': 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',
|
||||||
@ -206,10 +206,10 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||||||
'tenant_name': 'admin',
|
'tenant_name': 'admin',
|
||||||
'domain_name': 'domainname',
|
'domain_name': 'domainname',
|
||||||
'rexray_preempt': 'False',
|
'rexray_preempt': 'False',
|
||||||
'mesos_slave_executor_env_variables': '{}',
|
'mesos_agent_executor_env_variables': '{}',
|
||||||
'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
|
'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
|
||||||
'mesos_slave_work_dir': '/tmp/mesos/slave',
|
'mesos_agent_work_dir': '/tmp/mesos/agent',
|
||||||
'mesos_slave_image_providers': 'docker'
|
'mesos_agent_image_providers': 'docker'
|
||||||
}
|
}
|
||||||
self.assertEqual(expected, definition)
|
self.assertEqual(expected, definition)
|
||||||
self.assertEqual(['environments/with_master_lb.yaml'], env_files)
|
self.assertEqual(['environments/with_master_lb.yaml'], env_files)
|
||||||
@ -235,8 +235,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',
|
||||||
'slave_flavor': 'flavor_id',
|
'agent_flavor': 'flavor_id',
|
||||||
'number_of_slaves': 1,
|
'number_of_agents': 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',
|
||||||
@ -254,10 +254,10 @@ class TestBayConductorWithMesos(base.TestCase):
|
|||||||
'tenant_name': 'admin',
|
'tenant_name': 'admin',
|
||||||
'domain_name': 'domainname',
|
'domain_name': 'domainname',
|
||||||
'rexray_preempt': 'False',
|
'rexray_preempt': 'False',
|
||||||
'mesos_slave_executor_env_variables': '{}',
|
'mesos_agent_executor_env_variables': '{}',
|
||||||
'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
|
'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
|
||||||
'mesos_slave_work_dir': '/tmp/mesos/slave',
|
'mesos_agent_work_dir': '/tmp/mesos/agent',
|
||||||
'mesos_slave_image_providers': 'docker'
|
'mesos_agent_image_providers': 'docker'
|
||||||
}
|
}
|
||||||
self.assertEqual(expected, definition)
|
self.assertEqual(expected, definition)
|
||||||
self.assertEqual(['environments/with_master_lb.yaml'], env_files)
|
self.assertEqual(['environments/with_master_lb.yaml'], env_files)
|
||||||
@ -281,7 +281,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_slaves': 1}
|
mock_heat_stack.parameters = {'number_of_agents': 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()
|
||||||
|
|
||||||
@ -290,7 +290,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_slaves': 2}
|
mock_heat_stack.parameters = {'number_of_agents': 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)
|
||||||
|
|
||||||
|
@ -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',
|
||||||
'slaves': [{
|
'agents': [{
|
||||||
'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',
|
||||||
'slaves': []
|
'agents': []
|
||||||
}
|
}
|
||||||
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)
|
||||||
|
@ -666,13 +666,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_slave_isolation = mock_baymodel.labels.get(
|
mesos_agent_isolation = mock_baymodel.labels.get(
|
||||||
'mesos_slave_isolation')
|
'mesos_agent_isolation')
|
||||||
mesos_slave_work_dir = mock_baymodel.labels.get('mesos_slave_work_dir')
|
mesos_agent_work_dir = mock_baymodel.labels.get('mesos_agent_work_dir')
|
||||||
mesos_slave_image_providers = mock_baymodel.labels.get(
|
mesos_agent_image_providers = mock_baymodel.labels.get(
|
||||||
'image_providers')
|
'image_providers')
|
||||||
mesos_slave_executor_env_variables = mock_baymodel.labels.get(
|
mesos_agent_executor_env_variables = mock_baymodel.labels.get(
|
||||||
'mesos_slave_executor_env_variables')
|
'mesos_agent_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
|
||||||
@ -696,12 +696,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_slave_isolation': mesos_slave_isolation,
|
'mesos_agent_isolation': mesos_agent_isolation,
|
||||||
'mesos_slave_work_dir': mesos_slave_work_dir,
|
'mesos_agent_work_dir': mesos_agent_work_dir,
|
||||||
'mesos_slave_executor_env_variables':
|
'mesos_agent_executor_env_variables':
|
||||||
mesos_slave_executor_env_variables,
|
mesos_agent_executor_env_variables,
|
||||||
'mesos_slave_image_providers': mesos_slave_image_providers,
|
'mesos_agent_image_providers': mesos_agent_image_providers,
|
||||||
'slaves_to_remove': removal_nodes}}
|
'agents_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)
|
||||||
|
|
||||||
@ -709,7 +709,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_slaves', heat_param)
|
self.assertEqual('number_of_agents', 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)
|
||||||
@ -718,7 +718,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_slave', 'address']
|
expected_node_addresses = ['ex_agent', 'address']
|
||||||
expected_master_addresses = ['ex_master', 'address']
|
expected_master_addresses = ['ex_master', 'address']
|
||||||
|
|
||||||
outputs = [
|
outputs = [
|
||||||
@ -733,10 +733,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_slaves_private"},
|
"output_key": "mesos_agents_private"},
|
||||||
{"output_value": expected_node_addresses,
|
{"output_value": expected_node_addresses,
|
||||||
"description": "No description given",
|
"description": "No description given",
|
||||||
"output_key": "mesos_slaves"},
|
"output_key": "mesos_agents"},
|
||||||
]
|
]
|
||||||
mock_stack = mock.MagicMock()
|
mock_stack = mock.MagicMock()
|
||||||
mock_stack.to_dict.return_value = {'outputs': outputs}
|
mock_stack.to_dict.return_value = {'outputs': outputs}
|
||||||
|
Loading…
Reference in New Issue
Block a user