cuboid 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99e1706f1f0771fae638ae08cf525077625255e3cda4b3a7ff09e92c192692c4
4
- data.tar.gz: 77f486938d14f0f579ccc1d4f3f20d0265c9d3590095912c667d28494f03013b
3
+ metadata.gz: 3b42624047576609e3109174ec397a7216906cb19c6f156bb8d5abb724ffc504
4
+ data.tar.gz: a748b900b4ab7b4e3d62ea6003f5a764de5c71eba1896a261864ddfe2540ecb2
5
5
  SHA512:
6
- metadata.gz: 5bc2b6bcb5d51deeccb44292aebacca47ded75cafeff7085bb9c645a108a58524b6c0a89bd11f521ec58a7e40cf3565d1d4a3c8dd5e9b8fe880a2226c2575209
7
- data.tar.gz: 031e775efa26dfc56d51823e8b00687a7727a72c22c78ab76b126b8fb2b7dc94ae79ea595a23eba3b2c1a121b08237adb542d4ad1783f38d9ebe4933eb7bb2ea
6
+ metadata.gz: ecb56be8d5ccfc13ed583bfd3162a15a5375045216747f22961292c92b917d1adc64db9aa39335185f6954fd45f5a74a056320861c6cdd4da3c6b970707cb821
7
+ data.tar.gz: ce236c9a3f3c1030ba60636d8933817c4b7481ce0f4945fa27e14ddd85e2a11011eaca754fac9c061ca49a03f8c16cb46e83a05d7eca7364bef951dd495f9163
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # 0.1.8
2
+
3
+ * `Processes::Manager`
4
+ * `#find_in_applications` -- Also include `PATH` search.
5
+
6
+ # 0.1.7
7
+
8
+ * `Application`
9
+ * Added `#shutdown` callback method to handle RPC server shutdowns.
10
+
11
+ # 0.1.6.1
12
+
13
+ * `OptionGroups::RPC`: Added `#url`.
14
+
1
15
  # 0.1.5
2
16
 
3
17
  * Fixed relative path for application source path detection.
@@ -67,6 +67,10 @@ class Application
67
67
  true
68
68
  end
69
69
 
70
+ def shutdown
71
+ super if defined? super
72
+ end
73
+
70
74
  private
71
75
 
72
76
  # @note Must be called before calling any audit methods.
@@ -79,6 +79,10 @@ class RPC < Cuboid::OptionGroup
79
79
  server_port: 7331
80
80
  )
81
81
 
82
+ def url
83
+ "#{server_address}:#{server_port}"
84
+ end
85
+
82
86
  def to_client_options
83
87
  {
84
88
  connection_pool_size: connection_pool_size,
@@ -86,10 +86,13 @@ class Manager
86
86
  @find_in_applications ||= {}
87
87
  return @find_in_applications[bin] if @find_in_applications.include?( bin )
88
88
 
89
- [
90
- '/Applications/*/Contents/MacOS'
91
- ].each do |root|
92
- glob = File.join( root, '**', bin )
89
+ (
90
+ ENV['PATH'].split( File::PATH_SEPARATOR ) |
91
+ [
92
+ '/Applications'
93
+ ]
94
+ ).each do |root|
95
+ glob = File.join( "#{root}/*/Contents/MacOS", '**', bin )
93
96
 
94
97
  exe = Dir.glob( glob ).find { |f| File.executable?( f ) }
95
98
  return @find_in_applications[bin] = exe if exe
@@ -19,7 +19,7 @@ class ApplicationWrapper
19
19
  def_delegators :@application, :suspended?, :suspending?, :suspend!, :status,
20
20
  :pause!, :running?, :status_messages, :paused?, :pausing?,
21
21
  :snapshot_path, :restore!, :resume!, :generate_report,
22
- :abort!, :aborting?, :aborted?
22
+ :abort!, :aborting?, :aborted?, :shutdown
23
23
 
24
24
  # {RPC::Server::Application} error namespace.
25
25
  #
@@ -102,7 +102,10 @@ class Instance
102
102
  # @see #suspend
103
103
  # @see #snapshot_path
104
104
  def restore!( snapshot )
105
- @application.restore!( snapshot ).run
105
+ Thread.new do
106
+ @application.restore!( snapshot ).run
107
+ end
108
+
106
109
  true
107
110
  end
108
111
 
@@ -205,8 +208,10 @@ class Instance
205
208
 
206
209
  @active_options.set( application: options )
207
210
 
208
- @application.run
209
- @run_initializing = false
211
+ Thread.new do
212
+ @application.run
213
+ @run_initializing = false
214
+ end
210
215
 
211
216
  true
212
217
  end
@@ -221,6 +226,8 @@ class Instance
221
226
 
222
227
  print_status 'Shutting down...'
223
228
 
229
+ @application.shutdown
230
+
224
231
  # We're shutting down services so we need to use a concurrent way but
225
232
  # without going through the Reactor.
226
233
  Thread.new do
@@ -110,10 +110,6 @@ class Application
110
110
  @status == :timed_out
111
111
  end
112
112
 
113
- # @param [Bool] block
114
- # `true` if the method should block until an abortion has completed,
115
- # `false` otherwise.
116
- #
117
113
  # @return [Bool]
118
114
  # `true` if the abort request was successful, `false` if the system is
119
115
  # already {#suspended?} or is {#suspending?}.
data/lib/version CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.8
@@ -111,8 +111,6 @@ describe 'Cuboid::RPC::Server::Instance' do
111
111
  subject = instance_spawn
112
112
  subject.restore! snapshot_path
113
113
 
114
- File.delete snapshot_path
115
-
116
114
  sleep 1 while subject.status != :done
117
115
 
118
116
  expect(subject.generate_report.options).to eq(options)
@@ -203,7 +201,7 @@ describe 'Cuboid::RPC::Server::Instance' do
203
201
  end
204
202
 
205
203
  describe '#abort_and_generate_report' do
206
- it "cleans-up and returns the report as #{Cuboid::Report}", focus: true do
204
+ it "cleans-up and returns the report as #{Cuboid::Report}" do
207
205
  subject.run
208
206
 
209
207
  expect(subject.abort_and_generate_report).to be_kind_of Cuboid::Report
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuboid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tasos Laskos
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-14 00:00:00.000000000 Z
11
+ date: 2022-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -451,7 +451,7 @@ homepage: https://github.com/qadron/cuboid
451
451
  licenses:
452
452
  - MIT
453
453
  metadata: {}
454
- post_install_message:
454
+ post_install_message:
455
455
  rdoc_options:
456
456
  - "--charset=UTF-8"
457
457
  require_paths:
@@ -468,102 +468,102 @@ required_rubygems_version: !ruby/object:Gem::Requirement
468
468
  version: '0'
469
469
  requirements: []
470
470
  rubygems_version: 3.1.6
471
- signing_key:
471
+ signing_key:
472
472
  specification_version: 4
473
473
  summary: An application-centric, decentralised and distributed computing solution.
474
474
  test_files:
475
- - spec/support/shared/application.rb
476
- - spec/support/shared/support/cache.rb
477
- - spec/support/shared/support/filter.rb
478
- - spec/support/shared/component/options/base.rb
479
- - spec/support/shared/component.rb
480
- - spec/support/shared/option_group.rb
481
- - spec/support/shared/system/platforms/base.rb
482
- - spec/support/shared/system/platforms/mixins/unix.rb
483
- - spec/support/lib/web_server_manager.rb
484
- - spec/support/lib/web_server_dispatcher.rb
485
- - spec/support/lib/factory.rb
486
- - spec/support/lib/web_server_client.rb
487
- - spec/support/pems/cacert.pem
488
- - spec/support/pems/server/cert.pem
489
- - spec/support/pems/server/key.pem
490
- - spec/support/pems/client/foo-cert.pem
491
- - spec/support/pems/client/cert.pem
492
- - spec/support/pems/client/foo-key.pem
493
- - spec/support/pems/client/key.pem
494
- - spec/support/factories/scan_report.rb
495
- - spec/support/factories/placeholder
496
- - spec/support/fixtures/mock_app.rb
497
- - spec/support/fixtures/mock_app/test_service.rb
498
- - spec/support/fixtures/empty/placeholder
499
- - spec/support/fixtures/executables/node.rb
500
- - spec/support/fixtures/services/echo.rb
501
- - spec/support/reports/placeholder
502
- - spec/support/logs/placeholder
503
- - spec/support/helpers/matchers.rb
504
- - spec/support/helpers/framework.rb
505
- - spec/support/helpers/paths.rb
506
- - spec/support/helpers/requires.rb
507
- - spec/support/helpers/resets.rb
508
- - spec/support/helpers/request_helpers.rb
509
- - spec/support/helpers/misc.rb
510
- - spec/support/helpers/web_server.rb
511
- - spec/support/snapshots/placeholder
512
475
  - spec/spec_helper.rb
513
- - spec/cuboid/data/application_spec.rb
514
476
  - spec/cuboid/error_spec.rb
515
- - spec/cuboid/option_groups/snapshot_spec.rb
516
- - spec/cuboid/option_groups/report_spec.rb
517
- - spec/cuboid/option_groups/datastore_spec.rb
518
- - spec/cuboid/option_groups/output_spec.rb
519
- - spec/cuboid/option_groups/paths_spec.rb
520
- - spec/cuboid/option_groups/rpc_spec.rb
521
- - spec/cuboid/option_groups/dispatcher_spec.rb
522
- - spec/cuboid/option_groups/system.rb
477
+ - spec/cuboid/report_spec.rb
478
+ - spec/cuboid/system_spec.rb
479
+ - spec/cuboid/snapshot_spec.rb
480
+ - spec/cuboid/options_spec.rb
523
481
  - spec/cuboid/state_spec.rb
524
- - spec/cuboid/support/database/categorized_queue_spec.rb
482
+ - spec/cuboid/state/options_spec.rb
483
+ - spec/cuboid/state/application_spec.rb
484
+ - spec/cuboid/data_spec.rb
485
+ - spec/cuboid/utilities_spec.rb
486
+ - spec/cuboid/system/platforms/linux_spec.rb
487
+ - spec/cuboid/system/platforms/windows_spec.rb
488
+ - spec/cuboid/system/platforms/osx_spec.rb
489
+ - spec/cuboid/system/slots_spec.rb
525
490
  - spec/cuboid/support/database/hash_spec.rb
491
+ - spec/cuboid/support/database/categorized_queue_spec.rb
526
492
  - spec/cuboid/support/database/scheduler_spec.rb
493
+ - spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
494
+ - spec/cuboid/support/cache/least_cost_replacement_spec.rb
527
495
  - spec/cuboid/support/cache/least_recently_pushed_spec.rb
528
496
  - spec/cuboid/support/cache/preference_spec.rb
529
497
  - spec/cuboid/support/cache/least_recently_used_spec.rb
530
498
  - spec/cuboid/support/cache/random_replacement_spec.rb
531
- - spec/cuboid/support/cache/least_cost_replacement_spec.rb
532
- - spec/cuboid/support/buffer/base_spec.rb
533
- - spec/cuboid/support/buffer/autoflush_spec.rb
534
499
  - spec/cuboid/support/mixins/observable_spec.rb
535
- - spec/cuboid/support/filter/set_spec.rb
536
500
  - spec/cuboid/support/glob_spec.rb
537
- - spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
538
- - spec/cuboid/application_spec.rb
501
+ - spec/cuboid/support/filter/set_spec.rb
502
+ - spec/cuboid/support/buffer/autoflush_spec.rb
503
+ - spec/cuboid/support/buffer/base_spec.rb
504
+ - spec/cuboid/application/runtime_spec.rb
505
+ - spec/cuboid/application/parts/report_spec.rb
539
506
  - spec/cuboid/application/parts/state_spec.rb
540
507
  - spec/cuboid/application/parts/data_spec.rb
541
- - spec/cuboid/application/parts/report_spec.rb
542
- - spec/cuboid/application/runtime_spec.rb
543
- - spec/cuboid/rpc/server/scheduler_spec.rb
544
- - spec/cuboid/rpc/server/active_options_spec.rb
545
508
  - spec/cuboid/rpc/server/output_spec.rb
546
- - spec/cuboid/rpc/server/base_spec.rb
547
- - spec/cuboid/rpc/server/agent_spec.rb
509
+ - spec/cuboid/rpc/server/active_options_spec.rb
548
510
  - spec/cuboid/rpc/server/instance_spec.rb
549
- - spec/cuboid/rpc/server/agent/service_spec.rb
511
+ - spec/cuboid/rpc/server/agent_spec.rb
550
512
  - spec/cuboid/rpc/server/agent/node_spec.rb
551
- - spec/cuboid/rpc/client/base_spec.rb
513
+ - spec/cuboid/rpc/server/agent/service_spec.rb
514
+ - spec/cuboid/rpc/server/scheduler_spec.rb
515
+ - spec/cuboid/rpc/server/base_spec.rb
552
516
  - spec/cuboid/rpc/client/instance_spec.rb
517
+ - spec/cuboid/rpc/client/base_spec.rb
553
518
  - spec/cuboid/rpc/client/dispatcher_spec.rb
554
- - spec/cuboid/options_spec.rb
555
- - spec/cuboid/data_spec.rb
556
- - spec/cuboid/snapshot_spec.rb
557
- - spec/cuboid/report_spec.rb
558
- - spec/cuboid/system_spec.rb
559
- - spec/cuboid/ruby/hash_spec.rb
519
+ - spec/cuboid/data/application_spec.rb
520
+ - spec/cuboid/application_spec.rb
560
521
  - spec/cuboid/ruby/object_spec.rb
561
522
  - spec/cuboid/ruby/array_spec.rb
562
- - spec/cuboid/state/application_spec.rb
563
- - spec/cuboid/state/options_spec.rb
564
- - spec/cuboid/system/slots_spec.rb
565
- - spec/cuboid/system/platforms/linux_spec.rb
566
- - spec/cuboid/system/platforms/osx_spec.rb
567
- - spec/cuboid/system/platforms/windows_spec.rb
523
+ - spec/cuboid/ruby/hash_spec.rb
568
524
  - spec/cuboid/rest/server_spec.rb
569
- - spec/cuboid/utilities_spec.rb
525
+ - spec/cuboid/option_groups/paths_spec.rb
526
+ - spec/cuboid/option_groups/output_spec.rb
527
+ - spec/cuboid/option_groups/report_spec.rb
528
+ - spec/cuboid/option_groups/snapshot_spec.rb
529
+ - spec/cuboid/option_groups/rpc_spec.rb
530
+ - spec/cuboid/option_groups/datastore_spec.rb
531
+ - spec/cuboid/option_groups/system.rb
532
+ - spec/cuboid/option_groups/dispatcher_spec.rb
533
+ - spec/support/snapshots/placeholder
534
+ - spec/support/shared/component.rb
535
+ - spec/support/shared/component/options/base.rb
536
+ - spec/support/shared/application.rb
537
+ - spec/support/shared/option_group.rb
538
+ - spec/support/shared/system/platforms/base.rb
539
+ - spec/support/shared/system/platforms/mixins/unix.rb
540
+ - spec/support/shared/support/filter.rb
541
+ - spec/support/shared/support/cache.rb
542
+ - spec/support/pems/server/key.pem
543
+ - spec/support/pems/server/cert.pem
544
+ - spec/support/pems/cacert.pem
545
+ - spec/support/pems/client/key.pem
546
+ - spec/support/pems/client/cert.pem
547
+ - spec/support/pems/client/foo-key.pem
548
+ - spec/support/pems/client/foo-cert.pem
549
+ - spec/support/logs/placeholder
550
+ - spec/support/factories/placeholder
551
+ - spec/support/factories/scan_report.rb
552
+ - spec/support/lib/web_server_client.rb
553
+ - spec/support/lib/web_server_dispatcher.rb
554
+ - spec/support/lib/factory.rb
555
+ - spec/support/lib/web_server_manager.rb
556
+ - spec/support/fixtures/mock_app/test_service.rb
557
+ - spec/support/fixtures/empty/placeholder
558
+ - spec/support/fixtures/executables/node.rb
559
+ - spec/support/fixtures/mock_app.rb
560
+ - spec/support/fixtures/services/echo.rb
561
+ - spec/support/helpers/matchers.rb
562
+ - spec/support/helpers/framework.rb
563
+ - spec/support/helpers/web_server.rb
564
+ - spec/support/helpers/request_helpers.rb
565
+ - spec/support/helpers/requires.rb
566
+ - spec/support/helpers/resets.rb
567
+ - spec/support/helpers/paths.rb
568
+ - spec/support/helpers/misc.rb
569
+ - spec/support/reports/placeholder