mobilize-ssh 1.25 → 1.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mobilize-ssh/handlers/ssh.rb +11 -6
- data/lib/mobilize-ssh/version.rb +1 -1
- data/mobilize-ssh.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f432114cc102b1402819a0d6641ca707d59c53c
|
4
|
+
data.tar.gz: 460bed02d0df8df2d0a45924dd3cd923c0faf80a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3666be3da31f2ce839cc8edefd9f2d76cd463211163530ba68fcab289219e09df63e18487c0f5a813e877cec7e38c016ad15f7484ad9d1aaa158c5fef6382ab0
|
7
|
+
data.tar.gz: 97374d509caf04c70bfe9ae003b3741856dd43dd1c6d356612ce9177279dd0f584d0a9f46027e2a05cd009225552ede5bc8fb0dcf6ceeffcab66b9b03f3b5000
|
@@ -58,7 +58,7 @@ module Mobilize
|
|
58
58
|
end
|
59
59
|
|
60
60
|
# converts a source path or target path to a dst in the context of handler and stage
|
61
|
-
def Ssh.path_to_dst(path,stage_path)
|
61
|
+
def Ssh.path_to_dst(path,stage_path,gdrive_slot)
|
62
62
|
has_handler = true if path.index("://")
|
63
63
|
red_path = path.split("://").last
|
64
64
|
#is user has a handler, their first path node is a node name,
|
@@ -69,7 +69,7 @@ module Mobilize
|
|
69
69
|
return Dataset.find_or_create_by_url(ssh_url)
|
70
70
|
end
|
71
71
|
#otherwise, use Gsheet
|
72
|
-
return Gsheet.path_to_dst(red_path,stage_path)
|
72
|
+
return Gsheet.path_to_dst(red_path,stage_path,gdrive_slot)
|
73
73
|
end
|
74
74
|
|
75
75
|
def Ssh.url_by_path(path,user_name)
|
@@ -218,12 +218,12 @@ module Mobilize
|
|
218
218
|
return user_name
|
219
219
|
end
|
220
220
|
|
221
|
-
def Ssh.file_hash_by_stage_path(stage_path)
|
221
|
+
def Ssh.file_hash_by_stage_path(stage_path,gdrive_slot)
|
222
222
|
file_hash = {}
|
223
223
|
s = Stage.where(:path=>stage_path).first
|
224
224
|
u = s.job.runner.user
|
225
225
|
user_name = Ssh.user_name_by_stage_path(stage_path)
|
226
|
-
s.sources.each do |sdst|
|
226
|
+
s.sources(gdrive_slot).each do |sdst|
|
227
227
|
split_path = sdst.path.split("/")
|
228
228
|
#if path is to stage output, name with stage name
|
229
229
|
file_name = if split_path.last == "out" and
|
@@ -234,7 +234,8 @@ module Mobilize
|
|
234
234
|
end
|
235
235
|
if ["gsheet","gfile"].include?(sdst.handler)
|
236
236
|
#google drive sources are always read as the user
|
237
|
-
|
237
|
+
#with the apportioned slot
|
238
|
+
file_hash[file_name] = sdst.read(u.name,gdrive_slot)
|
238
239
|
else
|
239
240
|
#other sources should be read by su-user
|
240
241
|
file_hash[file_name] = sdst.read(user_name)
|
@@ -244,12 +245,16 @@ module Mobilize
|
|
244
245
|
end
|
245
246
|
|
246
247
|
def Ssh.run_by_stage_path(stage_path)
|
248
|
+
gdrive_slot = Gdrive.slot_worker_by_path(stage_path)
|
249
|
+
#return blank response if there are no slots available
|
250
|
+
return nil unless gdrive_slot
|
247
251
|
s = Stage.where(:path=>stage_path).first
|
248
252
|
params = s.params
|
249
253
|
node, command = [params['node'],params['cmd']]
|
250
254
|
node ||= Ssh.default_node
|
251
255
|
user_name = Ssh.user_name_by_stage_path(stage_path)
|
252
|
-
file_hash = Ssh.file_hash_by_stage_path(stage_path)
|
256
|
+
file_hash = Ssh.file_hash_by_stage_path(stage_path,gdrive_slot)
|
257
|
+
Gdrive.unslot_worker_by_path(stage_path)
|
253
258
|
result = Ssh.run(node,command,user_name,file_hash)
|
254
259
|
#use Gridfs to cache result
|
255
260
|
response = {}
|
data/lib/mobilize-ssh/version.rb
CHANGED
data/mobilize-ssh.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
|
-
gem.add_runtime_dependency "mobilize-base","1.
|
19
|
+
gem.add_runtime_dependency "mobilize-base","1.26"
|
20
20
|
gem.add_runtime_dependency "net-ssh"
|
21
21
|
gem.add_runtime_dependency "net-scp"
|
22
22
|
gem.add_runtime_dependency "net-ssh-gateway"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobilize-ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.26'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cassio Paes-Leme
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mobilize-base
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.26'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.26'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: net-ssh
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|