Skip to content

Commit

Permalink
Merge pull request Pyomo#2 from Pyomo/master
Browse files Browse the repository at this point in the history
Update IDAES branch of Pyomo
  • Loading branch information
blnicho authored Apr 27, 2020
2 parents f9e3750 + cae2b0f commit 267db4c
Show file tree
Hide file tree
Showing 218 changed files with 11,032 additions and 7,764 deletions.
11 changes: 10 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,17 @@ install:
#
# Install GAMS
#
- ps: Start-FileDownload 'https://d37drm4t2jghv5.cloudfront.net/distributions/24.8.5/windows/windows_x64_64.exe'
- ps: Start-FileDownload 'https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0/windows/windows_x64_64.exe'
- windows_x64_64.exe /SP- /VERYSILENT /NORESTART /DIR=.\gams /NOICONS
- "SET cwd=%cd%"
- "cd gams\\apifiles\\Python"
- IF PYTHON_VERSION equ 2.7 (cd api \ python setup.py install )
- IF PYTHON_VERSION equ 3.6 (cd api_36 \ python setup.py install )
- IF PYTHON_VERSION equ 3.7 (cd api_37 \ python setup.py install )
- "cd %cwd%"
#
# Add GAMS to PATH
#
- "SET PATH=%cd%\\gams;%PATH%"
#
# Clone but don't install pyomo-model-libraries
Expand Down
48 changes: 42 additions & 6 deletions .github/workflows/mpi_matrix_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: continuous-integration/github/pr
name: GitHub CI (mpi)

on:
push:
Expand All @@ -10,7 +10,7 @@ on:

jobs:
build:
name: mpi/${{ matrix.TARGET }}/py${{ matrix.python-version }}
name: ${{ matrix.TARGET }}/py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
Expand All @@ -35,7 +35,7 @@ jobs:
echo ""
echo "Install conda packages"
echo ""
conda install mpi4py ipopt
conda install mpi4py
echo ""
echo "Upgrade pip..."
echo ""
Expand All @@ -51,9 +51,42 @@ jobs:
echo ""
pip install cplex || echo "CPLEX Community Edition is not available for ${{ matrix.python-version }}"
echo ""
echo "Install BARON..."
echo ""
if [ ${{ matrix.TARGET }} == 'osx' ]; then
wget -q https://www.minlp.com/downloads/xecs/baron/current/baron-osx64.zip -O baron_installer.zip
else
wget -q https://www.minlp.com/downloads/xecs/baron/current/baron-lin64.zip -O baron_installer.zip
fi
unzip -q baron_installer.zip
mv baron-* baron-dir
BARON_DIR=$(pwd)/baron-dir
export PATH=$PATH:$BARON_DIR
echo ""
echo "Install IDAES Ipopt..."
echo ""
sudo apt-get install libopenblas-dev gfortran liblapack-dev
mkdir ipopt && cd ipopt
wget -q https://github.com/IDAES/idaes-ext/releases/download/2.0.0/idaes-solvers-ubuntu1804-64.tar.gz -O ipopt.tar.gz
tar -xzf ipopt.tar.gz
cd ..
export PATH=$PATH:$(pwd)/ipopt
echo ""
echo "Install GJH_ASL_JSON..."
echo ""
wget -q "https://codeload.github.com/ghackebeil/gjh_asl_json/zip/master" -O gjh_asl_json.zip
unzip -q gjh_asl_json.zip
rm -rf gjh_asl_json.zip
cd gjh_asl_json-master/Thirdparty
./get.ASL
cd ..
make
export PATH=$PATH:$(pwd)/bin
cd ..
echo ""
echo "Install GAMS..."
echo ""
if hash brew; then
if [ ${{ matrix.TARGET }} == 'osx' ]; then
wget -q https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0/macosx/osx_x64_64_sfx.exe -O gams_installer.exe
else
wget -q https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0/linux/linux_x64_64_sfx.exe -O gams_installer.exe
Expand All @@ -64,7 +97,7 @@ jobs:
export PATH=$PATH:$GAMS_DIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GAMS_DIR
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GAMS_DIR
cd gams/*/apifiles/Python/
cd $GAMS_DIR/apifiles/Python/
py_ver=$(python -c 'import sys;print("%s%s" % sys.version_info[:2])')
gams_ver=api
for ver in api_*; do
Expand Down Expand Up @@ -122,7 +155,10 @@ jobs:
pyomo `pwd`/pyomo-model-libraries
- name: Upload coverage to codecov
env:
GITHUB_JOB_NAME: mpi/${{ matrix.TARGET }}/py${{ matrix.python-version }}
run: |
find . -maxdepth 10 -name ".cov*"
coverage combine
bash <(curl -s https://codecov.io/bash) -X gcov
coverage report -i
bash <(curl -s https://codecov.io/bash) -X gcov -n "$GITHUB_JOB_NAME"
48 changes: 43 additions & 5 deletions .github/workflows/push_branch_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,51 @@ jobs:
echo ""
echo "Install Pyomo dependencies..."
echo ""
pip install cython numpy scipy ipython openpyxl sympy pyyaml pyodbc networkx xlrd pandas matplotlib dill seaborn pymysql pyro4 pint pathos
pip install cython numpy scipy ipython openpyxl sympy pyyaml pyodbc networkx xlrd pandas matplotlib dill seaborn pymysql pyro4 pint pathos nose
echo ""
echo "Install CPLEX Community Edition..."
echo ""
pip install cplex || echo "CPLEX Community Edition is not available for ${{ matrix.python-version }}"
echo ""
echo "Install BARON..."
echo ""
if [ ${{ matrix.TARGET }} == 'osx' ]; then
wget -q https://www.minlp.com/downloads/xecs/baron/current/baron-osx64.zip -O baron_installer.zip
else
wget -q https://www.minlp.com/downloads/xecs/baron/current/baron-lin64.zip -O baron_installer.zip
fi
unzip -q baron_installer.zip
mv baron-* baron-dir
BARON_DIR=$(pwd)/baron-dir
export PATH=$PATH:$BARON_DIR
echo ""
echo "Install IDAES Ipopt..."
echo ""
sudo apt-get install libopenblas-dev gfortran liblapack-dev
mkdir ipopt_solver && cd ipopt_solver
wget -q https://github.com/IDAES/idaes-ext/releases/download/2.0.0/idaes-solvers-ubuntu1804-64.tar.gz -O ipopt.tar.gz
tar -xzf ipopt.tar.gz
cd ..
export PATH=$PATH:$(pwd)/ipopt_solver
echo ""
echo "Install GJH_ASL_JSON..."
echo ""
wget -q "https://codeload.github.com/ghackebeil/gjh_asl_json/zip/master" -O gjh_asl_json.zip
unzip -q gjh_asl_json.zip
rm -rf gjh_asl_json.zip
cd gjh_asl_json-master/Thirdparty
./get.ASL
cd ..
make
export PATH=$PATH:$(pwd)/bin
cd ..
echo ""
echo "Install GAMS..."
echo ""
wget -q https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0/linux/linux_x64_64_sfx.exe -O gams_installer.exe
chmod +x gams_installer.exe
./gams_installer.exe -q -d gams
GAMS_DIR=`ls -d1 $(pwd)/gams/*/ | head -1`
cd gams/*/apifiles/Python/
py_ver=$(python -c 'import sys;print("%s%s" % sys.version_info[:2])')
gams_ver=api
Expand All @@ -49,6 +83,14 @@ jobs:
done
cd $gams_ver
python setup.py -q install -noCheck
export PATH=$PATH:$GAMS_DIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GAMS_DIR
echo ""
echo "Pass key environment variables to subsequent steps"
echo ""
echo "::set-env name=PATH::$PATH"
echo "::set-env name=LD_LIBRARY_PATH::$LD_LIBRARY_PATH"
- name: Install Pyomo and extensions
run: |
echo "Clone Pyomo-model-libraries..."
Expand All @@ -69,8 +111,4 @@ jobs:
- name: Run nightly tests with test.pyomo
run: |
echo "Run test.pyomo..."
GAMS_DIR=`ls -d1 $(pwd)/gams/*/ | head -1`
export PATH=$PATH:$GAMS_DIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GAMS_DIR
pip install nose
test.pyomo -v --cat="nightly" pyomo `pwd`/pyomo-model-libraries
111 changes: 92 additions & 19 deletions .github/workflows/unix_python_matrix_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: continuous-integration/github/pr
name: GitHub CI (unix)

on:
push:
branches:
- master
pull_request:
branches:
- master
Expand All @@ -12,11 +15,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-18.04]
os: [macos-latest, ubuntu-latest]
include:
- os: macos-latest
TARGET: osx
- os: ubuntu-18.04
- os: ubuntu-latest
TARGET: linux
python-version: [3.5, 3.6, 3.7, 3.8]

Expand All @@ -26,48 +29,100 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Pyomo dependencies

- name: Install dependencies
run: |
if hash brew; then
if [ ${{ matrix.TARGET }} == 'osx' ]; then
echo "Install pre-dependencies for pyodbc..."
brew update
brew list bash || brew install bash
brew list gcc || brew install gcc
brew link --overwrite gcc
brew list pkg-config || brew install pkg-config
brew list unixodbc || brew install unixodbc
brew list freetds || brew install freetds
brew list freetds || brew install freetds
fi
echo ""
echo "Upgrade pip..."
echo ""
python -m pip install --upgrade pip
echo ""
echo "Install Pyomo dependencies..."
echo ""
pip install cython numpy scipy ipython openpyxl sympy pyyaml pyodbc networkx xlrd pandas matplotlib dill seaborn pymysql pyro4 pint pathos
# Note: pandas 1.0.3 causes gams 29.1.0 import to fail in python 3.8
pip install cython numpy scipy ipython openpyxl sympy pyyaml \
pyodbc networkx xlrd pandas matplotlib dill seaborn pymysql \
pyro4 pint pathos coverage nose
echo ""
echo "Install CPLEX Community Edition..."
echo ""
pip install cplex || echo "CPLEX Community Edition is not available for ${{ matrix.python-version }}"
echo ""
echo "Install BARON..."
echo ""
if [ ${{ matrix.TARGET }} == 'osx' ]; then
wget -q https://www.minlp.com/downloads/xecs/baron/current/baron-osx64.zip -O baron_installer.zip
else
wget -q https://www.minlp.com/downloads/xecs/baron/current/baron-lin64.zip -O baron_installer.zip
fi
unzip -q baron_installer.zip
mv baron-* baron-dir
BARON_DIR=$(pwd)/baron-dir
export PATH=$PATH:$BARON_DIR
echo ""
echo "Install IDAES Ipopt (Linux only)..."
echo ""
if [ ${{ matrix.TARGET }} == 'linux' ]; then
sudo apt-get install libopenblas-dev gfortran liblapack-dev
mkdir ipopt_solver && cd ipopt_solver
wget -q https://github.com/IDAES/idaes-ext/releases/download/2.0.0/idaes-solvers-ubuntu1804-64.tar.gz -O ipopt.tar.gz
tar -xzf ipopt.tar.gz
cd ..
export PATH=$PATH:$(pwd)/ipopt_solver
fi
echo ""
echo "Install GJH_ASL_JSON..."
echo ""
wget -q "https://codeload.github.com/ghackebeil/gjh_asl_json/zip/master" -O gjh_asl_json.zip
unzip -q gjh_asl_json.zip
rm -rf gjh_asl_json.zip
cd gjh_asl_json-master/Thirdparty
./get.ASL
cd ..
make
export PATH=$PATH:$(pwd)/bin
cd ..
echo ""
echo "Install GAMS..."
echo ""
if hash brew; then
if [ ${{ matrix.TARGET }} == 'osx' ]; then
wget -q https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0/macosx/osx_x64_64_sfx.exe -O gams_installer.exe
else
wget -q https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0/linux/linux_x64_64_sfx.exe -O gams_installer.exe
fi
chmod +x gams_installer.exe
./gams_installer.exe -q -d gams
cd gams/*/apifiles/Python/
GAMS_DIR=`ls -d1 $(pwd)/gams/*/ | head -1`
export PATH=$PATH:$GAMS_DIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GAMS_DIR
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GAMS_DIR
cd $GAMS_DIR/apifiles/Python/
py_ver=$(python -c 'import sys;print("%s%s" % sys.version_info[:2])')
gams_ver=api
for ver in api_*; do
if test ${ver:4} -le $py_ver; then
gams_ver=$ver
fi
fi
done
cd $gams_ver
python setup.py -q install -noCheck
echo ""
echo "Pass key environment variables to subsequent steps"
echo ""
echo "::set-env name=PATH::$PATH"
echo "::set-env name=LD_LIBRARY_PATH::$LD_LIBRARY_PATH"
echo "::set-env name=DYLD_LIBRARY_PATH::$DYLD_LIBRARY_PATH"
- name: Install Pyomo and extensions
run: |
echo "Clone Pyomo-model-libraries..."
Expand All @@ -80,17 +135,35 @@ jobs:
echo "Install Pyomo..."
echo ""
python setup.py develop
echo ""
echo "Download and install extensions..."
echo ""
- name: Set up coverage tracking
run: |
WORKSPACE=`pwd`
COVERAGE_PROCESS_START=${WORKSPACE}/coveragerc
echo "::set-env name=COVERAGE_PROCESS_START::$COVERAGE_PROCESS_START"
cp ${WORKSPACE}/.coveragerc ${COVERAGE_PROCESS_START}
echo "data_file=${WORKSPACE}/.coverage" >> ${COVERAGE_PROCESS_START}
SITE_PACKAGES=`python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`
if [ -z "$DISABLE_COVERAGE" ]; then
echo 'import coverage; coverage.process_startup()' \
> ${SITE_PACKAGES}/run_coverage_at_startup.pth
fi
- name: Download and install extensions
run: |
pyomo download-extensions
pyomo build-extensions
- name: Run nightly tests with test.pyomo
- name: Run Pyomo tests
run: |
echo "Run test.pyomo..."
GAMS_DIR=`ls -d1 $(pwd)/gams/*/ | head -1`
export PATH=$PATH:$GAMS_DIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GAMS_DIR
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GAMS_DIR
pip install nose
test.pyomo -v --cat="nightly" pyomo `pwd`/pyomo-model-libraries
- name: Upload coverage to codecov
env:
GITHUB_JOB_NAME: unix/${{ matrix.TARGET }}/py${{ matrix.python-version }}
run: |
find . -maxdepth 10 -name ".cov*"
coverage combine
coverage report -i
bash <(curl -s https://codecov.io/bash) -X gcov -n "$GITHUB_JOB_NAME"
Loading

0 comments on commit 267db4c

Please sign in to comment.