Skip to content

Fix el9 patch; Metis aarch64 config #26

Fix el9 patch; Metis aarch64 config

Fix el9 patch; Metis aarch64 config #26

Workflow file for this run

name: Test Binaries
on:
push:
branches-ignore:
- main
tags:
- '*'
workflow_dispatch:
inputs:
git-ref:
description: Git Hash (Optional)
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
builtin:
name: ${{ matrix.os }}/${{ matrix.TARGET }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-13, macos-14, windows-2019, windows-2022]
include:
- os: ubuntu-20.04
TARGET: "ubuntu2004-x86_64"
SHORTOS: ubuntu
- os: ubuntu-22.04
TARGET: "ubuntu2204-x86_64"
SHORTOS: ubuntu
- os: macos-13
TARGET: "darwin-x86_64"
SHORTOS: osx
- os: macos-14
TARGET: "darwin-aarch64"
SHORTOS: osx
- os: windows-2019
TARGET: "windows-x86_64"
SHORTOS: win
- os: windows-2022
TARGET: "windows-x86_64"
SHORTOS: win
steps:
- name: Checkout IDAES-ext source
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Configure curl
run: |
CURLRC="$(cat <<EOF
retry = 0
max-time = 30
EOF
)"
echo "$CURLRC" > ${GITHUB_WORKSPACE}/.curlrc
echo "$CURLRC" > ${GITHUB_WORKSPACE}/_curlrc
echo "CURL_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Setup IDAES package directories
run: |
# This simulates the ".idaes" directory, where binaries get unpacked
# for use by idaes-pse (and other programs). Note that we do not actually
# install idaes-pse in this workflow.
# ... why do we put the unpacked binaries in cache/tpl?...
IDAES_DIR="${GITHUB_WORKSPACE}/cache/tpl"
mkdir -p "$IDAES_DIR"
DOWNLOAD_DIR="${GITHUB_WORKSPACE}/cache/download"
mkdir -p "$DOWNLOAD_DIR"
echo "IDAES_DIR=$IDAES_DIR" >> $GITHUB_ENV
echo "DOWNLOAD_DIR=$DOWNLOAD_DIR" >> $GITHUB_ENV
- name: Install Dependencies
run: |
pip install pyomo pytest scipy "numpy<2" parameterized
- name: Download Binaries
run: |
# Per IDAES's current convention (v2.6), we unpack binaries into IDAES_DIR/bin
# Note that this will need to change when new binaries are released.
IDAES_BIN_DIR=$IDAES_DIR/bin
echo "$IDAES_BIN_DIR" >> $GITHUB_PATH
# Unlike `idaes get-extensions`, we need to link against libipopt.so.
# We will unpack these libraries into IDAES_DIR/bin/lib. There is no real
# logic to this. It will have to change when new binaries are released,
# as new binaries will unpack into top-level bin, lib, include, and share
# subdirectories.
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IDAES_BIN_DIR:$IDAES_BIN_DIR/lib" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$IDAES_BIN_DIR:$IDAES_BIN_DIR/lib" >> $GITHUB_ENV
# The idaes-local targz that we will unpack contains lib/pkgconfig, which
# CyIpopt will need to know about.
IDAES_PC_DIR=$IDAES_BIN_DIR/lib/pkgconfig
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$IDAES_PC_DIR" >> $GITHUB_ENV
# CyIpopt on Windows uses a custom environment var rather than pkg-config
if test "${{ matrix.SHORTOS }}" == win; then
echo "IPOPTWINDIR=$IDAES_BIN_DIR" >> $GITHUB_ENV
fi
# The binaries we unpack are *not* already in a bin subdirectory, so
# we have to make this directory here
mkdir -p $IDAES_BIN_DIR
# This is what we will call the idaes-solvers targz file once we
# download it (which we have not done yet)
SOLVERS_TAR=${DOWNLOAD_DIR}/idaes-solvers.tar.gz
# This is what we will call the idaes-lib (external functions) targz file
FUNCTIONS_TAR=${DOWNLOAD_DIR}/idaes-functions.tar.gz
# As of idaes-ext 3.4.2, we distribute petsc separately
PETSC_TAR=${DOWNLOAD_DIR}/idaes-petsc.tar.gz
# idaes-local*tar.gz is a file we distribute with idaes-solvers that
# contains include and pkgconfig files that we need for linking CyIpopt.
if test "${{ matrix.os }}" == macos-14; then
# Basically a bug in the build process -- we forgot to change the name
# to aarch64 here.
IDAES_LOCAL_TAR=${IDAES_BIN_DIR}/idaes-local-darwin-arm64.tar.gz
else
IDAES_LOCAL_TAR=${IDAES_BIN_DIR}/idaes-local-${{ matrix.TARGET }}.tar.gz
fi
# Why are we testing this here? Why would this already exist?
# TODO: Download idaes-lib and idaes-petsc as well
if test ! -e $SOLVERS_TAR; then
echo "...downloading idaes-solvers"
URL=https://github.com/IDAES/idaes-ext
RELEASE=$(curl --max-time 150 --retry 8 \
-L -s -H 'Accept: application/json' ${URL}/releases/latest)
VER=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
URL=${URL}/releases/download/3.4.2/idaes-solvers-${{ matrix.TARGET }}.tar.gz
curl --max-time 150 --retry 8 \
-L $URL > $SOLVERS_TAR
fi
echo "...downloading idaes-lib"
URL=https://github.com/IDAES/idaes-ext
RELEASE=$(curl --max-time 150 --retry 8 \
-L -s -H 'Accept: application/json' ${URL}/releases/latest)
VER=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
URL=${URL}/releases/download/3.4.2/idaes-lib-${{ matrix.TARGET }}.tar.gz
curl --max-time 150 --retry 8 \
-L $URL > $FUNCTIONS_TAR
echo "Downloaded idaes-lib .tar.gz file"
echo "...downloading idaes-petsc"
URL=https://github.com/IDAES/idaes-ext
RELEASE=$(curl --max-time 150 --retry 8 \
-L -s -H 'Accept: application/json' ${URL}/releases/latest)
VER=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
URL=${URL}/releases/download/3.4.2/idaes-petsc-${{ matrix.TARGET }}.tar.gz
curl --max-time 150 --retry 8 \
-L $URL > $PETSC_TAR
echo "Downloaded idaes-petsc .tar.gz file"
file $SOLVERS_TAR # Hopefully this works on Windows
cd $IDAES_BIN_DIR
if test "${{ matrix.SHORTOS }}" == osx; then
echo "Unpacking $SOLVERS_TAR into $PWD"
tar -xvf $SOLVERS_TAR
echo "Unpacking $FUNCTIONS_TAR into $PWD"
tar -xvf $FUNCTIONS_TAR
echo "Unpacking $PETSC_TAR into $PWD"
tar -xvf $PETSC_TAR
echo "Unpacking $IDAES_LOCAL_TAR"
tar -xvf $IDAES_LOCAL_TAR
else
echo "Unpacking $SOLVERS_TAR into $PWD"
tar -xzi < $SOLVERS_TAR
echo "Unpacking $FUNCTIONS_TAR into $PWD"
tar -xzi < $FUNCTIONS_TAR
echo "Unpacking $PETSC_TAR into $PWD"
tar -xzi < $PETSC_TAR
echo "Unpacking $IDAES_LOCAL_TAR"
tar -xzi < $IDAES_LOCAL_TAR
fi
# To use the helmholtz EOS external functions, we need data that is unpacked
# from idaes-lib (external functions) targz.
# One way to communicate this is via the IDAES_HELMHOLTZ_DATA_PATH envvar
# Note that the trailing '/' is necessary here
# TODO: How to handle on windows?
echo "IDAES_HELMHOLTZ_DATA_PATH=$IDAES_DIR/bin/helm_data/" >> $GITHUB_ENV
echo "Done unpacking tar files"
echo ""
echo "$IDAES_BIN_DIR"
ls -l $IDAES_BIN_DIR
echo "$IDAES_PC_DIR"
ls -l $IDAES_PC_DIR
#- name: Check sipopt/k_aug
# run: |
# $IDAES_DIR/bin/ipopt --version
# $IDAES_DIR/bin/ipopt_sens --version
# $IDAES_DIR/bin/k_aug --version
- name: Configure and Install cyipopt
run: |
IDAES_PC_DIR=$IDAES_BIN_DIR/lib/pkgconfig
# Why is this not already set?
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$IDAES_PC_DIR" >> $GITHUB_ENV
echo "$PKG_CONFIG_PATH"
#pkg-config --libs --cflags ipopt
#pip install git+https://github.com/mechmotum/cyipopt.git
#if test "${{ matrix.SHORTOS }}" == win; then
# echo "$IPOPTWINDIR"
# git clone https://github.com/mechmotum/cyipopt.git
# cd cyipopt
# python setup.py install
# cd ..
#else
# pip install cyipopt
#fi
if test "${{ matrix.SHORTOS }}" == win; then
echo "IPOPTWINDIR = $IPOPTWINDIR"
echo "IPOPTWINDIR contents:"
ls -l $IPOPTWINDIR
echo "IPOPTWINDIR/lib contents:"
ls -l $IPOPTWINDIR/lib
#echo "IPOPTWINDIR/include/coin-or contents:"
#ls -l $IPOPTWINDIR/include/coin-or
# Need to make a bin directory and put extra DLLs there
mkdir $IPOPTWINDIR/bin
echo "Made directory $IPOPTWINDIR/bin"
# For now, just copy all DLLs into this directory. Not all
# are strictly necessary.
echo "Copying extra DLLs to bin"
# Why isn't this var set anymore?
echo "IDAES_BIN_DIR = $IDAES_BIN_DIR"
cp $IPOPTWINDIR/libblas.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libbz2-1.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libgcc_s_seh-1.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libgfortran-5.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libgomp-1.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libipopt-3.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/liblapack.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libquadmath-0.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libsipopt-3.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libssp-0.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libstdc++-6.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/libwinpthread-1.dll $IPOPTWINDIR/bin/
cp $IPOPTWINDIR/zlib1.dll $IPOPTWINDIR/bin/
# Does putting this on the path make the library discoverable?
#echo "PATH=$PATH:$IPOPTWINDIR/lib" >> $GITHUB_ENV
# Library must end with .lib?
cp $IPOPTWINDIR/lib/libipopt.dll.a $IPOPTWINDIR/lib/libipopt.dll.a.lib
git clone -b idaes-ipopt https://github.com/Robbybp/cyipopt.git
cd cyipopt
python setup.py install
cd ..
#pip install -v git+https://github.com/Robbybp/cyipopt.git@idaes-ipopt
echo "Importing CyIpopt:"
python -c "import cyipopt"
else
pip install -v cyipopt
fi
- name: Run tests
run: |
pytest -v -rs `pwd`/test
docker:
name: ${{ matrix.container }}/${{ matrix.TARGET }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
container: ["rockylinux:8", "rockylinux:9", "debian:10", "debian:11", "debian:12"]
include:
- container: "rockylinux:8"
TARGET: "el8"
SHORTOS: el
- container: "rockylinux:9"
TARGET: "ubuntu2204"
SHORTOS: el
- container: "debian:10"
TARGET: "el8"
SHORTOS: deb
- container: "debian:11"
TARGET: "ubuntu2004"
SHORTOS: deb
- container: "debian:12"
TARGET: "ubuntu2204"
SHORTOS: deb
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Install basic libraries
run: |
cat /etc/*-release
if test "${{ matrix.SHORTOS }}" == el; then
yum -y update
yum -y install libgfortran blas libgomp lapack
yum -y install pkg-config gcc git cmake
yum -y install g++ # This doesn't work on rhel8/rocky8?
yum -y install wget curl || yum -y install --allowerasing wget curl
else
apt-get update
apt-get -y install libgfortran5 libgomp1 liblapack3 libblas3 libc6
apt-get -y install wget curl pkg-config gcc g++ git cmake
fi
if [ `uname -m` = "aarch64" ]; then
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh -O $WORKSPACE/miniconda.sh
DISTRO='aarch64'
fi
if [ `uname -m` = "x86_64" ]; then
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $WORKSPACE/miniconda.sh
DISTRO='x86_64'
fi
echo "DISTRO=$DISTRO" >> $GITHUB_ENV
chmod +x $WORKSPACE/miniconda.sh
bash $WORKSPACE/miniconda.sh -b -p $WORKSPACE/miniconda
ls $WORKSPACE/miniconda/bin
- name: Setup IDAES package directories
run: |
# This simulates the ".idaes" directory, where binaries get unpacked
# for use by idaes-pse (and other programs). Note that we do not actually
# install idaes-pse in this workflow.
IDAES_DIR="${GITHUB_WORKSPACE}/cache/tpl"
mkdir -p "$IDAES_DIR"
DOWNLOAD_DIR="${GITHUB_WORKSPACE}/cache/download"
mkdir -p "$DOWNLOAD_DIR"
# Add a global var / something that you want to exist in future steps
echo "IDAES_DIR=$IDAES_DIR" >> $GITHUB_ENV
echo "DOWNLOAD_DIR=$DOWNLOAD_DIR" >> $GITHUB_ENV
- name: Install Dependencies
run: |
eval "$(/miniconda/bin/conda shell.bash hook)"
conda --version
conda create -n idaes python=3.10 pip psutil
conda activate idaes
# Grab the most recent release of the IDAES extensions
pip install pyomo pytest scipy "numpy<2" parameterized
- name: Download Binaries
run: |
# Per IDAES's current convention (v2.6), we unpack binaries into IDAES_DIR/bin
# Note that this will need to change when new binaries are released.
IDAES_BIN_DIR=$IDAES_DIR/bin
# Add something to the path; good for executables
echo "$IDAES_BIN_DIR" >> $GITHUB_PATH
echo "IDAES_BIN_DIR=$IDAES_BIN_DIR" >> $GITHUB_ENV
# Unlike `idaes get-extensions`, we need to link against libipopt.so.
# We will unpack these libraries into IDAES_DIR/bin/lib. There is no real
# logic to this. It will have to change when new binaries are released,
# as new binaries will unpack into top-level bin, lib, include, and share
# subdirectories.
echo "PATH=$PATH:$IDAES_BIN_DIR" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IDAES_BIN_DIR/lib:$IDAES_BIN_DIR" >> $GITHUB_ENV
#echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IDAES_BIN_DIR" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$IDAES_BIN_DIR/lib" >> $GITHUB_ENV
#echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$IDAES_BIN_DIR" >> $GITHUB_ENV
# The idaes-local targz that we will unpack contains lib/pkgconfig, which
# CyIpopt will need to know about.
IDAES_PC_DIR=$IDAES_BIN_DIR/lib/pkgconfig
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$IDAES_PC_DIR" >> $GITHUB_ENV
# The binaries we unpack are *not* already in a bin subdirectory, so
# we have to make this directory here
mkdir -p $IDAES_BIN_DIR
SOLVERS_TAR=${DOWNLOAD_DIR}/idaes-solvers.tar.gz
FUNCTIONS_TAR=${DOWNLOAD_DIR}/idaes-functions.tar.gz
PETSC_TAR=${DOWNLOAD_DIR}/idaes-petsc.tar.gz
if test ! -e $SOLVERS_TAR; then
echo "...downloading idaes-solvers"
URL=https://github.com/IDAES/idaes-ext
RELEASE=$(curl --max-time 150 --retry 8 \
-L -s -H 'Accept: application/json' ${URL}/releases/latest)
VER=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
URL=${URL}/releases/download/3.4.2/idaes-solvers-${{ matrix.TARGET }}-$DISTRO.tar.gz
curl --max-time 150 --retry 8 \
-L $URL > $SOLVERS_TAR
echo "...downloaded idaes-solvers"
fi
echo "...downloading idaes-lib"
URL=https://github.com/IDAES/idaes-ext
RELEASE=$(curl --max-time 150 --retry 8 \
-L -s -H 'Accept: application/json' ${URL}/releases/latest)
VER=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
URL=${URL}/releases/download/3.4.2/idaes-lib-${{ matrix.TARGET }}-$DISTRO.tar.gz
curl --max-time 150 --retry 8 \
-L $URL > $FUNCTIONS_TAR
echo "...downloaded idaes-lib"
echo "...downloading idaes-petsc"
URL=https://github.com/IDAES/idaes-ext
RELEASE=$(curl --max-time 150 --retry 8 \
-L -s -H 'Accept: application/json' ${URL}/releases/latest)
VER=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
URL=${URL}/releases/download/3.4.2/idaes-petsc-${{ matrix.TARGET }}-$DISTRO.tar.gz
curl --max-time 150 --retry 8 \
-L $URL > $PETSC_TAR
echo "...downloaded idaes-petsc"
cd $IDAES_BIN_DIR
IDAES_LOCAL_TAR=${IDAES_BIN_DIR}/idaes-local-${{ matrix.TARGET }}-$DISTRO.tar.gz
echo "Unpacking $SOLVERS_TAR into $PWD"
tar -xzi < $SOLVERS_TAR
echo "Unpacking $FUNCTIONS_TAR into $PWD"
tar -xzi < $FUNCTIONS_TAR
echo "Unpacking $PETSC_TAR into $PWD"
tar -xzi < $PETSC_TAR
echo "Unpacking $IDAES_LOCAL_TAR"
tar -xzi < $IDAES_LOCAL_TAR
# To use the helmholtz EOS external functions, we need data that is unpacked
# from idaes-lib (external functions) targz.
# One way to communicate this is via the IDAES_HELMHOLTZ_DATA_PATH envvar
# Note that the trailing '/' is necessary here
echo "IDAES_HELMHOLTZ_DATA_PATH=$IDAES_DIR/bin/helm_data/" >> $GITHUB_ENV
echo ""
echo "$IDAES_BIN_DIR"
ls -l $IDAES_BIN_DIR
#- name: Check sipopt/k_aug
# run: |
# $IDAES_DIR/bin/ipopt --version
# $IDAES_DIR/bin/ipopt_sens --version
# $IDAES_DIR/bin/k_aug --version
- name: Configure and Install cyipopt
run: |
echo "$PKG_CONFIG_PATH"
echo "$IDAES_DIR/bin/lib/pkgconfig"
ls "$IDAES_DIR"
ls "$IDAES_DIR/bin"
ls "$IDAES_DIR/bin/lib"
ls "$IDAES_DIR/bin/lib/pkgconfig"
pkg-config --libs --cflags ipopt
eval "$(/miniconda/bin/conda shell.bash hook)"
conda activate idaes
# Building extensions here shouldn't be necessary, as we distribute
# libpynumero_ASL, but our Rocky8 tests only pass if we build from
# scratch here...
#pyomo build-extensions
pip install cyipopt
#pip install git+https://github.com/mechmotum/cyipopt.git
- name: Run tests
run: |
eval "$(/miniconda/bin/conda shell.bash hook)"
conda activate idaes
cat $GITHUB_PATH
export PATH=$PATH:$IDAES_DIR/bin
echo "PATH = $PATH"
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
echo "IDAES_DIR = $IDAES_DIR"
ls "$IDAES_BIN_DIR"
pytest -v -rs `pwd`/test