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

Add bindIP option to minio #32

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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="")
jfunstonRAI marked this conversation as resolved.
Show resolved Hide resolved
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
Loading