Skip to content

Commit

Permalink
Fix various issues with build process build
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Dec 13, 2024
1 parent 6f8fd94 commit c1851fa
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 68 deletions.
77 changes: 13 additions & 64 deletions .github/workflows/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,78 +11,27 @@ on:
types: [ created ]

env:
GITHUB_TOKEN: ${{ github.token }}
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }}

jobs:

build_sirius:
name: build sirius
runs-on: ubuntu-latest
container: 'centos:centos7'
steps:
- name: is release created
- name: Build sirius using docker image
run: |
release_created=${{ github.event_name == 'release' && github.event.action == 'created' }}
echo "RELEASE_CREATED=$release_created" >> $GITHUB_ENV
docker build -t centos7-sirius -f docker/Dockerfile
- name: Get release
if: ${{ env.RELEASE_CREATED == 'true' }}
id: get_release
uses:
bruceadams/[email protected]

- name: install requirements
run: |
yum install -y epel-release
yum install -y git redhat-lsb-core centos-release-scl scl-utils
yum install -y cmake3 devtoolset-9
- name: Checkout sirius
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b $GITHUB_REF_NAME .
- name: set sirius output variables
id: sirius-variables
run: |
SIRIUS_BASE_PATH=$PWD
SIRIUS_INSTALL_DIR=centos-7_sirius-solver-install
SIRIUS_INSTALL_PATH="${SIRIUS_BASE_PATH}/${SIRIUS_INSTALL_DIR}"
ARCHIVE_NAME=centos-7_sirius-solver.zip
ARCHIVE_PATH="${SIRIUS_BASE_PATH}/${ARCHIVE_NAME}"
echo "::set-output name=install-dir::$SIRIUS_INSTALL_DIR"
echo "::set-output name=install-path::$SIRIUS_INSTALL_PATH"
echo "::set-output name=archive-name::$ARCHIVE_NAME"
echo "::set-output name=archive-path::$ARCHIVE_PATH"
- name: Configure Sirius
run: |
source /opt/rh/devtoolset-9/enable
cmake3 -S src \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${{ steps.sirius-variables.outputs.install-dir }}"
- name: Build & Install Sirius
- name: create a container without starting it && retrieve the .tgz
run: |
source /opt/rh/devtoolset-9/enable
cmake3 --build build --config Release --target install -j14
- name: Zip Install Sirius
container_id=$(docker create centos7-sirius)
docker cp $container_id:/centos-7_sirius-solver.zip /tmp
- name: Publish assets
if: ${{ env.IS_RELEASE == 'true' }}
env:
GITHUB_TOKEN: ${{ github.token }}
tag: ${{ github.event.inputs.release_tag }}
run: |
ARCHIVE_NAME="${{ steps.sirius-variables.outputs.archive-name }}"
zip -r $ARCHIVE_NAME "${{ steps.sirius-variables.outputs.install-dir }}"
- name: Upload sirius install
uses: actions/upload-artifact@v2
with:
name: ${{ steps.sirius-variables.outputs.install-dir }}
path: ${{ steps.sirius-variables.outputs.install-path }}

- name: Publish sirius install
if: ${{ env.RELEASE_CREATED == 'true' }}
uses: actions/[email protected]
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.sirius-variables.outputs.archive-path }}
asset_name: ${{ steps.sirius-variables.outputs.archive-name }}
asset_content_type: application/zip
gh release upload "$tag" /tmp/centos-7_sirius-solver.zip
4 changes: 2 additions & 2 deletions .github/workflows/oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ jobs:
zip -r $ARCHIVE_NAME "${{ steps.sirius-variables.outputs.install-dir }}"
- name: Upload sirius install
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ steps.sirius-variables.outputs.install-dir }}
path: ${{ steps.sirius-variables.outputs.install-path }}
path: ${{ steps.sirius-variables.outputs.install-path }}-ol8

- name: Publish sirius install
if: ${{ env.RELEASE_CREATED == 'true' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ jobs:
zip -r "${{ steps.sirius-variables.outputs.archive-name }}" "${{ steps.sirius-variables.outputs.install-dir }}"
- name: Upload sirius install
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ steps.sirius-variables.outputs.install-dir }}
name: ${{ steps.sirius-variables.outputs.install-dir }}-${{ matrix.os }}
path: ${{ steps.sirius-variables.outputs.install-path }}

- name: Publish sirius install
Expand Down
44 changes: 44 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM centos:7

ENV LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8

CMD ["/bin/bash"]

# Install requirements : update repo
RUN 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 &&\
yum install -y epel-release &&\
yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils python3 &&\
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

RUN yum update -y
RUN yum install -y epel-release
RUN yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils rpm-build && \
yum install -y devtoolset-9 && \
yum install -y rh-git227-git cmake3

RUN rm -rf /var/cache/yum

RUN echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc
RUN echo "source /opt/rh/rh-git227/enable" >> /etc/bashrc

SHELL ["/bin/bash", "--login", "-c"]

RUN git clone --branch antares_integration --depth 1 https://github.com/rte-france/sirius-solver

RUN cd sirius-solver &&\
cmake3 -S src \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/install"

RUN cd sirius-solver &&\
cmake3 --build build --config Release -j4 &&\
cd build &&\
cmake3 --install .

RUN zip -r /centos-7_sirius-solver.zip /install

0 comments on commit c1851fa

Please sign in to comment.