Skip to content

Commit fac1994

Browse files
committed
Revert "Revert "simplify run_interactive, pipeline can now accept an IOBuffer" (#199)"
This reverts commit 769d8e2.
1 parent e93a4fe commit fac1994

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

src/DockerRunner.jl

+1-15
Original file line numberDiff line numberDiff line change
@@ -212,21 +212,7 @@ function run_interactive(dr::DockerRunner, cmd::Cmd; stdin = nothing, stdout = n
212212

213213
try
214214
mount_shards(dr; verbose=verbose)
215-
if stdout isa IOBuffer
216-
if !(stdin isa IOBuffer)
217-
stdin = devnull
218-
end
219-
process = open(docker_cmd, "r", stdin)
220-
@async begin
221-
while !eof(process)
222-
write(stdout, read(process))
223-
end
224-
end
225-
wait(process)
226-
return success(process)
227-
else
228-
return success(run(docker_cmd))
229-
end
215+
return success(run(docker_cmd))
230216
finally
231217
unmount_shards(dr; verbose=verbose)
232218
# Cleanup permissions, if we need to.

src/UserNSRunner.jl

+2-16
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function UserNSRunner(workspace_root::String;
6262
sandbox_cmd = `$sandbox_cmd --verbose`
6363
end
6464
sandbox_cmd = `$sandbox_cmd --rootfs $(mpath)`
65-
if cwd != nothing
65+
if cwd !== nothing
6666
sandbox_cmd = `$sandbox_cmd --cd $cwd`
6767
end
6868

@@ -203,21 +203,7 @@ function run_interactive(ur::UserNSRunner, user_cmd::Cmd; stdin = nothing, stdou
203203

204204
try
205205
mount_shards(ur; verbose=verbose)
206-
if stdout isa IOBuffer
207-
if !(stdin isa IOBuffer)
208-
stdin = devnull
209-
end
210-
process = open(cmd, "r", stdin)
211-
@async begin
212-
while !eof(process)
213-
write(stdout, read(process))
214-
end
215-
end
216-
wait(process)
217-
return success(process)
218-
else
219-
return success(run(cmd))
220-
end
206+
return success(run(cmd))
221207
finally
222208
unmount_shards(ur)
223209
end

0 commit comments

Comments
 (0)