Skip to content

Commit

Permalink
make mem and cpu spec optional for yarn submit
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmaykm committed Jan 7, 2020
1 parent 880a14f commit 1c6ddc4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/api_yarn_appmaster.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ callback(yam::YarnAppMaster, on_container_alloc::Union{Nothing,Function}, on_con
function submit(client::YarnClient, unmanagedappmaster::YarnAppMaster)
@debug("submitting unmanaged application")
clc = launchcontext()
app = submit(client, clc, YARN_CONTAINER_MEM_DEFAULT, YARN_CONTAINER_CPU_DEFAULT; unmanaged=true)
app = submit(client, clc; unmanaged=true)

# keep the am_rm token
tok = am_rm_token(app)
Expand Down
6 changes: 3 additions & 3 deletions src/api_yarn_client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ function _new_app(client::YarnClient)
resp.application_id, resp.maximumCapability.memory, resp.maximumCapability.virtual_cores
end

function submit(client::YarnClient, cmd::Union{AbstractString,Vector}, mem::Integer=YARN_CONTAINER_MEM_DEFAULT, cores::Integer=YARN_CONTAINER_CPU_DEFAULT, env::Dict{String,String}=Dict{String,String}(); kwargs...)
function submit(client::YarnClient, cmd::Union{AbstractString,Vector}, env::Dict{String,String}=Dict{String,String}(); kwargs...)
container_spec = launchcontext(cmd=cmd, env=env)
submit(client, container_spec, mem, cores; kwargs...)
submit(client, container_spec; kwargs...)
end

function submit(client::YarnClient, container_spec::ContainerLaunchContextProto, mem::Integer=YARN_CONTAINER_MEM_DEFAULT, cores::Integer=YARN_CONTAINER_CPU_DEFAULT;
function submit(client::YarnClient, container_spec::ContainerLaunchContextProto; mem::Integer=YARN_CONTAINER_MEM_DEFAULT, cores::Integer=YARN_CONTAINER_CPU_DEFAULT,
priority::Int32=one(Int32), appname::AbstractString="EllyApp", queue::AbstractString="default", apptype::AbstractString="YARN",
reuse::Bool=false, unmanaged::Bool=false, schedaddr::String="")
@debug("submitting application", unmanaged=unmanaged, cmd=container_spec.command)
Expand Down
2 changes: 1 addition & 1 deletion test/yarntests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function test_managed_yarn_clustermanager(host="localhost", rmport=8032, schedpo
@info("starting managed julia with environment", env)

testscript = joinpath(@__DIR__, "yarnmanagedcm.jl")
app = submit(clnt, [Elly._currprocname(), testscript], Elly.YARN_CONTAINER_MEM_DEFAULT, Elly.YARN_CONTAINER_CPU_DEFAULT, env; schedaddr="$(host):$(schedport)")
app = submit(clnt, [Elly._currprocname(), testscript], env; schedaddr="$(host):$(schedport)")
Elly.wait_for_state(app, Elly.YarnApplicationStateProto.FINISHED)
@info("app complete", status=status(app))
@test isfile("/tmp/ellytest.log")
Expand Down

0 comments on commit 1c6ddc4

Please sign in to comment.