diff --git a/.cicd/build-scripts.yml b/.cicd/build-scripts.yml index 1cc43727e31..4e8bf8c98fd 100644 --- a/.cicd/build-scripts.yml +++ b/.cicd/build-scripts.yml @@ -21,7 +21,18 @@ steps: command: - "./scripts/eosio_build.sh -P -y" timeout: 180 - + + - label: ":centos: CentOS 8 - Build Pinned" + plugins: + - docker#v3.3.0: + image: "centos:8" + always-pull: true + agents: + queue: "automation-eks-eos-builder-fleet" + command: + - "./scripts/eosio_build.sh -P -y" + timeout: 180 + - label: ":darwin: macOS 10.14 - Build Pinned" env: REPO: "git@github.com:EOSIO/eos.git" @@ -137,6 +148,17 @@ steps: command: - "./scripts/eosio_build.sh -y" timeout: 180 + + - label: ":centos: CentOS 8 - Build UnPinned" + plugins: + - docker#v3.3.0: + image: "centos:8" + always-pull: true + agents: + queue: "automation-eks-eos-builder-fleet" + command: + - "./scripts/eosio_build.sh -y" + timeout: 180 - label: ":darwin: macOS 10.14 - Build UnPinned" env: diff --git a/.cicd/build.sh b/.cicd/build.sh index 7a076acc532..ab3272be3b7 100755 --- a/.cicd/build.sh +++ b/.cicd/build.sh @@ -38,7 +38,7 @@ else # Linux elif [[ "$IMAGE_TAG" == 'ubuntu-18.04-unpinned' ]]; then CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_CXX_COMPILER='clang++-7' -DCMAKE_C_COMPILER='clang-7' -DLLVM_DIR='/usr/lib/llvm-7/lib/cmake/llvm'" fi - if [[ "$IMAGE_TAG" == centos* ]]; then + if [[ "$IMAGE_TAG" == centos-7.* ]]; then PRE_COMMANDS="$PRE_COMMANDS && source /opt/rh/rh-python36/enable" fi BUILD_COMMANDS="cmake $CMAKE_EXTRAS .. && make -j$JOBS" @@ -59,4 +59,4 @@ else # Linux COMMANDS="$PRE_COMMANDS && $COMMANDS" echo "$ docker run $ARGS $(buildkite-intrinsics) $FULL_TAG bash -c \"$COMMANDS\"" eval docker run $ARGS $(buildkite-intrinsics) $FULL_TAG bash -c \"$COMMANDS\" -fi \ No newline at end of file +fi diff --git a/.cicd/platforms/pinned/centos-8-pinned.dockerfile b/.cicd/platforms/pinned/centos-8-pinned.dockerfile new file mode 100644 index 00000000000..b8cce7fa34c --- /dev/null +++ b/.cicd/platforms/pinned/centos-8-pinned.dockerfile @@ -0,0 +1,57 @@ +FROM centos:8 +ENV VERSION 1 +#install dependencies +RUN yum update -y && \ + yum install -y epel-release && \ + yum --enablerepo=extras install -y which git autoconf automake libtool make bzip2 && \ + yum --enablerepo=extras install -y graphviz bzip2-devel openssl-devel gmp-devel && \ + yum --enablerepo=extras install -y file libusbx-devel && \ + yum --enablerepo=extras install -y libcurl-devel patch vim-common jq && \ + yum install -y python3 +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \ + dnf group install -y "Development Tools" && \ + dnf --enablerepo=PowerTools install -y doxygen ocaml +# cmake3.18.0 +RUN curl -LO https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0.tar.gz && \ + tar -xzf cmake-3.18.0.tar.gz && \ + cd cmake-3.18.0 && \ + ./bootstrap --prefix=/usr/local && \ + make -j$(nproc) && make install && \ + rm -rf cmake-3.18.0.tar.gz cmake-3.18.2 +# clang10.0.0 +RUN git clone --single-branch --branch llvmorg-10.0.0 https://github.com/llvm/llvm-project clang10 && \ + mkdir /clang10/build && cd /clang10/build && \ + cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX='/usr/local' -DLLVM_ENABLE_PROJECTS='lld;polly;clang;clang-tools-extra;libcxx;libcxxabi;libunwind;compiler-rt' -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_INCLUDE_DOCS=OFF -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Release ../llvm && \ + make -j$(nproc) && make install && \ + cd / && \ + rm -rf /clang10 +COPY ./.cicd/helpers/clang.make /tmp/clang.cmake +#build llvm10 +RUN git clone --depth 1 --single-branch --branch llvmorg-10.0.0 https://github.com/llvm/llvm-project llvm && \ + cd llvm/llvm && \ + mkdir build && \ + cd build && \ + cmake -G 'Unix Makefiles' -DLLVM_TARGETS_TO_BUILD=host -DLLVM_BUILD_TOOLS=false -DLLVM_ENABLE_RTTI=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_TOOLCHAIN_FILE='/tmp/clang.cmake' -DCMAKE_EXE_LINKER_FLAGS=-pthread -DCMAKE_SHARED_LINKER_FLAGS=-pthread -DLLVM_ENABLE_PIC=NO -DLLVM_ENABLE_TERMINFO=OFF .. && \ + make -j$(nproc) && \ + make install && \ + cd / && \ + rm -rf /llvm +# build boost +RUN curl -LO https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2 && \ + tar -xjf boost_1_72_0.tar.bz2 && \ + cd boost_1_72_0 && \ + ./bootstrap.sh --with-toolset=clang --prefix=/usr/local && \ + ./b2 toolset=clang cxxflags='-stdlib=libc++ -D__STRICT_ANSI__ -nostdinc++ -I/usr/local/include/c++/v1 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fpie' linkflags='-stdlib=libc++ -pie' link=static threading=multi --with-iostreams --with-date_time --with-filesystem --with-system --with-program_options --with-chrono --with-test -q -j$(nproc) install && \ + cd / && \ + rm -rf boost_1_72_0.tar.bz2 /boost_1_72_0 +# install nvm +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash +# load nvm in non-interactive shells +RUN cp ~/.bashrc ~/.bashrc.bak && \ + cat ~/.bashrc.bak | tail -3 > ~/.bashrc && \ + cat ~/.bashrc.bak | head -n '-3' >> ~/.bashrc && \ + rm ~/.bashrc.bak +# install node 10 +RUN bash -c '. ~/.bashrc; nvm install --lts=dubnium' && \ + ln -s "/root/.nvm/versions/node/$(ls -p /root/.nvm/versions/node | sort -Vr | head -1)bin/node" /usr/local/bin/node +RUN yum install -y nodejs diff --git a/.cicd/platforms/unpinned/centos-8-unpinned.dockerfile b/.cicd/platforms/unpinned/centos-8-unpinned.dockerfile new file mode 100644 index 00000000000..0f7fc620283 --- /dev/null +++ b/.cicd/platforms/unpinned/centos-8-unpinned.dockerfile @@ -0,0 +1,40 @@ +FROM centos:8 +ENV VERSION 1 +#install dependencies +RUN yum update -y && \ + yum install -y epel-release && \ + yum --enablerepo=extras install -y which git autoconf automake libtool make bzip2 && \ + yum --enablerepo=extras install -y graphviz bzip2-devel openssl-devel gmp-devel && \ + yum --enablerepo=extras install -y file libusbx-devel && \ + yum --enablerepo=extras install -y libcurl-devel patch vim-common jq && \ + yum install -y python3 llvm-toolset +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \ + dnf group install -y "Development Tools" && \ + dnf --enablerepo=PowerTools install -y doxygen ocaml +# cmake3.18.0 +RUN curl -LO https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0.tar.gz && \ + tar -xzf cmake-3.18.0.tar.gz && \ + cd cmake-3.18.0 && \ + ./bootstrap --prefix=/usr/local && \ + make -j$(nproc) && make install && \ + rm -rf cmake-3.18.0.tar.gz cmake-3.18.2 +# build boost +RUN curl -LO https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2 && \ + tar -xjf boost_1_72_0.tar.bz2 && \ + cd boost_1_72_0 && \ + ./bootstrap.sh --prefix=/usr/local && \ + ./b2 --with-iostreams --with-date_time --with-filesystem --with-system --with-program_options --with-chrono --with-test -q -j$(nproc) install && \ + cd / && \ + rm -rf boost_1_72_0.tar.bz2 /boost_1_72_0 +# install nvm +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash +# load nvm in non-interactive shells +RUN cp ~/.bashrc ~/.bashrc.bak && \ + cat ~/.bashrc.bak | tail -3 > ~/.bashrc && \ + cat ~/.bashrc.bak | head -n '-3' >> ~/.bashrc && \ + rm ~/.bashrc.bak +# install node 10 +RUN bash -c '. ~/.bashrc; nvm install --lts=dubnium' && \ + ln -s "/root/.nvm/versions/node/$(ls -p /root/.nvm/versions/node | sort -Vr | head -1)bin/node" /usr/local/bin/node +RUN yum install -y nodejs + diff --git a/libraries/fc b/libraries/fc deleted file mode 160000 index 26f699fbd7d..00000000000 --- a/libraries/fc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 26f699fbd7d3567cf56a7fb5eb752f259ab4680d diff --git a/scripts/eosio_build.sh b/scripts/eosio_build.sh index 793376f7193..980271b25a9 100755 --- a/scripts/eosio_build.sh +++ b/scripts/eosio_build.sh @@ -118,8 +118,7 @@ echo "$( date -u )" echo "User: ${CURRENT_USER}" # echo "git head id: %s" "$( cat .git/refs/heads/master )" echo "Current branch: $( execute git rev-parse --abbrev-ref HEAD 2>/dev/null )" - -( [[ ! $NAME == "Ubuntu" ]] && [[ ! $ARCH == "Darwin" ]] ) && set -i # Ubuntu doesn't support interactive mode since it uses dash + Some folks are having this issue on Darwin; colors aren't supported yet anyway +( [[ ! $NAME == "Ubuntu" ]] && [[ ! $ARCH == "Darwin" ]] && [[ ! $NAME == "CentOS Linux" ]]) && set -i # Ubuntu doesn't support interactive mode since it uses dash + Some folks are having this issue on Darwin; colors aren't supported yet anyway # Ensure sudo is available (only if not using the root user) ensure-sudo diff --git a/scripts/eosio_build_centos.sh b/scripts/eosio_build_centos.sh index e6720e51241..94b790157ff 100755 --- a/scripts/eosio_build_centos.sh +++ b/scripts/eosio_build_centos.sh @@ -12,6 +12,7 @@ echo "Disk space available: ${DISK_AVAIL}G" echo "" +if [[ "$(echo ${VERSION} | sed 's/ .*//g')" == 7 ]]; then # Repo necessary for rh-python3, devtoolset-8 and llvm-toolset-7.0 ensure-scl # GCC8 for Centos / Needed for CMAKE install even if we're pinning @@ -30,6 +31,15 @@ if $DRYRUN || [ -d $PYTHON3PATH ]; then echo " ${COLOR_GREEN}- Python36 successfully enabled!${COLOR_NC}" echo "" fi +fi + +if [[ "$(echo ${VERSION} | sed 's/ .*//g')" == 8 ]]; then + echo "Install Development Tools ..." + install-package https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm + group-install-package 'Development Tools' + install-package openssl-devel +fi + # Handle clang/compiler ensure-compiler # CMAKE Installation diff --git a/scripts/helpers/general.sh b/scripts/helpers/general.sh index c57908b6f76..02be712d010 100755 --- a/scripts/helpers/general.sh +++ b/scripts/helpers/general.sh @@ -90,6 +90,19 @@ function install-package() { true # Required; Weird behavior without it } +function group-install-package() { + if [[ $ARCH == "Linux" ]]; then + EXECUTION_FUNCTION="execute" + [[ $2 == "WETRUN" ]] && EXECUTION_FUNCTION="execute-always" + ( [[ $2 =~ "--" ]] || [[ $3 =~ "--" ]] ) && OPTIONS="${2}${3}" + # Can't use $SUDO_COMMAND: https://askubuntu.com/questions/953485/where-do-i-find-the-sudo-command-environment-variable + [[ $CURRENT_USER != "root" ]] && [[ ! -z $SUDO_LOCATION ]] && NEW_SUDO_COMMAND="$SUDO_LOCATION -E" + ( [[ $NAME =~ "Amazon Linux" ]] || [[ $NAME == "CentOS Linux" ]] ) && eval $EXECUTION_FUNCTION $NEW_SUDO_COMMAND $YUM $OPTIONS groupinstall -y '$1' + ( [[ $NAME =~ "Ubuntu" ]] ) && eval $EXECUTION_FUNCTION $NEW_SUDO_COMMAND $APTGET $OPTIONS install -y $1 + fi + true # Required; Weird behavior without it +} + function uninstall-package() { if [[ $ARCH == "Linux" ]]; then EXECUTION_FUNCTION="execute"