Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/centos build #971

Merged
merged 47 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5034070
start
a-zakir Dec 4, 2024
a380790
update
a-zakir Dec 5, 2024
9dd73b3
update
a-zakir Dec 5, 2024
b0759dc
update
a-zakir Dec 5, 2024
33a8c5a
update
a-zakir Dec 5, 2024
ccfddbc
update
a-zakir Dec 5, 2024
27315a7
update
a-zakir Dec 5, 2024
1470111
update
a-zakir Dec 5, 2024
14b05d8
update
a-zakir Dec 5, 2024
18ab776
update
a-zakir Dec 5, 2024
f705f84
update
a-zakir Dec 5, 2024
4110024
update
a-zakir Dec 5, 2024
0d7ced3
update
a-zakir Dec 5, 2024
7bd6f65
update
a-zakir Dec 5, 2024
46b92e7
update
a-zakir Dec 5, 2024
79db9c0
update
a-zakir Dec 5, 2024
fd1daf5
shorten image deps
a-zakir Dec 6, 2024
8ad4b74
update
a-zakir Dec 6, 2024
1887262
update
a-zakir Dec 6, 2024
0cc465e
update
a-zakir Dec 6, 2024
c3bbd94
update
a-zakir Dec 6, 2024
2275ebe
update
a-zakir Dec 6, 2024
0d77f7e
update
a-zakir Dec 6, 2024
53d2cfc
test cache
a-zakir Dec 6, 2024
33e9324
update
a-zakir Dec 6, 2024
0979da3
update upload
a-zakir Dec 6, 2024
a8283ec
update
a-zakir Dec 6, 2024
e67faea
update
a-zakir Dec 6, 2024
ba22d9d
update
a-zakir Dec 6, 2024
c364f82
update
a-zakir Dec 6, 2024
bfd2950
Cache
a-zakir Dec 6, 2024
17bb211
update
a-zakir Dec 10, 2024
bf715a9
update
a-zakir Dec 10, 2024
6a4f034
update
a-zakir Dec 10, 2024
5116d0f
tmp
a-zakir Dec 10, 2024
f0aa159
tmp
a-zakir Dec 10, 2024
b7b52ab
tmp
a-zakir Dec 10, 2024
6248458
tmp
a-zakir Dec 10, 2024
c67dcd8
tmp
a-zakir Dec 10, 2024
b3c25d7
update
a-zakir Dec 10, 2024
ba1f914
Revert "update"
a-zakir Dec 10, 2024
1096e68
update
a-zakir Dec 10, 2024
bd5f7c1
update
a-zakir Dec 10, 2024
85557c3
Revert "update"
a-zakir Dec 10, 2024
3c3aca9
reactivating tests
a-zakir Dec 10, 2024
4759ad4
Revert "update"
a-zakir Dec 11, 2024
d374189
update
a-zakir Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading
Loading