coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
513 stars 88 forks source link

Issues running the latest versions of Python-MIP on AWS lambda functions #333

Closed jeroenmeijer92 closed 1 year ago

jeroenmeijer92 commented 1 year ago

Bug With the two latest versions of Python-MIP (1.14.0 and 1.15.0) I seem to have issues running on AWS lambda functions. When calling the lambda function, the issue that appears is the following:

import mip.cbc\n File \"/tmp/sls-py-req/mip/cbc.py\", line 603, in <module>\n Osi_getNumCols = cbclib.Osi_getNumCols\nNameError: name 'cbclib' is not defined\n"

This issue is also reported in other places, and, as far as I understand it, the proposed solution is to add the CBC binaries manually, as described here: https://python-mip.readthedocs.io/en/latest/install.html

This solved the aforementioned error. However, this seems to be resulting in much longer solving times (sometimes more than doubling). Is this a known or explainable issue? Are there alternatives for resolving the initial problem?

Important to mention is that the reason for wanting to upgrade from 1.13.0 to 1.15.0 is that when calling the solver multiple times in a row, the solver sometimes seems to get stuck in an infinite loop (reproducing the error doesn't seem to be easy, as it seems to be machine/OS-dependent). My guess was that that issue was solved in https://github.com/coin-or/Cbc/commit/e008a3644f0d31f312574f2c9e25fdc463c69255

Lambda function specifications:

Thanks in advance! Feel free to ask questions if anything is missing or unclear.