From 146f5399c72ff508f176e6392e490647ac657ce7 Mon Sep 17 00:00:00 2001 From: caballa Date: Wed, 20 Sep 2023 20:57:43 -0600 Subject: [PATCH] fix(ci): run ci on dev branch --- .github/workflows/nightly-crab-docker.yaml | 23 ++++++-------- .github/workflows/test-crab-dev-docker.yaml | 6 ++-- .github/workflows/test-crab-docker.yml | 6 ++-- docker/buildpack-deps-crab.Dockerfile | 2 +- docker/buildpack-deps-crab.jammy.Dockerfile | 18 +++++++++++ docker/crab.dev.Dockerfile | 29 ++++++++++++++++++ docker/crab.dev.apron.Dockerfile | 34 +++++++++++++++++++++ docker/crab.dev.elina.Dockerfile | 34 +++++++++++++++++++++ docker/crab.dev.pplite.Dockerfile | 32 +++++++++++++++++++ docker/readme.md | 12 +++++--- 10 files changed, 172 insertions(+), 24 deletions(-) create mode 100644 docker/buildpack-deps-crab.jammy.Dockerfile create mode 100644 docker/crab.dev.Dockerfile create mode 100644 docker/crab.dev.apron.Dockerfile create mode 100644 docker/crab.dev.elina.Dockerfile create mode 100644 docker/crab.dev.pplite.Dockerfile diff --git a/.github/workflows/nightly-crab-docker.yaml b/.github/workflows/nightly-crab-docker.yaml index 349e3c2a..09827bbe 100644 --- a/.github/workflows/nightly-crab-docker.yaml +++ b/.github/workflows/nightly-crab-docker.yaml @@ -30,25 +30,22 @@ jobs: uses: actions/checkout@v2 with: ref: master - - name: Build crab without external libraries + run tests - run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:bionic -f docker/crab.Dockerfile . - #- name: Build crab without external libraries + run tests - # run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Coverage -t seahorn/crab:bionic -f docker/crab.Dockerfile . + #- name: Build crab without external libraries for coverage + # run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Coverage -t seahorn/crab:nightly -f docker/crab.Dockerfile . #- name: Generate coverage report and upload to codecov - # run: docker run -v $(pwd):/host -it seahorn/crab:bionic /bin/sh -c "bash /crab/tests/run_coverage.sh /crab/build /crab && mv /crab/build/all.info /host" && bash <(curl -s https://codecov.io/bash) -Z -f all.info -t ${{ secrets.CODECOV_TOKEN }} + # run: docker run -v $(pwd):/host -it seahorn/crab:nightly /bin/sh -c "bash /crab/tests/run_coverage.sh /crab/build /crab && mv /crab/build/all.info /host" && bash <(curl -s https://codecov.io/bash) -Z -f all.info -t ${{ secrets.CODECOV_TOKEN }} + - name: Build crab without external libraries + run tests + run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:nightly -f docker/crab.Dockerfile . - name: Build crab+apron+ldd-boxes and run tests - run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes:bionic -f docker/crab.apron.Dockerfile . + run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes:nightly -f docker/crab.apron.Dockerfile . - name: Build crab+elina and run tests - run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina:bionic -f docker/crab.elina.Dockerfile . - #- name: Build crab+pplite and run tests - # run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_pplite:bionic -f docker/crab.pplite.Dockerfile . + run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina:nightly -f docker/crab.elina.Dockerfile . - name: Login to DockerHub Registry if: ${{ github.event_name == 'schedule' }} # only push if nightly run run: echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin - name: Tag and push crab (nightly) to DockerHub if: ${{ github.event_name == 'schedule' }} # only push if nightly run run: | - docker push seahorn/crab:bionic - docker push seahorn/crab_apron_boxes:bionic - docker push seahorn/crab_elina:bionic - #docker push seahorn/crab_pplite:bionic + docker push seahorn/crab:nightly + docker push seahorn/crab_apron_boxes:nightly + docker push seahorn/crab_elina:nightly diff --git a/.github/workflows/test-crab-dev-docker.yaml b/.github/workflows/test-crab-dev-docker.yaml index 05f48c6a..fb4185cf 100644 --- a/.github/workflows/test-crab-dev-docker.yaml +++ b/.github/workflows/test-crab-dev-docker.yaml @@ -25,8 +25,8 @@ jobs: with: ref: dev - name: Build crab without external libraries + run tests - run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:bionic -f docker/crab.Dockerfile . + run: docker build --build-arg BUILD_TYPE=Release -t seahorn/crab -f docker/crab.dev.Dockerfile . - name: Build crab+apron+ldd-boxes and run tests - run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes:bionic -f docker/crab.apron.Dockerfile . + run: docker build --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes -f docker/crab.dev.apron.Dockerfile . - name: Build crab+elina and run tests - run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina:bionic -f docker/crab.elina.Dockerfile . + run: docker build --build-arg BUILD_TYPE=Release -t seahorn/crab_elina -f docker/crab.dev.elina.Dockerfile . diff --git a/.github/workflows/test-crab-docker.yml b/.github/workflows/test-crab-docker.yml index 6962763d..8d77de90 100644 --- a/.github/workflows/test-crab-docker.yml +++ b/.github/workflows/test-crab-docker.yml @@ -25,8 +25,8 @@ jobs: with: ref: master - name: Build crab without external libraries + run tests - run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:bionic -f docker/crab.Dockerfile . + run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab -f docker/crab.Dockerfile . - name: Build crab+apron+ldd-boxes and run tests - run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes:bionic -f docker/crab.apron.Dockerfile . + run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes -f docker/crab.apron.Dockerfile . - name: Build crab+elina and run tests - run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina:bionic -f docker/crab.elina.Dockerfile . + run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina -f docker/crab.elina.Dockerfile . diff --git a/docker/buildpack-deps-crab.Dockerfile b/docker/buildpack-deps-crab.Dockerfile index a568bd3f..f954ac8f 100644 --- a/docker/buildpack-deps-crab.Dockerfile +++ b/docker/buildpack-deps-crab.Dockerfile @@ -1,5 +1,5 @@ # -# Dockerfile for building Crab dependencies. +# Dockerfile for building Crab dependencies for Ubuntu xenial and bionic. # # Arguments: # - UBUNTU: xenial, bionic diff --git a/docker/buildpack-deps-crab.jammy.Dockerfile b/docker/buildpack-deps-crab.jammy.Dockerfile new file mode 100644 index 00000000..37281932 --- /dev/null +++ b/docker/buildpack-deps-crab.jammy.Dockerfile @@ -0,0 +1,18 @@ +# +# Dockerfile for building Crab dependencies for Ubuntu 22.04 jammy +# + +# Pull base image. +FROM buildpack-deps:jammy + +RUN apt-get update && \ + apt-get install -yqq software-properties-common && \ + apt-get install -yqq build-essential && \ + add-apt-repository -y ppa:mhier/libboost-latest && \ + apt-get update && \ + apt-get install -yqq cmake cmake-data \ + ninja-build \ + g++-12 \ + libboost1.74-dev libboost-program-options1.74-dev \ + libgmp-dev libmpfr-dev libflint-dev + diff --git a/docker/crab.dev.Dockerfile b/docker/crab.dev.Dockerfile new file mode 100644 index 00000000..dc923385 --- /dev/null +++ b/docker/crab.dev.Dockerfile @@ -0,0 +1,29 @@ +# +# Dockerfile for Crab image without external libraries. +# +# Pull base image. +FROM seahorn/buildpack-deps-crab:jammy + +# Assume that docker-build is ran in the top-level Crab directory +COPY . /crab +# Re-create the build directory that might have been present in the source tree +RUN rm -rf /crab/build /crab/debug /crab/release && mkdir /crab/build + +WORKDIR /crab/build + +ARG BUILD_TYPE +# Build configuration. +RUN cmake -GNinja \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DCMAKE_INSTALL_PREFIX=run \ + -DCMAKE_CXX_COMPILER=g++-12 \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ + -DCRAB_ENABLE_TESTS=ON \ + ../ && \ + cmake --build . --target install + +# Run tests +RUN /crab/tests/run_tests.sh /crab/tests/expected_results.out /crab/build + +WORKDIR /crab + diff --git a/docker/crab.dev.apron.Dockerfile b/docker/crab.dev.apron.Dockerfile new file mode 100644 index 00000000..07e099d1 --- /dev/null +++ b/docker/crab.dev.apron.Dockerfile @@ -0,0 +1,34 @@ +# +# Dockerfile for Crab image with apron and boxes libraries. +# + +# Pull base image. +FROM seahorn/buildpack-deps-crab:jammy + +# Assume that docker-build is ran in the top-level Crab directory +COPY . /crab +# Re-create the build directory that might have been present in the source tree +RUN rm -rf /crab/build /crab/debug /crab/release && mkdir /crab/build +WORKDIR /crab/build + +ARG BUILD_TYPE +# Build configuration. +RUN cmake -GNinja \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DCMAKE_INSTALL_PREFIX=run \ + -DCMAKE_CXX_COMPILER=g++-12 \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ + -DCRAB_USE_LDD=ON \ + -DCRAB_USE_APRON=ON \ + -DCRAB_ENABLE_TESTS=ON \ + ../ && \ + cmake --build . --target ldd && cmake .. && \ + cmake --build . --target apron && cmake .. && \ + cmake --build . --target install + +# Run tests +RUN /crab/tests/run_tests.sh /crab/tests/expected_results.apron.out /crab/build +RUN /crab/tests/run_tests.sh /crab/tests/expected_results.boxes.out /crab/build + +WORKDIR /crab + diff --git a/docker/crab.dev.elina.Dockerfile b/docker/crab.dev.elina.Dockerfile new file mode 100644 index 00000000..7bef5aea --- /dev/null +++ b/docker/crab.dev.elina.Dockerfile @@ -0,0 +1,34 @@ +# +# Dockerfile for Crab image with elina library. +# + +# Pull base image. +FROM seahorn/buildpack-deps-crab:jammy + +# Assume that docker-build is ran in the top-level Crab directory +COPY . /crab +# Re-create the build directory that might have been present in the source tree +RUN rm -rf /crab/build /crab/debug /crab/release && mkdir /crab/build +WORKDIR /crab/build + +ARG BUILD_TYPE +# Build configuration. +RUN cmake -GNinja \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DCMAKE_INSTALL_PREFIX=run \ + -DCMAKE_CXX_COMPILER=g++-12 \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ + -DCRAB_USE_ELINA=ON \ + -DCRAB_ENABLE_TESTS=ON \ + ../ && \ + cmake --build . --target elina && cmake .. && \ + cmake --build . --target install + +# To find elina dynamic libraries +ENV LD_LIBRARY_PATH "/crab/build/run/elina/lib:$LD_LIBRARY_PATH" + +# Run tests +RUN /crab/tests/run_tests.sh /crab/tests/expected_results.elina.out /crab/build + +WORKDIR /crab + diff --git a/docker/crab.dev.pplite.Dockerfile b/docker/crab.dev.pplite.Dockerfile new file mode 100644 index 00000000..f6b7b96b --- /dev/null +++ b/docker/crab.dev.pplite.Dockerfile @@ -0,0 +1,32 @@ +# +# Dockerfile for Crab image with pplite library. +# + +# Pull base image. +FROM seahorn/buildpack-deps-crab:jammy + +# Assume that docker-build is ran in the top-level Crab directory +COPY . /crab +# Re-create the build directory that might have been present in the source tree +RUN rm -rf /crab/build /crab/debug /crab/release && mkdir /crab/build +WORKDIR /crab/build + +ARG BUILD_TYPE +# Build configuration. +RUN cmake -GNinja \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DCMAKE_INSTALL_PREFIX=run \ + -DCMAKE_CXX_COMPILER=g++-12 \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ + -DCRAB_USE_APRON=ON -DCRAB_USE_PPLITE=ON \ + -DCRAB_ENABLE_TESTS=ON \ + ../ && \ + cmake --build . --target apron && cmake .. && \ + cmake --build . --target pplite && cmake .. && \ + cmake --build . --target pplite_domains + +# Run tests +RUN /crab/tests/run_tests.sh /crab/tests/expected_results.pplite.out /crab/build + +WORKDIR /crab + diff --git a/docker/readme.md b/docker/readme.md index 8d392ebd..387e2abb 100644 --- a/docker/readme.md +++ b/docker/readme.md @@ -2,16 +2,21 @@ ```shell -$ docker build --build-arg UBUNTU=bionic -t seahorn/buildpack-deps-crab:bionic -f docker/buildpack-deps-crab.Dockerfile . +$ docker build -t seahorn/buildpack-deps-crab:bionic -f docker/buildpack-deps-crab.Dockerfile . $ docker push seahorn/buildpack-deps-crab:bionic ``` +or +```shell +$ docker build -t seahorn/buildpack-deps-crab:bionic -f docker/buildpack-deps-crab.jammy.Dockerfile . +$ docker push seahorn/buildpack-deps-crab:jammy +``` # Building Docker image for Crab and running tests # ```shell -docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:bionic -f docker/crab.Dockerfile . -docker run -v `pwd`:/host -it seahorn/crab:bionic +docker build --build-arg BUILD_TYPE=Release -t seahorn/crab -f docker/crab.Dockerfile . +docker run -v `pwd`:/host -it seahorn/crab:latest ``` This will automatically download all dependencies from a base image @@ -20,6 +25,5 @@ and build Crab under `/crab/build`. Crab's install directory is added to `PATH`. Build arguments (required): -- UBUNTU: xenial, bionic - BUILD_TYPE: Release, Debug