Merge "Enable Mesos Bay export more slave flags"
This commit is contained in:
commit
b5068b59ed
|
@ -663,7 +663,10 @@ class UbuntuMesosTemplateDefinition(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']
|
label_list = ['rexray_preempt', 'mesos_slave_isolation',
|
||||||
|
'mesos_slave_image_providers',
|
||||||
|
'mesos_slave_work_dir',
|
||||||
|
'mesos_slave_executor_environment_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)
|
||||||
|
|
|
@ -30,3 +30,23 @@ echo "docker,mesos" > /etc/mesos-slave/containerizers
|
||||||
cat > /etc/mesos-slave/executor_registration_timeout <<EOF
|
cat > /etc/mesos-slave/executor_registration_timeout <<EOF
|
||||||
$EXECUTOR_REGISTRATION_TIMEOUT
|
$EXECUTOR_REGISTRATION_TIMEOUT
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if [ -n "$ISOLATION" ]; then
|
||||||
|
echo "$ISOLATION" > /etc/mesos-slave/isolation
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$WORK_DIR" ]; then
|
||||||
|
echo "$WORK_DIR" > /etc/mesos-slave/work_dir
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$IMAGE_PROVIDERS" ]; then
|
||||||
|
if [ -n "$ISOLATION" ]; then
|
||||||
|
echo "$IMAGE_PROVIDERS" > /etc/mesos-slave/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/mesos-slave/executor_environment_variables
|
||||||
|
fi
|
||||||
|
|
|
@ -18,3 +18,7 @@ write_files:
|
||||||
REGION_NAME="$REGION_NAME"
|
REGION_NAME="$REGION_NAME"
|
||||||
DOMAIN_NAME="$DOMAIN_NAME"
|
DOMAIN_NAME="$DOMAIN_NAME"
|
||||||
REXRAY_PREEMPT="$REXRAY_PREEMPT"
|
REXRAY_PREEMPT="$REXRAY_PREEMPT"
|
||||||
|
ISOLATION="$ISOLATION"
|
||||||
|
WORK_DIR="$WORK_DIR"
|
||||||
|
IMAGE_PROVIDERS="$IMAGE_PROVIDERS"
|
||||||
|
EXECUTOR_ENVIRONMENT_VARIABLES="$EXECUTOR_ENVIRONMENT_VARIABLES"
|
||||||
|
|
|
@ -155,6 +155,38 @@ parameters:
|
||||||
type: string
|
type: string
|
||||||
description: url for keystone
|
description: url for keystone
|
||||||
|
|
||||||
|
mesos_slave_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.
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
mesos_slave_work_dir:
|
||||||
|
type: string
|
||||||
|
description: directory path to place framework work directories
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
mesos_slave_image_providers:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
Comma separated list of supported image providers e.g.,
|
||||||
|
APPC,DOCKER
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
mesos_slave_executor_environment_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.
|
||||||
|
default: ""
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
@ -388,6 +420,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_slave_work_dir: {get_param: mesos_slave_work_dir}
|
||||||
|
mesos_slave_image_providers: {get_param: mesos_slave_image_providers}
|
||||||
|
mesos_slave_executor_environment_variables: {get_param: mesos_slave_executor_environment_variables}
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,34 @@ 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:
|
||||||
|
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_slave_work_dir:
|
||||||
|
type: string
|
||||||
|
description: directory path to place framework work directories
|
||||||
|
|
||||||
|
mesos_slave_image_providers:
|
||||||
|
type: string
|
||||||
|
description: >
|
||||||
|
Comma separated list of supported image providers e.g.,
|
||||||
|
APPC,DOCKER
|
||||||
|
|
||||||
|
mesos_slave_executor_environment_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:
|
mesos_masters_ips:
|
||||||
type: string
|
type: string
|
||||||
description: IP addresses of the Mesos master servers.
|
description: IP addresses of the Mesos master servers.
|
||||||
|
@ -150,6 +178,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}
|
||||||
|
"$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_environment_variables}
|
||||||
|
|
||||||
configure_mesos_slave:
|
configure_mesos_slave:
|
||||||
type: OS::Heat::SoftwareConfig
|
type: OS::Heat::SoftwareConfig
|
||||||
|
|
|
@ -40,7 +40,13 @@ class TestBayConductorWithMesos(base.TestCase):
|
||||||
'no_proxy': 'no_proxy',
|
'no_proxy': 'no_proxy',
|
||||||
'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':
|
||||||
|
'docker/runtime,filesystem/linux',
|
||||||
|
'mesos_slave_image_providers': 'docker',
|
||||||
|
'mesos_slave_executor_environment_variables': '{}',
|
||||||
|
'mesos_slave_work_dir': '/tmp/mesos/slave'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.bay_dict = {
|
self.bay_dict = {
|
||||||
'id': 1,
|
'id': 1,
|
||||||
|
@ -107,7 +113,11 @@ class TestBayConductorWithMesos(base.TestCase):
|
||||||
'username': 'mesos_user',
|
'username': 'mesos_user',
|
||||||
'tenant_name': 'admin',
|
'tenant_name': 'admin',
|
||||||
'domain_name': 'domainname',
|
'domain_name': 'domainname',
|
||||||
'rexray_preempt': 'False'
|
'rexray_preempt': 'False',
|
||||||
|
'mesos_slave_executor_environment_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(expected, definition)
|
||||||
|
|
||||||
|
@ -145,7 +155,11 @@ class TestBayConductorWithMesos(base.TestCase):
|
||||||
'username': 'mesos_user',
|
'username': 'mesos_user',
|
||||||
'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_slave_executor_environment_variables': '{}',
|
||||||
|
'mesos_slave_work_dir': '/tmp/mesos/slave',
|
||||||
|
'mesos_slave_image_providers': 'docker'
|
||||||
}
|
}
|
||||||
self.assertEqual(expected, definition)
|
self.assertEqual(expected, definition)
|
||||||
|
|
||||||
|
|
|
@ -526,6 +526,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_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_slave_executor_environment_variables = mock_baymodel.labels.get(
|
||||||
|
'mesos_slave_executor_environment_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
|
||||||
|
@ -543,7 +550,12 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
|
||||||
'username': 'mesos_user',
|
'username': 'mesos_user',
|
||||||
'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_slave_work_dir': mesos_slave_work_dir,
|
||||||
|
'mesos_slave_executor_environment_variables':
|
||||||
|
mesos_slave_executor_environment_variables,
|
||||||
|
'mesos_slave_image_providers': mesos_slave_image_providers}}
|
||||||
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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue