Make package installable/testable on clean docker image

master
Alinson S. Xavier 2 years ago
parent eab4697b6b
commit b82a984ab1
Signed by: isoron
GPG Key ID: 0DA8E4B9E1109DCA

@ -0,0 +1,3 @@
install-test:
docker build -t miplearnjl-test -f test/docker/Dockerfile .
docker run --rm -it miplearnjl-test

@ -4,7 +4,6 @@ authors = ["Alinson S Xavier <git@axavier.org>"]
version = "0.3.0" version = "0.3.0"
[deps] [deps]
CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0"
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d" Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"

2
deps/build.jl vendored

@ -5,7 +5,7 @@ function install_miplearn()
Conda.update() Conda.update()
pip = joinpath(dirname(pyimport("sys").executable), "pip") pip = joinpath(dirname(pyimport("sys").executable), "pip")
isfile(pip) || error("$pip: invalid path") isfile(pip) || error("$pip: invalid path")
run(`$pip install miplearn==0.3.0.dev0`) run(`$pip install miplearn==0.3.0.dev1`)
end end
install_miplearn() install_miplearn()

@ -8,7 +8,7 @@ import ..to_str_array
include("tableau/structs.jl") include("tableau/structs.jl")
include("blackbox/cplex.jl") # include("blackbox/cplex.jl")
include("tableau/collect.jl") include("tableau/collect.jl")
include("tableau/gmi.jl") include("tableau/gmi.jl")
include("tableau/moi.jl") include("tableau/moi.jl")

@ -4,7 +4,6 @@ authors = ["Alinson S. Xavier <git@axavier.org>"]
version = "0.1.0" version = "0.1.0"
[deps] [deps]
CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0"
Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d" Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c" Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"

@ -0,0 +1,3 @@
FROM julia:1.9-buster
ADD . /app
CMD julia --project=/app/test /app/test/docker/run.jl

@ -0,0 +1,6 @@
using Pkg
Pkg.develop(path="/app")
Pkg.build("MIPLearn")
using MIPLearnT
runtests()

Binary file not shown.

@ -3,7 +3,7 @@
# Released under the modified BSD license. See COPYING.md for more details. # Released under the modified BSD license. See COPYING.md for more details.
using Clp using Clp
using CPLEX # using CPLEX
using HiGHS using HiGHS
using JuMP using JuMP
using Test using Test
@ -130,5 +130,5 @@ end
function test_bb() function test_bb()
@time bb_run("Clp", optimizer_with_attributes(Clp.Optimizer)) @time bb_run("Clp", optimizer_with_attributes(Clp.Optimizer))
@time bb_run("HiGHS", optimizer_with_attributes(HiGHS.Optimizer)) @time bb_run("HiGHS", optimizer_with_attributes(HiGHS.Optimizer))
@time bb_run("CPLEX", optimizer_with_attributes(CPLEX.Optimizer, "CPXPARAM_Threads" => 1)) # @time bb_run("CPLEX", optimizer_with_attributes(CPLEX.Optimizer, "CPXPARAM_Threads" => 1))
end end

@ -27,7 +27,7 @@ function runtests()
@testset "BB" begin @testset "BB" begin
test_bb() test_bb()
end end
test_cuts_blackbox_cplex() # test_cuts_blackbox_cplex()
test_io() test_io()
test_problems_setcover() test_problems_setcover()
test_solvers_jump() test_solvers_jump()

@ -6,10 +6,10 @@ function test_usage()
LogisticRegression = pyimport("sklearn.linear_model").LogisticRegression LogisticRegression = pyimport("sklearn.linear_model").LogisticRegression
@debug "Generating data files..." @debug "Generating data files..."
dirname = tempdir() dirname = mktempdir()
data = [fixture_setcover_data()] data = [fixture_setcover_data()]
data_filenames = write_pkl_gz(data, dirname) data_filenames = write_pkl_gz(data, dirname)
h5_filenames = ["$(f).h5" for f in data_filenames] h5_filenames = [replace(f, ".pkl.gz" => ".h5") for f in data_filenames]
@debug "Setting up LearningSolver..." @debug "Setting up LearningSolver..."
solver = LearningSolver( solver = LearningSolver(

Loading…
Cancel
Save