Skip to content

Commit

Permalink
Merge branch 'develop' into release/1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tbittar committed Dec 11, 2024
2 parents 7872222 + 59db4fd commit 8d03d7f
Show file tree
Hide file tree
Showing 284 changed files with 224,693 additions and 15,525 deletions.
228 changes: 62 additions & 166 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,198 +46,94 @@ jobs:
cache: false
tags: 1.1.1

versions:
runs-on: ubuntu-latest
outputs:
antares-version: ${{steps.antares-version.outputs.result}}
antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}}
steps:
- uses: actions/checkout@v4
- name: Read antares-solver version
id: antares-version
uses: ./.github/actions/read-json-value
with:
path: 'antares-version.json'
key: 'antares_version'

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


build:
runs-on: ubuntu-latest
needs: [ docker_publish, versions ]
container: 'antaresrte/xpansion-centos7:1.1.1'
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools
ORTOOLS_URL: "https://github.com/rte-france/or-tools-rte/releases/download/v9.11-rte1.1/ortools_cxx_centos7_static_sirius.zip"

needs: [ docker_publish ]
outputs:
TGZ_NAME: ${{ steps.export_output.outputs.TGZ_NAME }}
SINGLE_FILE_NAME: ${{ steps.export_output.outputs.SINGLE_FILE_NAME }}

TGZ_NAME: ${{ steps.get-archives.outputs.TGZ_NAME }}
SINGLE_FILE_NAME: ${{ steps.get-archives.outputs.SINGLE_FILE_NAME }}
steps:
- run: |
source /opt/rh/devtoolset-11/enable
echo $PATH >> $GITHUB_PATH
- name: Get release
if: github.event_name == 'release' && github.event.action == 'created'
id: get_release
uses: bruceadams/[email protected]

- uses: actions/checkout@v3 #Keep at 3
with:
submodules: true

- run: |
yum install -y nodejs
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.28.x'

- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
- uses: actions/checkout@master
with:
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: repo update
run: |
yum update
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install wheel #Does not work in requirements
pip3 install -r requirements-tests.txt
pip3 install -r requirements-ui.txt
fetch-depth: 0
sparse-checkout: |
docker
src/vcpkg.json
ref: ${{ env.REF }}


- name: Set-up Xpress with pip for centos 7
shell: bash
run: |
export PATH=/root/miniconda3/condabin:$PATH
conda install -c fico-xpress "xpress>=9.2,<9.3"
XPRESS_DIR=/root/miniconda3/lib/python3.8/site-packages/xpress
echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV
echo "XPAUTH_PATH=$XPRESS_DIR/license/community-xpauth.xpr" >> $GITHUB_ENV
echo "Create symbolic link for XPRESS library file because it is missing in the Python installation"
ln -s $XPRESS_DIR/lib/libxprs.so.42 $XPRESS_DIR/lib/libxprs.so

- name: vcpkg install
- name: create vcpkg cache dir
run: |
git config --global safe.directory '*'
git submodule update --remote --init vcpkg
pushd vcpkg
git fetch --unshallow
./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
mkdir -p ${{ github.workspace }}/vcpkg_cache
- name: Restore vcpkg binary dir from cache
id: cache-vcpkg-binary
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-centOS-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-cache-centos7-${{ hashFiles('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-

- name: Configure
run: |
source /opt/rh/devtoolset-11/enable
cmake -B _build -S . \
-DBUILD_TESTING=ON \
-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
run: |
cmake --build _build --config Release -j$(nproc)
restore-keys: vcpkg-cache-centos7-

- name: Tests with Cucumber
uses: ./.github/workflows/cucumber-tests
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
# feature: "features/outer_loop_tests.feature"
mpi_path: ${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux-release/tools/openmpi/bin
key: centos7-on-${{ runner.os }}

- name: Cache vcpkg binary dir
if: always()
id: save-cache-vcpkg-binary
uses: actions/cache/save@v3
with:
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-centOS-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}

- name: Running unit tests
timeout-minutes: 120
shell: bash
- name: set env variables -- DockerFiles
run: |
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux-release/tools/openmpi/bin/:$PATH
cd _build
ctest -C Release --output-on-failure -L "unit|benders|lpnamer|medium"
echo "DOCKERFILE=$(pwd)/docker/centos7-build" >> $GITHUB_ENV
echo "DOCKERDIR=$(pwd)/docker" >> $GITHUB_ENV
#######################
- name: Install
- name: Build the image and Antares-Xpansion
run: |
ls -latr .ccache/
echo "-------------"
docker build \
-t antaresxpansion:centos7 \
--build-arg="BRANCH=${{ github.ref_name }}" \
--build-arg="NPROC=$(nproc)" \
--build-arg="VCPKG_CACHE_DIR=./vcpkg_cache" \
--build-arg CCACHE_DIR=./.ccache \
--build-arg CCACHE_KEY=centos7-on-${{ runner.os }} \
-f ${{ env.DOCKERFILE }} .
- name: create a container without starting it && retrieve archive dir
id: get-archives
run: |
cd _build
cmake --install .
container_id=$(docker create antaresxpansion:centos7)
docker cp $container_id:/workspace/antares-xpansion/archive archive
echo "TGZ_NAME=$(basename "$(ls ./archive/multiple/*.tar.gz)")" >> $GITHUB_OUTPUT
echo "SINGLE_FILE_NAME=$(basename "$(ls ./archive/single/*.tar.gz)")" >> $GITHUB_OUTPUT
docker cp $container_id:/workspace/vcpkg_cache ${{ env.VCPKG_CACHE_DIR }}
docker cp $container_id:/workspace/.ccache/. .ccache
ls -la .ccache
docker rm $container_id
- id: create-single-file
name: Single file .tar.gz creation
uses: ./.github/workflows/single-file-creation-tgz
- name: Cache vcpkg binary dir
if: always()
id: save-cache-vcpkg-binary
uses: actions/cache/save@v4
with:
antares-xpansion-version: ${{needs.versions.outputs.antares-xpansion-version}}

- name: Installer .tar.gz creation
run: |
cd _build
export FILE_NAME="antaresXpansion-${{needs.versions.outputs.antares-xpansion-version}}-CentOS-7.9.2009"
cpack -G TGZ -D CPACK_PACKAGE_FILE_NAME=$FILE_NAME
#Need to differentiate between xpress/no_xpress files
#Cpack command line doesn't seem to care about -P or -R options
echo "TGZ_NAME=$FILE_NAME.tar.gz" >> $GITHUB_ENV
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-cache-centos7-${{ hashFiles('vcpkg.json', '.git/modules/vcpkg/HEAD') }}

- name: Upload .tar.gz
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{env.TGZ_NAME}}
path: _build/${{env.TGZ_NAME}}
path: archive/single
name: ${{ steps.get-archives.outputs.SINGLE_FILE_NAME }}

- name: Upload single file
uses: actions/upload-artifact@v3
- name: Upload .tar.gz
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create-single-file.outputs.archive-name }}
path: ${{ steps.create-single-file.outputs.archive-path }}
path: archive/multiple
name: ${{ steps.get-archives.outputs.TGZ_NAME }}

- name: export asset name in output
id: export_output
run: |
echo "TGZ_NAME=${{env.TGZ_NAME}}" >> $GITHUB_OUTPUT
echo "SINGLE_FILE_NAME=${{ steps.create-single-file.outputs.archive-name }}" >> $GITHUB_OUTPUT

#######################
#####################
userguide:
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -291,7 +187,7 @@ jobs:
needs: [ build, build_running_image ]
steps:
- name: Download build assets
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{needs.build.outputs.TGZ_NAME}}

Expand Down Expand Up @@ -338,7 +234,7 @@ jobs:
needs: [ build, build_running_image ]
steps:
- name: Download build assets
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{needs.build.outputs.SINGLE_FILE_NAME}}

Expand Down Expand Up @@ -392,13 +288,13 @@ jobs:
path: docs/

- name: Download build assets
uses: actions/download-artifact@v3 #build use v3
uses: actions/download-artifact@v4
with:
name: ${{needs.build.outputs.TGZ_NAME}}
path: _build/

- name: Download build assets single file
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{needs.build.outputs.SINGLE_FILE_NAME}}
path: .
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-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
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements-tests.txt
pip install -r requirements-ui.txt
- name: Set-up Xpress with pip for Ubuntu
shell: bash
Expand Down Expand Up @@ -142,7 +141,6 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-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
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements-tests.txt
pip install -r requirements-ui.txt
- name: Set-up Xpress with pip
shell: bash
Expand Down Expand Up @@ -121,7 +120,6 @@ jobs:
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
-DCMAKE_INSTALL_PREFIX=_install
-DPython3_EXECUTABLE="${{ env.Python3_ROOT_DIR }}/python.exe"
-DBUILD_UI=ON
- name: Build
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cucumber-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
required: false
default: 'features'
tags:
description: 'Tags to run (default skips tests marked @flaky)'
description: 'Tags to run (default skips tests marked @flaky or @xpress)'
required: false
default: '~@flaky'
mpi_path:
Expand All @@ -21,4 +21,4 @@ runs:
run: |
export PATH="${{ inputs.mpi_path }}:$PATH"
cd tests/end_to_end
behave --tags ${{ inputs.tags }} cucumber/${{ inputs.feature }} --no-capture --no-capture-stderr --format pretty
behave --tags ${{ inputs.tags }} cucumber/${{ inputs.feature }} --no-capture --no-capture-stderr --format pretty
2 changes: 0 additions & 2 deletions .github/workflows/ubuntu-system-deps-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements-tests.txt
pip install -r requirements-ui.txt
- name: Install mandatory system libraries
run: |
Expand Down Expand Up @@ -94,7 +93,6 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/windows-vcpkg-deps-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements-tests.txt
pip install -r requirements-ui.txt
- name: Pre-requisites
shell: cmd
Expand Down Expand Up @@ -75,7 +74,7 @@ jobs:
- name: Configure
run: |
$pwd=Get-Location
cmake -B _build -S . -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON
cmake -B _build -S . -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install
- name: Cache vcpkg binary dir
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ CMakeFiles/*
src/python/config.yaml
src/python/antares_xpansion/__version__.py
src/python/resources.py
config-ui.yaml
build_config.yaml

# Tests
Expand All @@ -54,6 +53,7 @@ coverage-reports
# Doc pdf file
antaresxpansionuserguide.pdf
include/google/protobuf/message.h
xwiki_source

# vscode
.vscode
Expand Down
Loading

0 comments on commit 8d03d7f

Please sign in to comment.