workflow_manager 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88f95f40f936353afb33946a4b539d5a764deae5
4
- data.tar.gz: dd04c1f835a75333a115cfd1d37695586ed88a26
3
+ metadata.gz: 40c628f6e8ccbe527f259dbe9fc95170ad8e158a
4
+ data.tar.gz: e223d03706824b259f4bd796bfa3f1bda8776a67
5
5
  SHA512:
6
- metadata.gz: d43a9d5f7d4856a2f4d91510941a723e60073eaa6b5735e351e38d297eb6d1380faa5205cb4acd3003c2297b206e87b6a13df9566d72fab62259c30b2d28d7c5
7
- data.tar.gz: e08720305b65b8bef18f73310fc51467f9aadea21d09a5766b4c58f2d8e13222bc9dc042ea7ff4cf7c685687510a838e3de30abc7edcf07deaf7970f3fd0d230
6
+ metadata.gz: 5e5d93487e964a7d5dc3a5edc08b052d2b4b682f296004345fc298969a6ecd138a91524960b2d3519712e41ed62cc2a113d21d5a3159ca30cfe79961dbc24d66
7
+ data.tar.gz: 48bf35a8ac1a56c8e506156fba74b43fdaae93bfa6ed7c3109b3eaa143ce9427051ead9b7004ead2bccc35aafbbf8c1cd93503e9e8c8cc07d652d0d6c0074a42
@@ -90,6 +90,42 @@ module WorkflowManager
90
90
  end
91
91
  end
92
92
 
93
+ class TaskSpooler < LocalComputer
94
+ def submit_job(script_file, script_content, option='')
95
+ if script_name = File.basename(script_file) and script_name =~ /\.sh$/
96
+ new_job_script = generate_new_job_script(script_name, script_content)
97
+ new_job_script_base = File.basename(new_job_script)
98
+ log_file = File.join(@log_dir, new_job_script_base + "_o.log")
99
+ err_file = File.join(@log_dir, new_job_script_base + "_e.log")
100
+ command = "tsp sh -c 'bash #{new_job_script} 1> #{log_file} 2> #{err_file}'"
101
+ pid = spawn(command)
102
+ Process.detach(pid)
103
+ [pid.to_s, log_file, command]
104
+ end
105
+ end
106
+ def job_running?(pid)
107
+ command = "tsp"
108
+ result = IO.popen(command) do |io|
109
+ flag = false
110
+ while line=io.gets
111
+ x = line.split
112
+ if x[0].to_i == pid.to_i
113
+ flag = true
114
+ break
115
+ end
116
+ end
117
+ flag
118
+ end
119
+ result
120
+ end
121
+ def kill_command(job_id)
122
+ command = "tsp -k #{job_id}"
123
+ end
124
+ def cluster_nodes
125
+ {"Local with TaskSpooler" => ""}
126
+ end
127
+ end
128
+
93
129
  class FGCZCluster < Cluster
94
130
  def submit_job(script_file, script_content, option='')
95
131
  if script_name = File.basename(script_file) and script_name =~ /\.sh/
@@ -1,3 +1,3 @@
1
1
  module WorkflowManager
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workflow_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Functional Genomics Center Zurich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-03 00:00:00.000000000 Z
11
+ date: 2019-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler