Skip to content

Commit

Permalink
Test assets are running in fresh environnement (CentOS7) (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMarechal25 authored Sep 4, 2024
1 parent 1134553 commit 224a10a
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 0 deletions.
113 changes: 113 additions & 0 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,119 @@ jobs:
name: user-guide
path: ${{ steps.create-user-guide.outputs.pdf-path }}

build_running_image:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export
uses: docker/build-push-action@v6
with:
tags: centos:run
file: docker/centos7_test_run
outputs: type=docker,dest=/tmp/centos.tar

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: centos
path: /tmp/centos.tar

test_assets:
runs-on: ubuntu-latest
needs: [ build, build_running_image ]
steps:
- name: Download build assets
uses: actions/download-artifact@v3
with:
name: ${{needs.build.outputs.TGZ_NAME}}

- name: Download image
uses: actions/download-artifact@v4
with:
name: centos
path: /tmp

- name: Load image
run: |
docker load --input /tmp/centos.tar
- name: setup
run: |
tar --strip-components=1 -xzf ${{needs.build.outputs.TGZ_NAME}}
- uses: addnab/docker-run-action@v3
name: Run tests
with:
image: centos:run
shell: bash
options: -v ${{ github.workspace }}:/work
run: |
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib
cd /work
./antares-xpansion-launcher -i examples/SmallTestFiveCandidates --allow-run-as-root
- uses: addnab/docker-run-action@v3
name: run tests with 2 processes
with:
image: centos:run
shell: bash
options: -v ${{ github.workspace }}:/work
run: |
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib
cd /work
./antares-xpansion-launcher -i examples/SmallTestFiveCandidates -n 2 --allow-run-as-root
test_single_file_asset:
runs-on: ubuntu-latest
needs: [ build, build_running_image ]
steps:
- name: Download build assets
uses: actions/download-artifact@v3
with:
name: ${{needs.build.outputs.SINGLE_FILE_NAME}}

- name: Download image
uses: actions/download-artifact@v4
with:
name: centos
path: /tmp

- name: Load image
run: |
docker load --input /tmp/centos.tar
- name: setup
run: |
tar --strip-components=1 -xzf ${{needs.build.outputs.SINGLE_FILE_NAME}}
- uses: addnab/docker-run-action@v3
name: Run tests
with:
image: centos:run
shell: bash
options: -v ${{ github.workspace }}:/work
run: |
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib
cd /work
./antares-xpansion-launcher -i examples/SmallTestFiveCandidates --allow-run-as-root
- uses: addnab/docker-run-action@v3
name: run tests with 2 processes
with:
image: centos:run
shell: bash
options: -v ${{ github.workspace }}:/work
run: |
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib
cd /work
./antares-xpansion-launcher -i examples/SmallTestFiveCandidates -n 2 --allow-run-as-root
release:
runs-on: ubuntu-latest
needs: [ build, userguide ]
Expand Down
27 changes: 27 additions & 0 deletions docker/centos7_test_run
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM centos:7

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 update -y && \
yum install -y centos-release-scl && \
#not a typo, centos-release-scl is needed to install devtoolset-10 but introduce deprecated mirror && \
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 update -y && \
yum install -y wget git epel-release redhat-lsb-core gcc gcc-c++ make scl-utils && \
yum install -y devtoolset-10-gcc* environment-modules rpm-build zlib-devel bzip2

RUN \
source /opt/rh/devtoolset-10/enable && \
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.6.tar.bz2 && \
tar -xvf openmpi-4.1.6.tar.bz2 && \
cd openmpi-4.1.6 && \
./configure --prefix=/usr/lib64/openmpi && \
make -j$(nproc) && \
make install && \
cd - && \
rm openmpi-4.1.6.tar.bz2 && \
rm -rf openmpi-4.1.6

0 comments on commit 224a10a

Please sign in to comment.