Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wreck: use cmb.exec instead of direct fork/exec for wrexecd execution in job module #1508

Merged
merged 9 commits into from May 8, 2018
9 changes: 8 additions & 1 deletion src/bindings/lua/wreck.lua
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
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