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 +4 -4
- data/lib/workflow_manager/cluster.rb +36 -0
- data/lib/workflow_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40c628f6e8ccbe527f259dbe9fc95170ad8e158a
|
4
|
+
data.tar.gz: e223d03706824b259f4bd796bfa3f1bda8776a67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
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.
|
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:
|
11
|
+
date: 2019-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|