Agiley-ec2onrails 0.9.9 → 0.9.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/{History.txt → CHANGELOG} +0 -0
  2. data/{COPYING.txt → COPYING} +0 -0
  3. data/Manifest +161 -0
  4. data/{website/index.txt → README.textile} +33 -5
  5. data/Rakefile +36 -4
  6. data/TODO +91 -0
  7. data/ec2onrails.gemspec +279 -0
  8. data/examples/Capfile +3 -0
  9. data/examples/deploy.rb +88 -0
  10. data/examples/s3.yml +9 -0
  11. data/lib/ec2onrails/capistrano_utils.rb +0 -11
  12. data/lib/ec2onrails/recipes.rb +165 -59
  13. data/lib/ec2onrails/version.rb +1 -1
  14. data/server/build-ec2onrails.sh +44 -0
  15. data/server/files/etc/aliases +5 -0
  16. data/server/files/etc/aliases.db +0 -0
  17. data/server/files/etc/apache2/apache2.conf +295 -0
  18. data/server/files/etc/apache2/conf.d/app.proxy_cluster.conf +7 -0
  19. data/server/files/etc/apache2/conf.d/app.proxy_frontend.conf +10 -0
  20. data/server/files/etc/apache2/mods-available/proxy.conf +18 -0
  21. data/server/files/etc/apache2/sites-available/app.common +56 -0
  22. data/server/files/etc/apache2/sites-available/app.custom +0 -0
  23. data/server/files/etc/apache2/sites-available/default +14 -0
  24. data/server/files/etc/apache2/sites-available/default-ssl +18 -0
  25. data/server/files/etc/cron.d/backup_app_db_to_s3 +6 -0
  26. data/server/files/etc/cron.daily/app +9 -0
  27. data/server/files/etc/cron.daily/logrotate_post +19 -0
  28. data/server/files/etc/cron.hourly/app +10 -0
  29. data/server/files/etc/cron.monthly/app +10 -0
  30. data/server/files/etc/cron.weekly/app +10 -0
  31. data/server/files/etc/ec2onrails/balancer_members +6 -0
  32. data/server/files/etc/ec2onrails/roles.yml +5 -0
  33. data/server/files/etc/environment +2 -0
  34. data/server/files/etc/event.d/monit +13 -0
  35. data/server/files/etc/init.d/ec2-every-startup +29 -0
  36. data/server/files/etc/init.d/ec2-first-startup +36 -0
  37. data/server/files/etc/init.d/mongrel +91 -0
  38. data/server/files/etc/init.d/nginx +78 -0
  39. data/server/files/etc/init.d/set_roles +3 -0
  40. data/server/files/etc/logrotate.d/apache2 +16 -0
  41. data/server/files/etc/logrotate.d/mongrel +11 -0
  42. data/server/files/etc/logrotate.d/nginx +11 -0
  43. data/server/files/etc/memcached.conf +47 -0
  44. data/server/files/etc/mongrel_cluster/app.yml +9 -0
  45. data/server/files/etc/monit/README +5 -0
  46. data/server/files/etc/monit/app.monitrc.erb +13 -0
  47. data/server/files/etc/monit/db_primary.monitrc.erb +10 -0
  48. data/server/files/etc/monit/memcache.monitrc +8 -0
  49. data/server/files/etc/monit/monitrc +12 -0
  50. data/server/files/etc/monit/system.monitrc +15 -0
  51. data/server/files/etc/monit/web.monitrc.erb +23 -0
  52. data/server/files/etc/motd.tail +13 -0
  53. data/server/files/etc/mysql/my.cnf +149 -0
  54. data/server/files/etc/nginx/nginx.conf +296 -0
  55. data/server/files/etc/postfix/main.cf +4 -0
  56. data/server/files/etc/rc0.d/K10mongrel +1 -0
  57. data/server/files/etc/rc1.d/K10mongrel +1 -0
  58. data/server/files/etc/rc2.d/S90mongrel +1 -0
  59. data/server/files/etc/rc3.d/S90mongrel +1 -0
  60. data/server/files/etc/rc4.d/S90mongrel +1 -0
  61. data/server/files/etc/rc5.d/S90mongrel +1 -0
  62. data/server/files/etc/rc6.d/K10mongrel +1 -0
  63. data/server/files/etc/rcS.d/S91ec2-first-startup +1 -0
  64. data/server/files/etc/rcS.d/S92ec2-every-startup +1 -0
  65. data/server/files/etc/rcS.d/S99set_roles +1 -0
  66. data/server/files/etc/ssh/sshd_config +94 -0
  67. data/server/files/etc/sudoers +1 -0
  68. data/server/files/etc/sudoers.full_access +26 -0
  69. data/server/files/etc/sudoers.restricted_access +28 -0
  70. data/server/files/etc/syslog.conf +69 -0
  71. data/server/files/usr/local/ec2onrails/COPYING +339 -0
  72. data/server/files/usr/local/ec2onrails/bin/archive_file.rb +44 -0
  73. data/server/files/usr/local/ec2onrails/bin/backup_app_db.rb +68 -0
  74. data/server/files/usr/local/ec2onrails/bin/init_services.rb +57 -0
  75. data/server/files/usr/local/ec2onrails/bin/mongrel_start +8 -0
  76. data/server/files/usr/local/ec2onrails/bin/mongrel_stop +8 -0
  77. data/server/files/usr/local/ec2onrails/bin/optimize_mysql.rb +339 -0
  78. data/server/files/usr/local/ec2onrails/bin/rails_env +35 -0
  79. data/server/files/usr/local/ec2onrails/bin/rebundle.sh +70 -0
  80. data/server/files/usr/local/ec2onrails/bin/restore_app_db.rb +58 -0
  81. data/server/files/usr/local/ec2onrails/bin/set_rails_env +40 -0
  82. data/server/files/usr/local/ec2onrails/bin/set_roles.rb +76 -0
  83. data/server/files/usr/local/ec2onrails/bin/setup_web_proxy.rb +106 -0
  84. data/server/files/usr/local/ec2onrails/config +30 -0
  85. data/server/files/usr/local/ec2onrails/lib/mysql_helper.rb +82 -0
  86. data/server/files/usr/local/ec2onrails/lib/roles_helper.rb +137 -0
  87. data/server/files/usr/local/ec2onrails/lib/s3_helper.rb +126 -0
  88. data/server/files/usr/local/ec2onrails/lib/utils.rb +16 -0
  89. data/server/files/usr/local/ec2onrails/lib/vendor/ini.rb +268 -0
  90. data/server/files/usr/local/ec2onrails/startup-scripts/every-startup/get-hostname.sh +27 -0
  91. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/README +5 -0
  92. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/create-dirs.sh +42 -0
  93. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/generate-default-web-cert-and-key.sh +49 -0
  94. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/misc.sh +27 -0
  95. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/prepare-mysql-data-dir.sh +24 -0
  96. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/setup-credentials.sh +29 -0
  97. data/server/rakefile.rb +222 -0
  98. data/test/autobench.conf +60 -0
  99. data/test/spec/lib/s3_helper_spec.rb +134 -0
  100. data/test/spec/lib/s3_old.yml +3 -0
  101. data/test/spec/test_files/test1 +0 -0
  102. data/test/spec/test_files/test2 +0 -0
  103. data/test/test_app/Capfile +3 -0
  104. data/test/test_app/README +182 -0
  105. data/test/test_app/Rakefile +10 -0
  106. data/test/test_app/app/controllers/application.rb +7 -0
  107. data/test/test_app/app/controllers/db_fast_controller.rb +6 -0
  108. data/test/test_app/app/controllers/fast_controller.rb +5 -0
  109. data/test/test_app/app/controllers/slow_controller.rb +6 -0
  110. data/test/test_app/app/controllers/very_slow_controller.rb +6 -0
  111. data/test/test_app/app/helpers/application_helper.rb +3 -0
  112. data/test/test_app/app/helpers/db_fast_helper.rb +2 -0
  113. data/test/test_app/app/helpers/fast_helper.rb +2 -0
  114. data/test/test_app/app/helpers/slow_helper.rb +2 -0
  115. data/test/test_app/app/helpers/very_slow_helper.rb +2 -0
  116. data/test/test_app/config/boot.rb +109 -0
  117. data/test/test_app/config/database.yml +19 -0
  118. data/test/test_app/config/deploy.rb +21 -0
  119. data/test/test_app/config/environment.rb +60 -0
  120. data/test/test_app/config/environments/development.rb +21 -0
  121. data/test/test_app/config/environments/production.rb +18 -0
  122. data/test/test_app/config/environments/test.rb +19 -0
  123. data/test/test_app/config/routes.rb +27 -0
  124. data/test/test_app/db/schema.rb +7 -0
  125. data/test/test_app/doc/README_FOR_APP +2 -0
  126. data/test/test_app/public/404.html +30 -0
  127. data/test/test_app/public/500.html +30 -0
  128. data/test/test_app/public/dispatch.cgi +10 -0
  129. data/test/test_app/public/dispatch.fcgi +24 -0
  130. data/test/test_app/public/dispatch.rb +10 -0
  131. data/test/test_app/public/favicon.ico +0 -0
  132. data/test/test_app/public/images/rails.png +0 -0
  133. data/test/test_app/public/javascripts/application.js +2 -0
  134. data/test/test_app/public/javascripts/controls.js +963 -0
  135. data/test/test_app/public/javascripts/dragdrop.js +972 -0
  136. data/test/test_app/public/javascripts/effects.js +1120 -0
  137. data/test/test_app/public/javascripts/prototype.js +4225 -0
  138. data/test/test_app/public/robots.txt +1 -0
  139. data/test/test_app/script/about +3 -0
  140. data/test/test_app/script/breakpointer +3 -0
  141. data/test/test_app/script/console +3 -0
  142. data/test/test_app/script/destroy +3 -0
  143. data/test/test_app/script/generate +3 -0
  144. data/test/test_app/script/performance/benchmarker +3 -0
  145. data/test/test_app/script/performance/profiler +3 -0
  146. data/test/test_app/script/performance/request +3 -0
  147. data/test/test_app/script/plugin +3 -0
  148. data/test/test_app/script/process/inspector +3 -0
  149. data/test/test_app/script/process/reaper +3 -0
  150. data/test/test_app/script/process/spawner +3 -0
  151. data/test/test_app/script/runner +3 -0
  152. data/test/test_app/script/server +3 -0
  153. data/test/test_app/test/functional/db_fast_controller_test.rb +18 -0
  154. data/test/test_app/test/functional/fast_controller_test.rb +18 -0
  155. data/test/test_app/test/functional/slow_controller_test.rb +18 -0
  156. data/test/test_app/test/functional/very_slow_controller_test.rb +18 -0
  157. metadata +193 -36
  158. data/Manifest.txt +0 -25
  159. data/README.txt +0 -1
  160. data/config/hoe.rb +0 -70
  161. data/config/requirements.rb +0 -17
  162. data/script/destroy +0 -14
  163. data/script/generate +0 -14
  164. data/script/txt2html +0 -74
  165. data/tasks/deployment.rake +0 -27
  166. data/tasks/environment.rake +0 -7
  167. data/tasks/website.rake +0 -17
  168. data/website/javascripts/rounded_corners_lite.inc.js +0 -285
  169. data/website/stylesheets/screen.css +0 -144
  170. data/website/template.rhtml +0 -53
File without changes
File without changes
data/Manifest ADDED
@@ -0,0 +1,161 @@
1
+ CHANGELOG
2
+ COPYING
3
+ ec2onrails.gemspec
4
+ examples/Capfile
5
+ examples/deploy.rb
6
+ examples/s3.yml
7
+ lib/ec2onrails/capistrano_utils.rb
8
+ lib/ec2onrails/recipes.rb
9
+ lib/ec2onrails/version.rb
10
+ lib/ec2onrails.rb
11
+ Manifest
12
+ Rakefile
13
+ README.textile
14
+ server/build-ec2onrails.sh
15
+ server/files/etc/aliases
16
+ server/files/etc/aliases.db
17
+ server/files/etc/apache2/apache2.conf
18
+ server/files/etc/apache2/conf.d/app.proxy_cluster.conf
19
+ server/files/etc/apache2/conf.d/app.proxy_frontend.conf
20
+ server/files/etc/apache2/mods-available/proxy.conf
21
+ server/files/etc/apache2/sites-available/app.common
22
+ server/files/etc/apache2/sites-available/app.custom
23
+ server/files/etc/apache2/sites-available/default
24
+ server/files/etc/apache2/sites-available/default-ssl
25
+ server/files/etc/cron.d/backup_app_db_to_s3
26
+ server/files/etc/cron.daily/app
27
+ server/files/etc/cron.daily/logrotate_post
28
+ server/files/etc/cron.hourly/app
29
+ server/files/etc/cron.monthly/app
30
+ server/files/etc/cron.weekly/app
31
+ server/files/etc/ec2onrails/balancer_members
32
+ server/files/etc/ec2onrails/roles.yml
33
+ server/files/etc/environment
34
+ server/files/etc/event.d/monit
35
+ server/files/etc/init.d/ec2-every-startup
36
+ server/files/etc/init.d/ec2-first-startup
37
+ server/files/etc/init.d/mongrel
38
+ server/files/etc/init.d/nginx
39
+ server/files/etc/init.d/set_roles
40
+ server/files/etc/logrotate.d/apache2
41
+ server/files/etc/logrotate.d/mongrel
42
+ server/files/etc/logrotate.d/nginx
43
+ server/files/etc/memcached.conf
44
+ server/files/etc/mongrel_cluster/app.yml
45
+ server/files/etc/monit/app.monitrc.erb
46
+ server/files/etc/monit/db_primary.monitrc.erb
47
+ server/files/etc/monit/memcache.monitrc
48
+ server/files/etc/monit/monitrc
49
+ server/files/etc/monit/README
50
+ server/files/etc/monit/system.monitrc
51
+ server/files/etc/monit/web.monitrc.erb
52
+ server/files/etc/motd.tail
53
+ server/files/etc/mysql/my.cnf
54
+ server/files/etc/nginx/nginx.conf
55
+ server/files/etc/postfix/main.cf
56
+ server/files/etc/rc0.d/K10mongrel
57
+ server/files/etc/rc1.d/K10mongrel
58
+ server/files/etc/rc2.d/S90mongrel
59
+ server/files/etc/rc3.d/S90mongrel
60
+ server/files/etc/rc4.d/S90mongrel
61
+ server/files/etc/rc5.d/S90mongrel
62
+ server/files/etc/rc6.d/K10mongrel
63
+ server/files/etc/rcS.d/S91ec2-first-startup
64
+ server/files/etc/rcS.d/S92ec2-every-startup
65
+ server/files/etc/rcS.d/S99set_roles
66
+ server/files/etc/ssh/sshd_config
67
+ server/files/etc/sudoers
68
+ server/files/etc/sudoers.full_access
69
+ server/files/etc/sudoers.restricted_access
70
+ server/files/etc/syslog.conf
71
+ server/files/usr/local/ec2onrails/bin/archive_file.rb
72
+ server/files/usr/local/ec2onrails/bin/backup_app_db.rb
73
+ server/files/usr/local/ec2onrails/bin/init_services.rb
74
+ server/files/usr/local/ec2onrails/bin/mongrel_start
75
+ server/files/usr/local/ec2onrails/bin/mongrel_stop
76
+ server/files/usr/local/ec2onrails/bin/optimize_mysql.rb
77
+ server/files/usr/local/ec2onrails/bin/rails_env
78
+ server/files/usr/local/ec2onrails/bin/rebundle.sh
79
+ server/files/usr/local/ec2onrails/bin/restore_app_db.rb
80
+ server/files/usr/local/ec2onrails/bin/set_rails_env
81
+ server/files/usr/local/ec2onrails/bin/set_roles.rb
82
+ server/files/usr/local/ec2onrails/bin/setup_web_proxy.rb
83
+ server/files/usr/local/ec2onrails/config
84
+ server/files/usr/local/ec2onrails/COPYING
85
+ server/files/usr/local/ec2onrails/lib/mysql_helper.rb
86
+ server/files/usr/local/ec2onrails/lib/roles_helper.rb
87
+ server/files/usr/local/ec2onrails/lib/s3_helper.rb
88
+ server/files/usr/local/ec2onrails/lib/utils.rb
89
+ server/files/usr/local/ec2onrails/lib/vendor/ini.rb
90
+ server/files/usr/local/ec2onrails/startup-scripts/every-startup/get-hostname.sh
91
+ server/files/usr/local/ec2onrails/startup-scripts/first-startup/create-dirs.sh
92
+ server/files/usr/local/ec2onrails/startup-scripts/first-startup/generate-default-web-cert-and-key.sh
93
+ server/files/usr/local/ec2onrails/startup-scripts/first-startup/misc.sh
94
+ server/files/usr/local/ec2onrails/startup-scripts/first-startup/prepare-mysql-data-dir.sh
95
+ server/files/usr/local/ec2onrails/startup-scripts/first-startup/README
96
+ server/files/usr/local/ec2onrails/startup-scripts/first-startup/setup-credentials.sh
97
+ server/rakefile.rb
98
+ setup.rb
99
+ test/autobench.conf
100
+ test/spec/lib/s3_helper_spec.rb
101
+ test/spec/lib/s3_old.yml
102
+ test/spec/test_files/test1
103
+ test/spec/test_files/test2
104
+ test/test_app/app/controllers/application.rb
105
+ test/test_app/app/controllers/db_fast_controller.rb
106
+ test/test_app/app/controllers/fast_controller.rb
107
+ test/test_app/app/controllers/slow_controller.rb
108
+ test/test_app/app/controllers/very_slow_controller.rb
109
+ test/test_app/app/helpers/application_helper.rb
110
+ test/test_app/app/helpers/db_fast_helper.rb
111
+ test/test_app/app/helpers/fast_helper.rb
112
+ test/test_app/app/helpers/slow_helper.rb
113
+ test/test_app/app/helpers/very_slow_helper.rb
114
+ test/test_app/Capfile
115
+ test/test_app/config/boot.rb
116
+ test/test_app/config/database.yml
117
+ test/test_app/config/deploy.rb
118
+ test/test_app/config/environment.rb
119
+ test/test_app/config/environments/development.rb
120
+ test/test_app/config/environments/production.rb
121
+ test/test_app/config/environments/test.rb
122
+ test/test_app/config/routes.rb
123
+ test/test_app/db/schema.rb
124
+ test/test_app/doc/README_FOR_APP
125
+ test/test_app/public/404.html
126
+ test/test_app/public/500.html
127
+ test/test_app/public/dispatch.cgi
128
+ test/test_app/public/dispatch.fcgi
129
+ test/test_app/public/dispatch.rb
130
+ test/test_app/public/favicon.ico
131
+ test/test_app/public/images/rails.png
132
+ test/test_app/public/javascripts/application.js
133
+ test/test_app/public/javascripts/controls.js
134
+ test/test_app/public/javascripts/dragdrop.js
135
+ test/test_app/public/javascripts/effects.js
136
+ test/test_app/public/javascripts/prototype.js
137
+ test/test_app/public/robots.txt
138
+ test/test_app/Rakefile
139
+ test/test_app/README
140
+ test/test_app/script/about
141
+ test/test_app/script/breakpointer
142
+ test/test_app/script/console
143
+ test/test_app/script/destroy
144
+ test/test_app/script/generate
145
+ test/test_app/script/performance/benchmarker
146
+ test/test_app/script/performance/profiler
147
+ test/test_app/script/performance/request
148
+ test/test_app/script/plugin
149
+ test/test_app/script/process/inspector
150
+ test/test_app/script/process/reaper
151
+ test/test_app/script/process/spawner
152
+ test/test_app/script/runner
153
+ test/test_app/script/server
154
+ test/test_app/test/functional/db_fast_controller_test.rb
155
+ test/test_app/test/functional/fast_controller_test.rb
156
+ test/test_app/test/functional/slow_controller_test.rb
157
+ test/test_app/test/functional/very_slow_controller_test.rb
158
+ test/test_app/test/test_helper.rb
159
+ test/test_ec2onrails.rb
160
+ test/test_helper.rb
161
+ TODO
@@ -73,7 +73,7 @@ _Be sure to customize those files and read the comments._
73
73
  Also, use the hostname "db_primary" in your database.yml file. After running "cap ec2onrails:server:set_roles" it will resolve
74
74
  to the instance defined in your Capistrano "db" role.
75
75
 
76
- h4. 4. Start up one or more instances of the image.
76
+ h4. 3. Start up one or more instances of the image.
77
77
 
78
78
  There is nothing EC2 on Rails-specific here yet (though soon there will be a Capistrano task to do this for you),
79
79
  if you've started EC2 instances before you can skip this section. Otherwise, I'm not going to lie, this part is complicated
@@ -88,7 +88,7 @@ configured in the previous step (they're also listed earlier on this page).
88
88
 
89
89
  _NOTE: Only use the images that match the current version of the gem._
90
90
 
91
- Please see the "change log":http://ec2onrails.rubyforge.org/svn/trunk/gem/History.txt for release notes, and
91
+ Please see the "change log":http://ec2onrails.rubyforge.org/svn/trunk/gem/CHANGELOG for release notes, and
92
92
  see the "list of open issues":http://rubyforge.org/tracker/?atid=17558&group_id=4552&func=browse.
93
93
 
94
94
  As is "standard for public AMI's":http://docs.amazonwebservices.com/AWSEC2/2007-08-29/DeveloperGuide/public-ami-guidelines.html,
@@ -107,7 +107,7 @@ Be sure that you haven't allowed public access to any ports other than TCP 22 an
107
107
  If you're using multiple instances, be sure to allow them network access to each other.
108
108
 
109
109
 
110
- h4. 5. Copy your public key from the server to keep Capistrano happy
110
+ h4. 4. Copy your public key from the server to keep Capistrano happy
111
111
 
112
112
  This is a workaround for a quirk in Capistrano. Technically all you should need to connect to the server is the private
113
113
  key file, the public key is on the server. But for some reason
@@ -120,7 +120,7 @@ There is a Capistrano task that tries to fix this for you. From within the root
120
120
  Note, this will only work if you have an external ssh command in the path, it won't work for most Windows users.
121
121
 
122
122
 
123
- h4. 6. Deploy the app with Capistrano
123
+ h4. 5. Deploy the app with Capistrano
124
124
 
125
125
  Now that the gem is installed, your deploy.rb is configured and you can start and stop EC2 instances,
126
126
  this is the only thing you'll need to do from now on.
@@ -190,6 +190,32 @@ Building the image is not required, most people will simply use the prebuilt pub
190
190
  image, but there is also a build script that builds the image. It's meant to be called by
191
191
  "Eric Hammond's EC2 Ubuntu script":http://alestic.com/.
192
192
 
193
+ Here is how you go about setting it up:
194
+
195
+
196
+ h4. Notes
197
+
198
+ * amazon-keypair is your amazon keypair, which in this case has has had the public and private keys copied into the ~/.ssh folder
199
+ * we need to copy the ec2onrails source folder onto the image instance
200
+ * HOST_PUBLIC_INSTANCE is the hostname of the instance that you will soon be creating. run <code>ec2-describe-instances</code> to find this value. It will look something like <code>ec2-xxx-xxx-xxx-xxx.compute-x.amazonaws.com</code>
201
+
202
+ h4. Getting started...
203
+
204
+ * launch one of Eric's default images (see "Eric Hammond's":http://alestic.com/ page for the most recent ami-images): <code>ec2-run-instances ami-179e7a7e -k amazon-keypair</code> (for a 64-bit image, launch: <code>ec2-run-instances ami-f89d7991 -k amazon-keypair --instance-type m1.large</code>)
205
+ * lets get your amazon keypair up onto the instance: <code>scp -i ~/.ssh/id_rsa-amazon-keypair ~/.ec2/{cert,pk}-*.pem root@HOST_PUBLIC_ADDRESS:/mnt/</code>
206
+ * ditto for getting the ec2onrails server code up onto your new instance: <code>scp -rp -i ~/.ssh/id_rsa-amazon-keypair ~/your/copy/of/ec2onrails/. root@HOST_PUBLIC_ADDRESS:/mnt/ec2onrails</code>
207
+ * time to log into your instance: <code>ssh -i ~/.ssh/id_rsa-amazon-keypair root@HOST_PUBLIC_ADDRESS</code>
208
+ * get the most recent ec2ubuntu script: <code>curl -Lo /mnt/ec2ubuntu-build-ami http://ec2ubuntu-build-ami.notlong.com</code>
209
+ * time to get the instance ready for ec2onrails. The script will end with a command you need to run to finish creating an amazon ami-image. <pre>bash /mnt/ec2ubuntu-build-ami \
210
+ --codename hardy \
211
+ --bucket YOURNAME_ec2onrails \
212
+ --prefix ec2onrails \
213
+ --user YOUR_AMAZON_USER_ID \
214
+ --access-key AMAZON_ACCESS_KEY \
215
+ --secret-key AMAZON_SECRET_KEY \
216
+ --private-key /mnt/pk-*.pem \
217
+ --cert /mnt/cert-*.pem \
218
+ --script /mnt/ec2onrails/server/build-ec2onrails.sh</pre>
193
219
 
194
220
  h2. Mailing lists
195
221
 
@@ -210,7 +236,7 @@ or send me an "email":http://pauldowman.com/contact/.
210
236
 
211
237
  h2. Change log
212
238
 
213
- See the "change log":http://ec2onrails.rubyforge.org/svn/trunk/gem/History.txt.
239
+ See the "change log":http://ec2onrails.rubyforge.org/svn/trunk/gem/CHANGELOG.
214
240
 
215
241
 
216
242
  h2. How to submit patches
@@ -221,6 +247,8 @@ The source code can be checked out anonymously using:
221
247
  svn checkout http://ec2onrails.rubyforge.org/svn/trunk ec2onrails
222
248
  </pre>
223
249
 
250
+ Code on Github: "https://github.com/pauldowman/ec2onrails":https://github.com/pauldowman/ec2onrails
251
+
224
252
  Patches can be submitted to the "RubyForge Tracker":http://rubyforge.org/tracker/?atid=17560&group_id=4552&func=browse
225
253
  or "emailed directly to me":http://pauldowman.com/contact/ .
226
254
 
data/Rakefile CHANGED
@@ -1,4 +1,36 @@
1
- require 'config/requirements'
2
- require 'config/hoe' # setup Hoe + all gem configuration
3
-
4
- Dir['tasks/**/*.rake'].each { |rake| load rake }
1
+ require "./lib/ec2onrails/version"
2
+
3
+ begin
4
+ require 'echoe'
5
+ rescue LoadError
6
+ abort "You'll need to have `echoe' installed to use ec2onrails' Rakefile"
7
+ end
8
+
9
+ version = Ec2onrails::VERSION::STRING.dup
10
+
11
+ Echoe.new('ec2onrails', version) do |p|
12
+ p.changelog = "CHANGELOG"
13
+
14
+ p.author = ['Paul Dowman', 'Adam Greene']
15
+ p.email = "paul@pauldowman.com"
16
+
17
+ p.summary = <<-DESC.strip.gsub(/\n\s+/, " ")
18
+ Client-side libraries (Capistrano tasks) for managing and
19
+ deploying to EC2 on Rails servers.
20
+ DESC
21
+
22
+ #OTHER helpful options
23
+ # p.install_message = "perhaps telling them where to find the example docs?"
24
+ # p.rdoc_pattern
25
+ p.url = "http://ec2onrails.rubyforge.org"
26
+ p.need_zip = true
27
+ p.rdoc_pattern = /^(lib|README.textile|CHANGELOG)/
28
+
29
+ p.dependencies = [
30
+ 'capistrano >= 2.4.3',
31
+ 'archive-tar-minitar >= 0.5.1',
32
+ 'optiflag >= 0.6.5']
33
+
34
+ p.development_dependencies = ['rake >=0.7.1']
35
+
36
+ end
data/TODO ADDED
@@ -0,0 +1,91 @@
1
+ here are a list of upcoming changes or ones I'm thinking about
2
+
3
+ FUTURE CHANGES
4
+ [ ] do not change the Capify file. This is an issue if you want to use ec2 for staging but something else (engineyard) for production. The issue is that require 'ec2onrails/recipes' cannot be called until after the deploy file has been run because of some loading dependencies. SO, is it possible to not have this behavior, or is this making a mnt out of a mole-hill?
5
+
6
+ [ ] be able to save an ami file after cap ec2onrails:setup is run... this way you can just launch more instances of that specific ami file (can we automate this? )
7
+
8
+ [ ] use mongrel_cluster from app directory (shared or directly in the app/config dir), and then default to the one at /etc/mongrel_cluster/app.yml
9
+
10
+ [ ] customize roles. For example, lets say I want to have nginx publish to multiple proxy's instead of the set_roles.rb default ones. Have a hook where I, as an end user, can extend custom roles... but where do I put it? is there a custom_roles_file location pref that is set in the cap deploy file?
11
+
12
+ [X] mysql optimizations
13
+
14
+ [ ] hook memcached into nginx...
15
+
16
+ [ ] hook ssl setup hooks for nginx
17
+
18
+ [ ] automatic firewall setup. The hitch is can we find the amazon user_id automatically?
19
+
20
+ [ ] automatic and randomized initial mysql root password setup. Place the root password in a text file only to be read by 'root', perhaps in /etc/ec2onrails/mysq_root_passwd
21
+
22
+ [ ] multi-database setup. Master -> n slave(s)
23
+
24
+ [ ] when generating roles file for each server, so each server knows where/how to find the internal IP of other servers in the cluster, generate this based on the roles that actually exist so arbitrary new ones can be added (recipes.rb, task :set_roles). Capistrano has a variable 'roles', that should be useable...? is an array, with Capistrano::ServerDefinition objects, which have the following attributes :host, :user, :port, :options
25
+
26
+ [ ] allow memcache servers to reside on a separate host/cluster
27
+
28
+ [ ] do a little memcache optimization, especially if it is its own host
29
+
30
+ [ ] allow to pull memcache file from application directory ./config
31
+
32
+ [ ] hook in pauls postfix changes to be able to use an external smtp provider. make it configurable:
33
+ http://pauldowman.com/2008/02/17/smtp-mail-from-ec2-web-server-setup/
34
+ also see this file for updates:
35
+ http://www.babbleon.co.uk/2008/05/email-with-ec2/
36
+
37
+ [ ] preload mysql timezone information
38
+
39
+ [ ] mysql optimizations are not calculating the num of cores avail correctly
40
+
41
+ [ ] preset defaults for the ec2onrails configs?
42
+
43
+ [ ] right now cron has a task called 'app' in cron.daily, cron.hourly, cron.monthly, and cron.weekly. BUT, these are run on every server. we should probably provide some sort of mechanism so a user can specify particular jobs for particular roles
44
+
45
+ [ ] consolidate all logs to /mnt/log, including /mnt/app/current... it makes it easier to rotate and shuffle them off to s3
46
+
47
+ [ ] get all user-data and meta-data variables from the amazon image in a similar way to rightscale? Makes it dead simple to use/manipulate that information
48
+
49
+ [ ] /etc/monit/monitrc needs to be chmod 700. see error at: http://pastie.org/251895, with custom task at http://pastie.org/251896.. Perhaps this should be solved in set_roles.rb or init_services or something a bit higher`
50
+
51
+ [ ] hook in encryption of backup archives
52
+
53
+ [ ] hook in backup of server... or should we wait for persistent storage snapshots? http://www.webmonkey.com/tutorial/Back_Up_a_Web_Server
54
+
55
+ [ ] allow a non-standard ssh port (and make sure the firewall is setup correclty)
56
+
57
+ [ ] should we go back to having a sudo user like 'admin' that we flip into when we need sudo access instead of root?
58
+
59
+ POSSIBLE CHANGES
60
+ [ ] move to god from monit. One advantage is that right now, we don't use monit to send start/stop/restart signals to the underlying processes. Monit does not always stop mongrel, and if mongrel doesn't restart monit doesn't go in with the oh-holy 'kill -9'. So we unmonit mongrel, then use the /etc/init.d/mongrel stop to kill it. This works (quite well actually) BUT it makes it tricky because if we limit sudo access to only monit, we cannot run the /etc/init.d/*. It would be best if we provide sudo access to ONLY one process. God, supposedly, doesn't have this issue. So if we use god instead of monit, can we have god be responsible for restarts and what not?
61
+
62
+ [ ] do not put users custom files up there until before deploy:cold? Right now I'm pushing a lot of custom stuff out there into monit which is failing because the code it is supposed to monitor is not there yet. will pushing it to "before 'deploy:cold' cause an issues"
63
+
64
+
65
+ QUESTIONS
66
+ * during setup, what do you choose for Postfix configurations? ANSWER:
67
+
68
+ * why install php5? ANSWER: Can't tell... seems to run fine without it, so removing it as a direct aptitude fetch (if it is a dependency somewhere else, it will get downloaded)
69
+
70
+ * WHO runs the script/migration? App or db? ANSWER: the (primary-) db does. This make sense in that you don't want every app instance running a rake db:migration. This means that the db role needs to be fully setup to handle rake db:migration, meaning the /etc/hosts file needs to contain db_primary as an alias to 127.0.0.1
71
+
72
+
73
+ COMPLETED
74
+ [X] Move to Echoe? It just seems a LOT easier to setup and handle than hoe. It can remove a lot of cruft, probably including ./config, ./script, ./tasks (or most of them), and ./website (move that to the README file?... looks like would need to be moved to ./docs ). A few folks have branched ec2onrails into github before and they've all done this...
75
+
76
+ [X] set -y flag when installing/updating gems UPDATE: not needed... does it automatically for the other non-interactive flags we are using
77
+
78
+ [X] remove the *_admin capistrano roles. can we use admin for sudo access but continue to deploy and run under a user without sudo access? It looks like we can if we add this to the recipes.rb file:
79
+ set :use_sudo, true
80
+ set :user, "app"
81
+ set :admin_runner, "admin"
82
+ UPDATE: this didn't work as then admin would need to behave as root... SO, here is what I did:
83
+ * remove _admin roles AND the admin user
84
+ * give app user full sudo access to begin with
85
+ * have /etc/sudoers -> /etc/sudoers.full_access
86
+ * after ec2onrails:setup, trigger ec2onrails:server:restrict_sudo_access
87
+ - flips /etc/sudoers -> /etc/sudoers.restricted_access
88
+ - at this point, the app user ONLY has access to sudo to monit
89
+ * provide cap tasks to restrict or grant full sudo access
90
+
91
+ [X] allow config to be able to flip between nginx and apache as proxy...
@@ -0,0 +1,279 @@
1
+
2
+ # Gem::Specification for Ec2onrails-0.9.10
3
+ # Originally generated by Echoe
4
+
5
+ --- !ruby/object:Gem::Specification
6
+ name: ec2onrails
7
+ version: !ruby/object:Gem::Version
8
+ version: 0.9.10
9
+ platform: ruby
10
+ authors:
11
+ - Paul Dowman, Adam Greene
12
+ autorequire:
13
+ bindir: bin
14
+
15
+ date: 2008-08-18 00:00:00 +02:00
16
+ default_executable:
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
19
+ name: capistrano
20
+ type: :runtime
21
+ version_requirement:
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: "0"
27
+ - - "="
28
+ - !ruby/object:Gem::Version
29
+ version: 2.4.3
30
+ version:
31
+ - !ruby/object:Gem::Dependency
32
+ name: archive-tar-minitar
33
+ type: :runtime
34
+ version_requirement:
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: "0"
40
+ - - "="
41
+ - !ruby/object:Gem::Version
42
+ version: 0.5.1
43
+ version:
44
+ - !ruby/object:Gem::Dependency
45
+ name: optiflag
46
+ type: :runtime
47
+ version_requirement:
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: "0"
53
+ - - "="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.6.5
56
+ version:
57
+ - !ruby/object:Gem::Dependency
58
+ name: rake
59
+ type: :development
60
+ version_requirement:
61
+ version_requirements: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 0.7.1
66
+ version:
67
+ description: Client-side libraries (Capistrano tasks) for managing and deploying to EC2 on Rails servers.
68
+ email: paul@pauldowman.com
69
+ executables: []
70
+
71
+ extensions: []
72
+
73
+ extra_rdoc_files:
74
+ - CHANGELOG
75
+ - lib/ec2onrails/capistrano_utils.rb
76
+ - lib/ec2onrails/recipes.rb
77
+ - lib/ec2onrails/version.rb
78
+ - lib/ec2onrails.rb
79
+ - README.textile
80
+ files:
81
+ - CHANGELOG
82
+ - COPYING
83
+ - ec2onrails.gemspec
84
+ - examples/Capfile
85
+ - examples/deploy.rb
86
+ - examples/s3.yml
87
+ - lib/ec2onrails/capistrano_utils.rb
88
+ - lib/ec2onrails/recipes.rb
89
+ - lib/ec2onrails/version.rb
90
+ - lib/ec2onrails.rb
91
+ - Manifest
92
+ - Rakefile
93
+ - README.textile
94
+ - server/build-ec2onrails.sh
95
+ - server/files/etc/aliases
96
+ - server/files/etc/aliases.db
97
+ - server/files/etc/apache2/apache2.conf
98
+ - server/files/etc/apache2/conf.d/app.proxy_cluster.conf
99
+ - server/files/etc/apache2/conf.d/app.proxy_frontend.conf
100
+ - server/files/etc/apache2/mods-available/proxy.conf
101
+ - server/files/etc/apache2/sites-available/app.common
102
+ - server/files/etc/apache2/sites-available/app.custom
103
+ - server/files/etc/apache2/sites-available/default
104
+ - server/files/etc/apache2/sites-available/default-ssl
105
+ - server/files/etc/cron.d/backup_app_db_to_s3
106
+ - server/files/etc/cron.daily/app
107
+ - server/files/etc/cron.daily/logrotate_post
108
+ - server/files/etc/cron.hourly/app
109
+ - server/files/etc/cron.monthly/app
110
+ - server/files/etc/cron.weekly/app
111
+ - server/files/etc/ec2onrails/balancer_members
112
+ - server/files/etc/ec2onrails/roles.yml
113
+ - server/files/etc/environment
114
+ - server/files/etc/event.d/monit
115
+ - server/files/etc/init.d/ec2-every-startup
116
+ - server/files/etc/init.d/ec2-first-startup
117
+ - server/files/etc/init.d/mongrel
118
+ - server/files/etc/init.d/nginx
119
+ - server/files/etc/init.d/set_roles
120
+ - server/files/etc/logrotate.d/apache2
121
+ - server/files/etc/logrotate.d/mongrel
122
+ - server/files/etc/logrotate.d/nginx
123
+ - server/files/etc/memcached.conf
124
+ - server/files/etc/mongrel_cluster/app.yml
125
+ - server/files/etc/monit/app.monitrc.erb
126
+ - server/files/etc/monit/db_primary.monitrc.erb
127
+ - server/files/etc/monit/memcache.monitrc
128
+ - server/files/etc/monit/monitrc
129
+ - server/files/etc/monit/README
130
+ - server/files/etc/monit/system.monitrc
131
+ - server/files/etc/monit/web.monitrc.erb
132
+ - server/files/etc/motd.tail
133
+ - server/files/etc/mysql/my.cnf
134
+ - server/files/etc/nginx/nginx.conf
135
+ - server/files/etc/postfix/main.cf
136
+ - server/files/etc/rc0.d/K10mongrel
137
+ - server/files/etc/rc1.d/K10mongrel
138
+ - server/files/etc/rc2.d/S90mongrel
139
+ - server/files/etc/rc3.d/S90mongrel
140
+ - server/files/etc/rc4.d/S90mongrel
141
+ - server/files/etc/rc5.d/S90mongrel
142
+ - server/files/etc/rc6.d/K10mongrel
143
+ - server/files/etc/rcS.d/S91ec2-first-startup
144
+ - server/files/etc/rcS.d/S92ec2-every-startup
145
+ - server/files/etc/rcS.d/S99set_roles
146
+ - server/files/etc/ssh/sshd_config
147
+ - server/files/etc/sudoers
148
+ - server/files/etc/sudoers.full_access
149
+ - server/files/etc/sudoers.restricted_access
150
+ - server/files/etc/syslog.conf
151
+ - server/files/usr/local/ec2onrails/bin/archive_file.rb
152
+ - server/files/usr/local/ec2onrails/bin/backup_app_db.rb
153
+ - server/files/usr/local/ec2onrails/bin/init_services.rb
154
+ - server/files/usr/local/ec2onrails/bin/mongrel_start
155
+ - server/files/usr/local/ec2onrails/bin/mongrel_stop
156
+ - server/files/usr/local/ec2onrails/bin/optimize_mysql.rb
157
+ - server/files/usr/local/ec2onrails/bin/rails_env
158
+ - server/files/usr/local/ec2onrails/bin/rebundle.sh
159
+ - server/files/usr/local/ec2onrails/bin/restore_app_db.rb
160
+ - server/files/usr/local/ec2onrails/bin/set_rails_env
161
+ - server/files/usr/local/ec2onrails/bin/set_roles.rb
162
+ - server/files/usr/local/ec2onrails/bin/setup_web_proxy.rb
163
+ - server/files/usr/local/ec2onrails/config
164
+ - server/files/usr/local/ec2onrails/COPYING
165
+ - server/files/usr/local/ec2onrails/lib/mysql_helper.rb
166
+ - server/files/usr/local/ec2onrails/lib/roles_helper.rb
167
+ - server/files/usr/local/ec2onrails/lib/s3_helper.rb
168
+ - server/files/usr/local/ec2onrails/lib/utils.rb
169
+ - server/files/usr/local/ec2onrails/lib/vendor/ini.rb
170
+ - server/files/usr/local/ec2onrails/startup-scripts/every-startup/get-hostname.sh
171
+ - server/files/usr/local/ec2onrails/startup-scripts/first-startup/create-dirs.sh
172
+ - server/files/usr/local/ec2onrails/startup-scripts/first-startup/generate-default-web-cert-and-key.sh
173
+ - server/files/usr/local/ec2onrails/startup-scripts/first-startup/misc.sh
174
+ - server/files/usr/local/ec2onrails/startup-scripts/first-startup/prepare-mysql-data-dir.sh
175
+ - server/files/usr/local/ec2onrails/startup-scripts/first-startup/README
176
+ - server/files/usr/local/ec2onrails/startup-scripts/first-startup/setup-credentials.sh
177
+ - server/rakefile.rb
178
+ - setup.rb
179
+ - test/autobench.conf
180
+ - test/spec/lib/s3_helper_spec.rb
181
+ - test/spec/lib/s3_old.yml
182
+ - test/spec/test_files/test1
183
+ - test/spec/test_files/test2
184
+ - test/test_app/app/controllers/application.rb
185
+ - test/test_app/app/controllers/db_fast_controller.rb
186
+ - test/test_app/app/controllers/fast_controller.rb
187
+ - test/test_app/app/controllers/slow_controller.rb
188
+ - test/test_app/app/controllers/very_slow_controller.rb
189
+ - test/test_app/app/helpers/application_helper.rb
190
+ - test/test_app/app/helpers/db_fast_helper.rb
191
+ - test/test_app/app/helpers/fast_helper.rb
192
+ - test/test_app/app/helpers/slow_helper.rb
193
+ - test/test_app/app/helpers/very_slow_helper.rb
194
+ - test/test_app/Capfile
195
+ - test/test_app/config/boot.rb
196
+ - test/test_app/config/database.yml
197
+ - test/test_app/config/deploy.rb
198
+ - test/test_app/config/environment.rb
199
+ - test/test_app/config/environments/development.rb
200
+ - test/test_app/config/environments/production.rb
201
+ - test/test_app/config/environments/test.rb
202
+ - test/test_app/config/routes.rb
203
+ - test/test_app/db/schema.rb
204
+ - test/test_app/doc/README_FOR_APP
205
+ - test/test_app/public/404.html
206
+ - test/test_app/public/500.html
207
+ - test/test_app/public/dispatch.cgi
208
+ - test/test_app/public/dispatch.fcgi
209
+ - test/test_app/public/dispatch.rb
210
+ - test/test_app/public/favicon.ico
211
+ - test/test_app/public/images/rails.png
212
+ - test/test_app/public/javascripts/application.js
213
+ - test/test_app/public/javascripts/controls.js
214
+ - test/test_app/public/javascripts/dragdrop.js
215
+ - test/test_app/public/javascripts/effects.js
216
+ - test/test_app/public/javascripts/prototype.js
217
+ - test/test_app/public/robots.txt
218
+ - test/test_app/Rakefile
219
+ - test/test_app/README
220
+ - test/test_app/script/about
221
+ - test/test_app/script/breakpointer
222
+ - test/test_app/script/console
223
+ - test/test_app/script/destroy
224
+ - test/test_app/script/generate
225
+ - test/test_app/script/performance/benchmarker
226
+ - test/test_app/script/performance/profiler
227
+ - test/test_app/script/performance/request
228
+ - test/test_app/script/plugin
229
+ - test/test_app/script/process/inspector
230
+ - test/test_app/script/process/reaper
231
+ - test/test_app/script/process/spawner
232
+ - test/test_app/script/runner
233
+ - test/test_app/script/server
234
+ - test/test_app/test/functional/db_fast_controller_test.rb
235
+ - test/test_app/test/functional/fast_controller_test.rb
236
+ - test/test_app/test/functional/slow_controller_test.rb
237
+ - test/test_app/test/functional/very_slow_controller_test.rb
238
+ - test/test_app/test/test_helper.rb
239
+ - test/test_ec2onrails.rb
240
+ - test/test_helper.rb
241
+ - TODO
242
+ has_rdoc: true
243
+ homepage: http://ec2onrails.rubyforge.org
244
+ post_install_message:
245
+ rdoc_options:
246
+ - --line-numbers
247
+ - --inline-source
248
+ - --title
249
+ - Ec2onrails
250
+ - --main
251
+ - README.textile
252
+ require_paths:
253
+ - lib
254
+ required_ruby_version: !ruby/object:Gem::Requirement
255
+ requirements:
256
+ - - ">="
257
+ - !ruby/object:Gem::Version
258
+ version: "0"
259
+ version:
260
+ required_rubygems_version: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "="
263
+ - !ruby/object:Gem::Version
264
+ version: "1.2"
265
+ version:
266
+ requirements: []
267
+
268
+ rubyforge_project: ec2onrails
269
+ rubygems_version: 1.2.0
270
+ specification_version: 2
271
+ summary: Client-side libraries (Capistrano tasks) for managing and deploying to EC2 on Rails servers.
272
+ test_files:
273
+ - test/test_app/test/functional/db_fast_controller_test.rb
274
+ - test/test_app/test/functional/fast_controller_test.rb
275
+ - test/test_app/test/functional/slow_controller_test.rb
276
+ - test/test_app/test/functional/very_slow_controller_test.rb
277
+ - test/test_app/test/test_helper.rb
278
+ - test/test_ec2onrails.rb
279
+ - test/test_helper.rb