From 9e9dbae5af47df7d34be607c9bcc7d24d02148f9 Mon Sep 17 00:00:00 2001 From: Jason Marechal Date: Mon, 9 Oct 2023 14:28:06 +0200 Subject: [PATCH] Try simplify centOS image use --- .github/workflows/build_centos7.yml | 8 ++-- .github/workflows/centos-release.yml | 8 ++-- .../workflows/centos7-system-deps-build.yml | 46 +++++++++++-------- .github/workflows/publish_centos_docker.yml | 4 +- docker/centos7 | 46 ------------------- docker/centos7-bare | 33 ------------- docker/centos7-system-dpes | 27 +++++++++++ 7 files changed, 63 insertions(+), 109 deletions(-) delete mode 100644 docker/centos7 delete mode 100644 docker/centos7-bare create mode 100644 docker/centos7-system-dpes diff --git a/.github/workflows/build_centos7.yml b/.github/workflows/build_centos7.yml index 2c452a5843..604cb51169 100644 --- a/.github/workflows/build_centos7.yml +++ b/.github/workflows/build_centos7.yml @@ -25,7 +25,7 @@ jobs: uses: tj-actions/changed-files@v32 with: files: | - docker/centos7-bare + docker/centos7-system-deps - name: Docker file push id: docker_push @@ -36,9 +36,9 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} workdir: docker - dockerfile: centos7-bare + dockerfile: centos7-system-deps cache: false - tags: centos7-xpansion-bare + tags: centos7-system-deps versions: runs-on: ubuntu-latest @@ -72,7 +72,7 @@ jobs: build: runs-on: ubuntu-latest needs: [ docker_publish, versions ] - container: 'antaresrte/rte-antares:centos7-xpansion-bare' + container: 'antaresrte/rte-antares:centos7-system-deps' strategy: matrix: xprs: [ XPRESS-ON, XPRESS-OFF ] diff --git a/.github/workflows/centos-release.yml b/.github/workflows/centos-release.yml index 052d7e0052..601bed450e 100644 --- a/.github/workflows/centos-release.yml +++ b/.github/workflows/centos-release.yml @@ -32,7 +32,7 @@ jobs: uses: tj-actions/changed-files@v32 with: files: | - docker/centos7-bare + docker/centos7-system-deps - name: Docker file push id: docker_push @@ -43,9 +43,9 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} workdir: docker - dockerfile: centos7-bare + dockerfile: centos7-system-deps cache: false - tags: centos7-xpansion-bare + tags: centos7-system-deps userguide: runs-on: ubuntu-latest @@ -107,7 +107,7 @@ jobs: build: runs-on: ubuntu-latest needs: [ docker_publish, userguide, versions ] - container: 'antaresrte/rte-antares:centos7-xpansion-bare' + container: 'antaresrte/rte-antares:centos7-system-deps' strategy: matrix: xprs: [ XPRESS-ON, XPRESS-OFF ] diff --git a/.github/workflows/centos7-system-deps-build.yml b/.github/workflows/centos7-system-deps-build.yml index 4c37de838e..96fe6b7932 100644 --- a/.github/workflows/centos7-system-deps-build.yml +++ b/.github/workflows/centos7-system-deps-build.yml @@ -8,6 +8,31 @@ on: - release/* - ci/* jobs: + docker_publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + with: + fetch-depth: 0 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v32 + with: + files: | + docker/centos7-system-deps + + - name: Docker file push + id: docker_push + if: steps.changed-files.outputs.any_changed == 'true' + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: antaresrte/rte-antares + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + workdir: docker + dockerfile: centos7-system-deps + cache: false + tags: centos7-system-deps versions: runs-on: ubuntu-latest @@ -42,31 +67,12 @@ jobs: runs-on: ubuntu-latest needs: versions - container: 'centos:7' + container: 'antaresrte/rte-antares:centos7-system-deps' steps: - id: branch-name uses: tj-actions/branch-names@v6 - - name: Set up Python - run: | - yum update -y - yum install -y python3 python3-pip - pip3 install --upgrade pip - - - name: Install libraries - run: | - yum install -y wget git epel-release redhat-lsb-core gcc gcc-c++ make centos-release-scl scl-utils - yum install -y jsoncpp-devel gtest-devel openmpi-devel doxygen graphviz boost-program-options - yum install -y cmake3 devtoolset-9 environment-modules rpm-build zlib-devel - yum install -y rh-git227-git - yum install -y libuuid-devel - - - name: update bashrc - run: | - echo "source scl_source enable rh-git227" >> ~/.bashrc - echo "source scl_source enable devtoolset-9" >> ~/.bashrc - - run: | git --version diff --git a/.github/workflows/publish_centos_docker.yml b/.github/workflows/publish_centos_docker.yml index 27f783454b..b70599a375 100644 --- a/.github/workflows/publish_centos_docker.yml +++ b/.github/workflows/publish_centos_docker.yml @@ -22,6 +22,6 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} workdir: docker - dockerfile: centos7-bare + dockerfile: centos7-system-deps cache: false - tags: centos7-xpansion-bare \ No newline at end of file + tags: centos7-system-deps \ No newline at end of file diff --git a/docker/centos7 b/docker/centos7 deleted file mode 100644 index 976d2e93ec..0000000000 --- a/docker/centos7 +++ /dev/null @@ -1,46 +0,0 @@ -FROM centos:7 - -ARG ANTARES_DEPS_VERSION -ARG ANTARES_SOLVER_VERSION - -# Install requirements : update repo -RUN yum update -y - -# Install requirements : install epel -RUN yum install -y epel-release - -# Install requirements -RUN yum install -y git redhat-lsb-core gcc gcc-c++ make wget centos-release-scl scl-utils rpm-build &&\ - yum install -y cmake3 devtoolset-9 &&\ - yum install -y rh-git227-git - -# Install xpansion requirements -RUN yum install -y jsoncpp-devel gtest-devel openmpi-devel boost-openmpi-devel doxygen graphviz boost-program-options environment-modules rpm-build zlib-devel - -# Add python and pip installation for antares-xpansion -RUN yum install -y python3-pip &&\ - python3 -m pip install --upgrade pip &&\ - pip3 install pyinstaller pyyaml pytest numpy touch pytest-cov mkdocs mkdocs-material - -# Install tbb. tbb is required for execution policy (parallelization c++) but the system version is too old. -RUN git clone https://github.com/wjakob/tbb.git && \ - cd tbb/build && \ - cmake3 .. && \ - cmake3 --build . --target install -j8 - -# Download and extract pre-compiled libraries -RUN wget https://github.com/AntaresSimulatorTeam/antares-deps/releases/download/v${ANTARES_DEPS_VERSION}/rte-antares-deps-centos7-Release.tar.gz -RUN tar -xvf rte-antares-deps-centos7-Release.tar.gz -RUN rm -rf rte-antares-deps-centos7-Release.tar.gz - -RUN wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${ANTARES_SOLVER_VERSION}/antares-${ANTARES_SOLVER_VERSION}-CentOS-7.9.2009.tar.gz -RUN tar -xvf antares-${ANTARES_SOLVER_VERSION}-CentOS-7.9.2009-ortools-xpress.tar.gz -C rte-antares-deps-Release --strip-components=1 -RUN rm -rf antares-${ANTARES_SOLVER_VERSION}-CentOS-7.9.2009-ortools-xpress.tar.gz - -RUN yum install -y openmpi-devel -RUN wget https://github.com/boostorg/boost/releases/download/boost-1.81.0/boost-1.81.0.tar.gz \ - tar xvf boost-1.81.0.tar.gz \ - cd boost-1.81.0 \ - ./bootstrap.sh --with-libraries=serialization,program_options,mpi \ - echo "using mpi ;" >> project-config.jam \ - ./b2 install diff --git a/docker/centos7-bare b/docker/centos7-bare deleted file mode 100644 index 69a7e027ad..0000000000 --- a/docker/centos7-bare +++ /dev/null @@ -1,33 +0,0 @@ -FROM centos:7 - -# Install requirements: update repo -RUN yum update -y - -# Install requirements : install epel -RUN yum install -y epel-release - -# Install requirements -RUN yum install -y git redhat-lsb-core gcc gcc-c++ make wget centos-release-scl scl-utils rpm-build &&\ - yum install -y cmake3 devtoolset-9 - -RUN yum -y remove git && \ - yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm && \ - yum -y install git - -# Install xpansion requirements -RUN yum install -y jsoncpp-devel gtest-devel openmpi-devel doxygen graphviz environment-modules zlib-devel - -# Install tbb. tbb is required for execution policy (parallelization c++) but the system version is too old. -RUN git clone https://github.com/wjakob/tbb.git && \ - cd tbb/build && \ - cmake3 .. && \ - cmake3 --build . --target install -j8 - -# Add python and pip installation for antares-xpansion -RUN yum install -y python3-pip &&\ - python3 -m pip install --upgrade pip &&\ - pip3 install pyinstaller pyyaml pytest numpy touch pytest-cov mkdocs mkdocs-material - -#create user -RUN useradd user -# USER user diff --git a/docker/centos7-system-dpes b/docker/centos7-system-dpes new file mode 100644 index 0000000000..634149774a --- /dev/null +++ b/docker/centos7-system-dpes @@ -0,0 +1,27 @@ +FROM centos:7 + +# Install requirements: update repo +RUN yum update -y + +# Install requirements : install epel +RUN yum install -y epel-release + +RUN \ + yum install -y wget git epel-release redhat-lsb-core gcc gcc-c++ make centos-release-scl scl-utils &&\ + yum install -y jsoncpp-devel gtest-devel openmpi-devel doxygen graphviz boost-program-options &&\ + yum install -y cmake3 devtoolset-9 environment-modules rpm-build zlib-devel &&\ + yum install -y rh-git227-git &&\ + yum install -y libuuid-devel + +RUN \ + echo "source scl_source enable rh-git227" >> ~/.bashrc &&\ + echo "source scl_source enable devtoolset-9" >> ~/.bashrc + +# Add python and pip installation for antares-xpansion +RUN yum install -y python3-pip &&\ + python3 -m pip install --upgrade pip &&\ + pip3 install pyinstaller pyyaml pytest numpy touch pytest-cov mkdocs mkdocs-material + +#create user +RUN useradd user +# USER user