Skip to content

Commit

Permalink
[API]Use antares lib (#825)
Browse files Browse the repository at this point in the history
Properly use antares in CI for new API mode
  • Loading branch information
JasonMarechal25 authored Jul 25, 2024
1 parent 3901ebb commit 8f705e3
Show file tree
Hide file tree
Showing 37 changed files with 300 additions and 115 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
XPRESS_CONTAINER: ${GITHUB_WORKSPACE}/xpress/bin
XPRS_LIB_Path_CONTAINER: ${GITHUB_WORKSPACE}/xpress/lib
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools

outputs:
TGZ_NAME: ${{ steps.export_output.outputs.TGZ_NAME }}
Expand All @@ -94,6 +95,10 @@ jobs:
id: get_release
uses: bruceadams/[email protected]

- name: Config OR-Tools URL
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools/releases/download/v9.8-rte1.0/ortools_cxx_centos7_static_sirius.zip" >> $GITHUB_ENV
- uses: actions/checkout@v3 #Keep at 3
with:
submodules: true
Expand Down Expand Up @@ -130,6 +135,8 @@ jobs:
antares-version: ${{needs.versions.outputs.antares-version}}
os: centos7
os-full-name: CentOS-7.9.2009
ortools-url: ${{env.ORTOOLS_URL}}
ortools-dir: ${{env.ORTOOLS_DIR}}

- name: Install dependencies
run: |
Expand Down Expand Up @@ -163,11 +170,12 @@ jobs:
source /opt/rh/devtoolset-10/enable
cmake -B _build -S . \
-DBUILD_TESTING=ON \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/deps \
-DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/deps;${{env.ORTOOLS_DIR}}/install" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-DBUILD_UI=ON \
-DALLOW_RUN_AS_ROOT=ON \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
Expand All @@ -186,7 +194,7 @@ jobs:
timeout-minutes: 120
shell: bash
run: |
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux/tools/openmpi/bin/:$PATH
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux-release/tools/openmpi/bin/:$PATH
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:${{ env.XPRS_LIB_Path_CONTAINER }}
export XPRESS=${{ env.XPRESS_CONTAINER }}
cd _build
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/build_oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
XPRESSDIR_CONTAINER: ${GITHUB_WORKSPACE}/xpress
XPRESS_CONTAINER: ${GITHUB_WORKSPACE}/xpress/bin
XPRS_LIB_Path_CONTAINER: ${GITHUB_WORKSPACE}/xpress/lib
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools

outputs:
zip_name: ${{ steps.zip_name.outputs.zip_name }}
Expand All @@ -63,11 +64,15 @@ jobs:
- name: Install System
run: |
dnf install -y epel-release git wget rpm-build redhat-lsb-core openmpi-devel
dnf install -y unzip libuuid-devel gcc-toolset-10-toolchain python3-devel zlib-devel
dnf install -y unzip libuuid-devel gcc-toolset-11 python3-devel zlib-devel
#make gcc &co available system wide and "action wide"
source /opt/rh/gcc-toolset-10/enable
source /opt/rh/gcc-toolset-11/enable
echo $PATH >> $GITHUB_PATH
- name: Config OR-Tools URL
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools/releases/download/v9.8-rte1.0/ortools_cxx_oraclelinux-8_static_sirius.zip" >> $GITHUB_ENV
- run: |
dnf module install -y nodejs:20/common
Expand Down Expand Up @@ -103,6 +108,8 @@ jobs:
antares-version: ${{needs.versions.outputs.antares-version}}
os: Oracle8
os-full-name: OracleServer-8.10
ortools-url: ${{env.ORTOOLS_URL}}
ortools-dir: ${{env.ORTOOLS_DIR}}

- name: vcpkg install
run: |
Expand Down Expand Up @@ -130,9 +137,10 @@ jobs:
-DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/deps \
-DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/deps;${{env.ORTOOLS_DIR}}/install" \
-DBUILD_UI=OFF \
-DALLOW_RUN_AS_ROOT=ON \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
Expand All @@ -143,7 +151,7 @@ jobs:
timeout-minutes: 120
shell: bash
run: |
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux/tools/openmpi/bin/:$PATH
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux-release/tools/openmpi/bin/:$PATH
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:${{ env.XPRS_LIB_Path_CONTAINER }}
export XPRESS=${{ env.XPRESS_CONTAINER }}
cd _build
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
XPRESS: ${{ github.workspace }}/xpress/bin
XPRS_LIB_Path: ${{ github.workspace }}/xpress/lib
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite"
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools

outputs:
TGZ_NAME: ${{ steps.export_output.outputs.TGZ_NAME }}
Expand Down Expand Up @@ -102,12 +103,18 @@ jobs:
path: 'antares-version.json'
key: 'antares_xpansion_version'

- name: Config OR-Tools URL
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools/releases/download/v9.8-rte1.0/ortools_cxx_ubuntu-20.04_static_sirius.zip" >> $GITHUB_ENV
- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
with:
antares-version: ${{steps.antares-version.outputs.result}}
os: ${{matrix.os}}
os-full-name: Ubuntu-20.04
ortools-url: ${{env.ORTOOLS_URL}}
ortools-dir: ${{env.ORTOOLS_DIR}}

- name: vcpkg install
run: |
Expand Down Expand Up @@ -136,8 +143,9 @@ jobs:
-DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/deps;${{env.ORTOOLS_DIR}}/install" \
-DBUILD_UI=ON \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
Expand All @@ -146,7 +154,7 @@ jobs:
- name: Test
run: |
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux/tools/openmpi/bin/:$PATH
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux-release/tools/openmpi/bin/:$PATH
cd _build
ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer"
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
# 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"
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools

outputs:
zip_name: ${{ steps.zip_name.outputs.zip_name }}
Expand All @@ -41,6 +42,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Config OR-Tools URL
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools/releases/download/v9.8-rte1.0/ortools_cxx_windows-latest_static_sirius.zip" >> $GITHUB_ENV
- name: Checkout xpressmp linux
if: matrix.xprs.value == 'XPRESS-ON'
uses: actions/checkout@v4
Expand Down Expand Up @@ -100,16 +105,33 @@ jobs:
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-windows-

- name: Config OR-Tools URL
shell: bash
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools/releases/download/v9.8-rte1.0/ortools_cxx_windows-latest_static_sirius.zip" >> $GITHUB_ENV
- run: echo ${{env.ORTOOLS_URL}}
- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-zip
with:
antares-version: ${{steps.antares-version.outputs.result}}
os: ${{matrix.os}}
ortools-url: ${{env.ORTOOLS_URL}}
ortools-dir: ${{env.ORTOOLS_DIR}}

- run: echo "version=$(echo ${{steps.antares-version.outputs.result}} | sed 's/-.*//')" >> $GITHUB_ENV
shell: bash
- name: Configure
shell: bash
run: |
$pwd=Get-Location
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
cmake -B _build -S . \
-DCMAKE_PREFIX_PATH="${{github.workspace}}/rte-antares-${{env.version}}-installer-64bits;${{env.ORTOOLS_DIR}}/install" \
-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: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,29 @@ inputs:
description: 'build type'
required: false
default: 'Release'
variant:
description: 'extra qualifiers'
required: false
default: ""
ortools-url:
description: 'URL for OR-Tools'
required: true
ortools-dir:
description: 'Destination directory for OR-Tools'
required: true
runs:
using: "composite"
steps:
- id: download-extract
- name: download-extract antares
shell: bash
run: |
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
version=$(echo ${{inputs.antares-version}} | sed 's/-.*//')
mkdir deps
wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${{inputs.antares-version}}/antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz
tar -xvf antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz -C deps --strip-components=1
rm -rf antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz
wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${{inputs.antares-version}}/antares-${version}-${{inputs.os-full-name}}.tar.gz
tar -xvf antares-${version}-${{inputs.os-full-name}}.tar.gz -C deps --strip-components=1
rm -rf antares-${version}-${{inputs.os-full-name}}.tar.gz
- name: Download & extract OR-Tools
shell: bash
run: |
mkdir -p ${{inputs.ortools-dir}}
cd ${{inputs.ortools-dir}}
wget ${{inputs.ortools-url}} -O ortools.zip
unzip ortools.zip
rm ortools.zip
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,29 @@ inputs:
description: 'extra qualifiers'
required: false
default: ""
ortools-url:
description: 'URL for OR-Tools'
required: true
ortools-dir:
description: 'Destination directory for OR-Tools'
required: true

runs:
using: "composite"
steps:
- id: download-extract
shell: bash
run: |
wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${{inputs.antares-version}}/rte-antares-${{inputs.antares-version}}-installer-64bits.zip
unzip rte-antares-${{inputs.antares-version}}-installer-64bits.zip
rm -rf rte-antares-${{inputs.antares-version}}-installer-64bits.zip
steps:
- id: download-extract
shell: bash
run: |
version=$(echo ${{inputs.antares-version}} | sed 's/-.*//')
wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${{inputs.antares-version}}/rte-antares-${version}-installer-64bits.zip
unzip rte-antares-${version}-installer-64bits.zip
rm -rf rte-antares-${version}-installer-64bits.zip
- name: Download & extract OR-Tools
shell: bash
run: |
mkdir "${{inputs.ortools-dir}}"
cd "${{inputs.ortools-dir}}"
wget ${{inputs.ortools-url}} -O ortools.zip
unzip ortools.zip
rm ortools.zip
10 changes: 9 additions & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
os: [ ubuntu-20.04 ]
env:
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite"
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools

steps:

Expand Down Expand Up @@ -80,12 +81,19 @@ jobs:
path: 'antares-version.json'
key: 'antares_xpansion_version'

- name: Config OR-Tools URL
shell: bash
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools/releases/download/v9.8-rte1.0/ortools_cxx_ubuntu-20.04_static_sirius.zip" >> $GITHUB_ENV
- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
with:
antares-version: ${{steps.antares-version.outputs.result}}
os: ${{matrix.os}}
os-full-name: Ubuntu-20.04
ortools-url: ${{env.ORTOOLS_URL}}
ortools-dir: ${{env.ORTOOLS_DIR}}

- name: Init submodule
run: |
Expand Down Expand Up @@ -117,7 +125,7 @@ jobs:
-DBUILD_TESTING=ON \
-DBUILD_antares_solver=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/deps;${{env.ORTOOLS_DIR}}/install" \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ubuntu-system-deps-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
-DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-DBUILD_UI=ON \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Cache vcpkg binary dir
Expand All @@ -113,7 +114,7 @@ jobs:
- name: Running unit tests
run: |
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux/tools/openmpi/bin/:$PATH
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux-release/tools/openmpi/bin/:$PATH
cd _build
ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer"
Expand Down
Loading

0 comments on commit 8f705e3

Please sign in to comment.