peplum 0.2.5 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/peplum/application.rb +10 -6
- data/lib/peplum/version.rb +1 -1
- data/peplum.gemspec +2 -2
- metadata +3 -4
- data/lib/peplum/application/peers.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c2c58c0b4f8d82bb6376ca24b17b1b07585630e257f0c38717d19a02a71ce76
|
4
|
+
data.tar.gz: 235f665ccb1f8c49d6a991166a55f5871556a483c3b57937d89427cf5694a2f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6625f8916a0cfb646972c700d1f68cd7d97ba5fbc23f9637896190fffdce28f64c2878e2cc0c811ba37702fab63fe1fa65f0e8561203cbad420177e293e82a7c
|
7
|
+
data.tar.gz: 22cf60063e6040de45ba80c3fb5cfa1930898bcd46615b6ce80bf67baa12d4b9eb30ca9d8e79c3cbdc6b635600fb29e14eadac9940cb00a144ac0c6b7cf71f22
|
data/lib/peplum/application.rb
CHANGED
@@ -5,8 +5,6 @@ require 'peplum/core_ext/array'
|
|
5
5
|
|
6
6
|
module Peplum
|
7
7
|
class Application < Cuboid::Application
|
8
|
-
require 'peplum/application/peers'
|
9
|
-
|
10
8
|
require 'peplum/application/services/shared_hash'
|
11
9
|
require 'peplum/application/services/scheduler'
|
12
10
|
|
@@ -27,11 +25,12 @@ module Peplum
|
|
27
25
|
end
|
28
26
|
|
29
27
|
attr_reader :peers
|
28
|
+
attr_reader :master
|
30
29
|
|
31
30
|
def initialize(*)
|
32
31
|
super
|
33
32
|
|
34
|
-
@peers = Peers.new
|
33
|
+
@peers = Cuboid::RPC::Server::Instance::Peers.new
|
35
34
|
end
|
36
35
|
|
37
36
|
def run
|
@@ -53,6 +52,11 @@ module Peplum
|
|
53
52
|
end
|
54
53
|
end
|
55
54
|
|
55
|
+
def worker?
|
56
|
+
# Has a master?
|
57
|
+
!!@master
|
58
|
+
end
|
59
|
+
|
56
60
|
# Implements:
|
57
61
|
# * `.run` -- Worker; executes its payload against `objects`.
|
58
62
|
# * `.group` -- Splits given `objects` into groups for each worker.
|
@@ -73,13 +77,13 @@ module Peplum
|
|
73
77
|
|
74
78
|
def execute( peplum_options, payload_options )
|
75
79
|
master_info = peplum_options.delete( 'master' )
|
80
|
+
@master = Processes::Instances.connect( master_info['url'], master_info['token'] )
|
76
81
|
|
77
82
|
self.peers.set( peplum_options.delete( 'peers' ) || {} )
|
78
83
|
|
79
84
|
report_data = payload.run( peplum_options['objects'], payload_options )
|
80
85
|
|
81
|
-
master
|
82
|
-
master.scheduler.report report_data, Cuboid::Options.rpc.url
|
86
|
+
@master.scheduler.report report_data, Cuboid::Options.rpc.url
|
83
87
|
end
|
84
88
|
|
85
89
|
def schedule( peplum_options, payload_options )
|
@@ -121,7 +125,7 @@ module Peplum
|
|
121
125
|
objects: groups.pop,
|
122
126
|
peers: peers,
|
123
127
|
master: {
|
124
|
-
url:
|
128
|
+
url: Cuboid::Options.rpc.url,
|
125
129
|
token: Cuboid::Options.datastore.token
|
126
130
|
}
|
127
131
|
},
|
data/lib/peplum/version.rb
CHANGED
data/peplum.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Tasos Laskos"]
|
9
9
|
spec.email = ["tasos.laskos@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary = "Distributed computing made easy."
|
12
|
-
spec.description = "Distributed computing made easy."
|
11
|
+
spec.summary = "Distributed parallel computing made easy."
|
12
|
+
spec.description = "Distributed parallel computing made easy."
|
13
13
|
spec.homepage = "http://ecsypno.com/"
|
14
14
|
spec.required_ruby_version = ">= 2.6.0"
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peplum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tasos Laskos
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description: Distributed computing made easy.
|
27
|
+
description: Distributed parallel computing made easy.
|
28
28
|
email:
|
29
29
|
- tasos.laskos@gmail.com
|
30
30
|
executables: []
|
@@ -34,7 +34,6 @@ files:
|
|
34
34
|
- bin/.gitkeep
|
35
35
|
- lib/peplum.rb
|
36
36
|
- lib/peplum/application.rb
|
37
|
-
- lib/peplum/application/peers.rb
|
38
37
|
- lib/peplum/application/services/scheduler.rb
|
39
38
|
- lib/peplum/application/services/shared_hash.rb
|
40
39
|
- lib/peplum/core_ext/array.rb
|
@@ -61,5 +60,5 @@ requirements: []
|
|
61
60
|
rubygems_version: 3.4.13
|
62
61
|
signing_key:
|
63
62
|
specification_version: 4
|
64
|
-
summary: Distributed computing made easy.
|
63
|
+
summary: Distributed parallel computing made easy.
|
65
64
|
test_files: []
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Peplum
|
2
|
-
class Application
|
3
|
-
|
4
|
-
class Peers
|
5
|
-
include Enumerable
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
@peers = {}
|
9
|
-
end
|
10
|
-
|
11
|
-
def set( peer_info )
|
12
|
-
peer_info.each do |url, token|
|
13
|
-
next if url == self.self_url
|
14
|
-
@peers[url] = Peplum::Application.connect( url: url, token: token )
|
15
|
-
end
|
16
|
-
|
17
|
-
nil
|
18
|
-
end
|
19
|
-
|
20
|
-
def each( &block )
|
21
|
-
@peers.each do |_, client|
|
22
|
-
block.call client
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def self_url
|
27
|
-
Cuboid::Options.rpc.url
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|