nuri 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.travis.yml +12 -0
- data/CHANGELOG +146 -0
- data/Gemfile +3 -0
- data/LICENSE +28 -0
- data/README.md +64 -0
- data/Rakefile +15 -0
- data/VERSION +1 -0
- data/bin/delete_modules +11 -0
- data/bin/install_agent +18 -0
- data/bin/install_module +65 -0
- data/bin/nuri +519 -0
- data/bin/nuri.old +183 -0
- data/bin/push_model +16 -0
- data/examples/.gitignore +3 -0
- data/examples/bonfire.sfp +95 -0
- data/examples/bonfire/epcc.sfp +43 -0
- data/examples/bonfire/epcc0.sfp +49 -0
- data/examples/bonfire/epcc2.sfp +52 -0
- data/examples/bonfire/epcc2a.sfp +25 -0
- data/examples/bonfire/inria.sfp +72 -0
- data/examples/bonfire/inria0.sfp +49 -0
- data/examples/bonfire/inria2.sfp +71 -0
- data/examples/bonfire/inria2a.sfp +44 -0
- data/examples/bonfire/inria2b.sfp +54 -0
- data/examples/bonfire/inria2c.sfp +62 -0
- data/examples/bonfire/inria2d.sfp +71 -0
- data/examples/bonfire/inria2e.sfp +80 -0
- data/examples/bonfire/main.sfp +33 -0
- data/examples/bonfire/old/bonfire-1-1-1.sfp +76 -0
- data/examples/bonfire/old/bonfire-1-10-1.sfp +77 -0
- data/examples/bonfire/old/bonfire-1-2-1.sfp +58 -0
- data/examples/bonfire/old/bonfire-1-3-1.sfp +61 -0
- data/examples/bonfire/old/bonfire-1-4-1.sfp +64 -0
- data/examples/bonfire/old/bonfire-1-5-1.sfp +67 -0
- data/examples/bonfire/old/bonfire-1-6-1.sfp +82 -0
- data/examples/bonfire/old/bonfire-1-7-1.sfp +82 -0
- data/examples/bonfire/old/bonfire-1-8-1.sfp +79 -0
- data/examples/bonfire/old/bonfire-1-9-1.sfp +83 -0
- data/examples/bonfire/old/wp-test1a.sfp +38 -0
- data/examples/bonfire/old/wp-test1b.sfp +18 -0
- data/examples/bonfire/old/wp-test1c.sfp +7 -0
- data/examples/bonfire/old/wp-test2.sfp +47 -0
- data/examples/bonfire/old3/bonfire-epcc.sfp +57 -0
- data/examples/bonfire/old3/bonfire-inria.sfp +72 -0
- data/examples/bonfire/old3/bonfire-master.sfp +18 -0
- data/examples/bonfire/old3/bonfire.sfp +23 -0
- data/examples/bonfire/old3/bonfire2.sfp +49 -0
- data/examples/bonfire/old3/bonfire3.sfp +76 -0
- data/examples/bonfire/old3/bonfire4.sfp +78 -0
- data/examples/bonfire/old3/bonfire5.sfp +34 -0
- data/examples/bonfire/old3/bonfire5b.sfp +84 -0
- data/examples/bonfire/old3/hpvm6.sfp +22 -0
- data/examples/bonfire/old3/model.json +1 -0
- data/examples/bonfire/old3/test0.sfp +16 -0
- data/examples/bonfire/old3/test1.sfp +5 -0
- data/examples/bonfire/old3/test10.sfp +5 -0
- data/examples/bonfire/old3/test2.sfp +18 -0
- data/examples/bonfire/old3/test3.sfp +10 -0
- data/examples/bonfire/old3/test4.sfp +11 -0
- data/examples/bonfire/old3/test5.sfp +18 -0
- data/examples/bonfire/old3/test6.sfp +19 -0
- data/examples/bonfire/old3/test7.sfp +34 -0
- data/examples/bonfire/old3/test8.sfp +5 -0
- data/examples/bonfire/old3/test9.sfp +16 -0
- data/examples/bonfire/old3/wordpress-test-cluster.sfp +38 -0
- data/examples/bonfire/old3/wordpress-test.sfp +22 -0
- data/examples/bonfire/old3/wp-test-2.sfp +49 -0
- data/examples/bonfire/test.sfp +13 -0
- data/examples/generator.rb +66 -0
- data/examples/hadoop2.sfp +20 -0
- data/examples/hpcloud.sfp +18 -0
- data/examples/run.rb +17 -0
- data/examples/test.inc +0 -0
- data/examples/test.sfp +11 -0
- data/lib/naas/d3.js +5 -0
- data/lib/naas/d3.v3.min.js +5 -0
- data/lib/naas/index.css +0 -0
- data/lib/naas/index.html +18 -0
- data/lib/naas/index.js +18 -0
- data/lib/naas/jquery-1.10.2.min.js +6 -0
- data/lib/naas/jquery.js +6 -0
- data/lib/naas/naas.rb +160 -0
- data/lib/nuri.rb +62 -0
- data/lib/nuri/choreographer.rb +151 -0
- data/lib/nuri/constraint_helper.rb +9 -0
- data/lib/nuri/directory.rb +40 -0
- data/lib/nuri/master.rb +725 -0
- data/lib/nuri/net_helper.rb +65 -0
- data/lib/nuri/orchestrator.rb +224 -0
- data/lib/nuri/server.rb +212 -0
- data/modules/.gitignore +4 -0
- data/modules/apache/apache.rb +255 -0
- data/modules/apache/apache.rb.old +167 -0
- data/modules/apache/apache.sfp +146 -0
- data/modules/apache/apache.sfp.future +100 -0
- data/modules/apache/load_balancer +20 -0
- data/modules/apache/model.json +1 -0
- data/modules/apache/test.sfp +8 -0
- data/modules/aptpackage/aptpackage.rb +82 -0
- data/modules/aptpackage/aptpackage.sfp +5 -0
- data/modules/bonfire/.gitignore +2 -0
- data/modules/bonfire/README.md +12 -0
- data/modules/bonfire/bonfire.rb +60 -0
- data/modules/bonfire/bonfire.sfp +9 -0
- data/modules/bonfire/config.yml +4 -0
- data/modules/bonfire/helper.rb +149 -0
- data/modules/bonfire/stresstest.rb +144 -0
- data/modules/bonfire/test.sfp +8 -0
- data/modules/client/client.rb +22 -0
- data/modules/client/client.sfp +14 -0
- data/modules/cloud/cloud.rb +11 -0
- data/modules/cloud/cloud.sfp +26 -0
- data/modules/file/file.rb +91 -0
- data/modules/file/file.sfp +9 -0
- data/modules/hadoop1/core-site.xml +17 -0
- data/modules/hadoop1/hadoop-env.sh +55 -0
- data/modules/hadoop1/hadoop1.rb +384 -0
- data/modules/hadoop1/hadoop1.sfp +93 -0
- data/modules/hadoop1/hdfs-site.xml +16 -0
- data/modules/hadoop1/mapred-site.xml +17 -0
- data/modules/hadoop2/core-site.xml +31 -0
- data/modules/hadoop2/hadoop-env.sh +77 -0
- data/modules/hadoop2/hadoop2.rb +401 -0
- data/modules/hadoop2/hadoop2.sfp +114 -0
- data/modules/hadoop2/hdfs-site.xml +47 -0
- data/modules/hadoop2/mapred-site.xml +71 -0
- data/modules/hadoop2/ports +14 -0
- data/modules/hadoop2/yarn-env.sh +112 -0
- data/modules/hadoop2/yarn-site.xml +107 -0
- data/modules/hpcloud/.gitignore +2 -0
- data/modules/hpcloud/README.md +16 -0
- data/modules/hpcloud/config.yml +3 -0
- data/modules/hpcloud/example.sfp +18 -0
- data/modules/hpcloud/hpcloud.rb +241 -0
- data/modules/hpcloud/hpcloud.sfp +22 -0
- data/modules/hpcloud/test.sfp +5 -0
- data/modules/install_module +65 -0
- data/modules/machine/machine.rb +95 -0
- data/modules/machine/machine.sfp +9 -0
- data/modules/mockcloud/mockcloud.rb +20 -0
- data/modules/mockcloud/mockcloud.sfp +6 -0
- data/modules/mysql/mysql.rb +118 -0
- data/modules/mysql/mysql.sfp +38 -0
- data/modules/mysql/test.sfp +3 -0
- data/modules/node/node.rb +8 -0
- data/modules/node/node.sfp +7 -0
- data/modules/object/object.rb +7 -0
- data/modules/object/object.sfp +1 -0
- data/modules/os/os.rb +38 -0
- data/modules/os/os.sfp +11 -0
- data/modules/package/package.rb +26 -0
- data/modules/package/package.sfp +22 -0
- data/modules/package/test.sfp +6 -0
- data/modules/service/model.json +1 -0
- data/modules/service/service.rb +50 -0
- data/modules/service/service.sfp +46 -0
- data/modules/service/test.sfp +6 -0
- data/modules/tarpackage/tarpackage.rb +93 -0
- data/modules/tarpackage/tarpackage.sfp +5 -0
- data/modules/vm/vm.rb +8 -0
- data/modules/vm/vm.sfp +18 -0
- data/modules/wordpress/wordpress.rb +98 -0
- data/modules/wordpress/wordpress.sfp +34 -0
- data/modules/wordpresscluster/wordpresscluster.rb +150 -0
- data/modules/wordpresscluster/wordpresscluster.sfp +74 -0
- data/nuri.gemspec +26 -0
- metadata +281 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
include "../modules/machine/machine.sfp"
|
2
|
+
include "../modules/bonfire/bonfire.sfp"
|
3
|
+
include "../modules/vm/vm.sfp"
|
4
|
+
include "../modules/apache/apache.sfp"
|
5
|
+
include "../modules/mysql/mysql.sfp"
|
6
|
+
|
7
|
+
master isa Machine {
|
8
|
+
sfpAddress is "localhost"
|
9
|
+
|
10
|
+
bonfireEPCC isa Bonfire {
|
11
|
+
experiment is "autocloud"
|
12
|
+
location is "uk-epcc"
|
13
|
+
wan_name is "BonFIRE WAN"
|
14
|
+
}
|
15
|
+
bonfireINRIA extends master.bonfireEPCC {
|
16
|
+
location is "fr-inria"
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
vm1 isa VM {
|
21
|
+
type is "small"
|
22
|
+
image is "BonFIRE Debian Squeeze 10G v5"
|
23
|
+
created is true
|
24
|
+
apache isa Apache {
|
25
|
+
running is true
|
26
|
+
is_load_balancer is true
|
27
|
+
}
|
28
|
+
in_cloud is master.bonfireEPCC
|
29
|
+
}
|
30
|
+
|
31
|
+
vm2 isa VM {
|
32
|
+
type is "small"
|
33
|
+
image is "BonFIRE Debian Squeeze 10G v5"
|
34
|
+
created is true
|
35
|
+
apache isa Apache {
|
36
|
+
running is true
|
37
|
+
}
|
38
|
+
in_cloud is master.bonfireEPCC
|
39
|
+
}
|
40
|
+
vm3 extends vm2
|
41
|
+
|
42
|
+
vm4 extends vm2
|
43
|
+
|
44
|
+
vm5 extends vm2
|
45
|
+
|
46
|
+
vm6 extends vm2
|
47
|
+
|
48
|
+
vm7 extends vm2
|
49
|
+
|
50
|
+
vm8 extends vm2
|
51
|
+
|
52
|
+
vm9 extends vm2
|
53
|
+
|
54
|
+
vm10 isa VM {
|
55
|
+
type is "small"
|
56
|
+
image is "BonFIRE Debian Squeeze 10G v5"
|
57
|
+
created is true
|
58
|
+
mysql isa Mysql {
|
59
|
+
running is true
|
60
|
+
}
|
61
|
+
in_cloud is master.bonfireEPCC
|
62
|
+
}
|
63
|
+
|
64
|
+
global {
|
65
|
+
if vm1.apache.running = true then {
|
66
|
+
vm2.apache.running = true
|
67
|
+
vm3.apache.running = true
|
68
|
+
vm4.apache.running = true
|
69
|
+
vm5.apache.running = true
|
70
|
+
vm6.apache.running = true
|
71
|
+
vm7.apache.running = true
|
72
|
+
vm8.apache.running = true
|
73
|
+
vm9.apache.running = true
|
74
|
+
}
|
75
|
+
|
76
|
+
if vm2.apache.running = true then vm10.mysql.running = true
|
77
|
+
if vm3.apache.running = true then vm10.mysql.running = true
|
78
|
+
if vm4.apache.running = true then vm10.mysql.running = true
|
79
|
+
if vm5.apache.running = true then vm10.mysql.running = true
|
80
|
+
if vm6.apache.running = true then vm10.mysql.running = true
|
81
|
+
if vm7.apache.running = true then vm10.mysql.running = true
|
82
|
+
if vm8.apache.running = true then vm10.mysql.running = true
|
83
|
+
if vm9.apache.running = true then vm10.mysql.running = true
|
84
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
include "../modules/machine/machine.sfp"
|
2
|
+
include "../modules/bonfire/bonfire.sfp"
|
3
|
+
include "../modules/vm/vm.sfp"
|
4
|
+
include "../modules/apache/apache.sfp"
|
5
|
+
include "../modules/mysql/mysql.sfp"
|
6
|
+
|
7
|
+
hpvm6 isa Machine {
|
8
|
+
sfpAddress is "hpvm6.diy.inf.ed.ac.uk"
|
9
|
+
|
10
|
+
bonfireEPCC isa Bonfire {
|
11
|
+
experiment is "autocloud"
|
12
|
+
location is "uk-epcc"
|
13
|
+
image_name is "BonFIRE Debian Squeeze 10G v5"
|
14
|
+
wan_name is "BonFIRE WAN"
|
15
|
+
}
|
16
|
+
bonfireINRIA isa Bonfire {
|
17
|
+
experiment is "autocloud"
|
18
|
+
location is "fr-inria"
|
19
|
+
image_name is "BonFIRE Debian Squeeze 10G v5"
|
20
|
+
wan_name is "BonFIRE WAN"
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"Object":{"_self":"Object","_context":"class"},"Node":{"_self":"Node","_context":"class","sfpAddress":"","sfpPort":"1314","_extends":"$.Object","_super":["$.Object"]},"Package":{"_self":"Package","_context":"class","package_name":"","installed":false,"version":"","install":{"_self":"install","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.installed":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.installed":{"_context":"mutation","_type":"equals","_value":true}}},"uninstall":{"_self":"uninstall","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.installed":{"_context":"mutation","_type":"equals","_value":false}}},"_extends":"$.Object","_super":["$.Object"]},"Service":{"_self":"Service","_context":"class","_extends":"$.Package","service_name":"","running":false,"uninstall":{"_self":"uninstall","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":false},"$.this.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.installed":{"_context":"mutation","_type":"equals","_value":false}}},"start":{"_self":"start","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.running":{"_context":"mutation","_type":"equals","_value":true}}},"stop":{"_self":"stop","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.running":{"_context":"mutation","_type":"equals","_value":false}}},"package_name":"","installed":false,"version":"","install":{"_self":"install","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.installed":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.installed":{"_context":"mutation","_type":"equals","_value":true}}},"_super":["$.Object","$.Package"]},"Apache":{"_self":"Apache","_context":"class","_extends":"$.Service","package_name":"apache2","service_name":"apache2","port":80,"document_root":"/var/www","php_module":false,"php_mysql_module":false,"server_name":"","libaugeas_ruby":{"_self":"libaugeas_ruby","_context":"object","_isa":"$.Package","_is_array":false,"package_name":"libaugeas-ruby","installed":true,"version":"","install":{"_self":"install","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.installed":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.installed":{"_context":"mutation","_type":"equals","_value":true}}},"uninstall":{"_self":"uninstall","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.installed":{"_context":"mutation","_type":"equals","_value":false}}},"_classes":["$.Object","$.Package"]},"set_port":{"_self":"set_port","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.port":{"_context":"mutation","_type":"equals","_value":"$.target"}},"target":{"_context":"null","_isa":"$.Integer"}},"install":{"_self":"install","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":false},"$.this.libaugeas.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.installed":{"_context":"mutation","_type":"equals","_value":true}}},"uninstall":{"_self":"uninstall","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false},"$.this.php_module":{"_context":"constraint","_type":"equals","_value":false},"$.this.php_mysql_module":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.installed":{"_context":"mutation","_type":"equals","_value":false}}},"set_document_root":{"_self":"set_document_root","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":false},"$.this.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.document_root":{"_context":"mutation","_type":"equals","_value":"$.target"}},"target":{"_context":"null","_isa":"$.String"}},"set_server_name":{"_self":"set_server_name","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":false},"$.this.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.server_name":{"_context":"mutation","_type":"equals","_value":"$.target"}},"target":{"_context":"null","_isa":"$.String"}},"install_php_module":{"_self":"install_php_module","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.php_module":{"_context":"mutation","_type":"equals","_value":true}}},"uninstall_php_module":{"_self":"uninstall_php_module","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.php_module":{"_context":"mutation","_type":"equals","_value":false}}},"install_php_mysql_module":{"_self":"install_php_mysql_module","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.php_module":{"_context":"constraint","_type":"equals","_value":true},"$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.php_mysql_module":{"_context":"mutation","_type":"equals","_value":true}}},"uninstall_php_mysql_module":{"_self":"uninstall_php_mysql_module","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.php_mysql_module":{"_context":"mutation","_type":"equals","_value":false}}},"running":false,"start":{"_self":"start","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.running":{"_context":"mutation","_type":"equals","_value":true}}},"stop":{"_self":"stop","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.running":{"_context":"mutation","_type":"equals","_value":false}}},"installed":false,"version":"","_super":["$.Object","$.Package","$.Service"]},"hpvm6":{"_self":"hpvm6","_context":"object","_isa":"$.Node","_is_array":false,"sfpAddress":"hpvm6.diy.inf.ed.ac.uk","sfpPort":"1314","_classes":["$.Object","$.Node"],"apache":{"_self":"apache","_context":"object","_isa":"$.Apache","_is_array":false,"package_name":"apache2","service_name":"apache2","port":80,"document_root":"/var/www","php_module":false,"php_mysql_module":false,"server_name":"","libaugeas_ruby":{"_self":"libaugeas_ruby","_context":"object","_isa":"$.Package","_is_array":false,"package_name":"libaugeas-ruby","installed":true,"version":"","install":{"_self":"install","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.installed":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.installed":{"_context":"mutation","_type":"equals","_value":true}}},"uninstall":{"_self":"uninstall","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.installed":{"_context":"mutation","_type":"equals","_value":false}}},"_classes":["$.Object","$.Package"]},"set_port":{"_self":"set_port","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.port":{"_context":"mutation","_type":"equals","_value":"$.target"}},"target":{"_context":"null","_isa":"$.Integer"}},"install":{"_self":"install","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":false},"$.this.libaugeas.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.installed":{"_context":"mutation","_type":"equals","_value":true}}},"uninstall":{"_self":"uninstall","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false},"$.this.php_module":{"_context":"constraint","_type":"equals","_value":false},"$.this.php_mysql_module":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.installed":{"_context":"mutation","_type":"equals","_value":false}}},"set_document_root":{"_self":"set_document_root","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":false},"$.this.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.document_root":{"_context":"mutation","_type":"equals","_value":"$.target"}},"target":{"_context":"null","_isa":"$.String"}},"set_server_name":{"_self":"set_server_name","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":false},"$.this.installed":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.server_name":{"_context":"mutation","_type":"equals","_value":"$.target"}},"target":{"_context":"null","_isa":"$.String"}},"install_php_module":{"_self":"install_php_module","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.php_module":{"_context":"mutation","_type":"equals","_value":true}}},"uninstall_php_module":{"_self":"uninstall_php_module","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.php_module":{"_context":"mutation","_type":"equals","_value":false}}},"install_php_mysql_module":{"_self":"install_php_mysql_module","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.php_module":{"_context":"constraint","_type":"equals","_value":true},"$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.php_mysql_module":{"_context":"mutation","_type":"equals","_value":true}}},"uninstall_php_mysql_module":{"_self":"uninstall_php_mysql_module","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.php_mysql_module":{"_context":"mutation","_type":"equals","_value":false}}},"running":false,"start":{"_self":"start","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.installed":{"_context":"constraint","_type":"equals","_value":true},"$.this.running":{"_context":"constraint","_type":"equals","_value":false}},"_effect":{"_context":"effect","_type":"and","$.this.running":{"_context":"mutation","_type":"equals","_value":true}}},"stop":{"_self":"stop","_context":"procedure","_cost":1,"_condition":{"_context":"constraint","_type":"and","$.this.running":{"_context":"constraint","_type":"equals","_value":true}},"_effect":{"_context":"effect","_type":"and","$.this.running":{"_context":"mutation","_type":"equals","_value":false}}},"installed":false,"version":"","_classes":["$.Object","$.Package","$.Service","$.Apache"]}}}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
include "../modules/node/node.sfp"
|
2
|
+
include "../modules/apache/apache.sfp"
|
3
|
+
|
4
|
+
hpvm6 isa Node {
|
5
|
+
sfpAddress is "hpvm6.diy.inf.ed.ac.uk"
|
6
|
+
|
7
|
+
apache isa Apache {
|
8
|
+
installed = false
|
9
|
+
/*running = true
|
10
|
+
php_module = true
|
11
|
+
php_mysql_module = true
|
12
|
+
|
13
|
+
is_load_balancer = true
|
14
|
+
lb_method = "bytraffic"*/
|
15
|
+
}
|
16
|
+
|
17
|
+
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
include "../modules/node/node.sfp"
|
2
|
+
include "../modules/mysql/mysql.sfp"
|
3
|
+
|
4
|
+
hpvm6 isa Node {
|
5
|
+
sfpAddress is "hpvm6.diy.inf.ed.ac.uk"
|
6
|
+
|
7
|
+
mysql isa Mysql {
|
8
|
+
//installed = false
|
9
|
+
//installed = true
|
10
|
+
running = true
|
11
|
+
//running = false
|
12
|
+
//root_password = "nuri"
|
13
|
+
//port = 4000
|
14
|
+
//public = true
|
15
|
+
}
|
16
|
+
|
17
|
+
|
18
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
include "../modules/node/node.sfp"
|
2
|
+
include "../modules/apache/apache.sfp"
|
3
|
+
|
4
|
+
hpvm7 isa Node {
|
5
|
+
sfpAddress is "hpvm7.diy.inf.ed.ac.uk"
|
6
|
+
|
7
|
+
apache isa Apache {
|
8
|
+
//installed = false
|
9
|
+
running = true
|
10
|
+
//php_module = false
|
11
|
+
//php_mysql_module = false
|
12
|
+
//version = "2.2.22-1ubuntu1."
|
13
|
+
|
14
|
+
is_load_balancer = true
|
15
|
+
lb_method = "bytraffic"
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
include "../modules/node/node.sfp"
|
2
|
+
include "../modules/apache/apache.sfp"
|
3
|
+
include "../modules/mysql/mysql.sfp"
|
4
|
+
|
5
|
+
hpvm6 isa Node {
|
6
|
+
sfpAddress = "hpvm6.diy.inf.ed.ac.uk"
|
7
|
+
mysql isa Mysql {
|
8
|
+
running = true
|
9
|
+
//root_password = "mysql"
|
10
|
+
//public = true
|
11
|
+
//installed = false
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
hpvm7 isa Node {
|
16
|
+
sfpAddress is "hpvm7.diy.inf.ed.ac.uk"
|
17
|
+
|
18
|
+
apache isa Apache {
|
19
|
+
//installed = false
|
20
|
+
running = true
|
21
|
+
//php_module = false
|
22
|
+
//php_mysql_module = false
|
23
|
+
//version = "2.2.22-1ubuntu1."
|
24
|
+
|
25
|
+
is_load_balancer = true
|
26
|
+
lb_method = "bytraffic"
|
27
|
+
lb_members = ( hpvm6 )
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
global {
|
32
|
+
if hpvm7.apache.running then hpvm6.mysql.running
|
33
|
+
//if hpvm6.mysql.running then hpvm7.apache.running
|
34
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
//include "../modules/node/node.sfp"
|
2
|
+
include "../modules/machine/machine.sfp"
|
3
|
+
include "../modules/file/file.sfp"
|
4
|
+
|
5
|
+
canim isa Machine { //Node {
|
6
|
+
sfpAddress = "localhost"
|
7
|
+
test isa File {
|
8
|
+
path = "/tmp/test"
|
9
|
+
exists = true
|
10
|
+
content = "hello world!"
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
sometime {
|
15
|
+
canim.test.exists = false
|
16
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
include "modules/machine/machine.sfp"
|
2
|
+
include "modules/wordpresscluster/wordpresscluster.sfp"
|
3
|
+
|
4
|
+
hpvm6 isa Machine {
|
5
|
+
sfpAddress is "hpvm6.diy.inf.ed.ac.uk"
|
6
|
+
apache isa Apache {
|
7
|
+
running is true
|
8
|
+
}
|
9
|
+
wp_web isa WordpressWeb {
|
10
|
+
installed is true
|
11
|
+
http is hpvm6.apache
|
12
|
+
database is hpvm7.wp_db
|
13
|
+
}
|
14
|
+
mysql isa Mysql {
|
15
|
+
installed = false
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
hpvm8 extends hpvm6 {
|
20
|
+
sfpAddress is "hpvm8.diy.inf.ed.ac.uk"
|
21
|
+
wp_web extends hpvm6.wp_web {
|
22
|
+
http is hpvm8.apache
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
hpvm7 isa Machine {
|
27
|
+
sfpAddress is "hpvm7.diy.inf.ed.ac.uk"
|
28
|
+
mysql isa Mysql {
|
29
|
+
running is true
|
30
|
+
}
|
31
|
+
wp_db isa WordpressDB {
|
32
|
+
installed is true
|
33
|
+
mysql is hpvm7.mysql
|
34
|
+
}
|
35
|
+
apache isa Apache {
|
36
|
+
installed = false
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
include "modules/machine/machine.sfp"
|
2
|
+
include "modules/apache/apache.sfp"
|
3
|
+
include "modules/mysql/mysql.sfp"
|
4
|
+
include "modules/wordpress/wordpress.sfp"
|
5
|
+
include "modules/file/file.sfp"
|
6
|
+
|
7
|
+
test isa Machine {
|
8
|
+
sfpAddress = "hpvm7.diy.inf.ed.ac.uk"
|
9
|
+
//sfpAddress = "localhost"
|
10
|
+
|
11
|
+
apache isa Apache {
|
12
|
+
//installed = false
|
13
|
+
}
|
14
|
+
mysql isa Mysql
|
15
|
+
|
16
|
+
wp isa Wordpress {
|
17
|
+
path = "/wp"
|
18
|
+
installed = true
|
19
|
+
http = test.apache
|
20
|
+
database = test.mysql
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
include "../modules/node/node.sfp"
|
2
|
+
include "../modules/bonfire/bonfire.sfp"
|
3
|
+
include "../modules/vm/vm.sfp"
|
4
|
+
include "../modules/wordpresscluster/wordpresscluster.sfp"
|
5
|
+
|
6
|
+
master isa Node {
|
7
|
+
sfpAddress is "hpvm6.diy.inf.ed.ac.uk"
|
8
|
+
epcc isa Bonfire {
|
9
|
+
experiment is "autocloud"
|
10
|
+
location is "uk-epcc"
|
11
|
+
image_name is "BonFIRE Debian Squeeze 10G v5"
|
12
|
+
wan_name is "BonFIRE WAN"
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
hpvm6 isa VM {
|
17
|
+
created = true
|
18
|
+
/*
|
19
|
+
apache isa Apache {
|
20
|
+
running is true
|
21
|
+
}
|
22
|
+
wp_web isa WordpressWeb {
|
23
|
+
installed is true
|
24
|
+
http is hpvm6.apache
|
25
|
+
database is hpvm7.wp_db
|
26
|
+
}
|
27
|
+
mysql isa Mysql {
|
28
|
+
installed = false
|
29
|
+
}
|
30
|
+
*/
|
31
|
+
}
|
32
|
+
|
33
|
+
/*hpvm8 extends hpvm6 {
|
34
|
+
created = true
|
35
|
+
wp_web extends hpvm6.wp_web {
|
36
|
+
http is hpvm8.apache
|
37
|
+
}
|
38
|
+
}*/
|
39
|
+
|
40
|
+
hpvm7 isa VM {
|
41
|
+
created = true
|
42
|
+
/* mysql isa Mysql {
|
43
|
+
running is true
|
44
|
+
}
|
45
|
+
wp_db isa WordpressDB {
|
46
|
+
installed is true
|
47
|
+
mysql is hpvm7.mysql
|
48
|
+
}*/
|
49
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
include "../modules/vm/vm.sfp"
|
2
|
+
include "../modules/apache/apache.sfp"
|
3
|
+
include "../modules/mysql/mysql.sfp"
|
4
|
+
include "../modules/wordpresscluster/wordpresscluster.sfp"
|
5
|
+
|
6
|
+
vm1x isa VM {
|
7
|
+
created = true
|
8
|
+
apache isa Apache {
|
9
|
+
running is true
|
10
|
+
is_load_balancer is true
|
11
|
+
}
|
12
|
+
in_cloud is proxy.epcc
|
13
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
def generate(number_apps)
|
4
|
+
header = 'include "../modules/node/node.sfp"
|
5
|
+
include "../modules/mockcloud/mockcloud.sfp"
|
6
|
+
include "../modules/vm/vm.sfp"
|
7
|
+
include "../modules/apache/apache.sfp"
|
8
|
+
include "../modules/mysql/mysql.sfp"
|
9
|
+
include "../modules/wordpresscluster/wordpresscluster.sfp"
|
10
|
+
|
11
|
+
proxy isa Node {
|
12
|
+
sfpAddress is "localhost"
|
13
|
+
cloud isa MockCloud
|
14
|
+
}
|
15
|
+
'
|
16
|
+
vmlb = 'vmlb isa VM {
|
17
|
+
apache isa Apache {
|
18
|
+
running is true
|
19
|
+
is_load_balancer is true
|
20
|
+
lb_members is (%members%)
|
21
|
+
}
|
22
|
+
}'
|
23
|
+
vmapp = '%vmapp% isa VM {
|
24
|
+
apache isa Apache {
|
25
|
+
running is true
|
26
|
+
}
|
27
|
+
wp_web isa WordpressWeb {
|
28
|
+
installed is true
|
29
|
+
http is %vmapp%.apache
|
30
|
+
database is vmdb.wp_db
|
31
|
+
}
|
32
|
+
}'
|
33
|
+
vmdb = 'vmdb isa VM {
|
34
|
+
mysql isa Mysql {
|
35
|
+
running is true
|
36
|
+
}
|
37
|
+
wp_db isa WordpressDB {
|
38
|
+
installed is true
|
39
|
+
mysql is vmdb.mysql
|
40
|
+
}
|
41
|
+
}'
|
42
|
+
output = ''
|
43
|
+
members = ''
|
44
|
+
global = "global {\n"
|
45
|
+
1.upto(number_apps) do |i|
|
46
|
+
name = "vmapp#{i}"
|
47
|
+
output += vmapp.gsub(/%vmapp%/, name) + "\n"
|
48
|
+
members += "#{name},"
|
49
|
+
global += "\tif vmlb.apache.running is true then #{name}.apache.running is true\n"
|
50
|
+
global += "\tif #{name}.apache.running is true then vmdb.mysql.running is true\n"
|
51
|
+
end
|
52
|
+
global += "}\n"
|
53
|
+
output = header +
|
54
|
+
vmlb.sub(/%members%/, members.chop) + "\n" +
|
55
|
+
output + vmdb + "\n" + global
|
56
|
+
output
|
57
|
+
end
|
58
|
+
|
59
|
+
if $0 == __FILE__
|
60
|
+
if ARGV[0] == 'help'
|
61
|
+
puts "Usage: generator.rb [total-app-layer]"
|
62
|
+
else
|
63
|
+
number_apps = (ARGV.length > 0 ? ARGV[0].to_i : 3)
|
64
|
+
puts generate(number_apps)
|
65
|
+
end
|
66
|
+
end
|