Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docker/dev/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,11 @@ axel --quiet --output /usr/local/bin/google_checks.xml \
axel --quiet --output /usr/local/bin/checkstyle-8.29-all.jar \
"$QINIU_BUCKET/checkstyle/checkstyle-8.29-all.jar" \
"https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.29/checkstyle-8.29-all.jar"

echo "Install BARON mathematical programming solver ..."
axel --quiet --output /tmp/baron-lin64.zip \
"https://minlp.com/downloads/xecs/baron/current/baron-lin64.zip"
unzip -qq /tmp/baron-lin64.zip -d /tmp/
mv /tmp/baron-lin64/baron /usr/bin
rm -rf /tmp/baron-lin64
rm -rf /tmp/baron-lin64.zip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also need to add to step image?

And, do I need to add baron into our github actions machines to fix the test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Added to step image.
  2. Yes, we should add BARON into our github actions machines.
10 changes: 9 additions & 1 deletion docker/step/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ RUN apt-get update && \
unzip -qq odpscmd_public.zip -d /install/local/odpscmd && \
rm -rf odpscmd_public.zip

RUN wget -q https://minlp.com/downloads/xecs/baron/current/baron-lin64.zip && \
unzip -qq baron-lin64.zip -d /install && \
mv /install/baron-lin64/baron /usr/bin && \
rm -rf /install/baron-lin64 && \
rm -rf baron-lin64.zip

ADD build/sqlflow_models-0.0.1-py3-none-any.whl /
RUN bash -c 'pip install --no-cache-dir --prefix=/install \
/sqlflow_models-0.0.1-py3-none-any.whl \
Expand All @@ -49,7 +55,9 @@ RUN bash -c 'pip install --no-cache-dir --prefix=/install \
seaborn==0.9.0 \
dill==0.3.0 \
sklearn2pmml==0.56.0 \
shap==0.30.1'
shap==0.30.1 \
PyUtilib==5.8.0 \
pyomo==5.6.9'

RUN py3clean /install /usr/lib/python3.6

Expand Down
2 changes: 1 addition & 1 deletion python/runtime/optimize/model_generation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def test_main(self):
constraints=constraints)
self.assertTrue(isinstance(model, pyomo_env.ConcreteModel))

result_x, result_y = solve_model(model, 'glpk')
result_x, result_y = solve_model(model, 'baron')
self.assertTrue(
np.array_equal(result_x, np.array([99, 1, 31, 59], dtype='int64')))
self.assertAlmostEqual(result_y, 2581.2)
Expand Down