skynet 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. data/History.txt +49 -0
  2. data/Manifest.txt +84 -6
  3. data/README.txt +75 -64
  4. data/app_generators/skynet_install/skynet_install_generator.rb +14 -8
  5. data/app_generators/skynet_install/templates/migration.rb +1 -24
  6. data/app_generators/skynet_install/templates/skynet_config.rb +50 -0
  7. data/app_generators/skynet_install/templates/skynet_initializer.rb +1 -0
  8. data/app_generators/skynet_install/templates/{skynet_schema.sql → skynet_mysql_schema.sql} +1 -24
  9. data/bin/skynet +37 -10
  10. data/bin/skynet_install +5 -5
  11. data/bin/skynet_tuplespace_server +27 -19
  12. data/examples/dgrep/README +70 -0
  13. data/examples/dgrep/config/skynet_config.rb +26 -0
  14. data/examples/dgrep/data/shakespeare/README +2 -0
  15. data/examples/dgrep/data/shakespeare/poetry/loverscomplaint +381 -0
  16. data/examples/dgrep/data/shakespeare/poetry/rapeoflucrece +2199 -0
  17. data/examples/dgrep/data/shakespeare/poetry/sonnets +2633 -0
  18. data/examples/dgrep/data/shakespeare/poetry/various +640 -0
  19. data/examples/dgrep/data/shakespeare/poetry/venusandadonis +1423 -0
  20. data/examples/dgrep/data/testfile1.txt +1 -0
  21. data/examples/dgrep/data/testfile2.txt +1 -0
  22. data/examples/dgrep/data/testfile3.txt +1 -0
  23. data/examples/dgrep/data/testfile4.txt +1 -0
  24. data/examples/dgrep/lib/dgrep.rb +59 -0
  25. data/examples/dgrep/lib/mapreduce_test.rb +32 -0
  26. data/examples/dgrep/lib/most_common_words.rb +45 -0
  27. data/examples/dgrep/script/dgrep +75 -0
  28. data/examples/rails_mysql_example/README +66 -0
  29. data/examples/rails_mysql_example/Rakefile +10 -0
  30. data/examples/rails_mysql_example/app/controllers/application.rb +10 -0
  31. data/examples/rails_mysql_example/app/helpers/application_helper.rb +3 -0
  32. data/examples/rails_mysql_example/app/models/user.rb +21 -0
  33. data/examples/rails_mysql_example/app/models/user_favorite.rb +5 -0
  34. data/examples/rails_mysql_example/app/models/user_mailer.rb +12 -0
  35. data/examples/rails_mysql_example/app/views/user_mailer/welcome.erb +5 -0
  36. data/examples/rails_mysql_example/config/boot.rb +109 -0
  37. data/examples/rails_mysql_example/config/database.yml +42 -0
  38. data/examples/rails_mysql_example/config/environment.rb +59 -0
  39. data/examples/rails_mysql_example/config/environments/development.rb +18 -0
  40. data/examples/rails_mysql_example/config/environments/production.rb +19 -0
  41. data/examples/rails_mysql_example/config/environments/test.rb +22 -0
  42. data/examples/rails_mysql_example/config/initializers/inflections.rb +10 -0
  43. data/examples/rails_mysql_example/config/initializers/mime_types.rb +5 -0
  44. data/examples/rails_mysql_example/config/initializers/skynet.rb +1 -0
  45. data/examples/rails_mysql_example/config/routes.rb +35 -0
  46. data/examples/rails_mysql_example/config/skynet_config.rb +36 -0
  47. data/examples/rails_mysql_example/db/migrate/001_create_skynet_tables.rb +43 -0
  48. data/examples/rails_mysql_example/db/migrate/002_create_users.rb +16 -0
  49. data/examples/rails_mysql_example/db/migrate/003_create_user_favorites.rb +14 -0
  50. data/examples/rails_mysql_example/db/schema.rb +85 -0
  51. data/examples/rails_mysql_example/db/skynet_mysql_schema.sql +33 -0
  52. data/examples/rails_mysql_example/doc/README_FOR_APP +2 -0
  53. data/examples/rails_mysql_example/lib/tasks/rails_mysql_example.rake +20 -0
  54. data/examples/rails_mysql_example/public/.htaccess +40 -0
  55. data/examples/rails_mysql_example/public/404.html +30 -0
  56. data/examples/rails_mysql_example/public/422.html +30 -0
  57. data/examples/rails_mysql_example/public/500.html +30 -0
  58. data/examples/rails_mysql_example/public/dispatch.cgi +10 -0
  59. data/examples/rails_mysql_example/public/dispatch.fcgi +24 -0
  60. data/examples/rails_mysql_example/public/dispatch.rb +10 -0
  61. data/{log/debug.log → examples/rails_mysql_example/public/favicon.ico} +0 -0
  62. data/examples/rails_mysql_example/public/images/rails.png +0 -0
  63. data/examples/rails_mysql_example/public/index.html +277 -0
  64. data/examples/rails_mysql_example/public/javascripts/application.js +2 -0
  65. data/examples/rails_mysql_example/public/javascripts/controls.js +963 -0
  66. data/examples/rails_mysql_example/public/javascripts/dragdrop.js +972 -0
  67. data/examples/rails_mysql_example/public/javascripts/effects.js +1120 -0
  68. data/examples/rails_mysql_example/public/javascripts/prototype.js +4225 -0
  69. data/examples/rails_mysql_example/public/robots.txt +5 -0
  70. data/examples/rails_mysql_example/script/about +3 -0
  71. data/examples/rails_mysql_example/script/console +3 -0
  72. data/examples/rails_mysql_example/script/destroy +3 -0
  73. data/examples/rails_mysql_example/script/generate +3 -0
  74. data/examples/rails_mysql_example/script/performance/benchmarker +3 -0
  75. data/examples/rails_mysql_example/script/performance/profiler +3 -0
  76. data/examples/rails_mysql_example/script/performance/request +3 -0
  77. data/examples/rails_mysql_example/script/plugin +3 -0
  78. data/examples/rails_mysql_example/script/process/inspector +3 -0
  79. data/examples/rails_mysql_example/script/process/reaper +3 -0
  80. data/examples/rails_mysql_example/script/process/spawner +3 -0
  81. data/examples/rails_mysql_example/script/runner +3 -0
  82. data/examples/rails_mysql_example/script/server +3 -0
  83. data/examples/rails_mysql_example/test/fixtures/user_favorites.yml +9 -0
  84. data/examples/rails_mysql_example/test/fixtures/users.yml +11 -0
  85. data/examples/rails_mysql_example/test/test_helper.rb +38 -0
  86. data/examples/rails_mysql_example/test/unit/user_favorite_test.rb +8 -0
  87. data/examples/rails_mysql_example/test/unit/user_test.rb +8 -0
  88. data/extras/README +7 -0
  89. data/extras/init.d/skynet +87 -0
  90. data/extras/nagios/check_skynet.sh +121 -0
  91. data/extras/rails/controllers/skynet_controller.rb +43 -0
  92. data/extras/rails/views/skynet/index.rhtml +137 -0
  93. data/lib/skynet.rb +59 -1
  94. data/lib/skynet/mapreduce_helper.rb +2 -2
  95. data/lib/skynet/mapreduce_test.rb +32 -1
  96. data/lib/skynet/message_queue_adapters/mysql.rb +422 -539
  97. data/lib/skynet/message_queue_adapters/tuple_space.rb +45 -71
  98. data/lib/skynet/skynet_active_record_extensions.rb +22 -11
  99. data/lib/skynet/skynet_config.rb +54 -20
  100. data/lib/skynet/skynet_console.rb +4 -1
  101. data/lib/skynet/skynet_console_helper.rb +5 -1
  102. data/lib/skynet/skynet_debugger.rb +58 -4
  103. data/lib/skynet/skynet_job.rb +61 -24
  104. data/lib/skynet/skynet_launcher.rb +29 -3
  105. data/lib/skynet/skynet_logger.rb +11 -1
  106. data/lib/skynet/skynet_manager.rb +403 -240
  107. data/lib/skynet/skynet_message.rb +1 -3
  108. data/lib/skynet/skynet_message_queue.rb +42 -19
  109. data/lib/skynet/skynet_partitioners.rb +19 -15
  110. data/lib/skynet/skynet_ruby_extensions.rb +18 -0
  111. data/lib/skynet/skynet_tuplespace_server.rb +17 -14
  112. data/lib/skynet/skynet_worker.rb +132 -98
  113. data/lib/skynet/version.rb +1 -1
  114. data/script/destroy +0 -0
  115. data/script/generate +0 -0
  116. data/script/txt2html +0 -0
  117. data/test/test_helper.rb +2 -0
  118. data/test/test_skynet.rb +13 -5
  119. data/test/test_skynet_manager.rb +24 -9
  120. data/test/test_skynet_task.rb +1 -1
  121. data/website/index.html +77 -29
  122. data/website/index.txt +53 -24
  123. data/website/stylesheets/screen.css +12 -12
  124. metadata +156 -66
  125. data/app_generators/skynet_install/templates/skynet +0 -46
  126. data/log/skynet.log +0 -29
  127. data/log/skynet_tuplespace_server.log +0 -7
  128. data/log/skynet_worker.pid +0 -1
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- <% if in_rails -%>
4
- # Load your rails app
5
- require File.dirname(__FILE__) + '/../config/boot'
6
- require File.expand_path(File.dirname(__FILE__)) + '/../config/environment'
7
- <% end -%>
8
-
9
- require 'rubygems'
10
- require 'skynet'
11
-
12
- Skynet::CONFIG[:LAUNCHER_PATH] = File.expand_path(__FILE__)
13
- Skynet::CONFIG[:SKYNET_LOG_FILE] ||= STDERR
14
- Skynet::CONFIG[:SKYNET_LOG_LEVEL] ||= Logger::ERROR
15
- <% if in_rails -%>
16
- Skynet::CONFIG[:SKYNET_PIDS_FILE] ||= File.expand_path("#{RAILS_ROOT}/log/skynet_#{RAILS_ENV}.pid")
17
- Skynet::CONFIG[:SKYNET_LOG_FILE] ||= File.expand_path("#{RAILS_ROOT}/log/skynet_#{RAILS_ENV}.log")
18
- <% else -%>
19
- Skynet::CONFIG[:SKYNET_PIDS_FILE] ||= File.expand_path("../log/skynet.pid")
20
- Skynet::CONFIG[:SKYNET_LOG_FILE] ||= File.expand_path("../log/skynet.log")
21
- <% end -%>
22
-
23
- <% if mysql -%>
24
- # Use the mysql message queue adapter
25
- Skynet::CONFIG[:MESSAGE_QUEUE_ADAPTER] = "Skynet::MessageQueueAdapter::Mysql"
26
- <% if not in_rails -%>
27
- Skynet::CONFIG[:MYSQL_HOST] = "localhost"
28
- Skynet::CONFIG[:MYSQL_USERNAME] = "root"
29
- Skynet::CONFIG[:MYSQL_PASSWORD] = ""
30
- Skynet::CONFIG[:MYSQL_DATABASE] = "skynet"
31
- <% end -%>
32
- <% end -%>
33
-
34
- begin
35
- mq = Skynet::MessageQueue.new
36
- rescue Skynet::ConnectionError
37
- if Skynet::MessageQueue.adapter == :tuplespace
38
- pid = fork do
39
- exec("skynet_tuplespace_server start")
40
- end
41
- sleep Skynet::CONFIG[:TS_SERVER_START_DELAY]
42
- end
43
- end
44
-
45
-
46
- Skynet.new
@@ -1,29 +0,0 @@
1
- # Logfile created on Sun Dec 16 13:48:06 -0800 2007 by logger.rb/1.5.2.9
2
- [ERROR] #38693 2007-12-16 13:48:10.48554 <Skynet> STARTING MANAGER
3
- [ERROR] #38693 2007-12-16 13:48:10.89662 <MANAGER> Starting 4 workers. 0 already running.
4
- [ERROR] #38693 2007-12-16 13:48:10.89922 <MANAGER> Adding 4 WORKERS. Task Workers: 2, Master Workers: 0 Master & Task Workers: 2
5
- [ERROR] #38693 2007-12-16 13:48:10.91940 <MANAGER> Adding Worker #1 PID: 38697 WORKER_TYPE?:task
6
- [ERROR] #38693 2007-12-16 13:48:10.104896 <MANAGER> Adding Worker #2 PID: 38698 WORKER_TYPE?:task
7
- [ERROR] #38693 2007-12-16 13:48:10.131977 <MANAGER> Adding Worker #3 PID: 38699 WORKER_TYPE?:any
8
- [ERROR] #38693 2007-12-16 13:48:10.203838 <MANAGER> Adding Worker #4 PID: 38700 WORKER_TYPE?:any
9
- [ERROR] #38693 2007-12-16 13:48:10.214819 <MANAGER> DISTRO [{:any=>2, :task=>2, :master=>0}]
10
- [ERROR] #38693 2007-12-16 13:48:10.219610 <MANAGER> Checking started workers, 0 out of 4 after the 1th try...
11
- [ERROR] #38697 2007-12-16 13:48:12.279163 <Skynet> STARTING WORKER
12
- [ERROR] #38698 2007-12-16 13:48:12.347062 <Skynet> STARTING WORKER
13
- [ERROR] #38699 2007-12-16 13:48:12.422812 <Skynet> STARTING WORKER
14
- [ERROR] #38700 2007-12-16 13:48:12.422851 <Skynet> STARTING WORKER
15
- [ERROR] #38693 2007-12-16 13:48:14.222861 <MANAGER> Checking started workers, 4 out of 4 after the 2th try...
16
- [ERROR] #38693 2007-12-16 13:48:14.223069 <MANAGER> FINISHED STARTING ALL 4 WORKERS
17
- [ERROR] #38693 2007-12-16 13:48:39.16030 <MANAGER> SHUTTING DOWN 38699 MR:
18
- [ERROR] #38693 2007-12-16 13:48:39.16351 <MANAGER> SHUTTING DOWN 38700 MR:
19
- [ERROR] #38697 2007-12-16 13:48:39.469756 <WORKER-38697> Exiting...
20
- [FATAL] #38697 2007-12-16 13:48:39.474372 <WORKER-38697> WORKER 38697 DYING Skynet::RequestExpiredError Skynet::RequestExpiredError /Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:227:in `ts_command'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:174:in `take'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:78:in `take_worker_status'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:97:in `take_worker_status'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:138:in `notify_worker_stop'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:258:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:170:in `loop'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:170:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:358:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_launcher.rb:6:in `new'/Users/apisoni/geni/dev/skynet/bin/skynet:17
21
- [ERROR] #38698 2007-12-16 13:48:39.595163 <WORKER-38698> Exiting...
22
- [FATAL] #38698 2007-12-16 13:48:39.602075 <WORKER-38698> WORKER 38698 DYING Skynet::RequestExpiredError Skynet::RequestExpiredError /Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:227:in `ts_command'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:174:in `take'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:78:in `take_worker_status'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:97:in `take_worker_status'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:138:in `notify_worker_stop'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:258:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:170:in `loop'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:170:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:358:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_launcher.rb:6:in `new'/Users/apisoni/geni/dev/skynet/bin/skynet:17
23
- [ERROR] #38699 2007-12-16 13:48:39.698919 <WORKER-38699> Exiting...
24
- [FATAL] #38699 2007-12-16 13:48:39.701947 <WORKER-38699> WORKER 38699 DYING Skynet::RequestExpiredError Skynet::RequestExpiredError /Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:227:in `ts_command'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:174:in `take'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:78:in `take_worker_status'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:97:in `take_worker_status'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:138:in `notify_worker_stop'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:258:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:170:in `loop'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:170:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:358:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_launcher.rb:6:in `new'/Users/apisoni/geni/dev/skynet/bin/skynet:17
25
- [ERROR] #38700 2007-12-16 13:48:39.788697 <WORKER-38700> Exiting...
26
- [FATAL] #38700 2007-12-16 13:48:39.792239 <WORKER-38700> WORKER 38700 DYING Skynet::RequestExpiredError Skynet::RequestExpiredError /Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:227:in `ts_command'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:174:in `take'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/message_queue_adapters/tuple_space.rb:78:in `take_worker_status'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:97:in `take_worker_status'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:138:in `notify_worker_stop'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:258:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:170:in `loop'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:170:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_worker.rb:358:in `start'/Users/apisoni/geni/dev/skynet/bin/../lib/skynet/skynet_launcher.rb:6:in `new'/Users/apisoni/geni/dev/skynet/bin/skynet:17
27
- [ERROR] #38693 2007-12-16 13:48:54.273721 <MANAGER> Missing worker 38698 from worker queue. Removing and/or killing.
28
- [ERROR] #38693 2007-12-16 13:48:54.283175 <MANAGER> Missing worker 38697 from worker queue. Removing and/or killing.
29
- [FATAL] #38693 2007-12-16 13:48:55.311967 <MANAGER> Manager Exiting!
@@ -1,7 +0,0 @@
1
- # Logfile created on Sun Dec 16 13:44:46 -0800 2007 by logger.rb/1.5.2.9
2
- STARTING SKYNET SERVER ON PORT: 7647 Logging to /Users/apisoni/geni/dev/skynet/log/skynet_tuplespace_server.log
3
- STARTING SKYNET SERVER ON PORT: 7647 Logging to /Users/apisoni/geni/dev/skynet/log/skynet_tuplespace_server.log
4
- Couldn't start Skynet Server #<Errno::EADDRINUSE: Address already in use - bind(2)>
5
- Couldn't start Skynet Server #<SystemExit: exit>
6
- STARTING SKYNET SERVER ON PORT: 7647 Logging to /Users/apisoni/geni/dev/skynet/log/skynet_tuplespace_server.log
7
- Couldn't start Skynet Server #<SystemExit: exit>
@@ -1 +0,0 @@
1
- 38693