Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/DockerRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,21 @@ function run_interactive(dr::DockerRunner, cmd::Cmd; stdin = nothing, stdout = n

try
mount_shards(dr; verbose=verbose)
return success(run(docker_cmd))
if stdout isa IOBuffer
if !(stdin isa IOBuffer)
stdin = devnull
end
process = open(docker_cmd, "r", stdin)
@async begin
while !eof(process)
write(stdout, read(process))
end
end
wait(process)
return success(process)
else
return success(run(docker_cmd))
end
finally
unmount_shards(dr; verbose=verbose)
# Cleanup permissions, if we need to.
Expand Down
18 changes: 16 additions & 2 deletions src/UserNSRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function UserNSRunner(workspace_root::String;
sandbox_cmd = `$sandbox_cmd --verbose`
end
sandbox_cmd = `$sandbox_cmd --rootfs $(mpath)`
if cwd !== nothing
if cwd != nothing
sandbox_cmd = `$sandbox_cmd --cd $cwd`
end

Expand Down Expand Up @@ -204,7 +204,21 @@ function run_interactive(ur::UserNSRunner, user_cmd::Cmd; stdin = nothing, stdou

try
mount_shards(ur; verbose=verbose)
return success(run(cmd))
if stdout isa IOBuffer
if !(stdin isa IOBuffer)
stdin = devnull
end
process = open(cmd, "r", stdin)
@async begin
while !eof(process)
write(stdout, read(process))
end
end
wait(process)
return success(process)
else
return success(run(cmd))
end
finally
unmount_shards(ur)
end
Expand Down