Skip to content

Commit

Permalink
Merge pull request #1508 from grondo/wreck-cmb.exec
Browse files Browse the repository at this point in the history
wreck: use cmb.exec instead of direct fork/exec for wrexecd execution in job module
  • Loading branch information
garlick authored May 8, 2018
2 parents 6939f86 + 19dd1d2 commit dc91642
Show file tree
Hide file tree
Showing 7 changed files with 261 additions and 172 deletions.
9 changes: 8 additions & 1 deletion src/bindings/lua/wreck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,21 @@ local function get_job_env (arg)
return (env)
end

local function array_tonumber (t)
for i = 1, #t do
t[i] = tonumber (t[i])
end
return t
end


local function job_kvspath (f, id)
assert (id, "Required argument id missing!")
local arg = { id }
if type (id) == "table" then
arg = id
end
local r, err = f:rpc ("job.kvspath", {ids = arg })
local r, err = f:rpc ("job.kvspath", {ids = array_tonumber (arg) })
if not r then error (err) end
if type (id) == "table" then return r.paths end
return r.paths [1]
Expand Down
5 changes: 3 additions & 2 deletions src/bindings/lua/wreck/io.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ function ioplex.create (arg)
files = {}
}
if not io.kvspath then
local r, err = io.flux:rpc ("job.kvspath", { ids = { io.id }})
local wreck = require 'wreck'
local r, err = wreck.id_to_path { flux = io.flux, jobid = io.id }
if not r then error (err) end
io.kvspath = r.paths [1]
io.kvspath = r
end
setmetatable (io, ioplex)
return io
Expand Down
Loading

0 comments on commit dc91642

Please sign in to comment.