vizir 0.2.2 → 0.2.3
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.
- data/VERSION +1 -1
- data/bin/vizir +22 -14
- data/vizir.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/bin/vizir
CHANGED
@@ -9,13 +9,8 @@ require 'optparse'
|
|
9
9
|
require 'rest_client'
|
10
10
|
require 'vizir'
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
def usage
|
16
|
-
puts 'usage: vizir [ -h | --help ] [ -l | --login login_name ]'
|
17
|
-
exit 1
|
18
|
-
end
|
12
|
+
$alert_period = 60
|
13
|
+
$refresh_period = 3600
|
19
14
|
|
20
15
|
def setup_ssh_tunnel
|
21
16
|
gateway = Net::SSH::Gateway.new('access.grenoble.grid5000.fr', $login)
|
@@ -37,13 +32,26 @@ def notify_via_growl(jobid, site_name, time, time_unit)
|
|
37
32
|
end
|
38
33
|
|
39
34
|
$login = nil
|
40
|
-
|
41
|
-
opts
|
42
|
-
opts.
|
43
|
-
opts.
|
35
|
+
|
36
|
+
opts = OptionParser.new do |opts|
|
37
|
+
opts.banner = "Usage: vizir [options]"
|
38
|
+
opts.separator("")
|
39
|
+
|
40
|
+
opts.separator("Options:")
|
41
|
+
opts.on('-a', '--alert-period TIME', Integer, "Job alert period (seconds), default: #{$alert_period}") { |t| $alert_period = t }
|
42
|
+
opts.on('-h', '--help', 'Print help') do
|
43
|
+
puts opts
|
44
|
+
exit
|
45
|
+
end
|
46
|
+
opts.on('-l', '--login LOGIN', String, "User login on Grid\'5000") { |str| $login = str }
|
47
|
+
opts.on('-m', '--min-job-time TIME', Integer, "Minimum job time (seconds), default: #{$refresh_period}") { |t| $refresh_period = t }
|
48
|
+
end
|
49
|
+
|
50
|
+
opts.parse!(ARGV)
|
44
51
|
|
45
52
|
if $login == nil
|
46
|
-
|
53
|
+
puts opts
|
54
|
+
exit
|
47
55
|
end
|
48
56
|
|
49
57
|
gateway, port = setup_ssh_tunnel
|
@@ -59,8 +67,8 @@ Vizir.learn_new_jobs(api)
|
|
59
67
|
Vizir.alert_jobs(api)
|
60
68
|
|
61
69
|
EventMachine::run {
|
62
|
-
EventMachine::PeriodicTimer.new(
|
63
|
-
EventMachine::PeriodicTimer.new(
|
70
|
+
EventMachine::PeriodicTimer.new($refresh_period) { Vizir.learn_new_jobs(api) }
|
71
|
+
EventMachine::PeriodicTimer.new($alert_period) { Vizir.alert_jobs(api) }
|
64
72
|
}
|
65
73
|
|
66
74
|
gateway.shutdown!
|
data/vizir.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{vizir}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Pierre Riteau"]
|
9
|
-
s.date = %q{2009-06-
|
9
|
+
s.date = %q{2009-06-19}
|
10
10
|
s.default_executable = %q{vizir}
|
11
11
|
s.email = %q{pierre.riteau@gmail.com}
|
12
12
|
s.executables = ["vizir"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vizir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Riteau
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-19 00:00:00 +02:00
|
13
13
|
default_executable: vizir
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|