workflow_manager 0.1.0 → 0.1.1

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/bin/wfm_kill_job ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+ # 20121112 masa workflow manager client
4
+ Version = '20140516-161420'
5
+
6
+ require 'drb/drb'
7
+ require 'workflow_manager/optparse_ex'
8
+ require 'pstore'
9
+
10
+ opt = OptionParser.new do |o|
11
+ o.banner = "Usage:\n #{File.basename(__FILE__)} [options]"
12
+ # o.on(:user, 'sushi lover', '-u user', '--user', 'who submitted?')
13
+ o.on(:job_id, nil, '-i job_id', '--job_id', 'Job ID')
14
+ o.on(:server, 'druby://localhost:12345', '-d server', '--server', 'workflow manager URI (default: druby://localhost:12345)')
15
+ o.parse!(ARGV)
16
+ end
17
+
18
+ uri = opt.server||'druby://localhost:12345'
19
+ unless job_id = opt.job_id
20
+ print opt.help
21
+ exit
22
+ end
23
+
24
+ workflow_manager = DRbObject.new_with_uri(uri)
25
+ puts workflow_manager.kill_job(job_id)
@@ -28,6 +28,8 @@ module WorkflowManager
28
28
  end
29
29
  def copy_commands(org_dir, dest_parent_dir)
30
30
  end
31
+ def kill_command(job_id)
32
+ end
31
33
  end
32
34
 
33
35
  class LocalComputer < Cluster
@@ -69,6 +71,9 @@ module WorkflowManager
69
71
  commands << "cp -r #{org_dir} #{dest_parent_dir}"
70
72
  commands
71
73
  end
74
+ def kill_command(job_id)
75
+ command = "kill #{job_id}"
76
+ end
72
77
  end
73
78
 
74
79
  class FGCZCluster < Cluster
@@ -111,5 +116,8 @@ module WorkflowManager
111
116
  def copy_commands(org_dir, dest_parent_dir)
112
117
  commands = ["g-req -w copy #{org_dir} #{dest_parent_dir}"]
113
118
  end
119
+ def kill_command(job_id)
120
+ command = "qdel #{job_id}"
121
+ end
114
122
  end
115
123
  end
@@ -110,6 +110,10 @@ module WorkflowManager
110
110
  def copy_commands(org_dir, dest_parent_dir)
111
111
  @cluster.copy_commands(org_dir, dest_parent_dir)
112
112
  end
113
+ def kill_job(job_id)
114
+ status(job_id, 'fail')
115
+ status = `#{@cluster.kill_command(job_id)}`
116
+ end
113
117
  def log_puts(str)
114
118
  time = Time.now.strftime("[%Y.%m.%d %H:%M:%S]")
115
119
  @mutex.synchronize do
@@ -1,3 +1,3 @@
1
1
  module WorkflowManager
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workflow_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-31 00:00:00.000000000 Z
12
+ date: 2014-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -51,6 +51,7 @@ executables:
51
51
  - wfm_get_script
52
52
  - wfm_hello
53
53
  - wfm_job_list
54
+ - wfm_kill_job
54
55
  - wfm_monitoring
55
56
  - wfm_status
56
57
  - workflow_manager
@@ -66,6 +67,7 @@ files:
66
67
  - bin/wfm_get_script
67
68
  - bin/wfm_hello
68
69
  - bin/wfm_job_list
70
+ - bin/wfm_kill_job
69
71
  - bin/wfm_monitoring
70
72
  - bin/wfm_status
71
73
  - bin/workflow_manager