From 7372442f3af720111e507238fd345f6aa99de5ff Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Mon, 8 Apr 2024 11:49:43 +0100 Subject: [PATCH] Fix clang-tidy in CI (#1325) Also removed old docker files and scripts. --- .github/workflows/build.yml | 4 +- .github/workflows/update_docker_ci.yml | 6 ++- docker/centos/Dockerfile | 49 ------------------- docker/centos/build_git_centos7.sh | 18 ------- docker/centos/install_cmake.sh | 11 ----- docker/ci/dockerfile | 7 ++- docker/clio_docker/centos/build_boost.sh | 13 ----- .../clio_docker/centos/build_git_centos7.sh | 18 ------- docker/clio_docker/centos/dockerfile | 34 ------------- docker/clio_docker/centos/install_cmake.sh | 11 ----- docker/compilers/gcc-12/dockerfile | 2 +- docker/shared/build_boost.sh | 13 ----- docker/shared/install_cmake.sh | 11 ----- docker/shared/install_openssl.sh | 3 -- docker/ubuntu/Dockerfile | 24 --------- 15 files changed, 13 insertions(+), 211 deletions(-) delete mode 100644 docker/centos/Dockerfile delete mode 100755 docker/centos/build_git_centos7.sh delete mode 100755 docker/centos/install_cmake.sh delete mode 100755 docker/clio_docker/centos/build_boost.sh delete mode 100755 docker/clio_docker/centos/build_git_centos7.sh delete mode 100644 docker/clio_docker/centos/dockerfile delete mode 100755 docker/clio_docker/centos/install_cmake.sh delete mode 100755 docker/shared/build_boost.sh delete mode 100755 docker/shared/install_cmake.sh delete mode 100755 docker/shared/install_openssl.sh delete mode 100644 docker/ubuntu/Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6417e21f..41b09663 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,8 +39,8 @@ jobs: build: name: Build - needs: - - check_format + needs: + - check_format - check_docs strategy: fail-fast: false diff --git a/.github/workflows/update_docker_ci.yml b/.github/workflows/update_docker_ci.yml index 7163476f..9aa7a2ab 100644 --- a/.github/workflows/update_docker_ci.yml +++ b/.github/workflows/update_docker_ci.yml @@ -1,5 +1,6 @@ name: Update CI docker image on: + pull_request: push: branches: [develop] paths: @@ -11,9 +12,10 @@ on: jobs: build_and_push: name: Build and push docker image - runs-on: ubuntu-20.04 + runs-on: [self-hosted, heavy] steps: - name: Login to DockerHub + if: ${{ github.event == 'push' }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USER }} @@ -36,6 +38,6 @@ jobs: with: context: ${{ github.workspace }}/docker/ci platforms: linux/amd64,linux/arm64 - push: true + push: ${{ github.event == 'push' }} tags: ${{ steps.meta.outputs.tags }} diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile deleted file mode 100644 index 0c5dd28b..00000000 --- a/docker/centos/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -# FROM centos:7 as deps -FROM centos:7 as build - -ENV CLIO_DIR=/opt/clio/ -# ENV OPENSSL_DIR=/opt/openssl - -RUN yum -y install git epel-release centos-release-scl perl-IPC-Cmd openssl -RUN yum install -y devtoolset-11 -ENV version=3.16 -ENV build=3 -# RUN curl -OJL https://cmake.org/files/v$version/cmake-$version.$build.tar.gz -COPY docker/shared/install_cmake.sh /install_cmake.sh -RUN /install_cmake.sh 3.16.3 /usr/local -RUN source /opt/rh/devtoolset-11/enable -WORKDIR /tmp -# RUN mkdir $OPENSSL_DIR && cd $OPENSSL_DIR -COPY docker/centos/build_git_centos7.sh build_git_centos7.sh - -RUN ./build_git_centos7.sh -RUN git clone https://github.com/openssl/openssl -WORKDIR /tmp/openssl -RUN git checkout OpenSSL_1_1_1q -#--prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic -RUN SSLDIR=$(openssl version -d | cut -d: -f2 | tr -d [:space:]\") && ./config -fPIC --prefix=/usr --openssldir=${SSLDIR} zlib shared && \ - make -j $(nproc) && \ - make install_sw -WORKDIR /tmp -# FROM centos:7 as build - -RUN git clone https://github.com/xrplf/clio.git -COPY docker/shared/build_boost.sh build_boost.sh -ENV OPENSSL_ROOT=/opt/local/openssl -ENV BOOST_ROOT=/boost -RUN source scl_source enable devtoolset-11 && /tmp/build_boost.sh 1.75.0 -RUN yum install -y bison flex -RUN yum install -y rpmdevtools rpmlint -RUN source /opt/rh/devtoolset-11/enable && cd /tmp/clio && \ - cmake -B build -DBUILD_TESTS=1 && \ - cmake --build build --parallel $(nproc) -RUN mkdir output -RUN strip clio/build/clio_server && strip clio/build/clio_tests -RUN cp clio/build/clio_tests output/ && cp clio/build/clio_server output/ -RUN cp clio/docs/examples/config/example-config.json output/example-config.json - -FROM centos:7 -COPY --from=build /tmp/output /clio -RUN mkdir -p /opt/clio/etc && mv /clio/docs/examples/config/example-config.json /opt/clio/etc/config.json - -CMD ["/clio/clio_server", "/opt/clio/etc/config.json"] diff --git a/docker/centos/build_git_centos7.sh b/docker/centos/build_git_centos7.sh deleted file mode 100755 index 0db195f3..00000000 --- a/docker/centos/build_git_centos7.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -ex -GIT_VERSION="2.37.1" -curl -OJL https://github.com/git/git/archive/refs/tags/v${GIT_VERSION}.tar.gz -tar zxvf git-${GIT_VERSION}.tar.gz -cd git-${GIT_VERSION} - -yum install -y centos-release-scl epel-release -yum update -y -yum install -y devtoolset-11 autoconf gnu-getopt gettext zlib-devel libcurl-devel - -source /opt/rh/devtoolset-11/enable -make configure -./configure -make git -j$(nproc) -make install git -git --version | cut -d ' ' -f3 diff --git a/docker/centos/install_cmake.sh b/docker/centos/install_cmake.sh deleted file mode 100755 index 6a3cba4f..00000000 --- a/docker/centos/install_cmake.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -CMAKE_VERSION=${1:-"3.16.3"} -cd /tmp -URL="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" -curl -OJLs $URL -tar xzvf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -mv cmake-${CMAKE_VERSION}-Linux-x86_64 /opt/ -ln -s /opt/cmake-${CMAKE_VERSION}-Linux-x86_64/bin/cmake /usr/local/bin/cmake diff --git a/docker/ci/dockerfile b/docker/ci/dockerfile index cbc07016..25f81494 100644 --- a/docker/ci/dockerfile +++ b/docker/ci/dockerfile @@ -20,7 +20,7 @@ RUN apt-get -qq update \ # Install packages RUN apt update -qq \ && apt install -y --no-install-recommends --no-install-suggests python3 python3-pip git git-lfs make ninja-build flex bison jq graphviz \ - clang-format-${LLVM_TOOLS_VERSION} clang-tidy-${LLVM_TOOLS_VERSION} clang-tools-${LLVM_TOOLS_VERSION} \ + clang-format-${LLVM_TOOLS_VERSION} clang-tidy-${LLVM_TOOLS_VERSION} clang-tools-${LLVM_TOOLS_VERSION} \ && update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${LLVM_TOOLS_VERSION} 100 \ && pip3 install -q --upgrade --no-cache-dir pip && pip3 install -q --no-cache-dir conan==1.62 gcovr cmake cmake-format \ && apt-get clean && apt remove -y software-properties-common @@ -64,6 +64,11 @@ WORKDIR /root # Setup conan # Note: intentionally leaving cppstd=20 RUN conan profile new default --detect \ + && conan profile update settings.compiler=gcc default \ + && conan profile update settings.compiler.version=12 default \ && conan profile update settings.compiler.cppstd=20 default \ && conan profile update settings.compiler.libcxx=libstdc++11 default \ + && conan profile update env.CC=/opt/bin/gcc default \ + && conan profile update env.CXX=/opt/bin/g++ default \ + && conan profile update "conf.tools.build:compiler_executables={\"c\": \"/opt/bin/gcc\", \"cpp\": \"/opt/bin/g++\"}" default \ && conan remote add --insert 0 conan-non-prod http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod diff --git a/docker/clio_docker/centos/build_boost.sh b/docker/clio_docker/centos/build_boost.sh deleted file mode 100755 index a7253128..00000000 --- a/docker/clio_docker/centos/build_boost.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -exu - -#yum install wget lz4 lz4-devel git llvm13-static.x86_64 llvm13-devel.x86_64 devtoolset-11-binutils zlib-static -# it's either those or link=static that halves the failures. probably link=static -BOOST_VERSION=$1 -BOOST_VERSION_=$(echo ${BOOST_VERSION} | tr . _) -echo "BOOST_VERSION: ${BOOST_VERSION}" -echo "BOOST_VERSION_: ${BOOST_VERSION_}" -curl -OJLs "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_}.tar.gz" -tar zxf "boost_${BOOST_VERSION_}.tar.gz" -cd boost_${BOOST_VERSION_} && ./bootstrap.sh && ./b2 --without-python link=static -j$(nproc) -mkdir -p /boost && mv boost /boost && mv stage /boost diff --git a/docker/clio_docker/centos/build_git_centos7.sh b/docker/clio_docker/centos/build_git_centos7.sh deleted file mode 100755 index 0db195f3..00000000 --- a/docker/clio_docker/centos/build_git_centos7.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -ex -GIT_VERSION="2.37.1" -curl -OJL https://github.com/git/git/archive/refs/tags/v${GIT_VERSION}.tar.gz -tar zxvf git-${GIT_VERSION}.tar.gz -cd git-${GIT_VERSION} - -yum install -y centos-release-scl epel-release -yum update -y -yum install -y devtoolset-11 autoconf gnu-getopt gettext zlib-devel libcurl-devel - -source /opt/rh/devtoolset-11/enable -make configure -./configure -make git -j$(nproc) -make install git -git --version | cut -d ' ' -f3 diff --git a/docker/clio_docker/centos/dockerfile b/docker/clio_docker/centos/dockerfile deleted file mode 100644 index 012ce09e..00000000 --- a/docker/clio_docker/centos/dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -FROM centos:7 - -ENV CLIO_DIR=/opt/clio/ -# ENV OPENSSL_DIR=/opt/openssl - -RUN yum -y install git epel-release centos-release-scl perl-IPC-Cmd openssl -RUN yum install -y devtoolset-11 -ENV version=3.16 -ENV build=3 -# RUN curl -OJL https://cmake.org/files/v$version/cmake-$version.$build.tar.gz -COPY install_cmake.sh /install_cmake.sh -RUN /install_cmake.sh 3.16.3 /usr/local -RUN source /opt/rh/devtoolset-11/enable -WORKDIR /tmp -# RUN mkdir $OPENSSL_DIR && cd $OPENSSL_DIR -COPY build_git_centos7.sh build_git_centos7.sh - -RUN ./build_git_centos7.sh -RUN git clone https://github.com/openssl/openssl -WORKDIR /tmp/openssl -RUN git checkout OpenSSL_1_1_1q -#--prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic -RUN SSLDIR=$(openssl version -d | cut -d: -f2 | tr -d [:space:]\") && ./config -fPIC --prefix=/usr --openssldir=${SSLDIR} zlib shared && \ - make -j $(nproc) && \ - make install_sw -WORKDIR /tmp -RUN git clone https://github.com/xrplf/clio.git -COPY build_boost.sh build_boost.sh -ENV OPENSSL_ROOT=/opt/local/openssl -ENV BOOST_ROOT=/boost -RUN source scl_source enable devtoolset-11 && /tmp/build_boost.sh 1.75.0 -RUN yum install -y bison flex -RUN source /opt/rh/devtoolset-11/enable && \ - cd /tmp/clio && cmake -B build -Dtests=0 -Dlocal_libarchive=1 -Dunity=0 -DBUILD_TESTS=0 && cmake --build build --parallel $(nproc) diff --git a/docker/clio_docker/centos/install_cmake.sh b/docker/clio_docker/centos/install_cmake.sh deleted file mode 100755 index 6a3cba4f..00000000 --- a/docker/clio_docker/centos/install_cmake.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -CMAKE_VERSION=${1:-"3.16.3"} -cd /tmp -URL="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" -curl -OJLs $URL -tar xzvf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -mv cmake-${CMAKE_VERSION}-Linux-x86_64 /opt/ -ln -s /opt/cmake-${CMAKE_VERSION}-Linux-x86_64/bin/cmake /usr/local/bin/cmake diff --git a/docker/compilers/gcc-12/dockerfile b/docker/compilers/gcc-12/dockerfile index e80fca68..a811c55b 100644 --- a/docker/compilers/gcc-12/dockerfile +++ b/docker/compilers/gcc-12/dockerfile @@ -6,7 +6,7 @@ SHELL ["/bin/bash", "-c"] USER root WORKDIR /root -ENV GCC_VERSION=12.3.0 +ENV GCC_VERSION=12.3.0 RUN apt update -qq \ && apt install -qq -y --no-install-recommends --no-install-suggests \ diff --git a/docker/shared/build_boost.sh b/docker/shared/build_boost.sh deleted file mode 100755 index a7253128..00000000 --- a/docker/shared/build_boost.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -exu - -#yum install wget lz4 lz4-devel git llvm13-static.x86_64 llvm13-devel.x86_64 devtoolset-11-binutils zlib-static -# it's either those or link=static that halves the failures. probably link=static -BOOST_VERSION=$1 -BOOST_VERSION_=$(echo ${BOOST_VERSION} | tr . _) -echo "BOOST_VERSION: ${BOOST_VERSION}" -echo "BOOST_VERSION_: ${BOOST_VERSION_}" -curl -OJLs "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_}.tar.gz" -tar zxf "boost_${BOOST_VERSION_}.tar.gz" -cd boost_${BOOST_VERSION_} && ./bootstrap.sh && ./b2 --without-python link=static -j$(nproc) -mkdir -p /boost && mv boost /boost && mv stage /boost diff --git a/docker/shared/install_cmake.sh b/docker/shared/install_cmake.sh deleted file mode 100755 index 6a3cba4f..00000000 --- a/docker/shared/install_cmake.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -CMAKE_VERSION=${1:-"3.16.3"} -cd /tmp -URL="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" -curl -OJLs $URL -tar xzvf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -mv cmake-${CMAKE_VERSION}-Linux-x86_64 /opt/ -ln -s /opt/cmake-${CMAKE_VERSION}-Linux-x86_64/bin/cmake /usr/local/bin/cmake diff --git a/docker/shared/install_openssl.sh b/docker/shared/install_openssl.sh deleted file mode 100755 index d9628ae7..00000000 --- a/docker/shared/install_openssl.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -set -e diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile deleted file mode 100644 index 9078429f..00000000 --- a/docker/ubuntu/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM ubuntu:20.04 AS boost - -RUN apt-get update && apt-get install -y build-essential -ARG BOOST_VERSION_=1_75_0 -ARG BOOST_VERSION=1.75.0 -COPY docker/shared/build_boost.sh . -RUN apt install -y curl -RUN ./build_boost.sh ${BOOST_VERSION} -ENV BOOST_ROOT=/boost - -FROM ubuntu:20.04 AS build -ENV BOOST_ROOT=/boost -COPY --from=boost /boost /boost -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install --no-install-recommends -y build-essential software-properties-common pkg-config libssl-dev wget curl gpg git zlib1g-dev bison flex autoconf lsb-release -RUN apt install -y gpg-agent -RUN wget https://apt.llvm.org/llvm.sh -RUN chmod +x llvm.sh && ./llvm.sh 14 && ./llvm.sh 15 -# COPY . /clio -## Install cmake -ARG CMAKE_VERSION=3.16.3 -COPY docker/shared/install_cmake.sh . -RUN ./install_cmake.sh ${CMAKE_VERSION} -ENV PATH="/opt/local/cmake/bin:$PATH"