From d84b74a8a749729f8eceddee75ee534b1a931766 Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Thu, 8 Sep 2022 11:35:11 -0500 Subject: [PATCH] relog-web: Make time limit configurable --- Dockerfile | 4 +++- Makefile | 11 ++++++++++- src/web/run.jl | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 58f438e..0f377c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM julia:1.7-buster +ENV RELOG_TIME_LIMIT_SEC=3600 + # Install Node.js & zip RUN apt-get update -yq && \ apt-get -yq install curl gnupg ca-certificates && \ @@ -24,4 +26,4 @@ RUN julia --project=/app -e 'using Pkg; Pkg.precompile()' RUN cd /app/relog-web && npm run build WORKDIR /app -CMD julia --project=/app -e 'import RELOG; RELOG.web("0.0.0.0")' \ No newline at end of file +CMD julia --project=/app -e 'import RELOG; RELOG.web("0.0.0.0")' diff --git a/Makefile b/Makefile index 6a381aa..96072d9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ VERSION := 0.5 +PKG := ghcr.io/anl-ceeesa/relog-web clean: rm -rfv build Manifest.toml test/Manifest.toml deps/formatter/build deps/formatter/Manifest.toml @@ -8,7 +9,15 @@ docs: rsync -avP --delete-after docs/build/ ../docs/$(VERSION)/ docker-build: - docker build --tag relog-web:$(VERSION) . + docker build --tag $(PKG):$(VERSION) . + docker build --tag $(PKG):latest . + +docker-push: + docker push $(PKG):$(VERSION) + docker push $(PKG):latest + +docker-run: + docker run -it --rm --name relog --volume $(PWD)/jobs:/app/jobs --publish 8000:8080 $(PKG):$(VERSION) format: cd deps/formatter; ../../juliaw format.jl diff --git a/src/web/run.jl b/src/web/run.jl index cd1a23e..0666b12 100644 --- a/src/web/run.jl +++ b/src/web/run.jl @@ -11,7 +11,7 @@ function solve(root, filename) ref_file = "$root/$filename" optimizer = optimizer_with_attributes( Cbc.Optimizer, - "seconds" => 900, + "seconds" => parse(Int, ENV["RELOG_TIME_LIMIT_SEC"]), ) ref_solution, ref_model = RELOG.solve( ref_file,