Browse Source

Update mesos slave to mesos agent

Mesos community has renamed slave to agent. This change reflect
this renaming in the code.

Change-Id: Ic97a827345b62f812ed63180cd1f5820e2200682
Closes-Bug: #1516188
tags/3.0.0
Rajiv Kumar 2 years ago
parent
commit
15162ce33a

+ 3
- 3
doc/source/dev/mesos.rst View File

@@ -144,12 +144,12 @@ You can ssh into that server as the ``ubuntu`` user:
144 144
 
145 145
     $ ssh ubuntu@192.168.200.86
146 146
 
147
-You can log into your slaves using the ``ubuntu`` user as well. You can
148
-get a list of slaves addresses by running:
147
+You can log into your agents using the ``ubuntu`` user as well. You can
148
+get a list of agents addresses by running:
149 149
 
150 150
 ::
151 151
 
152
-    $ heat output-show my-mesos-cluster mesos_slaves
152
+    $ heat output-show my-mesos-cluster mesos_agents
153 153
     [
154 154
       "192.168.200.182"
155 155
     ]

+ 23
- 23
magnum/api/attr_validator.py View File

@@ -109,14 +109,14 @@ def validate_labels(labels):
109 109
 
110 110
 
111 111
 def validate_labels_isolation(labels):
112
-    """Validate mesos_slave_isolation"""
113
-    mesos_slave_isolation = labels.get('mesos_slave_isolation')
114
-    mesos_slave_isolation_list = mesos_slave_isolation.split(',')
115
-    unsupported_isolations = set(mesos_slave_isolation_list) - set(
112
+    """Validate mesos_agent_isolation"""
113
+    mesos_agent_isolation = labels.get('mesos_agent_isolation')
114
+    mesos_agent_isolation_list = mesos_agent_isolation.split(',')
115
+    unsupported_isolations = set(mesos_agent_isolation_list) - set(
116 116
         SUPPORTED_ISOLATION)
117 117
     if (len(unsupported_isolations) > 0):
118 118
         raise exception.InvalidParameterValue(_(
119
-            'property "labels/mesos_salve_isolation" with value '
119
+            'property "labels/mesos_agent_isolation" with value '
120 120
             '"%(isolation_val)s" is not supported, supported values are: '
121 121
             '%(supported_isolation)s') % {
122 122
                 'isolation_val': ', '.join(list(unsupported_isolations)),
@@ -125,15 +125,15 @@ def validate_labels_isolation(labels):
125 125
 
126 126
 
127 127
 def validate_labels_image_providers(labels):
128
-    """Validate mesos_slave_image_providers"""
129
-    mesos_slave_image_providers = labels.get('mesos_slave_image_providers')
130
-    mesos_slave_image_providers_list = mesos_slave_image_providers.split(',')
128
+    """Validate mesos_agent_image_providers"""
129
+    mesos_agent_image_providers = labels.get('mesos_agent_image_providers')
130
+    mesos_agent_image_providers_list = mesos_agent_image_providers.split(',')
131 131
     isolation_with_valid_data = False
132
-    for image_providers_val in mesos_slave_image_providers_list:
132
+    for image_providers_val in mesos_agent_image_providers_list:
133 133
         image_providers_val = image_providers_val.lower()
134 134
         if image_providers_val not in SUPPORTED_IMAGE_PROVIDERS:
135 135
             raise exception.InvalidParameterValue(_(
136
-                'property "labels/mesos_slave_image_providers" with value '
136
+                'property "labels/mesos_agent_image_providers" with value '
137 137
                 '"%(image_providers)s" is not supported, supported values '
138 138
                 'are: %(supported_image_providers)s') % {
139 139
                 'image_providers': image_providers_val,
@@ -141,26 +141,26 @@ def validate_labels_image_providers(labels):
141 141
                     SUPPORTED_IMAGE_PROVIDERS + ['unspecified'])})
142 142
 
143 143
         if image_providers_val == 'docker':
144
-            mesos_slave_isolation = labels.get('mesos_slave_isolation')
145
-            if mesos_slave_isolation is not None:
146
-                mesos_slave_isolation_list = mesos_slave_isolation.split(',')
147
-                for isolations_val in mesos_slave_isolation_list:
144
+            mesos_agent_isolation = labels.get('mesos_agent_isolation')
145
+            if mesos_agent_isolation is not None:
146
+                mesos_agent_isolation_list = mesos_agent_isolation.split(',')
147
+                for isolations_val in mesos_agent_isolation_list:
148 148
                     if isolations_val == 'docker/runtime':
149 149
                         isolation_with_valid_data = True
150
-            if mesos_slave_isolation is None or not isolation_with_valid_data:
150
+            if mesos_agent_isolation is None or not isolation_with_valid_data:
151 151
                 raise exception.RequiredParameterNotProvided(_(
152 152
                     "Docker runtime isolator has to be specified if 'docker' "
153
-                    "is included in 'mesos_slave_image_providers' Please add "
154
-                    "'docker/runtime' to 'mesos_slave_isolation' labels "
153
+                    "is included in 'mesos_agent_image_providers' Please add "
154
+                    "'docker/runtime' to 'mesos_agent_isolation' labels "
155 155
                     "flags"))
156 156
 
157 157
 
158 158
 def validate_labels_executor_env_variables(labels):
159 159
     """Validate executor_environment_variables"""
160
-    mesos_slave_executor_env_val = labels.get(
161
-        'mesos_slave_executor_env_variables')
160
+    mesos_agent_executor_env_val = labels.get(
161
+        'mesos_agent_executor_env_variables')
162 162
     try:
163
-        json.loads(mesos_slave_executor_env_val)
163
+        json.loads(mesos_agent_executor_env_val)
164 164
     except ValueError:
165 165
         err = (_("Json format error"))
166 166
         raise exception.InvalidParameterValue(err)
@@ -194,8 +194,8 @@ validators = {'image_id': validate_image,
194 194
               'fixed_network': validate_fixed_network,
195 195
               'labels': validate_labels}
196 196
 
197
-labels_validators = {'mesos_slave_isolation': validate_labels_isolation,
198
-                     'mesos_slave_image_providers':
197
+labels_validators = {'mesos_agent_isolation': validate_labels_isolation,
198
+                     'mesos_agent_image_providers':
199 199
                      validate_labels_image_providers,
200
-                     'mesos_slave_executor_env_variables':
200
+                     'mesos_agent_executor_env_variables':
201 201
                      validate_labels_executor_env_variables}

+ 1
- 1
magnum/api/controllers/v1/bay.py View File

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

+ 5
- 5
magnum/conductor/mesos_monitor.py View File

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

+ 1
- 1
magnum/drivers/mesos_ubuntu_v1/image/mesos/post-install.d/60-disable-upstart View File

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

+ 10
- 10
magnum/drivers/mesos_ubuntu_v1/template_def.py View File

@@ -28,11 +28,11 @@ class UbuntuMesosTemplateDefinition(template_def.BaseTemplateDefinition):
28 28
         self.add_parameter('external_network',
29 29
                            baymodel_attr='external_network_id',
30 30
                            required=True)
31
-        self.add_parameter('number_of_slaves',
31
+        self.add_parameter('number_of_agents',
32 32
                            bay_attr='node_count')
33 33
         self.add_parameter('master_flavor',
34 34
                            baymodel_attr='master_flavor_id')
35
-        self.add_parameter('slave_flavor',
35
+        self.add_parameter('agent_flavor',
36 36
                            baymodel_attr='flavor_id')
37 37
         self.add_parameter('cluster_name',
38 38
                            bay_attr='name')
@@ -45,9 +45,9 @@ class UbuntuMesosTemplateDefinition(template_def.BaseTemplateDefinition):
45 45
                         bay_attr=None)
46 46
         self.add_output('mesos_master',
47 47
                         bay_attr='master_addresses')
48
-        self.add_output('mesos_slaves_private',
48
+        self.add_output('mesos_agents_private',
49 49
                         bay_attr=None)
50
-        self.add_output('mesos_slaves',
50
+        self.add_output('mesos_agents',
51 51
                         bay_attr='node_addresses')
52 52
 
53 53
     def get_params(self, context, baymodel, bay, **kwargs):
@@ -62,18 +62,18 @@ class UbuntuMesosTemplateDefinition(template_def.BaseTemplateDefinition):
62 62
         extra_params['domain_name'] = context.domain_name
63 63
         extra_params['region_name'] = osc.cinder_region_name()
64 64
 
65
-        label_list = ['rexray_preempt', 'mesos_slave_isolation',
66
-                      'mesos_slave_image_providers',
67
-                      'mesos_slave_work_dir',
68
-                      'mesos_slave_executor_env_variables']
65
+        label_list = ['rexray_preempt', 'mesos_agent_isolation',
66
+                      'mesos_agent_image_providers',
67
+                      'mesos_agent_work_dir',
68
+                      'mesos_agent_executor_env_variables']
69 69
 
70 70
         for label in label_list:
71 71
             extra_params[label] = baymodel.labels.get(label)
72 72
 
73 73
         scale_mgr = kwargs.pop('scale_manager', None)
74 74
         if scale_mgr:
75
-            hosts = self.get_output('mesos_slaves_private')
76
-            extra_params['slaves_to_remove'] = (
75
+            hosts = self.get_output('mesos_agents_private')
76
+            extra_params['agents_to_remove'] = (
77 77
                 scale_mgr.get_removal_nodes(hosts))
78 78
 
79 79
         return super(UbuntuMesosTemplateDefinition,

magnum/drivers/mesos_ubuntu_v1/templates/fragments/configure-mesos-slave.sh → magnum/drivers/mesos_ubuntu_v1/templates/fragments/configure-mesos-agent.sh View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 . /etc/sysconfig/heat-params
4 4
 
5
-echo "Configuring mesos (slave)"
5
+echo "Configuring mesos (agent)"
6 6
 
7 7
 myip=$(ip addr show eth0 |
8 8
        awk '$1 == "inet" {print $2}' | cut -f1 -d/)
@@ -17,31 +17,31 @@ zk=${zk::-1}
17 17
 # Format: zk://host1:port1,...,hostN:portN/path
18 18
 echo "zk://${zk}/mesos" > /etc/mesos/zk
19 19
 
20
-# The hostname the slave should report
21
-echo "$myip" > /etc/mesos-slave/hostname
20
+# The hostname the agent should report
21
+echo "$myip" > /etc/mesos-agent/hostname
22 22
 
23 23
 # The IP address to listen on
24
-echo "$myip" > /etc/mesos-slave/ip
24
+echo "$myip" > /etc/mesos-agent/ip
25 25
 
26 26
 # List of containerizer implementations
27
-echo "docker,mesos" > /etc/mesos-slave/containerizers
27
+echo "docker,mesos" > /etc/mesos-agent/containerizers
28 28
 
29 29
 # Amount of time to wait for an executor to register
30
-cat > /etc/mesos-slave/executor_registration_timeout <<EOF
30
+cat > /etc/mesos-agent/executor_registration_timeout <<EOF
31 31
 $EXECUTOR_REGISTRATION_TIMEOUT
32 32
 EOF
33 33
 
34 34
 if [ -n "$ISOLATION" ]; then
35
-    echo "$ISOLATION" > /etc/mesos-slave/isolation
35
+    echo "$ISOLATION" > /etc/mesos-agent/isolation
36 36
 fi
37 37
 
38 38
 if [ -n "$WORK_DIR" ]; then
39
-    echo "$WORK_DIR" > /etc/mesos-slave/work_dir
39
+    echo "$WORK_DIR" > /etc/mesos-agent/work_dir
40 40
 fi
41 41
 
42 42
 if [ -n "$IMAGE_PROVIDERS" ]; then
43 43
     if [ -n "$ISOLATION" ]; then
44
-        echo "$IMAGE_PROVIDERS" > /etc/mesos-slave/image_providers
44
+        echo "$IMAGE_PROVIDERS" > /etc/mesos-agent/image_providers
45 45
     else
46 46
         echo "isolation doesn't exist, not setting image_providers"
47 47
     fi
@@ -49,5 +49,5 @@ fi
49 49
 
50 50
 if [ -n "$EXECUTOR_ENVIRONMENT_VARIABLES" ]; then
51 51
     echo "$EXECUTOR_ENVIRONMENT_VARIABLES" > /etc/executor_environment_variables
52
-    echo "file:///etc/executor_environment_variables" > /etc/mesos-slave/executor_environment_variables
52
+    echo "file:///etc/executor_environment_variables" > /etc/mesos-agent/executor_environment_variables
53 53
 fi

magnum/drivers/mesos_ubuntu_v1/templates/fragments/start-services-slave.sh → magnum/drivers/mesos_ubuntu_v1/templates/fragments/start-services-agent.sh View File

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

magnum/drivers/mesos_ubuntu_v1/templates/mesosslave.yaml → magnum/drivers/mesos_ubuntu_v1/templates/mesosagent.yaml View File

@@ -1,7 +1,7 @@
1 1
 heat_template_version: 2014-10-16
2 2
 
3 3
 description: >
4
-  This is a nested stack that defines a single Mesos slave, This stack is
4
+  This is a nested stack that defines a single Mesos agent, This stack is
5 5
   included by a ResourceGroup resource in the parent template
6 6
   (mesoscluster.yaml).
7 7
 
@@ -11,7 +11,7 @@ parameters:
11 11
     type: string
12 12
     description: glance image used to boot the server
13 13
 
14
-  slave_flavor:
14
+  agent_flavor:
15 15
     type: string
16 16
     description: flavor to use when booting the server
17 17
 
@@ -87,7 +87,7 @@ parameters:
87 87
       enables any host to take control of a volume irrespective of whether
88 88
       other hosts are using the volume
89 89
 
90
-  mesos_slave_isolation:
90
+  mesos_agent_isolation:
91 91
     type: string
92 92
     description: >
93 93
       Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or
@@ -98,17 +98,17 @@ parameters:
98 98
       module using the `--modules` flag. Note that this flag is only relevant
99 99
       for the Mesos Containerizer.
100 100
 
101
-  mesos_slave_work_dir:
101
+  mesos_agent_work_dir:
102 102
     type: string
103 103
     description: directory path to place framework work directories
104 104
 
105
-  mesos_slave_image_providers:
105
+  mesos_agent_image_providers:
106 106
     type: string
107 107
     description: >
108 108
       Comma separated list of supported image providers e.g.,
109 109
       APPC,DOCKER
110 110
 
111
-  mesos_slave_executor_env_variables:
111
+  mesos_agent_executor_env_variables:
112 112
     type: string
113 113
     description: >
114 114
       JSON object representing the environment variables that should be passed
@@ -133,14 +133,14 @@ parameters:
133 133
 
134 134
 resources:
135 135
 
136
-  slave_wait_handle:
136
+  agent_wait_handle:
137 137
     type: OS::Heat::WaitConditionHandle
138 138
 
139
-  slave_wait_condition:
139
+  agent_wait_condition:
140 140
     type: OS::Heat::WaitCondition
141
-    depends_on: mesos_slave
141
+    depends_on: mesos_agent
142 142
     properties:
143
-      handle: {get_resource: slave_wait_handle}
143
+      handle: {get_resource: agent_wait_handle}
144 144
       timeout: {get_param: wait_condition_timeout}
145 145
 
146 146
   secgroup_all_open:
@@ -178,24 +178,24 @@ resources:
178 178
             "$REGION_NAME": {get_param: region_name}
179 179
             "$DOMAIN_NAME": {get_param: domain_name}
180 180
             "$REXRAY_PREEMPT": {get_param: rexray_preempt}
181
-            "$ISOLATION": {get_param: mesos_slave_isolation}
182
-            "$WORK_DIR": {get_param: mesos_slave_work_dir}
183
-            "$IMAGE_PROVIDERS": {get_param: mesos_slave_image_providers}
184
-            "$EXECUTOR_ENVIRONMENT_VARIABLES": {get_param: mesos_slave_executor_env_variables}
181
+            "$ISOLATION": {get_param: mesos_agent_isolation}
182
+            "$WORK_DIR": {get_param: mesos_agent_work_dir}
183
+            "$IMAGE_PROVIDERS": {get_param: mesos_agent_image_providers}
184
+            "$EXECUTOR_ENVIRONMENT_VARIABLES": {get_param: mesos_agent_executor_env_variables}
185 185
 
186
-  configure_mesos_slave:
186
+  configure_mesos_agent:
187 187
     type: OS::Heat::SoftwareConfig
188 188
     properties:
189 189
       group: ungrouped
190
-      config: {get_file: fragments/configure-mesos-slave.sh}
190
+      config: {get_file: fragments/configure-mesos-agent.sh}
191 191
 
192 192
   start_services:
193 193
     type: OS::Heat::SoftwareConfig
194 194
     properties:
195 195
       group: ungrouped
196
-      config: {get_file: fragments/start-services-slave.sh}
196
+      config: {get_file: fragments/start-services-agent.sh}
197 197
 
198
-  slave_wc_notify:
198
+  agent_wc_notify:
199 199
     type: OS::Heat::SoftwareConfig
200 200
     properties:
201 201
       group: ungrouped
@@ -205,7 +205,7 @@ resources:
205 205
             #!/bin/bash -v
206 206
             wc_notify --data-binary '{"status": "SUCCESS"}'
207 207
           params:
208
-            wc_notify: {get_attr: [slave_wait_handle, curl_cli]}
208
+            wc_notify: {get_attr: [agent_wait_handle, curl_cli]}
209 209
 
210 210
   add_proxy:
211 211
     type: OS::Heat::SoftwareConfig
@@ -219,34 +219,34 @@ resources:
219 219
       group: ungrouped
220 220
       config: {get_file: fragments/volume-service.sh}
221 221
 
222
-  mesos_slave_init:
222
+  mesos_agent_init:
223 223
     type: OS::Heat::MultipartMime
224 224
     properties:
225 225
       parts:
226 226
         - config: {get_resource: write_heat_params}
227
-        - config: {get_resource: configure_mesos_slave}
227
+        - config: {get_resource: configure_mesos_agent}
228 228
         - config: {get_resource: add_proxy}
229 229
         - config: {get_resource: volume_service}
230 230
         - config: {get_resource: start_services}
231
-        - config: {get_resource: slave_wc_notify}
231
+        - config: {get_resource: agent_wc_notify}
232 232
 
233 233
   ######################################################################
234 234
   #
235 235
   # a single Mesos agent.
236 236
   #
237 237
 
238
-  mesos_slave:
238
+  mesos_agent:
239 239
     type: OS::Nova::Server
240 240
     properties:
241 241
       image: {get_param: server_image}
242
-      flavor: {get_param: slave_flavor}
242
+      flavor: {get_param: agent_flavor}
243 243
       key_name: {get_param: ssh_key_name}
244 244
       user_data_format: RAW
245
-      user_data: {get_resource: mesos_slave_init}
245
+      user_data: {get_resource: mesos_agent_init}
246 246
       networks:
247
-        - port: {get_resource: mesos_slave_eth0}
247
+        - port: {get_resource: mesos_agent_eth0}
248 248
 
249
-  mesos_slave_eth0:
249
+  mesos_agent_eth0:
250 250
     type: OS::Neutron::Port
251 251
     properties:
252 252
       network: {get_param: fixed_network}
@@ -257,19 +257,19 @@ resources:
257 257
         - subnet: {get_param: fixed_subnet}
258 258
       replacement_policy: AUTO
259 259
 
260
-  mesos_slave_floating:
260
+  mesos_agent_floating:
261 261
     type: OS::Neutron::FloatingIP
262 262
     properties:
263 263
       floating_network: {get_param: external_network}
264
-      port_id: {get_resource: mesos_slave_eth0}
264
+      port_id: {get_resource: mesos_agent_eth0}
265 265
 
266 266
 outputs:
267 267
 
268
-  mesos_slave_ip:
269
-    value: {get_attr: [mesos_slave_eth0, fixed_ips, 0, ip_address]}
268
+  mesos_agent_ip:
269
+    value: {get_attr: [mesos_agent_eth0, fixed_ips, 0, ip_address]}
270 270
     description: >
271 271
       This is the "private" address of the Mesos agent node.
272
-  mesos_slave_external_ip:
273
-    value: {get_attr: [mesos_slave_floating, floating_ip_address]}
272
+  mesos_agent_external_ip:
273
+    value: {get_attr: [mesos_agent_floating, floating_ip_address]}
274 274
     description: >
275 275
       This is the "public" address of the Mesos agent node.

+ 26
- 26
magnum/drivers/mesos_ubuntu_v1/templates/mesoscluster.yaml View File

@@ -3,7 +3,7 @@ heat_template_version: 2014-10-16
3 3
 description: >
4 4
   This template will boot a Mesos cluster with one or more masters
5 5
   (as specified by number_of_masters, default is 1) and one or more agents
6
-  (as specified by the number_of_slaves parameter, which
6
+  (as specified by the number_of_agents parameter, which
7 7
   defaults to 1).
8 8
 
9 9
 parameters:
@@ -27,7 +27,7 @@ parameters:
27 27
     default: m1.small
28 28
     description: flavor to use when booting the master server
29 29
 
30
-  slave_flavor:
30
+  agent_flavor:
31 31
     type: string
32 32
     default: m1.small
33 33
     description: flavor to use when booting the agent server
@@ -37,9 +37,9 @@ parameters:
37 37
     description: address of a dns nameserver reachable in your environment
38 38
     default: 8.8.8.8
39 39
 
40
-  number_of_slaves:
40
+  number_of_agents:
41 41
     type: number
42
-    description: how many mesos slaves to spawn initially
42
+    description: how many mesos agents to spawn initially
43 43
     default: 1
44 44
 
45 45
   fixed_network_cidr:
@@ -61,7 +61,7 @@ parameters:
61 61
   executor_registration_timeout:
62 62
     type: string
63 63
     description: >
64
-      Amount of time to wait for an executor to register with the slave before
64
+      Amount of time to wait for an executor to register with the agent before
65 65
       considering it hung and shutting it down
66 66
     default: 5mins
67 67
 
@@ -156,7 +156,7 @@ parameters:
156 156
     type: string
157 157
     description: url for keystone
158 158
 
159
-  mesos_slave_isolation:
159
+  mesos_agent_isolation:
160 160
     type: string
161 161
     description: >
162 162
       Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or
@@ -168,19 +168,19 @@ parameters:
168 168
       for the Mesos Containerizer.
169 169
     default: ""
170 170
 
171
-  mesos_slave_work_dir:
171
+  mesos_agent_work_dir:
172 172
     type: string
173 173
     description: directory path to place framework work directories
174 174
     default: ""
175 175
 
176
-  mesos_slave_image_providers:
176
+  mesos_agent_image_providers:
177 177
     type: string
178 178
     description: >
179 179
       Comma separated list of supported image providers e.g.,
180 180
       APPC,DOCKER
181 181
     default: ""
182 182
 
183
-  mesos_slave_executor_env_variables:
183
+  mesos_agent_executor_env_variables:
184 184
     type: string
185 185
     description: >
186 186
       JSON object representing the environment variables that should be passed
@@ -188,10 +188,10 @@ parameters:
188 188
       executor will inherit the agent's environment variables.
189 189
     default: ""
190 190
 
191
-  slaves_to_remove:
191
+  agents_to_remove:
192 192
     type: comma_delimited_list
193 193
     description: >
194
-      List of slaves to be removed when doing an update. Individual slave may
194
+      List of agents to be removed when doing an update. Individual agent may
195 195
       be referenced several ways: (1) The resource name (e.g.['1', '3']),
196 196
       (2) The private IP address ['10.0.0.4', '10.0.0.6']. Note: the list should
197 197
       be empty when doing a create.
@@ -410,23 +410,23 @@ resources:
410 410
 
411 411
   ######################################################################
412 412
   #
413
-  # Mesos slaves. This is a resource group that will initially
414
-  # create <number_of_slaves> slaves, and needs to be manually scaled.
413
+  # Mesos agents. This is a resource group that will initially
414
+  # create <number_of_agents> agents, and needs to be manually scaled.
415 415
   #
416 416
 
417
-  mesos_slaves:
417
+  mesos_agents:
418 418
     type: OS::Heat::ResourceGroup
419 419
     depends_on:
420 420
       - extrouter_inside
421 421
     properties:
422
-      count: {get_param: number_of_slaves}
423
-      removal_policies: [{resource_list: {get_param: slaves_to_remove}}]
422
+      count: {get_param: number_of_agents}
423
+      removal_policies: [{resource_list: {get_param: agents_to_remove}}]
424 424
       resource_def:
425
-        type: mesosslave.yaml
425
+        type: mesosagent.yaml
426 426
         properties:
427 427
           ssh_key_name: {get_param: ssh_key_name}
428 428
           server_image: {get_param: server_image}
429
-          slave_flavor: {get_param: slave_flavor}
429
+          agent_flavor: {get_param: agent_flavor}
430 430
           fixed_network: {get_resource: fixed_network}
431 431
           fixed_subnet: {get_resource: fixed_subnet}
432 432
           mesos_masters_ips: {list_join: [' ', {get_attr: [mesos_masters, mesos_master_ip]}]}
@@ -445,10 +445,10 @@ resources:
445 445
           region_name: {get_param: region_name}
446 446
           domain_name: {get_param: domain_name}
447 447
           rexray_preempt: {get_param: rexray_preempt}
448
-          mesos_slave_isolation: {get_param: mesos_slave_isolation}
449
-          mesos_slave_work_dir: {get_param: mesos_slave_work_dir}
450
-          mesos_slave_image_providers: {get_param: mesos_slave_image_providers}
451
-          mesos_slave_executor_env_variables: {get_param: mesos_slave_executor_env_variables}
448
+          mesos_agent_isolation: {get_param: mesos_agent_isolation}
449
+          mesos_agent_work_dir: {get_param: mesos_agent_work_dir}
450
+          mesos_agent_image_providers: {get_param: mesos_agent_image_providers}
451
+          mesos_agent_executor_env_variables: {get_param: mesos_agent_executor_env_variables}
452 452
 
453 453
 outputs:
454 454
 
@@ -470,12 +470,12 @@ outputs:
470 470
       log in to the Mesos master via ssh or to access the Mesos API
471 471
       from outside the cluster.
472 472
 
473
-  mesos_slaves_private:
474
-    value: {get_attr: [mesos_slaves, mesos_slave_ip]}
473
+  mesos_agent_private:
474
+    value: {get_attr: [mesos_agents, mesos_agent_ip]}
475 475
     description: >
476 476
       This is a list of the "private" addresses of all the Mesos agents.
477 477
 
478
-  mesos_slaves:
479
-    value: {get_attr: [mesos_slaves, mesos_slave_external_ip]}
478
+  mesos_agents:
479
+    value: {get_attr: [mesos_agents, mesos_agent_external_ip]}
480 480
     description: >
481 481
       This is a list of the "public" addresses of all the Mesos agents.

+ 53
- 0
magnum/templates/mesos/fragments/configure-mesos-agent.sh View File

@@ -0,0 +1,53 @@
1
+#!/bin/bash
2
+
3
+. /etc/sysconfig/heat-params
4
+
5
+echo "Configuring mesos (agent)"
6
+
7
+myip=$(ip addr show eth0 |
8
+       awk '$1 == "inet" {print $2}' | cut -f1 -d/)
9
+
10
+zk=""
11
+for master_ip in $MESOS_MASTERS_IPS; do
12
+    zk="${zk}${master_ip}:2181,"
13
+done
14
+# Remove last ','
15
+zk=${zk::-1}
16
+# Zookeeper URL. This specifies how to connect to a quorum of masters
17
+# Format: zk://host1:port1,...,hostN:portN/path
18
+echo "zk://${zk}/mesos" > /etc/mesos/zk
19
+
20
+# The hostname the agent should report
21
+echo "$myip" > /etc/mesos-agent/hostname
22
+
23
+# The IP address to listen on
24
+echo "$myip" > /etc/mesos-agent/ip
25
+
26
+# List of containerizer implementations
27
+echo "docker,mesos" > /etc/mesos-agent/containerizers
28
+
29
+# Amount of time to wait for an executor to register
30
+cat > /etc/mesos-agent/executor_registration_timeout <<EOF
31
+$EXECUTOR_REGISTRATION_TIMEOUT
32
+EOF
33
+
34
+if [ -n "$ISOLATION" ]; then
35
+    echo "$ISOLATION" > /etc/mesos-agent/isolation
36
+fi
37
+
38
+if [ -n "$WORK_DIR" ]; then
39
+    echo "$WORK_DIR" > /etc/mesos-agent/work_dir
40
+fi
41
+
42
+if [ -n "$IMAGE_PROVIDERS" ]; then
43
+    if [ -n "$ISOLATION" ]; then
44
+        echo "$IMAGE_PROVIDERS" > /etc/mesos-agent/image_providers
45
+    else
46
+        echo "isolation doesn't exist, not setting image_providers"
47
+    fi
48
+fi
49
+
50
+if [ -n "$EXECUTOR_ENVIRONMENT_VARIABLES" ]; then
51
+    echo "$EXECUTOR_ENVIRONMENT_VARIABLES" > /etc/executor_environment_variables
52
+    echo "file:///etc/executor_environment_variables" > /etc/mesos-agent/executor_environment_variables
53
+fi

+ 8
- 0
magnum/templates/mesos/fragments/start-services-agent.sh View File

@@ -0,0 +1,8 @@
1
+#!/bin/sh
2
+
3
+# Start agent services
4
+for service in docker mesos-agent; do
5
+    echo "starting service $service"
6
+    service $service start
7
+    rm -f /etc/init/$service.override
8
+done

+ 275
- 0
magnum/templates/mesos/mesosagent.yaml View File

@@ -0,0 +1,275 @@
1
+heat_template_version: 2014-10-16
2
+
3
+description: >
4
+  This is a nested stack that defines a single Mesos agent, This stack is
5
+  included by a ResourceGroup resource in the parent template
6
+  (mesoscluster.yaml).
7
+
8
+parameters:
9
+
10
+  server_image:
11
+    type: string
12
+    description: glance image used to boot the server
13
+
14
+  agent_flavor:
15
+    type: string
16
+    description: flavor to use when booting the server
17
+
18
+  ssh_key_name:
19
+    type: string
20
+    description: name of ssh key to be provisioned on our server
21
+
22
+  external_network:
23
+    type: string
24
+    description: uuid/name of a network to use for floating ip addresses
25
+
26
+  wait_condition_timeout:
27
+    type: number
28
+    description : >
29
+      timeout for the Wait Conditions
30
+
31
+  executor_registration_timeout:
32
+    type: string
33
+    description: >
34
+      Amount of time to wait for an executor to register with the agent before
35
+      considering it hung and shutting it down
36
+
37
+  http_proxy:
38
+    type: string
39
+    description: http proxy address for docker
40
+
41
+  https_proxy:
42
+    type: string
43
+    description: https proxy address for docker
44
+
45
+  no_proxy:
46
+    type: string
47
+    description: no proxies for docker
48
+
49
+  auth_url:
50
+    type: string
51
+    description: >
52
+      url for mesos to authenticate before sending request
53
+
54
+  username:
55
+    type: string
56
+    description: user name
57
+
58
+  password:
59
+    type: string
60
+    description: >
61
+      user password, not set in current implementation, only used to
62
+      fill in for Kubernetes config file
63
+    hidden: true
64
+
65
+  tenant_name:
66
+    type: string
67
+    description: >
68
+      tenant_name is used to isolate access to Compute resources
69
+
70
+  volume_driver:
71
+    type: string
72
+    description: volume driver to use for container storage
73
+
74
+  region_name:
75
+    type: string
76
+    description: A logically separate section of the cluster
77
+
78
+  domain_name:
79
+    type: string
80
+    description: >
81
+      domain is to define the administrative boundaries for management
82
+      of Keystone entities
83
+
84
+  rexray_preempt:
85
+    type: string
86
+    description: >
87
+      enables any host to take control of a volume irrespective of whether
88
+      other hosts are using the volume
89
+
90
+  mesos_agent_isolation:
91
+    type: string
92
+    description: >
93
+      Isolation mechanisms to use, e.g., `posix/cpu,posix/mem`, or
94
+      `cgroups/cpu,cgroups/mem`, or network/port_mapping (configure with flag:
95
+      `--with-network-isolator` to enable), or `cgroups/devices/gpus/nvidia`
96
+      for nvidia specific gpu isolation (configure with flag: `--enable-nvidia
97
+      -gpu-support` to enable), or `external`, or load an alternate isolator
98
+      module using the `--modules` flag. Note that this flag is only relevant
99
+      for the Mesos Containerizer.
100
+
101
+  mesos_agent_work_dir:
102
+    type: string
103
+    description: directory path to place framework work directories
104
+
105
+  mesos_agent_image_providers:
106
+    type: string
107
+    description: >
108
+      Comma separated list of supported image providers e.g.,
109
+      APPC,DOCKER
110
+
111
+  mesos_agent_executor_env_variables:
112
+    type: string
113
+    description: >
114
+      JSON object representing the environment variables that should be passed
115
+      to the executor, and thus subsequently task(s). By default the executor,
116
+      executor will inherit the agent's environment variables.
117
+
118
+  mesos_masters_ips:
119
+    type: string
120
+    description: IP addresses of the Mesos master servers.
121
+
122
+  fixed_network:
123
+    type: string
124
+    description: Network from which to allocate fixed addresses.
125
+
126
+  fixed_subnet:
127
+    type: string
128
+    description: Subnet from which to allocate fixed addresses.
129
+
130
+  secgroup_base_id:
131
+    type: string
132
+    description: ID of the security group for base.
133
+
134
+resources:
135
+
136
+  agent_wait_handle:
137
+    type: OS::Heat::WaitConditionHandle
138
+
139
+  agent_wait_condition:
140
+    type: OS::Heat::WaitCondition
141
+    depends_on: mesos_agent
142
+    properties:
143
+      handle: {get_resource: agent_wait_handle}
144
+      timeout: {get_param: wait_condition_timeout}
145
+
146
+  secgroup_all_open:
147
+    type: OS::Neutron::SecurityGroup
148
+    properties:
149
+      rules:
150
+        - protocol: icmp
151
+        - protocol: tcp
152
+        - protocol: udp
153
+
154
+  ######################################################################
155
+  #
156
+  # software configs.  these are components that are combined into
157
+  # a multipart MIME user-data archive.
158
+  #
159
+
160
+  write_heat_params:
161
+    type: OS::Heat::SoftwareConfig
162
+    properties:
163
+      group: ungrouped
164
+      config:
165
+        str_replace:
166
+          template: {get_file: fragments/write-heat-params.yaml}
167
+          params:
168
+            "$MESOS_MASTERS_IPS": {get_param: mesos_masters_ips}
169
+            "$EXECUTOR_REGISTRATION_TIMEOUT": {get_param: executor_registration_timeout}
170
+            "$HTTP_PROXY": {get_param: http_proxy}
171
+            "$HTTPS_PROXY": {get_param: https_proxy}
172
+            "$NO_PROXY": {get_param: no_proxy}
173
+            "$AUTH_URL": {get_param: auth_url}
174
+            "$USERNAME": {get_param: username}
175
+            "$PASSWORD": {get_param: password}
176
+            "$TENANT_NAME": {get_param: tenant_name}
177
+            "$VOLUME_DRIVER": {get_param: volume_driver}
178
+            "$REGION_NAME": {get_param: region_name}
179
+            "$DOMAIN_NAME": {get_param: domain_name}
180
+            "$REXRAY_PREEMPT": {get_param: rexray_preempt}
181
+            "$ISOLATION": {get_param: mesos_agent_isolation}
182
+            "$WORK_DIR": {get_param: mesos_agent_work_dir}
183
+            "$IMAGE_PROVIDERS": {get_param: mesos_agent_image_providers}
184
+            "$EXECUTOR_ENVIRONMENT_VARIABLES": {get_param: mesos_agent_executor_env_variables}
185
+
186
+  configure_mesos_agent:
187
+    type: OS::Heat::SoftwareConfig
188
+    properties:
189
+      group: ungrouped
190
+      config: {get_file: fragments/configure-mesos-agent.sh}
191
+
192
+  start_services:
193
+    type: OS::Heat::SoftwareConfig
194
+    properties:
195
+      group: ungrouped
196
+      config: {get_file: fragments/start-services-agent.sh}
197
+
198
+  agent_wc_notify:
199
+    type: OS::Heat::SoftwareConfig
200
+    properties:
201
+      group: ungrouped
202
+      config:
203
+        str_replace:
204
+          template: |
205
+            #!/bin/bash -v
206
+            wc_notify --data-binary '{"status": "SUCCESS"}'
207
+          params:
208
+            wc_notify: {get_attr: [agent_wait_handle, curl_cli]}
209
+
210
+  add_proxy:
211
+    type: OS::Heat::SoftwareConfig
212
+    properties:
213
+      group: ungrouped
214
+      config: {get_file: fragments/add-proxy.sh}
215
+
216
+  volume_service:
217
+    type: OS::Heat::SoftwareConfig
218
+    properties:
219
+      group: ungrouped
220
+      config: {get_file: fragments/volume-service.sh}
221
+
222
+  mesos_agent_init:
223
+    type: OS::Heat::MultipartMime
224
+    properties:
225
+      parts:
226
+        - config: {get_resource: write_heat_params}
227
+        - config: {get_resource: configure_mesos_agent}
228
+        - config: {get_resource: add_proxy}
229
+        - config: {get_resource: volume_service}
230
+        - config: {get_resource: start_services}
231
+        - config: {get_resource: agent_wc_notify}
232
+
233
+  ######################################################################
234
+  #
235
+  # a single Mesos agent.
236
+  #
237
+
238
+  mesos_agent:
239
+    type: OS::Nova::Server
240
+    properties:
241
+      image: {get_param: server_image}
242
+      flavor: {get_param: agent_flavor}
243
+      key_name: {get_param: ssh_key_name}
244
+      user_data_format: RAW
245
+      user_data: {get_resource: mesos_agent_init}
246
+      networks:
247
+        - port: {get_resource: mesos_agent_eth0}
248
+
249
+  mesos_agent_eth0:
250
+    type: OS::Neutron::Port
251
+    properties:
252
+      network: {get_param: fixed_network}
253
+      security_groups:
254
+        - get_resource: secgroup_all_open
255
+        - get_param: secgroup_base_id
256
+      fixed_ips:
257
+        - subnet: {get_param: fixed_subnet}
258
+      replacement_policy: AUTO
259
+
260
+  mesos_agent_floating:
261
+    type: OS::Neutron::FloatingIP
262
+    properties:
263
+      floating_network: {get_param: external_network}
264
+      port_id: {get_resource: mesos_agent_eth0}
265
+
266
+outputs:
267
+
268
+  mesos_agent_ip:
269
+    value: {get_attr: [mesos_agent_eth0, fixed_ips, 0, ip_address]}
270
+    description: >
271
+      This is the "private" address of the Mesos agent node.
272
+  mesos_agent_external_ip:
273
+    value: {get_attr: [mesos_agent_floating, floating_ip_address]}
274
+    description: >
275
+      This is the "public" address of the Mesos agent node.

+ 3
- 3
magnum/tests/functional/common/base.py View File

@@ -176,7 +176,7 @@ class BaseMagnumTest(base.BaseTestCase):
176 176
 
177 177
         :param get_nodes_fn: function that takes no parameters and returns
178 178
             a list of node IPs which are in such form:
179
-                [[master_nodes], [slave_nodes]].
179
+                [[master_nodes], [agent_nodes]].
180 180
         :param coe: the COE type of the nodes
181 181
         """
182 182
 
@@ -192,7 +192,7 @@ class BaseMagnumTest(base.BaseTestCase):
192 192
                 nodes_addresses = get_nodes_fn()
193 193
 
194 194
                 master_nodes = nodes_addresses[0]
195
-                slave_nodes = nodes_addresses[1]
195
+                agent_nodes = nodes_addresses[1]
196 196
 
197 197
                 base_path = os.path.split(os.path.dirname(
198 198
                     os.path.abspath(magnum.__file__)))[0]
@@ -221,7 +221,7 @@ class BaseMagnumTest(base.BaseTestCase):
221 221
                                  log_name, node_address))
222 222
 
223 223
                 do_copy_logs('master', master_nodes)
224
-                do_copy_logs('node', slave_nodes)
224
+                do_copy_logs('node', agent_nodes)
225 225
             except Exception:
226 226
                 cls.LOG.exception(msg)
227 227
 

+ 1
- 1
magnum/tests/functional/python_client_base.py View File

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

+ 13
- 13
magnum/tests/unit/api/test_attr_validator.py View File

@@ -101,54 +101,54 @@ class TestAttrValidator(base.BaseTestCase):
101 101
                           mock_os_cli, 'test_keypair')
102 102
 
103 103
     def test_validate_labels_main_isolation_invalid(self):
104
-        fake_labels = {'mesos_slave_isolation': 'abc'}
104
+        fake_labels = {'mesos_agent_isolation': 'abc'}
105 105
         self.assertRaises(exception.InvalidParameterValue,
106 106
                           attr_validator.validate_labels,
107 107
                           fake_labels)
108 108
 
109 109
     def test_validate_labels_isolation_valid(self):
110
-        fake_labels = {'mesos_slave_isolation':
110
+        fake_labels = {'mesos_agent_isolation':
111 111
                        'filesystem/posix,filesystem/linux'}
112 112
         attr_validator.validate_labels_isolation(fake_labels)
113 113
 
114 114
     def test_validate_labels_main_with_valid_providers_none_isolation(self):
115
-        fake_labels = {'mesos_slave_image_providers': 'docker'}
115
+        fake_labels = {'mesos_agent_image_providers': 'docker'}
116 116
         self.assertRaises(exception.RequiredParameterNotProvided,
117 117
                           attr_validator.validate_labels,
118 118
                           fake_labels)
119 119
 
120 120
     def test_validate_labels_with_valid_providers_invalid_isolation(self):
121
-        fake_labels = {'mesos_slave_image_providers': 'docker',
122
-                       'mesos_slave_isolation': 'abc'}
121
+        fake_labels = {'mesos_agent_image_providers': 'docker',
122
+                       'mesos_agent_isolation': 'abc'}
123 123
         self.assertRaises(exception.RequiredParameterNotProvided,
124 124
                           attr_validator.validate_labels_image_providers,
125 125
                           fake_labels)
126 126
 
127 127
     def test_validate_labels_with_invalid_providers(self):
128
-        fake_labels = {'mesos_slave_image_providers': 'abc'}
128
+        fake_labels = {'mesos_agent_image_providers': 'abc'}
129 129
         self.assertRaises(exception.InvalidParameterValue,
130 130
                           attr_validator.validate_labels_image_providers,
131 131
                           fake_labels)
132 132
 
133 133
     def test_validate_labels_with_valid_providers_none_isolation(self):
134
-        fake_labels = {'mesos_slave_image_providers': 'docker'}
134
+        fake_labels = {'mesos_agent_image_providers': 'docker'}
135 135
         self.assertRaises(exception.RequiredParameterNotProvided,
136 136
                           attr_validator.validate_labels_image_providers,
137 137
                           fake_labels)
138 138
 
139 139
     def test_validate_labels_with_valid_providers_valid_isolation(self):
140
-        fake_labels = {'mesos_slave_image_providers': 'docker',
141
-                       'mesos_slave_isolation': 'docker/runtime'}
140
+        fake_labels = {'mesos_agent_image_providers': 'docker',
141
+                       'mesos_agent_isolation': 'docker/runtime'}
142 142
         attr_validator.validate_labels_image_providers(fake_labels)
143 143
 
144 144
     def test_validate_labels_with_environment_variables_valid_json(self):
145 145
         contents = '{"step": "upgrade", "interface": "deploy"}'
146
-        fack_labels = {'mesos_slave_executor_env_variables': contents}
146
+        fack_labels = {'mesos_agent_executor_env_variables': contents}
147 147
         attr_validator.validate_labels_executor_env_variables(
148 148
             fack_labels)
149 149
 
150 150
     def test_validate_labels_with_environment_variables_bad_json(self):
151
-        fack_labels = {'mesos_slave_executor_env_variables': 'step'}
151
+        fack_labels = {'mesos_agent_executor_env_variables': 'step'}
152 152
         self.assertRaisesRegex(
153 153
             exception.InvalidParameterValue,
154 154
             "Json format error",
@@ -156,12 +156,12 @@ class TestAttrValidator(base.BaseTestCase):
156 156
             fack_labels)
157 157
 
158 158
     def test_validate_labels_with_valid_isolation(self):
159
-        fake_labels = {'mesos_slave_isolation':
159
+        fake_labels = {'mesos_agent_isolation':
160 160
                        'filesystem/posix,filesystem/linux'}
161 161
         attr_validator.validate_labels_isolation(fake_labels)
162 162
 
163 163
     def test_validate_labels_isolation_invalid(self):
164
-        fake_labels = {'mesos_slave_isolation': 'filesystem'}
164
+        fake_labels = {'mesos_agent_isolation': 'filesystem'}
165 165
         self.assertRaises(exception.InvalidParameterValue,
166 166
                           attr_validator.validate_labels_isolation,
167 167
                           fake_labels)

+ 30
- 30
magnum/tests/unit/conductor/handlers/test_mesos_bay_conductor.py View File

@@ -40,11 +40,11 @@ class TestBayConductorWithMesos(base.TestCase):
40 40
             'server_type': 'vm',
41 41
             'volume_driver': 'volume_driver',
42 42
             'labels': {'rexray_preempt': 'False',
43
-                       'mesos_slave_isolation':
44
-                           'docker/runtime,filesystem/linux',
45
-                       'mesos_slave_image_providers': 'docker',
46
-                       'mesos_slave_executor_env_variables': '{}',
47
-                       'mesos_slave_work_dir': '/tmp/mesos/slave'
43
+                       'mesos_agent_isolation':
44
+                       'docker/runtime,filesystem/linux',
45
+                       'mesos_agent_image_providers': 'docker',
46
+                       'mesos_agent_executor_env_variables': '{}',
47
+                       'mesos_agent_work_dir': '/tmp/mesos/agent'
48 48
                        },
49 49
             'master_lb_enabled': False,
50 50
         }
@@ -96,8 +96,8 @@ class TestBayConductorWithMesos(base.TestCase):
96 96
             'dns_nameserver': 'dns_nameserver',
97 97
             'server_image': 'image_id',
98 98
             'master_flavor': 'master_flavor_id',
99
-            'slave_flavor': 'flavor_id',
100
-            'number_of_slaves': 1,
99
+            'agent_flavor': 'flavor_id',
100
+            'number_of_agents': 1,
101 101
             'number_of_masters': 1,
102 102
             'http_proxy': 'http_proxy',
103 103
             'https_proxy': 'https_proxy',
@@ -115,10 +115,10 @@ class TestBayConductorWithMesos(base.TestCase):
115 115
             'tenant_name': 'admin',
116 116
             'domain_name': 'domainname',
117 117
             'rexray_preempt': 'False',
118
-            'mesos_slave_executor_env_variables': '{}',
119
-            'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
120
-            'mesos_slave_work_dir': '/tmp/mesos/slave',
121
-            'mesos_slave_image_providers': 'docker'
118
+            'mesos_agent_executor_env_variables': '{}',
119
+            'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
120
+            'mesos_agent_work_dir': '/tmp/mesos/agent',
121
+            'mesos_agent_image_providers': 'docker'
122 122
         }
123 123
         self.assertEqual(expected, definition)
124 124
         self.assertEqual(['environments/no_master_lb.yaml'], env_files)
@@ -145,7 +145,7 @@ class TestBayConductorWithMesos(base.TestCase):
145 145
         expected = {
146 146
             'ssh_key_name': 'keypair_id',
147 147
             'external_network': 'external_network_id',
148
-            'number_of_slaves': 1,
148
+            'number_of_agents': 1,
149 149
             'number_of_masters': 1,
150 150
             'cluster_name': 'bay1',
151 151
             'trustee_domain_id': self.mock_keystone.trustee_domain_id,
@@ -159,10 +159,10 @@ class TestBayConductorWithMesos(base.TestCase):
159 159
             'tenant_name': 'admin',
160 160
             'domain_name': 'domainname',
161 161
             'rexray_preempt': 'False',
162
-            'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
163
-            'mesos_slave_executor_env_variables': '{}',
164
-            'mesos_slave_work_dir': '/tmp/mesos/slave',
165
-            'mesos_slave_image_providers': 'docker'
162
+            'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
163
+            'mesos_agent_executor_env_variables': '{}',
164
+            'mesos_agent_work_dir': '/tmp/mesos/agent',
165
+            'mesos_agent_image_providers': 'docker'
166 166
         }
167 167
         self.assertEqual(expected, definition)
168 168
         self.assertEqual(['environments/no_master_lb.yaml'], env_files)
@@ -187,8 +187,8 @@ class TestBayConductorWithMesos(base.TestCase):
187 187
             'dns_nameserver': 'dns_nameserver',
188 188
             'server_image': 'image_id',
189 189
             'master_flavor': 'master_flavor_id',
190
-            'slave_flavor': 'flavor_id',
191
-            'number_of_slaves': 1,
190
+            'agent_flavor': 'flavor_id',
191
+            'number_of_agents': 1,
192 192
             'number_of_masters': 1,
193 193
             'http_proxy': 'http_proxy',
194 194
             'https_proxy': 'https_proxy',
@@ -206,10 +206,10 @@ class TestBayConductorWithMesos(base.TestCase):
206 206
             'tenant_name': 'admin',
207 207
             'domain_name': 'domainname',
208 208
             'rexray_preempt': 'False',
209
-            'mesos_slave_executor_env_variables': '{}',
210
-            'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
211
-            'mesos_slave_work_dir': '/tmp/mesos/slave',
212
-            'mesos_slave_image_providers': 'docker'
209
+            'mesos_agent_executor_env_variables': '{}',
210
+            'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
211
+            'mesos_agent_work_dir': '/tmp/mesos/agent',
212
+            'mesos_agent_image_providers': 'docker'
213 213
         }
214 214
         self.assertEqual(expected, definition)
215 215
         self.assertEqual(['environments/with_master_lb.yaml'], env_files)
@@ -235,8 +235,8 @@ class TestBayConductorWithMesos(base.TestCase):
235 235
             'dns_nameserver': 'dns_nameserver',
236 236
             'server_image': 'image_id',
237 237
             'master_flavor': 'master_flavor_id',
238
-            'slave_flavor': 'flavor_id',
239
-            'number_of_slaves': 1,
238
+            'agent_flavor': 'flavor_id',
239
+            'number_of_agents': 1,
240 240
             'number_of_masters': 2,
241 241
             'http_proxy': 'http_proxy',
242 242
             'https_proxy': 'https_proxy',
@@ -254,10 +254,10 @@ class TestBayConductorWithMesos(base.TestCase):
254 254
             'tenant_name': 'admin',
255 255
             'domain_name': 'domainname',
256 256
             'rexray_preempt': 'False',
257
-            'mesos_slave_executor_env_variables': '{}',
258
-            'mesos_slave_isolation': 'docker/runtime,filesystem/linux',
259
-            'mesos_slave_work_dir': '/tmp/mesos/slave',
260
-            'mesos_slave_image_providers': 'docker'
257
+            'mesos_agent_executor_env_variables': '{}',
258
+            'mesos_agent_isolation': 'docker/runtime,filesystem/linux',
259
+            'mesos_agent_work_dir': '/tmp/mesos/agent',
260
+            'mesos_agent_image_providers': 'docker'
261 261
         }
262 262
         self.assertEqual(expected, definition)
263 263
         self.assertEqual(['environments/with_master_lb.yaml'], env_files)
@@ -281,7 +281,7 @@ class TestBayConductorWithMesos(base.TestCase):
281 281
     def test_poll_node_count(self):
282 282
         mock_heat_stack, bay, poller = self.setup_poll_test()
283 283
 
284
-        mock_heat_stack.parameters = {'number_of_slaves': 1}
284
+        mock_heat_stack.parameters = {'number_of_agents': 1}
285 285
         mock_heat_stack.stack_status = bay_status.CREATE_IN_PROGRESS
286 286
         poller.poll_and_check()
287 287
 
@@ -290,7 +290,7 @@ class TestBayConductorWithMesos(base.TestCase):
290 290
     def test_poll_node_count_by_update(self):
291 291
         mock_heat_stack, bay, poller = self.setup_poll_test()
292 292
 
293
-        mock_heat_stack.parameters = {'number_of_slaves': 2}
293
+        mock_heat_stack.parameters = {'number_of_agents': 2}
294 294
         mock_heat_stack.stack_status = bay_status.UPDATE_COMPLETE
295 295
         self.assertRaises(loopingcall.LoopingCallDone, poller.poll_and_check)
296 296
 

+ 2
- 2
magnum/tests/unit/conductor/test_monitors.py View File

@@ -262,7 +262,7 @@ class MonitorsTestCase(base.TestCase):
262 262
         state_json = {
263 263
             'leader': 'master@10.0.0.6:5050',
264 264
             'pid': 'master@10.0.0.6:5050',
265
-            'slaves': [{
265
+            'agents': [{
266 266
                 'resources': {
267 267
                     'mem': 100,
268 268
                     'cpus': 1,
@@ -281,7 +281,7 @@ class MonitorsTestCase(base.TestCase):
281 281
         state_json = {
282 282
             'leader': 'master@10.0.0.6:5050',
283 283
             'pid': 'master@1.1.1.1:5050',
284
-            'slaves': []
284
+            'agents': []
285 285
         }
286 286
         self._test_mesos_monitor_pull_data(mock_url_get, state_json,
287 287
                                            0, 0, 0, 0)

+ 16
- 16
magnum/tests/unit/drivers/test_template_definition.py View File

@@ -666,13 +666,13 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
666 666
         mock_baymodel = mock.MagicMock()
667 667
         mock_baymodel.tls_disabled = False
668 668
         rexray_preempt = mock_baymodel.labels.get('rexray_preempt')
669
-        mesos_slave_isolation = mock_baymodel.labels.get(
670
-            'mesos_slave_isolation')
671
-        mesos_slave_work_dir = mock_baymodel.labels.get('mesos_slave_work_dir')
672
-        mesos_slave_image_providers = mock_baymodel.labels.get(
669
+        mesos_agent_isolation = mock_baymodel.labels.get(
670
+            'mesos_agent_isolation')
671
+        mesos_agent_work_dir = mock_baymodel.labels.get('mesos_agent_work_dir')
672
+        mesos_agent_image_providers = mock_baymodel.labels.get(
673 673
             'image_providers')
674
-        mesos_slave_executor_env_variables = mock_baymodel.labels.get(
675
-            'mesos_slave_executor_env_variables')
674
+        mesos_agent_executor_env_variables = mock_baymodel.labels.get(
675
+            'mesos_agent_executor_env_variables')
676 676
         mock_bay = mock.MagicMock()
677 677
         mock_bay.uuid = '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'
678 678
         del mock_bay.stack_id
@@ -696,12 +696,12 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
696 696
             'tenant_name': 'admin',
697 697
             'domain_name': 'domainname',
698 698
             'rexray_preempt': rexray_preempt,
699
-            'mesos_slave_isolation': mesos_slave_isolation,
700
-            'mesos_slave_work_dir': mesos_slave_work_dir,
701
-            'mesos_slave_executor_env_variables':
702
-                mesos_slave_executor_env_variables,
703
-            'mesos_slave_image_providers': mesos_slave_image_providers,
704
-            'slaves_to_remove': removal_nodes}}
699
+            'mesos_agent_isolation': mesos_agent_isolation,
700
+            'mesos_agent_work_dir': mesos_agent_work_dir,
701
+            'mesos_agent_executor_env_variables':
702
+                mesos_agent_executor_env_variables,
703
+            'mesos_agent_image_providers': mesos_agent_image_providers,
704
+            'agents_to_remove': removal_nodes}}
705 705
         mock_get_params.assert_called_once_with(mock_context, mock_baymodel,
706 706
                                                 mock_bay, **expected_kwargs)
707 707
 
@@ -709,7 +709,7 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
709 709
         mesos_def = mesos_tdef.UbuntuMesosTemplateDefinition()
710 710
 
711 711
         heat_param = mesos_def.get_heat_param(bay_attr='node_count')
712
-        self.assertEqual('number_of_slaves', heat_param)
712
+        self.assertEqual('number_of_agents', heat_param)
713 713
 
714 714
         heat_param = mesos_def.get_heat_param(bay_attr='master_count')
715 715
         self.assertEqual('number_of_masters', heat_param)
@@ -718,7 +718,7 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
718 718
         mesos_def = mesos_tdef.UbuntuMesosTemplateDefinition()
719 719
 
720 720
         expected_api_address = 'updated_address'
721
-        expected_node_addresses = ['ex_slave', 'address']
721
+        expected_node_addresses = ['ex_agent', 'address']
722 722
         expected_master_addresses = ['ex_master', 'address']
723 723
 
724 724
         outputs = [
@@ -733,10 +733,10 @@ class UbuntuMesosTemplateDefinitionTestCase(base.TestCase):
733 733
              "output_key": "mesos_master"},
734 734
             {"output_value": ['any', 'output'],
735 735
              "description": "No description given",
736
-             "output_key": "mesos_slaves_private"},
736
+             "output_key": "mesos_agents_private"},
737 737
             {"output_value": expected_node_addresses,
738 738
              "description": "No description given",
739
-             "output_key": "mesos_slaves"},
739
+             "output_key": "mesos_agents"},
740 740
         ]
741 741
         mock_stack = mock.MagicMock()
742 742
         mock_stack.to_dict.return_value = {'outputs': outputs}

Loading…
Cancel
Save