pione 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. data/.gitignore +2 -0
  2. data/.s3cfg +42 -0
  3. data/.travis.yml +18 -4
  4. data/.yardopts +1 -0
  5. data/Gemfile +3 -0
  6. data/History.txt +14 -0
  7. data/Procfile +7 -0
  8. data/Rakefile +25 -0
  9. data/bin/pione-interactive +6 -0
  10. data/bin/{pione-compiler → pione-notification-listener} +1 -1
  11. data/bin/{pione-broker → pione-task-worker-broker} +1 -1
  12. data/doc/man/pione-list-param.md +36 -0
  13. data/example/ActionError/ActionError.pione +9 -0
  14. data/example/ActionError/pione-package.json +15 -0
  15. data/example/CountChar/CountChar.pione +1 -1
  16. data/example/ScoreAggregation/ScoreAggregation.pione +1 -1
  17. data/example/Touch/pione-package.json +15 -0
  18. data/lib/pione.rb +12 -0
  19. data/lib/pione/agent.rb +3 -3
  20. data/lib/pione/agent/basic-agent.rb +10 -4
  21. data/lib/pione/agent/input-generator.rb +3 -3
  22. data/lib/pione/agent/{process-manager.rb → job-manager.rb} +10 -7
  23. data/lib/pione/agent/job-terminator.rb +2 -2
  24. data/lib/pione/agent/logger.rb +3 -3
  25. data/lib/pione/agent/messenger.rb +20 -9
  26. data/lib/pione/agent/notification-listener.rb +88 -0
  27. data/lib/pione/agent/task-worker-broker.rb +84 -0
  28. data/lib/pione/agent/task-worker.rb +3 -2
  29. data/lib/pione/agent/tuple-space-client.rb +1 -0
  30. data/lib/pione/agent/tuple-space-provider.rb +17 -35
  31. data/lib/pione/command.rb +33 -15
  32. data/lib/pione/command/action.rb +105 -0
  33. data/lib/pione/command/basic-command.rb +34 -376
  34. data/lib/pione/command/command-exception.rb +12 -11
  35. data/lib/pione/command/common.rb +198 -0
  36. data/lib/pione/command/option.rb +159 -204
  37. data/lib/pione/command/pione-action-exec.rb +85 -0
  38. data/lib/pione/command/pione-action-list.rb +43 -19
  39. data/lib/pione/command/pione-action-print.rb +79 -0
  40. data/lib/pione/command/pione-action.rb +8 -67
  41. data/lib/pione/command/pione-clean.rb +88 -68
  42. data/lib/pione/command/pione-client.rb +475 -332
  43. data/lib/pione/command/pione-command.rb +14 -31
  44. data/lib/pione/command/pione-compile.rb +90 -0
  45. data/lib/pione/command/pione-config-get.rb +53 -0
  46. data/lib/pione/command/pione-config-list.rb +64 -0
  47. data/lib/pione/command/pione-config-set.rb +59 -0
  48. data/lib/pione/command/pione-config-unset.rb +50 -0
  49. data/lib/pione/command/pione-config.rb +61 -0
  50. data/lib/pione/command/pione-diagnosis-notification.rb +235 -0
  51. data/lib/pione/command/pione-diagnosis.rb +21 -0
  52. data/lib/pione/command/pione-interactive.rb +188 -0
  53. data/lib/pione/command/pione-lang-check-syntax.rb +163 -0
  54. data/lib/pione/command/pione-lang-interactive.rb +146 -0
  55. data/lib/pione/command/pione-lang.rb +22 -0
  56. data/lib/pione/command/pione-log-format.rb +163 -0
  57. data/lib/pione/command/pione-log-list-id.rb +48 -0
  58. data/lib/pione/command/pione-log.rb +19 -101
  59. data/lib/pione/command/pione-notification-listener.rb +95 -0
  60. data/lib/pione/command/pione-package-add.rb +137 -0
  61. data/lib/pione/command/pione-package-build.rb +122 -0
  62. data/lib/pione/command/pione-package-show.rb +96 -0
  63. data/lib/pione/command/pione-package-update.rb +59 -0
  64. data/lib/pione/command/pione-package.rb +11 -139
  65. data/lib/pione/command/pione-task-worker-broker.rb +88 -0
  66. data/lib/pione/command/pione-task-worker.rb +148 -98
  67. data/lib/pione/command/pione-tuple-space-provider.rb +62 -54
  68. data/lib/pione/command/pione-tuple-space-viewer.rb +105 -83
  69. data/lib/pione/command/pione-val.rb +39 -39
  70. data/lib/pione/command/spawner.rb +34 -27
  71. data/lib/pione/front.rb +4 -2
  72. data/lib/pione/front/basic-front.rb +86 -23
  73. data/lib/pione/front/client-front.rb +2 -2
  74. data/lib/pione/front/diagnosis-notification-front.rb +40 -0
  75. data/lib/pione/front/front-exception.rb +7 -1
  76. data/lib/pione/front/notification-listener-front.rb +36 -0
  77. data/lib/pione/front/notification-recipient-interface.rb +19 -0
  78. data/lib/pione/front/relay-front.rb +4 -4
  79. data/lib/pione/front/task-worker-broker-front.rb +19 -0
  80. data/lib/pione/front/task-worker-front.rb +2 -2
  81. data/lib/pione/front/tuple-space-provider-front.rb +3 -2
  82. data/lib/pione/global.rb +3 -1
  83. data/lib/pione/global/client-variable.rb +1 -1
  84. data/lib/pione/global/config.rb +63 -7
  85. data/lib/pione/global/diagnosis-variable.rb +26 -0
  86. data/lib/pione/global/item.rb +28 -5
  87. data/lib/pione/global/log-variable.rb +6 -5
  88. data/lib/pione/global/network-variable.rb +75 -4
  89. data/lib/pione/global/path-variable.rb +1 -1
  90. data/lib/pione/global/system-variable.rb +12 -12
  91. data/lib/pione/global/task-worker-broker-variable.rb +43 -0
  92. data/lib/pione/global/tuple-space-notifier-variable.rb +3 -55
  93. data/lib/pione/lang/boolean.rb +4 -0
  94. data/lib/pione/lang/data-expr.rb +1 -1
  95. data/lib/pione/lang/integer.rb +1 -1
  96. data/lib/pione/lang/string.rb +4 -0
  97. data/lib/pione/lang/type.rb +1 -1
  98. data/lib/pione/location.rb +1 -0
  99. data/lib/pione/location/data-location.rb +41 -13
  100. data/lib/pione/location/dropbox-location.rb +175 -56
  101. data/lib/pione/location/ftp-location.rb +4 -1
  102. data/lib/pione/location/http-location.rb +5 -3
  103. data/lib/pione/location/https-location.rb +4 -2
  104. data/lib/pione/location/local-location.rb +6 -3
  105. data/lib/pione/location/location-exception.rb +12 -0
  106. data/lib/pione/location/notification-scheme.rb +46 -0
  107. data/lib/pione/log.rb +8 -7
  108. data/lib/pione/log/debug.rb +9 -9
  109. data/lib/pione/log/domain-log.rb +6 -1
  110. data/lib/pione/log/message-log-receiver.rb +32 -0
  111. data/lib/pione/log/system-log.rb +62 -141
  112. data/lib/pione/model.rb +7 -0
  113. data/lib/pione/model/notification-listener-model.rb +29 -0
  114. data/lib/pione/model/task-worker-broker-model.rb +129 -0
  115. data/lib/pione/notification.rb +13 -0
  116. data/lib/pione/notification/address.rb +104 -0
  117. data/lib/pione/notification/exception.rb +10 -0
  118. data/lib/pione/notification/message.rb +109 -0
  119. data/lib/pione/notification/receiver.rb +90 -0
  120. data/lib/pione/notification/recipient.rb +68 -0
  121. data/lib/pione/notification/task-worker-broker-recipient.rb +85 -0
  122. data/lib/pione/notification/transmitter.rb +84 -0
  123. data/lib/pione/pnml.rb +35 -0
  124. data/lib/pione/pnml/annotation-extractor.rb +47 -0
  125. data/lib/pione/pnml/compiler.rb +176 -0
  126. data/lib/pione/pnml/input-merge-complement.rb +78 -0
  127. data/lib/pione/pnml/input-parallelization-complement.rb +75 -0
  128. data/lib/pione/pnml/input-reduction.rb +80 -0
  129. data/lib/pione/pnml/invalid-arc-elimination.rb +41 -0
  130. data/lib/pione/pnml/io-expansion.rb +88 -0
  131. data/lib/pione/pnml/isolated-element-elimination.rb +32 -0
  132. data/lib/pione/pnml/net-rewriter.rb +44 -0
  133. data/lib/pione/pnml/output-decomposition-complement.rb +77 -0
  134. data/lib/pione/pnml/output-reduction.rb +86 -0
  135. data/lib/pione/pnml/output-synchronization-complement.rb +77 -0
  136. data/lib/pione/pnml/pione-model.rb +417 -0
  137. data/lib/pione/pnml/pnml-exception.rb +23 -0
  138. data/lib/pione/pnml/pnml-model.rb +368 -0
  139. data/lib/pione/pnml/reader.rb +51 -0
  140. data/lib/pione/rule-engine/action-handler.rb +8 -6
  141. data/lib/pione/rule-engine/basic-handler.rb +5 -5
  142. data/lib/pione/rule-engine/engine-exception.rb +7 -6
  143. data/lib/pione/rule-engine/flow-handler.rb +27 -18
  144. data/lib/pione/system.rb +3 -1
  145. data/lib/pione/system/domain-dump.rb +34 -0
  146. data/lib/pione/system/file-cache.rb +92 -13
  147. data/lib/pione/system/init.rb +3 -0
  148. data/lib/pione/system/normalizer.rb +40 -0
  149. data/lib/pione/system/status.rb +5 -5
  150. data/lib/pione/system/system-exception.rb +14 -1
  151. data/lib/pione/task-worker-broker.rb +7 -0
  152. data/lib/pione/task-worker-broker/basic-provider.rb +20 -0
  153. data/lib/pione/task-worker-broker/easy-provider.rb +65 -0
  154. data/lib/pione/test-helper.rb +27 -0
  155. data/lib/pione/test-helper/command-helper.rb +9 -101
  156. data/lib/pione/tuple-space/basic-tuple.rb +1 -1
  157. data/lib/pione/tuple-space/tuple-definition.yml +4 -6
  158. data/lib/pione/tuple-space/tuple-space-interface.rb +3 -45
  159. data/lib/pione/tuple-space/tuple-space-server.rb +45 -0
  160. data/lib/pione/util.rb +1 -2
  161. data/lib/pione/util/boolean-value.rb +62 -0
  162. data/lib/pione/util/completion.rb +111 -0
  163. data/lib/pione/util/evaluatable.rb +13 -27
  164. data/lib/pione/util/package-parameters-list.rb +15 -27
  165. data/lib/pione/util/zip.rb +8 -3
  166. data/lib/pione/version.rb +1 -1
  167. data/lib/rootage.rb +20 -0
  168. data/lib/rootage/action.rb +114 -0
  169. data/lib/rootage/argument.rb +46 -0
  170. data/lib/rootage/command.rb +218 -0
  171. data/lib/rootage/core.rb +532 -0
  172. data/lib/rootage/exception.rb +107 -0
  173. data/lib/rootage/help.rb +148 -0
  174. data/lib/rootage/help.txt.erb +31 -0
  175. data/lib/rootage/log.rb +226 -0
  176. data/lib/rootage/normalizer.rb +184 -0
  177. data/lib/rootage/option.rb +152 -0
  178. data/lib/rootage/scenario-test-result.erb +39 -0
  179. data/lib/rootage/scenario.rb +362 -0
  180. data/lib/rootage/test-helper.rb +115 -0
  181. data/man/pione-list-param.1 +44 -0
  182. data/misc/clock.rb +9 -0
  183. data/misc/machine-info.sh +21 -0
  184. data/misc/pione-completion.bash +238 -0
  185. data/misc/pione-completion.erb +53 -0
  186. data/misc/pione-completion.zsh +238 -0
  187. data/misc/pione.god +22 -0
  188. data/misc/ui.xml +23 -0
  189. data/pione.gemspec +3 -1
  190. data/test/agent/spec_basic-agent.rb +1 -1
  191. data/test/agent/spec_input-generator.rb +2 -2
  192. data/test/agent/spec_messenger.rb +6 -9
  193. data/test/agent/spec_notification-listener.rb +80 -0
  194. data/test/agent/{spec_broker.rb → spec_task-worker-broker.rb} +13 -10
  195. data/test/agent/spec_tuple-space-provider.rb +10 -6
  196. data/test/command/command-behavior.rb +3 -11
  197. data/test/command/data/pione-list-param/AdvancedParameters.pione +12 -0
  198. data/test/command/data/pione-list-param/BasicParameters.pione +12 -0
  199. data/test/command/spec_pione-action-exec.rb +16 -0
  200. data/test/command/spec_pione-action-list.rb +15 -10
  201. data/test/command/spec_pione-action-print.rb +14 -0
  202. data/test/command/spec_pione-action.rb +6 -19
  203. data/test/command/spec_pione-clean.rb +29 -46
  204. data/test/command/spec_pione-client.rb +29 -36
  205. data/test/command/spec_pione-command.rb +6 -6
  206. data/test/command/{spec_pione-compiler.rb → spec_pione-compile.rb} +11 -13
  207. data/test/command/spec_pione-config-get.rb +47 -0
  208. data/test/command/spec_pione-config-list.rb +42 -0
  209. data/test/command/spec_pione-config-set.rb +38 -0
  210. data/test/command/spec_pione-config-unset.rb +44 -0
  211. data/test/command/spec_pione-config.rb +11 -0
  212. data/test/command/spec_pione-diagnosis-notification.rb +23 -0
  213. data/test/command/spec_pione-diagnosis.rb +11 -0
  214. data/test/command/spec_pione-lang-check-syntax.rb +12 -0
  215. data/test/command/spec_pione-lang.rb +11 -0
  216. data/test/command/spec_pione-log-format.rb +29 -0
  217. data/test/command/spec_pione-log-list-id.rb +17 -0
  218. data/test/command/spec_pione-log.rb +6 -20
  219. data/test/command/spec_pione-package-add.rb +55 -0
  220. data/test/command/spec_pione-package-build.rb +57 -0
  221. data/test/command/spec_pione-package-show.rb +72 -0
  222. data/test/command/{spec_pione-update-package-info.rb → spec_pione-package-update.rb} +12 -13
  223. data/test/command/spec_pione-package.rb +4 -104
  224. data/test/command/spec_pione-val.rb +10 -7
  225. data/test/global/spec_config.rb +50 -0
  226. data/test/global/spec_item.rb +1 -1
  227. data/test/literate-action/data/HelloWorld.md +1 -1
  228. data/test/location/location-behavior.rb +1 -1
  229. data/test/location/spec_dropbox-location.rb +39 -0
  230. data/test/location/spec_notification-scheme.rb +37 -0
  231. data/test/log/spec_debug.rb +5 -4
  232. data/test/log/spec_message-log-receiver.rb +13 -0
  233. data/test/log/spec_message-log.rb +6 -9
  234. data/test/log/spec_system-log.rb +5 -3
  235. data/test/notification/spec_address.rb +229 -0
  236. data/test/notification/spec_message.rb +30 -0
  237. data/test/notification/spec_receiver.rb +36 -0
  238. data/test/notification/spec_transmitter.rb +37 -0
  239. data/test/pnml/data/ConditionalBranchIf.pnml +270 -0
  240. data/test/pnml/data/ConditionalBranchIfElse.pnml +309 -0
  241. data/test/pnml/data/IOExpansionComplex.pnml +363 -0
  242. data/test/pnml/data/IOExpansionSimple.pnml +140 -0
  243. data/test/pnml/data/InputMergeComplementComplex.pnml +381 -0
  244. data/test/pnml/data/InputMergeComplementSimple.pnml +248 -0
  245. data/test/pnml/data/InputParallelizationComplementComplex.pnml +433 -0
  246. data/test/pnml/data/InputParallelizationComplementSimple.pnml +288 -0
  247. data/test/pnml/data/InputReductionComplex.pnml +192 -0
  248. data/test/pnml/data/InputReductionLong.pnml +344 -0
  249. data/test/pnml/data/InputReductionSimple.pnml +140 -0
  250. data/test/pnml/data/IsolatedElementElimination.pnml +171 -0
  251. data/test/pnml/data/OutputDecompositionComplementComplex.pnml +381 -0
  252. data/test/pnml/data/OutputDecompositionComplementSimple.pnml +242 -0
  253. data/test/pnml/data/OutputReductionComplex.pnml +186 -0
  254. data/test/pnml/data/OutputReductionLong.pnml +344 -0
  255. data/test/pnml/data/OutputReductionSimple.pnml +140 -0
  256. data/test/pnml/data/OutputSynchronizationComplementComplex.pnml +498 -0
  257. data/test/pnml/data/OutputSynchronizationComplementSimple.pnml +347 -0
  258. data/test/pnml/data/SampleNet.pnml +238 -0
  259. data/test/pnml/spec_input-merge-complement.rb +40 -0
  260. data/test/pnml/spec_input-parallelization-complement.rb +50 -0
  261. data/test/pnml/spec_input-reduction.rb +113 -0
  262. data/test/pnml/spec_invalid-arc-elimination.rb +33 -0
  263. data/test/pnml/spec_io-expansion.rb +126 -0
  264. data/test/pnml/spec_isolated-element-elimination.rb +25 -0
  265. data/test/pnml/spec_output-decomposition-complement.rb +40 -0
  266. data/test/pnml/spec_output-reduction.rb +114 -0
  267. data/test/pnml/spec_output-synchronization-complement.rb +62 -0
  268. data/test/pnml/spec_pione-element.rb +144 -0
  269. data/test/pnml/spec_pnml-element.rb +373 -0
  270. data/test/pnml/spec_reader.rb +16 -0
  271. data/test/rootage/spec_argument.rb +18 -0
  272. data/test/rootage/spec_command.rb +239 -0
  273. data/test/rootage/spec_core.rb +198 -0
  274. data/test/rootage/spec_scenario.rb +149 -0
  275. data/test/system/{spec_domain-info.rb → spec_domain-dump.rb} +6 -6
  276. data/test/system/spec_file-cache.rb +6 -9
  277. data/test/tuple-space/spec_finished-tuple.rb +1 -1
  278. data/test/util/{spec_package-parameters-list_1.pione → data/package-parameters-list/Param1.pione} +0 -0
  279. data/test/util/{spec_package-parameters-list_2.pione → data/package-parameters-list/Param2.pione} +0 -0
  280. data/test/util/{spec_package-parameters-list_3.pione → data/package-parameters-list/Param3.pione} +0 -0
  281. data/test/util/{spec_package-parameters-list_4.pione → data/package-parameters-list/Param4.pione} +0 -0
  282. data/test/util/spec_boolean-value.rb +32 -0
  283. data/test/util/spec_completion.rb +22 -0
  284. data/test/util/spec_package-parameters-list.rb +39 -52
  285. data/test/util/spec_zip.rb +28 -1
  286. metadata +288 -47
  287. data/bin/pione-tuple-space-receiver +0 -5
  288. data/lib/pione/agent/broker.rb +0 -304
  289. data/lib/pione/agent/tuple-space-receiver.rb +0 -137
  290. data/lib/pione/command/pione-broker.rb +0 -104
  291. data/lib/pione/command/pione-compiler.rb +0 -57
  292. data/lib/pione/command/pione-relay-account-db.rb +0 -141
  293. data/lib/pione/command/pione-relay-client-db.rb +0 -118
  294. data/lib/pione/command/pione-relay.rb +0 -59
  295. data/lib/pione/command/pione-syntax-checker.rb +0 -214
  296. data/lib/pione/command/pione-tuple-space-receiver.rb +0 -111
  297. data/lib/pione/command/pione-update-package-info.rb +0 -53
  298. data/lib/pione/front/broker-front.rb +0 -22
  299. data/lib/pione/front/tuple-space-receiver-front.rb +0 -11
  300. data/lib/pione/global/broker-variable.rb +0 -33
  301. data/lib/pione/system/domain-info.rb +0 -25
  302. data/lib/pione/util/pnml-compiler.rb +0 -168
  303. data/test/agent/spec_tuple-space-receiver.rb +0 -47
  304. data/test/util/spec_pnml-compiler.rb +0 -32
data/.gitignore CHANGED
@@ -9,6 +9,8 @@ Gemfile.lock
9
9
  gems
10
10
  log.txt
11
11
  nohup.out
12
+ test-report.txt
13
+ *.log
12
14
 
13
15
  /input
14
16
  /output
data/.s3cfg ADDED
@@ -0,0 +1,42 @@
1
+ [default]
2
+ bucket_location = US
3
+ cloudfront_host = cloudfront.amazonaws.com
4
+ default_mime_type = binary/octet-stream
5
+ delete_removed = False
6
+ dry_run = False
7
+ enable_multipart = True
8
+ encoding = UTF-8
9
+ encrypt = False
10
+ follow_symlinks = False
11
+ force = False
12
+ get_continue = False
13
+ gpg_command = /usr/bin/gpg
14
+ gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
15
+ gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
16
+ gpg_passphrase =
17
+ guess_mime_type = True
18
+ host_base = s3.amazonaws.com
19
+ host_bucket = %(bucket)s.s3.amazonaws.com
20
+ human_readable_sizes = False
21
+ invalidate_on_cf = False
22
+ list_md5 = False
23
+ log_target_prefix =
24
+ mime_type =
25
+ multipart_chunk_size_mb = 15
26
+ preserve_attrs = True
27
+ progress_meter = True
28
+ proxy_host =
29
+ proxy_port = 0
30
+ recursive = False
31
+ recv_chunk = 4096
32
+ reduced_redundancy = False
33
+ send_chunk = 4096
34
+ simpledb_host = sdb.amazonaws.com
35
+ skip_existing = False
36
+ socket_timeout = 300
37
+ urlencoding_mode = normal
38
+ use_https = False
39
+ verbosity = WARNING
40
+ website_endpoint = http://%(bucket)s.s3-website-%(location)s.amazonaws.com/
41
+ website_error =
42
+ website_index = index.html
data/.travis.yml CHANGED
@@ -1,11 +1,25 @@
1
- before_script:
2
- - sudo apt-get install bc # for processing Fib.pione
3
-
4
1
  language: ruby
5
2
  rvm:
6
- # - "1.9.2" # PIONE doesn't support 1.9.2
7
3
  - "1.9.3"
8
4
  # - "2.0.0" # pione doesn't work with 2.0
9
5
  # - jruby-19mode
10
6
  # - rbx-19mode # pione doesn't work with 2.0
11
7
  script: rake test
8
+
9
+ env:
10
+ global:
11
+ - secure: "RBvMvbfZYegOQWQ9AoWD1S6MejhyEx61ufLIBBFS4LgGV1cZLvlbEoPLLT3FJsKOtel1UJ/WFLD1CSelzoIaLHCWtDwg58HvKImRTGI/rQRFKpY82P+gW5E9gB80Z74d1bwhKMvC51Unj/EmPU5SinFDaGCwJD871Eedhs1oKMc="
12
+ - secure: "FvqAAf9yqE5se0xavXIn5huGAee9H//7yUHpGFhF6xJN9HlFJ4ciEu5kDzQIAzFh24qgLZtA+s3gY8Us5h+uW2ztEo/VHsohVK6KvZkT9ucouOepa2ubxbhacTbKJADYng8f1wlaIBt208AD22gkZbAR+/T2CwZMqiskgh5mmg8="
13
+
14
+ before_script:
15
+ - LANG=C date >> test-report.txt
16
+ - sh misc/machine-info.sh >> test-report.txt
17
+ - sudo apt-get install -y bc # for processing Fib.pione
18
+ - sudo apt-get install -y gnuplot # for processing ScoreAggregation.pione
19
+ - sudo apt-get install -y s3cmd
20
+
21
+ after_script:
22
+ - echo "access_key = $TRAVIS_AWS_ACCESS_KEY_ID" >> .s3cfg
23
+ - echo "secret_key = $TRAVIS_AWS_SECRET_KEY" >> .s3cfg
24
+ - s3cmd put --rr --config=.s3cfg --acl-public test-report.txt s3://pione-travis-result/pione/test-report-$TRAVIS_JOB_NUMBER.txt
25
+
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --markup markdown
data/Gemfile CHANGED
@@ -6,3 +6,6 @@ gemspec
6
6
 
7
7
  gem 'simplecov', :require => false, :group => :test
8
8
  gem 'coveralls', :require => false, :group => :test
9
+ gem 'clockwork'
10
+ gem 'foreman'
11
+ gem 'god'
data/History.txt CHANGED
@@ -1,5 +1,19 @@
1
1
  # History
2
2
 
3
+ ## 0.4.0(2014/4/17)
4
+
5
+ * Added new PNML compiler(`pione compile`).
6
+ * Added experimental `pione-interactive` command.
7
+ * Modified continuation condition for rule application.
8
+ * Changed to stop processing when action rules cause errors.
9
+ * Refined notification system, and added `pione diagnosis notification`.
10
+ * Renamed broker as `pione-task-worker-broker`.
11
+ * Added a new option `--file-sliding`.
12
+ * Added a new option `--file-cache-method`.
13
+ * Introduced `pione-notification-listener`.
14
+ * Fixed SpawnRetry problem with many task workers.
15
+ * Fixed data cache problem.
16
+
3
17
  ## 0.3.2(2013/11/05)
4
18
 
5
19
  * Added literate action document.
data/Procfile ADDED
@@ -0,0 +1,7 @@
1
+ # If you want to make upstart script, try this:
2
+ #
3
+ # sudo foreman export upstart /etc/init --app pione -d `pwd` -u `whoami` -l `pwd`
4
+ #
5
+
6
+ notification-listener: pione-notification-listener
7
+ task-worker-broker: pione-task-worker-broker
data/Rakefile CHANGED
@@ -85,4 +85,29 @@ task "man" do
85
85
  generate_man("doc/man/pione-update-package-info.md", "man/pione-update-package-info.1")
86
86
  generate_man("doc/man/pione-action.md", "man/pione-action.1")
87
87
  generate_man("doc/man/pione-action-list.md", "man/pione-action-list.1")
88
+ generate_man("doc/man/pione-list-param.md", "man/pione-list-param.1")
89
+ end
90
+
91
+ #
92
+ # Completion
93
+ #
94
+
95
+ desc "generate bash completion file"
96
+ task "completion:bash" do
97
+ Pione::Command.load_all
98
+ require 'pione/util/completion'
99
+ misc = Pione::Location[File.dirname(__FILE__)] + "misc"
100
+ source = misc + "pione-completion.erb"
101
+ target = misc + "pione-completion.bash"
102
+ Pione::Util::BashCompletion.compile(source, target)
103
+ end
104
+
105
+ desc "generate zsh completion file"
106
+ task "completion:zsh" do
107
+ Pione::Command.load_all
108
+ require 'pione/util/completion'
109
+ misc = Pione::Location[File.dirname(__FILE__)] + "misc"
110
+ source = misc + "pione-completion.erb"
111
+ target = misc + "pione-completion.zsh"
112
+ Pione::Util::ZshCompletion.compile(source, target)
88
113
  end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- ruby -*-
3
+
4
+ require 'pione'
5
+ require 'pione/command/pione-interactive'
6
+ Pione::Command::PioneInteractive.run(ARGV)
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneCompiler.run(ARGV)
5
+ Pione::Command::PioneNotificationListener.run(ARGV)
@@ -2,4 +2,4 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'pione'
5
- Pione::Command::PioneBroker.run(ARGV)
5
+ Pione::Command::PioneTaskWorkerBroker.run(ARGV)
@@ -0,0 +1,36 @@
1
+ % pione-list-param(1) PIONE User Manual
2
+ % Keita Yamaguchi
3
+
4
+ # NAME
5
+
6
+ pione-list-param - show a list of parameters in the document or package.
7
+
8
+ # SYNOPSIS
9
+
10
+ **pione list-param** [options] location
11
+
12
+ # DESCRIPTION
13
+
14
+ **list-param** command shows a list of parameters in the document or
15
+ package. The list includes basic parameters only by default, set `--advanced` option
16
+ if you want to show advanced parameters.
17
+
18
+ # OPTIONS
19
+
20
+ -a, --advanced
21
+ : Show advanced parameters.
22
+
23
+ # EXAMPLES
24
+
25
+ pione list-param example/HelloWorld/HelloWorld.pione
26
+ : Show basic parameters in the document `example/HelloWorld/HelloWorld.pione`.
27
+
28
+ pione list-param example/HelloWorld
29
+ : Show basic parameters in the package `example/HelloWorld`.
30
+
31
+ pione list-param --advanced example/HelloWorld
32
+ : Show basic and advanced parameters in the package `example/HelloWorld`.
33
+
34
+ # REPORTING BUGS
35
+
36
+ Report bugs or feature requests to PIONE's issue tracker(https://github.com/pione/pione/issues).
@@ -0,0 +1,9 @@
1
+ .@ PackageName :: "ActionError"
2
+
3
+ Rule Main
4
+ input null
5
+ output 'o1'
6
+ Action
7
+ sleep 3
8
+ hoge.sh > o1
9
+ End
@@ -0,0 +1,15 @@
1
+ {
2
+ "PackageName": "ActionError",
3
+ "Parents": [
4
+
5
+ ],
6
+ "Documents": [
7
+ "ActionError.pione"
8
+ ],
9
+ "Scenarios": [
10
+
11
+ ],
12
+ "Bins": [
13
+
14
+ ]
15
+ }
@@ -46,7 +46,7 @@ Action
46
46
  #!/usr/bin/env ruby
47
47
  # coding: utf-8
48
48
  table = {}
49
- "{$I[1]}".split(":").each do |path|
49
+ "{$I[1]}".split(" ").each do |path|
50
50
  File.read(path).split("\n").map do |line|
51
51
  c, number = line.split(":")
52
52
  table[c] = (table.has_key?(c) ? table[c] : 0) + number.to_i
@@ -111,7 +111,7 @@ Rule MD2HTML
111
111
  input '*.stat.md'
112
112
  output '{$*}.html.part'
113
113
  Action
114
- redcarpet --parse-tables {$I[1]} > {$O[1]}
114
+ kramdown {$I[1]} > {$O[1]}
115
115
  End
116
116
 
117
117
  Rule ApplyTemplate
@@ -0,0 +1,15 @@
1
+ {
2
+ "PackageName": "Touch",
3
+ "Parents": [
4
+
5
+ ],
6
+ "Documents": [
7
+ "Touch.pione"
8
+ ],
9
+ "Scenarios": [
10
+
11
+ ],
12
+ "Bins": [
13
+
14
+ ]
15
+ }
data/lib/pione.rb CHANGED
@@ -26,6 +26,7 @@ require 'socket'
26
26
  require 'digest'
27
27
  require 'forwardablex'
28
28
  require 'socket'
29
+ require 'ipaddr'
29
30
  require 'drb/drb'
30
31
  require 'drb/ssl'
31
32
  require 'rinda/rinda'
@@ -35,6 +36,7 @@ require 'yaml'
35
36
  require 'singleton'
36
37
  require 'timeout'
37
38
  require 'thread'
39
+ require 'thwait'
38
40
  require 'monitor'
39
41
  require 'uri'
40
42
  require 'pathname'
@@ -71,10 +73,14 @@ require 'retriable'
71
73
  require 'childprocess'
72
74
  require 'lettercase/core_ext'
73
75
  require 'kramdown'
76
+ require 'os'
77
+ require 'sys/proctable'
74
78
 
75
79
  # configuration for childprcess
76
80
  ChildProcess.posix_spawn = true
77
81
 
82
+ require 'rootage'
83
+
78
84
  #
79
85
  # load pione
80
86
  #
@@ -82,6 +88,7 @@ ChildProcess.posix_spawn = true
82
88
  require 'pione/version' # PIONE version information
83
89
  require 'pione/util' # various helper functions
84
90
  require 'pione/patch' # patches for libraries
91
+ require 'pione/notification' # PIONE notification system
85
92
  require 'pione/location' # location system for data and package
86
93
  require 'pione/log' # log and format
87
94
  require 'pione/global' # global variable manager
@@ -92,14 +99,19 @@ require 'pione/lang' # PIONE languge
92
99
  require 'pione/tuple-space' # tuple space functions
93
100
  require 'pione/rule-engine' # rule processing behaviors
94
101
  require 'pione/agent' # agent system
102
+ require 'pione/model' # command model
95
103
  require 'pione/front' # command front interface
96
104
  require 'pione/command' # command definitions
97
105
  require 'pione/literate-action' # literate action
106
+ require 'pione/task-worker-broker' # task worker broker
107
+ require 'pione/pnml' # PNML compiler
98
108
 
99
109
  #
100
110
  # other settings
101
111
  #
102
112
 
113
+ Version = Pione::VERSION
114
+
103
115
  module Pione
104
116
  # expand name spaces
105
117
  include Relay
data/lib/pione/agent.rb CHANGED
@@ -10,8 +10,8 @@ require 'pione/agent/job-terminator'
10
10
  require 'pione/agent/task-worker'
11
11
  require 'pione/agent/input-generator'
12
12
  require 'pione/agent/logger'
13
- require 'pione/agent/broker'
14
- require 'pione/agent/process-manager'
13
+ require 'pione/agent/task-worker-broker'
14
+ require 'pione/agent/job-manager'
15
15
  require 'pione/agent/messenger'
16
16
  require 'pione/agent/tuple-space-provider'
17
- require 'pione/agent/tuple-space-receiver'
17
+ require 'pione/agent/notification-listener'
@@ -124,7 +124,7 @@ module Pione
124
124
  @__wait_until_after_cv__ = Hash.new {|h, k| h[k] = ConditionVariable.new}
125
125
  end
126
126
 
127
- # Start agent activity.
127
+ # Start the agent activity.
128
128
  def start
129
129
  unless @chain_threads.list.empty?
130
130
  raise TerminationError.new(self, states)
@@ -140,6 +140,12 @@ module Pione
140
140
  return self
141
141
  end
142
142
 
143
+ # Start the agent activity and wait the termination.
144
+ def start!
145
+ start
146
+ wait_until_terminated(nil)
147
+ end
148
+
143
149
  # Fire the transtion with inputs.
144
150
  def transit(transition, transition_inputs)
145
151
  # wake up threads that wait by wait_until_before method
@@ -278,9 +284,9 @@ module Pione
278
284
  end
279
285
  end
280
286
  rescue Exception => e
281
- # throw the exception to command's runnning thread
282
- if Global.command and Global.command.running_thread and Global.command.running_thread.alive?
283
- Global.command.running_thread.raise e
287
+ # throw the exception to owner thread
288
+ if @__owner_thread__ and @__owner_thread__.alive?
289
+ @__owner_thread__.raise e
284
290
  else
285
291
  raise e
286
292
  end
@@ -35,13 +35,13 @@ module Pione
35
35
  forward :@generator, :stream?
36
36
 
37
37
  # Initialize the agent.
38
- def initialize(space, generator_name, input_location, stream)
39
- super(space)
38
+ def initialize(tuple_space, generator_name, input_location, stream)
39
+ super(tuple_space)
40
40
  @base_location = base_location
41
41
 
42
42
  # generator method
43
43
  if generator_method = InputGenerator.generator_method[generator_name]
44
- @generator = generator_method.new(space, input_location, stream)
44
+ @generator = generator_method.new(tuple_space, input_location, stream)
45
45
  else
46
46
  raise UnknownInputGeneratorMethod.new(generator_name)
47
47
  end
@@ -1,8 +1,8 @@
1
1
  module Pione
2
2
  module Agent
3
- class ProcessManager < TupleSpaceClient
3
+ class JobManager < TupleSpaceClient
4
4
  include Log::MessageLog
5
- set_agent_type :process_manager, self
5
+ set_agent_type :job_manager, self
6
6
 
7
7
  #
8
8
  # instance method
@@ -10,13 +10,13 @@ module Pione
10
10
 
11
11
  attr_reader :package
12
12
 
13
- def initialize(space, env, package, param_set, stream)
13
+ def initialize(tuple_space, env, package, param_set, stream)
14
14
  unless env.rule_get!(Lang::RuleExpr.new("Main"))
15
15
  raise JobError.new("Rule `Main` not found in the package.")
16
16
  end
17
17
 
18
- super(space)
19
- @space = space
18
+ super(tuple_space)
19
+ @tuple_space = tuple_space
20
20
  @env = env
21
21
  @package = package
22
22
  @param_set = param_set
@@ -61,7 +61,7 @@ module Pione
61
61
  end
62
62
 
63
63
  def transit_to_run
64
- finder = RuleEngine::DataFinder.new(@space, 'root')
64
+ finder = RuleEngine::DataFinder.new(@tuple_space, 'root')
65
65
  list = Enumerator.new(finder, :find, :input, @rule_condition.inputs, @env).to_a
66
66
  if list.empty?
67
67
  user_message "error: no inputs"
@@ -70,11 +70,14 @@ module Pione
70
70
  # call root rule of the current package
71
71
  list.each do |env, inputs|
72
72
  package_id = @env.current_package_id
73
- handler = RuleEngine.make(@space, @env, package_id, "Root", inputs, Lang::ParameterSet.new, 'root', nil)
73
+ handler = RuleEngine.make(@tuple_space, @env, package_id, "Root", inputs, Lang::ParameterSet.new, 'root', nil)
74
74
  handler.handle
75
75
  end
76
76
  end
77
77
 
78
+ # terminate if the agent is not stream mode
79
+ terminate unless @stream
80
+
78
81
  return
79
82
  end
80
83
  end