From 332235d75c19759bb89525b37f44e3d9e031a92f Mon Sep 17 00:00:00 2001 From: JP Lehr Date: Sun, 3 Nov 2024 19:55:19 +0100 Subject: [PATCH] [GH][CI] Adds container build to GH actions Build the MetaCG container via GH actions workflow. --- .github/workflows/mcg-ci.yml | 16 ++++++++++++++ container/full-build | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 container/full-build diff --git a/.github/workflows/mcg-ci.yml b/.github/workflows/mcg-ci.yml index a93bdb6..4213ed7 100644 --- a/.github/workflows/mcg-ci.yml +++ b/.github/workflows/mcg-ci.yml @@ -12,3 +12,19 @@ jobs: run: cmake -B build -S . - name: build run: cmake --build build --parallel + + build-container: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: . + file: "container/full-build" + tags: metacg-devel:latest + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/container/full-build b/container/full-build new file mode 100644 index 0000000..9420046 --- /dev/null +++ b/container/full-build @@ -0,0 +1,43 @@ +FROM ubuntu:20.04 + +WORKDIR /opt/metacg + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y gcc g++ gdb cmake python3 apt-utils wget gnupg qt5-default git autoconf automake libtool zlib1g-dev zlib1g vim unzip python3-pip python3-pytest python3-pytest-cov openmpi-bin openmpi-common bison flex python2 bear + +RUN pip3 install -U pip + +RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && apt-get install -y libllvm-10-ocaml-dev libllvm10 llvm-10 llvm-10-dev llvm-10-doc llvm-10-examples llvm-10-runtime clang-10 clang-tools-10 clang-10-doc libclang-common-10-dev libclang-10-dev libclang1-10 clang-format-10 python3-clang-10 clangd-10 clang-tidy-10 + +RUN ln -s /usr/bin/clang-10 /usr/bin/clang && ln -s /usr/bin/clang++-10 /usr/bin/clang++ + +RUN mkdir -p deps/install && \ + cd deps && \ + wget http://apps.fz-juelich.de/scalasca/releases/cube/4.5/dist/cubelib-4.5.tar.gz && \ + mkdir cubelib && \ + cd cubelib && \ + tar xzf ../cubelib-4.5.tar.gz && cd cubelib-4.5 && \ + ./configure --prefix=/opt/metacg/extern/install/cubelib && \ + make -j $(nproc) && \ + make install + +RUN mkdir metacg + +COPY ./build_submodules.sh /opt/metacg/metacg + +RUN cd metacg && \ + PATH=/opt/metacg/extern/install/cubelib/bin:$PATH ./build_submodules.sh $(nproc) + +COPY . /opt/metacg/metacg + +RUN cd metacg && cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=/tmp/metacg \ + -DCUBE_LIB=/opt/metacg/extern/install/cubelib/lib \ + -DCUBE_INCLUDE=/opt/metacg/extern/install/cubelib/include/cubelib \ + -DEXTRAP_INCLUDE=./extern/install/extrap/include \ + -DEXTRAP_LIB=./extern/install/extrap/lib \ + -DMETACG_BUILD_PGIS=ON \ + -DMETACG_BUILD_CGCOLLECTOR=ON \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON && \ + cmake --build build --parallel