Skip to content

Commit

Permalink
Move Coin dependency mangement to vcpkg (#843)
Browse files Browse the repository at this point in the history
- Remove Antares Deps dependency.
- Manage Coin dependency with vcpkg through custom ports
- Improve vcpkg usage in CI

---------

Co-authored-by: Jason Marechal <[email protected]>
Co-authored-by: Abdoulbari Zakir <[email protected]>
Co-authored-by: Abdoulbari Zaher <[email protected]>
  • Loading branch information
4 people authored Jul 2, 2024
1 parent 1bbbad1 commit 99d1ffa
Show file tree
Hide file tree
Showing 37 changed files with 516 additions and 199 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
outputs:
antares-version: ${{steps.antares-version.outputs.result}}
antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}}
antares-deps-version: ${{steps.antares-deps-version.outputs.result}}
steps:
- uses: actions/checkout@v4
- name: Read antares-solver version
Expand All @@ -62,13 +61,6 @@ jobs:
path: 'antares-version.json'
key: 'antares_xpansion_version'

- name: Read antares-deps version
id: antares-deps-version
uses: ./.github/actions/read-json-value
with:
path: 'antares-version.json'
key: 'antares_deps_version'

build:
runs-on: ubuntu-latest
needs: [ docker_publish, versions ]
Expand Down Expand Up @@ -135,7 +127,6 @@ jobs:
- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
with:
antares-deps-version: ${{needs.versions.outputs.antares-deps-version}}
antares-version: ${{needs.versions.outputs.antares-version}}
os: centos7
os-full-name: CentOS-7.9.2009
Expand All @@ -147,20 +138,22 @@ jobs:
pip3 install -r requirements-tests.txt
pip3 install -r requirements-ui.txt
- run: |
mkdir -p ${{ github.workspace }}/vcpkg_cache
- name: vcpkg install
run: |
git config --global safe.directory '*'
git submodule update --remote --init vcpkg
pushd vcpkg
git fetch --unshallow
./bootstrap-vcpkg.sh --disableMetrics
./bootstrap-vcpkg.sh -disableMetrics
echo "VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg" >> $GITHUB_ENV
echo "VCPKG_CACHE_DIR=$GITHUB_WORKSPACE/vcpkg_cache" >> $GITHUB_ENV
echo "VCPKG_BINARY_SOURCES=clear;files,$GITHUB_WORKSPACE/vcpkg_cache,readwrite" >> $GITHUB_ENV
- name: Restore vcpkg binary dir from cache
id: cache-vcpkg-binary
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/vcpkg_cache
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-centOS-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-centOS-
Expand All @@ -169,8 +162,8 @@ jobs:
run: |
source /opt/rh/devtoolset-10/enable
cmake -B _build -S . \
-DDEPS_INSTALL_DIR=rte-antares-deps-Release \
-DBUILD_TESTING=ON \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/deps \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-DBUILD_UI=ON \
Expand All @@ -186,7 +179,7 @@ jobs:
id: save-cache-vcpkg-binary
uses: actions/cache/save@v3
with:
path: ${{ github.workspace }}/vcpkg_cache
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-centOS-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}

- name: Running unit tests
Expand Down
29 changes: 11 additions & 18 deletions .github/workflows/build_oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
outputs:
antares-version: ${{steps.antares-version.outputs.result}}
antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}}
antares-deps-version: ${{steps.antares-deps-version.outputs.result}}
steps:
- uses: actions/checkout@v4
- name: Read antares-solver version
Expand All @@ -36,13 +35,6 @@ jobs:
path: 'antares-version.json'
key: 'antares_xpansion_version'

- name: Read antares-deps version
id: antares-deps-version
uses: ./.github/actions/read-json-value
with:
path: 'antares-version.json'
key: 'antares_deps_version'

build:
name: Build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -108,36 +100,37 @@ jobs:
- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
with:
antares-deps-version: ${{needs.versions.outputs.antares-deps-version}}
antares-version: ${{needs.versions.outputs.antares-version}}
os: Oracle8
os-full-name: OracleServer-8.10

- run: |
mkdir -p ${{ github.workspace }}/vcpkg_cache
- name: vcpkg install
run: |
git config --global safe.directory '*'
git submodule update --remote --init vcpkg
pushd vcpkg
git fetch --unshallow
./bootstrap-vcpkg.sh --disableMetrics
./bootstrap-vcpkg.sh -disableMetrics
echo "VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg" >> $GITHUB_ENV
echo "VCPKG_CACHE_DIR=$GITHUB_WORKSPACE/vcpkg_cache" >> $GITHUB_ENV
echo "VCPKG_BINARY_SOURCES=clear;files,$GITHUB_WORKSPACE/vcpkg_cache,readwrite" >> $GITHUB_ENV
- name: Restore vcpkg binary dir from cache
id: cache-vcpkg-binary
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-oracle8-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-oracle8-

- name: Configure
run: |
cmake -B _build -S . \
-DDEPS_INSTALL_DIR=rte-antares-deps-Release \
-DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/deps \
-DBUILD_UI=OFF \
-DALLOW_RUN_AS_ROOT=ON \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
Expand All @@ -155,21 +148,21 @@ jobs:
export XPRESS=${{ env.XPRESS_CONTAINER }}
cd _build
ctest -C Release --output-on-failure -L "unit|benders|lpnamer|medium"
- name: Cache vcpkg binary dir
if: always()
id: save-cache-vcpkg-binary
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-oracle8-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}

#######################
- name: Install
run: |
cd _build
cmake --install .
- name: .tar.gz creation
run: |
cd _build
Expand Down
29 changes: 10 additions & 19 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
XPRESSDIR: ${{ github.workspace }}/xpress
XPRESS: ${{ github.workspace }}/xpress/bin
XPRS_LIB_Path: ${{ github.workspace }}/xpress/lib
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite"

outputs:
TGZ_NAME: ${{ steps.export_output.outputs.TGZ_NAME }}
Expand All @@ -49,6 +50,12 @@ jobs:
ref: ${{ matrix.xprs.ref}}
token: ${{ secrets.AS_TOKEN }} #reniew token periodically

- name: Install mandatory system libraries
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y ccache
sudo apt-get install -y g++-10 gcc-10
- name: ccache
uses: hendrikmuhs/[email protected]
with:
Expand All @@ -66,12 +73,6 @@ jobs:
pip install -r requirements-tests.txt
pip install -r requirements-ui.txt
- name: Install mandatory system libraries
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y ccache
sudo apt-get install -y g++-10 gcc-10
- name: Update alternatives
#mpicxx uses "g++" so we need g++ to be symbolic link to g++-10
run: |
Expand Down Expand Up @@ -101,29 +102,19 @@ jobs:
path: 'antares-version.json'
key: 'antares_xpansion_version'

- name: Read antares-deps version
id: antares-deps-version
uses: ./.github/actions/read-json-value
with:
path: 'antares-version.json'
key: 'antares_deps_version'

- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
with:
antares-deps-version: ${{steps.antares-deps-version.outputs.result}}
antares-version: ${{steps.antares-version.outputs.result}}
os: ${{matrix.os}}
os-full-name: Ubuntu-20.04

- run: |
mkdir -p ${{ github.workspace }}/vcpkg_cache
- name: vcpkg install
run: |
git submodule update --remote --init vcpkg
pushd vcpkg
git fetch --unshallow
./bootstrap-vcpkg.sh --disableMetrics
./bootstrap-vcpkg.sh -disableMetrics
- name: Restore vcpkg binary dir from cache
id: cache-vcpkg-binary
Expand All @@ -142,10 +133,10 @@ jobs:
-DCMAKE_C_COMPILER=/usr/bin/gcc-10 \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \
-DDEPS_INSTALL_DIR=rte-antares-deps-Release \
-DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps \
-DBUILD_UI=ON \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest ]
triplet: [ x64-windows ]
triplet: [ x64-windows-release ]
xprs: [ #{ value: XPRESS-ON, ref: 8.13a },
{ value: XPRESS-ON, ref: 9.2.5 },
#{ value: XPRESS-OFF }
Expand All @@ -32,15 +32,14 @@ jobs:
XPRS_LIB_Path: ${{ github.workspace }}\xpress\lib
# Indicates the location of the vcpkg as a Git submodule of the project repository.
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite"

outputs:
zip_name: ${{ steps.zip_name.outputs.zip_name }}
singlefile_name: ${{steps.zip_name.outputs.singlefile_name}}

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Checkout xpressmp linux
if: matrix.xprs.value == 'XPRESS-ON'
Expand Down Expand Up @@ -77,12 +76,7 @@ jobs:
with:
path: 'antares-version.json'
key: 'antares_version'
- name: Read antares-deps version
id: antares-deps-version
uses: ./.github/actions/read-json-value
with:
path: 'antares-version.json'
key: 'antares_deps_version'

- name: Read antares-xpansion version
id: antares-xpansion-version
uses: ./.github/actions/read-json-value
Expand All @@ -93,10 +87,9 @@ jobs:
- name: vcpkg install
shell: bash
run: |
mkdir -p ${{ github.workspace }}/vcpkg_cache
git submodule update --remote --init vcpkg
pushd vcpkg
git fetch --unshallow
./bootstrap-vcpkg.sh --disableMetrics
./bootstrap-vcpkg.bat -disableMetrics
- name: Restore vcpkg binary dir from cache
id: cache-vcpkg-binary
Expand All @@ -110,18 +103,18 @@ jobs:
- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-zip
with:
antares-deps-version: ${{steps.antares-deps-version.outputs.result}}
antares-version: ${{steps.antares-version.outputs.result}}
os: ${{matrix.os}}

- name: Configure
run: |
$pwd=Get-Location
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.result}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON
cmake -B _build -S . -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.result}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON
- name: Build
run: |
cmake --build _build --config Release -j4
- name: Cache vcpkg binary dir
if: always()
id: save-cache-vcpkg-binary
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/compile-boost/action.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/compile-gtest/action.yml

This file was deleted.

Loading

0 comments on commit 99d1ffa

Please sign in to comment.