Skip to content

Commit

Permalink
Merge branch 'develop' into enhancement/SKALED-1900-release-build
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev authored Jan 8, 2025
2 parents 32e3309 + 5033d9f commit 2ba054f
Show file tree
Hide file tree
Showing 19 changed files with 271 additions and 192 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and test skale-consensus
on: [push]
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand All @@ -24,9 +24,9 @@ jobs:
- name: Free disk space
run: |
sudo apt-get remove -yq cmake libjsoncpp-dev aria2 ansible azure-cli shellcheck rpm xorriso zsync \
clang-6.0 lldb-6.0 lld-6.0 clang-format-6.0 clang-8 lldb-8 lld-8 clang-format-8 \
clang-9 lldb-9 lld-9 clangd-9 clang-format-9 dotnet-sdk-3.0 dotnet-sdk-3.1=3.1.101-1 \
esl-erlang firefox g++-8 g++-9 gfortran-8 gfortran-9 google-chrome-stable \
clang-6.0 lldb-6.0 lld-6.0 clang-8 lldb-8 lld-8 \
clang-9 lldb-9 lld-9 clangd-9 clang-format-14 dotnet-sdk-3.0 dotnet-sdk-3.1=3.1.101-1 \
esl-erlang firefox g++-11 g++-11 gfortran-8 gfortran-9 google-chrome-stable \
|| true >/dev/null 2>&1;
- name: Free more disk space
Expand Down Expand Up @@ -73,12 +73,18 @@ jobs:
sudo rm -rf /usr/local/lib/android >/dev/null 2>&1
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1
- name: Install docker compose
run: |
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
docker compose version
- name: try docker compose
run: |
# cd sgxwallet/run_sgx_sim && docker-compose pull && docker-compose up -d
cd sgxwallet/run_sgx_sim
echo " --------------------------- stopping sgx wallet ------------------------------------------------------------------------------------------------------ "
docker-compose down
docker compose down
echo " --------------------------- fixing sgx wallets docker config ----------------------------------------------------------------------------------------- "
mv docker-compose.yml docker-compose.yml.old-previous || true
echo "version: '3'" > docker-compose.yml
Expand All @@ -101,7 +107,7 @@ jobs:
echo " restart: unless-stopped" >> docker-compose.yml
echo " command: -s -y -V -d " >> docker-compose.yml
echo " --------------------------- pulling sgx wallet ------------------------------------------------------------------------------------------------------- "
docker-compose pull
docker compose pull
- name: install cmake
run: |
Expand All @@ -112,25 +118,24 @@ jobs:
- name: install packages
run: |
sudo apt-get -y install software-properties-common; sudo apt-add-repository universe; \
sudo apt-get update; sudo apt-get -y install -y software-properties-common apt-utils libprocps-dev \
gcc-9 g++-9 valgrind gawk sed libffi-dev ccache libgoogle-perftools-dev flex \
bison yasm texinfo \
autotools-dev autogen automake autoconf m4 shtool pkg-config sed gawk yasm nasm \
python3 python3-pip \
libtool build-essential \
libgcrypt20-dev
sudo apt-get update && \
sudo apt-get install -y build-essential software-properties-common; sudo apt-get update; \
sudo apt-add-repository universe; \
sudo apt-get update; sudo apt-get install -y apt-utils libprocps-dev \
gcc-11 g++-11 valgrind gawk sed libffi-dev ccache libunwind-dev libgoogle-perftools-dev yasm texinfo \
autotools-dev autogen automake autoconf m4 shtool pkg-config gawk nasm unzip \
python3 python3-pip libtool libgcrypt20-dev
# python python-pip
# python-is-python3
- name: Use g++-9 and gcov-9 by default
- name: Use g++-11 and gcov-11 by default
run: |
echo "Updating all needed alternatives"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 9
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 9
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9 9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-11 11
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-11 11
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-11 11
echo "Checking alternative for gcc"
which gcc
gcc --version
Expand All @@ -155,7 +160,7 @@ jobs:
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v1.1.0
uses: actions/cache@v4.2.0
with:
path: .ccache
key: ${ { matrix.config.name } }-ccache-${ { steps.ccache_cache_timestamp.outputs.timestamp } }
Expand All @@ -168,9 +173,6 @@ jobs:
- name: verify jsonrpc has been built
run: ls libBLS/deps/deps_inst/x86_or_x64/include/jsonrpccpp/client.h

- name: workaround for HUNTER
run: cd .. && mkdir -p "${HOME}"/.hunter/_Base/Download/crc32c/1.0.5/dc7fa8c/ && wget -O "${HOME}"/.hunter/_Base/Download/crc32c/1.0.5/dc7fa8c/hunter-1.0.5.tar.gz https://github.com/hunter-packages/crc32c/archive/refs/tags/hunter-1.0.5.tar.gz

- name: build consensus
run: |
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build consensust container
on: [push]
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:

- name: Cancel Previous Runs
Expand All @@ -13,9 +13,9 @@ jobs:
- name: Free disk space
run: |
sudo apt-get remove -yq cmake libjsoncpp-dev aria2 ansible azure-cli shellcheck rpm xorriso zsync \
clang-6.0 lldb-6.0 lld-6.0 clang-format-6.0 clang-8 lldb-8 lld-8 clang-format-8 \
clang-9 lldb-9 lld-9 clangd-9 clang-format-9 dotnet-sdk-3.0 dotnet-sdk-3.1=3.1.101-1 \
esl-erlang firefox g++-8 g++-9 gfortran-8 gfortran-9 google-chrome-stable \
clang-6.0 lldb-6.0 lld-6.0 clang-8 lldb-8 lld-8 \
clang-9 lldb-9 lld-9 clangd-9 clang-format-14 dotnet-sdk-3.0 dotnet-sdk-3.1=3.1.101-1 \
esl-erlang firefox g++-11 g++-11 gfortran-8 gfortran-9 google-chrome-stable \
|| true >/dev/null 2>&1;
- name: Free more disk space
Expand Down Expand Up @@ -73,24 +73,23 @@ jobs:
run: |
sudo apt-get install -y software-properties-common; sudo apt-add-repository universe; \
sudo apt-get update; sudo apt-get install -y software-properties-common apt-utils libprocps-dev \
gcc-9 g++-9 valgrind gawk sed libffi-dev ccache libgoogle-perftools-dev flex \
bison yasm texinfo \
autotools-dev autogen automake autoconf m4 shtool pkg-config sed gawk yasm nasm \
gcc-11 g++-11 valgrind gawk sed libffi-dev ccache libunwind-dev libgoogle-perftools-dev yasm texinfo \
autotools-dev autogen automake autoconf m4 shtool pkg-config sed gawk yasm nasm unzip \
python3 python3-pip python-is-python3 \
libtool build-essential \
libgcrypt20-dev
# python python-pip
# wget git libargtable2-dev \
# libmicrohttpd-dev libhiredis-dev redis-server openssl libssl-dev >/dev/null 2>&1;
- name: Use g++-9 and gcov-9 by default
- name: Use g++-11 and gcov-11 by default
run: |
echo "Updating all needed alternatives"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 9
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 9
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9 9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-11 11
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-11 11
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-11 11
echo "Checking alternative for gcc"
which gcc
gcc --version
Expand All @@ -106,7 +105,7 @@ jobs:
echo "Checking alternative for gcov-tool"
which gcov-tool
gcov-tool --version
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: submodule update
run: git submodule update --init --recursive
- name: Build the Docker image(GH)
Expand Down
99 changes: 24 additions & 75 deletions .github/workflows/dockerimagebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,89 +5,36 @@ on:
- build_base*
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Free disk space
run: |
sudo apt-get remove -yq cmake libjsoncpp-dev aria2 ansible azure-cli shellcheck rpm xorriso zsync \
clang-6.0 lldb-6.0 lld-6.0 clang-format-6.0 clang-8 lldb-8 lld-8 clang-format-8 \
clang-9 lldb-9 lld-9 clangd-9 clang-format-9 dotnet-sdk-3.0 dotnet-sdk-3.1=3.1.101-1 \
esl-erlang firefox g++-8 g++-9 gfortran-8 gfortran-9 google-chrome-stable \
|| true >/dev/null 2>&1;
- name: Free more disk space
run: |
sudo apt-get remove -yq > \
google-cloud-sdk ghc-8.0.2 ghc-8.2.2 ghc-8.4.4 ghc-8.6.2 ghc-8.6.3 ghc-8.6.4 \
ghc-8.6.5 ghc-8.8.1 ghc-8.8.2 ghc-8.8.3 ghc-8.10.1 cabal-install-2.0 cabal-install-2.2 \
cabal-install-2.4 cabal-install-3.0 cabal-install-3.2 heroku imagemagick \
libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \
mercurial apt-transport-https mono-complete mysql-client libmysqlclient-dev \
mysql-server mssql-tools unixodbc-dev yarn bazel chrpath libssl-dev libxft-dev \
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev php7.1 php7.1-bcmath \
php7.1-bz2 php7.1-cgi php7.1-cli php7.1-common php7.1-curl php7.1-dba php7.1-dev \
php7.1-enchant php7.1-fpm php7.1-gd php7.1-gmp php7.1-imap php7.1-interbase php7.1-intl \
php7.1-json php7.1-ldap php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-odbc \
php7.1-opcache php7.1-pgsql php7.1-phpdbg php7.1-pspell php7.1-readline php7.1-recode \
php7.1-snmp php7.1-soap php7.1-sqlite3 php7.1-sybase php7.1-tidy php7.1-xml \
php7.1-xmlrpc php7.1-xsl php7.1-zip php7.2 php7.2-bcmath php7.2-bz2 php7.2-cgi \
php7.2-cli php7.2-common php7.2-curl php7.2-dba php7.2-dev php7.2-enchant php7.2-fpm \
php7.2-gd php7.2-gmp php7.2-imap php7.2-interbase php7.2-intl php7.2-json php7.2-ldap \
php7.2-mbstring php7.2-mysql php7.2-odbc php7.2-opcache php7.2-pgsql php7.2-phpdbg \
php7.2-pspell php7.2-readline php7.2-recode php7.2-snmp php7.2-soap php7.2-sqlite3 \
php7.2-sybase php7.2-tidy php7.2-xml php7.2-xmlrpc php7.2-xsl php7.2-zip php7.3 \
php7.3-bcmath php7.3-bz2 php7.3-cgi php7.3-cli php7.3-common php7.3-curl php7.3-dba \
php7.3-dev php7.3-enchant php7.3-fpm php7.3-gd php7.3-gmp php7.3-imap php7.3-interbase \
php7.3-intl php7.3-json php7.3-ldap php7.3-mbstring php7.3-mysql php7.3-odbc \
php7.3-opcache php7.3-pgsql php7.3-phpdbg php7.3-pspell php7.3-readline php7.3-recode \
php7.3-snmp php7.3-soap php7.3-sqlite3 php7.3-sybase php7.3-tidy php7.3-xml \
php7.3-xmlrpc php7.3-xsl php7.3-zip php7.4 php7.4-bcmath php7.4-bz2 php7.4-cgi \
php7.4-cli php7.4-common php7.4-curl php7.4-dba php7.4-dev php7.4-enchant php7.4-fpm \
php7.4-gd php7.4-gmp php7.4-imap php7.4-interbase php7.4-intl php7.4-json php7.4-ldap \
php7.4-mbstring php7.4-mysql php7.4-odbc php7.4-opcache php7.4-pgsql php7.4-phpdbg \
php7.4-pspell php7.4-readline php7.4-snmp php7.4-soap php7.4-sqlite3 php7.4-sybase \
php7.4-tidy php7.4-xml php7.4-xmlrpc php7.4-xsl php7.4-zip php-amqp php-apcu \
php-igbinary php-memcache php-memcached php-mongodb php-redis php-xdebug \
php-zmq snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org \
|| true > /dev/null 2>&1;
- name: Cleanup
run: |
sudo apt-get autoremove -y >/dev/null 2>&1 && \
sudo apt-get autoclean -y >/dev/null 2>&1 && \
sudo rm -rf /usr/local/lib/android >/dev/null 2>&1 && \
docker rmi $(docker image ls -aq) >/dev/null 2>&1

- name: install cmake
run: |
wget --no-check-certificate https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh && \
chmod +x cmake-3.10.0-Linux-x86_64.sh && \
./cmake-3.10.0-Linux-x86_64.sh --skip-license --include-subdir && \
sudo ln -sf `pwd`/cmake-3.10.0-Linux-x86_64/bin/* /usr/local/bin
wget --no-check-certificate https://cmake.org/files/v3.21/cmake-3.21.0-linux-x86_64.sh && \
chmod +x cmake-3.21.0-linux-x86_64.sh && \
./cmake-3.21.0-linux-x86_64.sh --skip-license --include-subdir && \
sudo ln -sf `pwd`/cmake-3.21.0-linux-x86_64/bin/* /usr/local/bin
- name: install packages
run: |
sudo apt-get install -y software-properties-common; sudo apt-add-repository universe; \
sudo apt-get update; sudo apt-get install -y software-properties-common apt-utils libprocps-dev \
gcc-9 g++-9 valgrind gawk sed libffi-dev ccache libgoogle-perftools-dev flex \
bison yasm texinfo \
autotools-dev autogen automake autoconf m4 shtool pkg-config sed gawk yasm nasm \
sudo apt-get update && \
sudo apt-get install -y build-essential software-properties-common apt-utils libprocps-dev \
gcc-11 g++-11 valgrind gawk sed libffi-dev ccache yasm texinfo \
autotools-dev autogen automake autoconf m4 shtool pkg-config nasm \
python3 python3-pip python-is-python3 \
libtool build-essential \
libgcrypt20-dev
libtool libgcrypt20-dev
# python python-pip
# wget git libargtable2-dev \
# libmicrohttpd-dev libhiredis-dev redis-server openssl libssl-dev >/dev/null 2>&1;
# libmicrohttpd-dev libhiredis-dev redis-server openssl libssl-dev >/dev/null 2>&1;
- name: Use g++-9 and gcov-9 by default
- name: Use g++-11 and gcov-11 by default
run: |
echo "Updating all needed alternatives"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 9
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 9
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9 9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-11 11
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-11 11
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-11 11
echo "Checking alternative for gcc"
which gcc
gcc --version
Expand All @@ -104,16 +51,18 @@ jobs:
which gcov-tool
gcov-tool --version
- name: Login to docker
env:
GITHUB_TOKEN: ${{ secrets.DOCKER_SECRET }}
run: docker login -u skalelabsci -p ${GITHUB_TOKEN}
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: submodule update
run: git submodule update --init --recursive

- name: Build the Docker image(base)
run: docker build . --file DockerfileBase --tag skalenetwork/consensust_base:latest

- name: Login to docker
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin

- name: push docker image
run: docker push skalenetwork/consensust_base:latest
Expand Down
38 changes: 7 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.10)


option(COVERAGE "Build with code coverage support" OFF)
if (COVERAGE)
message(STATUS "**********************")
Expand All @@ -21,12 +20,6 @@ if (NOT DEFINED DEPS_INSTALL_ROOT)
endif ()
message(INFO "---- DEPS_INSTALL_ROOT in consensus is: ${DEPS_INSTALL_ROOT}")

include("cmake/HunterGate.cmake")
include("cmake/precompiledheader.cmake")


HunterGate(URL "https://github.com/ruslo/hunter/archive/v0.23.76.tar.gz" SHA1 "c7b60993e841850e2c449afd454f5d5aa4ec04e4")

option( CONSENSUS_PROFILING "Build for profiling" OFF )
if( SKALED_PROFILING )
set( CONSENSUS_PROFILING ON )
Expand Down Expand Up @@ -63,20 +56,11 @@ include_directories("${DEPS_INSTALL_ROOT}/include" "${DEPS_INSTALL_ROOT}/include
link_directories("${DEPS_INSTALL_ROOT}/lib")
set(CMAKE_PREFIX_PATH "${DEPS_INSTALL_ROOT}")

# zeromq


#find_package(оч CONFIG REQUIRED)


#leveldb

hunter_add_package(leveldb)
find_package(leveldb CONFIG REQUIRED)


#set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wreturn-type -Winit-self")

find_package( Snappy CONFIG REQUIRED )
find_package( Crc32c CONFIG REQUIRED )

set(CMAKE_CXX_STANDARD 17)
execute_process( COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gcc_ver_query.sh OUTPUT_VARIABLE GXX_MAJOR_VERSION )
Expand All @@ -95,7 +79,6 @@ add_definitions("-DZMQ_NONBLOCKING")


if (CMAKE_PROJECT_NAME STREQUAL "consensus")
unset(SKALE_HAVE_BOOST_FROM_HUNTER)
# to install compiler cache: sudo apt-get install ccache
find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND)
Expand Down Expand Up @@ -201,16 +184,7 @@ include_directories(. spdlog/include ${BLS_INCLUDE_DIRS} ${DEPS_INSTALL_ROOT}/in
"${DEPS_INSTALL_ROOT}/include" ${CMAKE_BINARY_DIR}/deps/include)


if (SKALE_HAVE_BOOST_FROM_HUNTER)
set(BOOST_LIBS_4_CONSENSUS
Boost::log Boost::thread Boost::system Boost::filesystem Boost::program_options
)
else ()
set(BOOST_LIBS_4_CONSENSUS
#boost_log
boost_thread boost_system boost_filesystem boost_program_options
)
endif ()
set(BOOST_LIBS_FOR_CONSENSUS boost_thread boost_system boost_filesystem boost_program_options)

set(DASH_D_SUFFIX "")
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
Expand All @@ -221,9 +195,11 @@ endif ()
SET(LINK_LIBRARIES
backtrace
Threads::Threads
${BOOST_LIBS_4_CONSENSUS}
${BOOST_LIBS_FOR_CONSENSUS}
${LIB_NAME_cryptopp}
leveldb::leveldb
leveldb
snappy
crc32c
"${DEPS_INSTALL_ROOT}/lib/libjsonrpccpp-client.a"
"${DEPS_INSTALL_ROOT}/lib/libjsonrpccpp-server.a"
"${DEPS_INSTALL_ROOT}/lib/libmicrohttpd.a"
Expand Down
Loading

0 comments on commit 2ba054f

Please sign in to comment.