Skip to content

Commit

Permalink
Add bindIP option to minio (#32)
Browse files Browse the repository at this point in the history
* Add bindIP option to minio

* Make 127.0.0.1 the default bindIP for minio
  • Loading branch information
jfunstonRAI authored Oct 2, 2023
1 parent 8d0e21f commit 715e687
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/CloudTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ publicPolicy(bucket) = """
# use `with`, not `run`! if you `run`, it returns `conf, p`, where `p` is the server process
# note that existing the Julia process *will not* stop the server process, which can easily
# lead to "dangling" server processes. You can `kill(p)` to stop the server process manually
function run(; dir=nothing, bucket=nothing, public=false, startupDelay=0.25, debug=false)
function run(; dir=nothing, bucket=nothing, public=false, startupDelay=0.25, debug=false, bindIP="127.0.0.1")
if dir === nothing
dir = mktempdir()
elseif !isdir(dir)
throw(ArgumentError("provided minio directory `$dir` doesn't exist; can't run minio server"))
end
p, port = findOpenPorts(2) do ports
port, cport = ports
cmd = _cmd(`$(minio_jll.minio()) server $dir --address :$(port) --console-address :$(cport)`)
cmd = _cmd(`$(minio_jll.minio()) server $dir --address $(bindIP):$(port) --console-address $(bindIP):$(cport)`)
p = debug ? Base.run(cmd, devnull, stderr, stderr; wait=false) : Base.run(cmd; wait=false)
sleep(startupDelay) # sleep just a little for server startup
return p, port
Expand Down
8 changes: 4 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ end

@time @testset "AWS" begin
config = Ref{Any}()
Minio.with(startupDelay=3) do conf
Minio.with(bindIP="127.0.0.1", startupDelay=3) do conf
config[] = conf
credentials, bucket = conf
csv = "a,b,c\n1,2,3\n4,5,$(rand())"
Expand All @@ -48,7 +48,7 @@ end
@test !isdir(config[].dir)
@test success(config[].process)
# test public access
Minio.with(startupDelay=3, public=true) do conf
Minio.with(bindIP="127.0.0.1", startupDelay=3, public=true) do conf
credentials, bucket = conf
csv = "a,b,c\n1,2,3\n4,5,$(rand())"
AWS.put("$(bucket.baseurl)test.csv", [], csv; service="s3")
Expand Down Expand Up @@ -116,7 +116,7 @@ end
mconfigs = Vector{Any}(undef, 10)
aconfigs = Vector{Any}(undef, 10)
@sync for i = 1:10
@async Minio.with(startupDelay=3) do conf
@async Minio.with(bindIP="127.0.0.1", startupDelay=3) do conf
mconfigs[i] = conf
credentials, bucket = conf
csv = "a,b,c\n1,2,3\n4,5,$(rand())"
Expand Down Expand Up @@ -211,7 +211,7 @@ end

# metrics hooks
@time @testset "Cloud metrics hooks" begin
Minio.with(startupDelay=3) do conf
Minio.with(bindIP="127.0.0.1", startupDelay=3) do conf
credentials, bucket = conf
prereq_ref = Ref(0)
metrics_ref = Ref{Any}()
Expand Down

0 comments on commit 715e687

Please sign in to comment.