-
Notifications
You must be signed in to change notification settings - Fork 1
/
vm.yml
90 lines (88 loc) · 3.46 KB
/
vm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
application:
configuration:
configuration.operating-system: { "image": "us-east-1/ami-d85e75b0", "identity": "ubuntu" }
configuration.SlaveTargetQuantity: 2
configuration.recipeUrl: "https://s3.amazonaws.com/qubell-starter-kit-artifacts/qubell-bazaar/component-mesos-cookbooks-stable-63451be.tar.gz"
configuration.hardwareId-slave: "m1.small"
interfaces:
configuration:
hardwareId-slave: bind(provisioner#input.hardwareId-slave)
operating-system: bind(provisioner#input.operating-system)
SlaveTargetQuantity: bind(provisioner#input.SlaveTargetQuantity)
recipeUrl: bind(provisioner#input.recipeUrl)
mesos:
scale: bind(provisioner#actions.scale)
slave-ips: bind(provisioner#result.slave-ips)
components:
provisioner:
type: workflow.Instance
interfaces:
input:
hardwareId-slave:
type: configuration(string)
name: slave Amazon image size
SlaveTargetQuantity:
type: configuration(int)
name: Slave numbers
operating-system:
type: configuration(map<string,object>)
name: Compatible image
suggestions:
"Ubuntu 14.04 [us-east]": { "image": "us-east-1/ami-d85e75b0", "identity": "ubuntu" }
recipeUrl:
type: configuration(string)
name: Chef recipes
actions:
scale: receive-command(int SlaveTargetQuantity, int destroy_count, list<string> destroy_ips)
result:
slave-ips: publish-signal(list<string>)
configuration:
configuration.workflows:
launch:
steps:
- provision-slave-nodes:
action: provisionVms
phase: provision
parameters:
roleName: slave
imageId: "{$.operating-system.image}"
vmIdentity: "{$.operating-system.identity}"
hardwareId: "{$.hardwareId-slave}"
targetQuantity: "{$.SlaveTargetQuantity}"
jcloudsNodeNamePrefix: "MesosSlaves"
output:
SlaveIPs: ips
return:
slave-ips:
value: "{$.SlaveIPs}"
scale:
parameters:
- SlaveTargetQuantity:
description: Signals Java opts
- destroy_count:
description: Slave numbers for destroy
- destroy_ips:
description: Slave ips for destroy
steps:
- provision-slave-nodes:
action: provisionVms
phase: provision
parameters:
roleName: slave
imageId: "{$.operating-system.image}"
vmIdentity: "{$.operating-system.identity}"
hardwareId: "{$.hardwareId-slave}"
targetQuantity: "{$.SlaveTargetQuantity}"
jcloudsNodeNamePrefix: "MesosSlaves"
- destroy-unused-slave:
action: destroyVms
precedingPhases: [provision]
parameters:
roleName: slave
quantity: "{$.destroy_count}"
ips: "{$.destroy_ips}"
output:
SlaveIPs: ips
return:
slave-ips:
value: "{$.SlaveIPs}"