StatCan / aaw-contrib-containers

Containers to be used for general purpose Data Science
Other
3 stars 14 forks source link

request(image): add support for Pyomo along with Couenne and Bonmin optimizers #86

Open bryanpaget opened 2 years ago

bryanpaget commented 2 years ago

Description of Request

I'd like to make a request (on behalf of an AAW client) for a custom image for Pyomo which is a mathematical optimization package for Python. I've made this request because it is difficult to install some of the custom optimization algorithms (Couenne and Bonmin in particular). More information about these optimizers can be found here: COIN-OR.

Pyomo is easy to install through Conda but there are a couple of optimizers the user wants that are more difficult to install.

What Have I Done So Far

I have followed the instructions found here on https://www.pyomo.org/installation, which for brevity's sake involves:

conda install -c conda-forge pyomo matplotlib networkx
                 numpy openpyxl pandas pint pymysql pyodbc pyro4
                 scipy sympy xlrd pyomo.solvers ipopt glpk coincbc coinbonmin 

I also install pyomo via pip.

pip install 'pyomo[optional]'

I was unable to install pyomo.extras from Anaconda but that package has not been updated for 3 years.

Results

I was able to install Pyomo, but Couenne is not included with the above. Couenne requires manual compilation.

Compilation of Couenne

I attempted a compilation of Couenne (following instructions from https://github.com/coin-or/Couenne) using Conda's installation location as the installation prefix. This did not work. I could just be missing something. :-) Compilation finishes successfully but Couenne is not found in the path.

git clone https://github.com/coin-or/Couenne
cd Couenne
cd ThirdParty      # Read INSTALL.* file in each subdirectory and get third party software
cd ..
mkdir build
cd build
../configure -C --prefix=/opt/conda       # original instructions say to do ../configure -C
make
make install

Next Steps

References

bryanpaget commented 2 years ago

I've run into a networking obstacle and cannot finish building this image. I have uploaded the (WIP) Dockerfile for Pyomo here: https://github.com/bryanpaget/aaw-contrib-containers/blob/pyomo/pyomo/Dockerfile.

Additionally, the following Dockerfile https://github.com/coin-or-tools/optimization-suite-docker may be enough to get COIN-OR optimization tools running for some applications. I tested the coin-or-tools image and it does indeed run Couenne (one of the requested optimizers).