Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1105 from EOSIO/merge-release-1.8.x-to-master
Browse files Browse the repository at this point in the history
Merge release/1.8.x to master for v1.8.0
  • Loading branch information
nksanthosh authored May 20, 2021
2 parents a6b8d3f + ecca060 commit 6d51c0d
Show file tree
Hide file tree
Showing 300 changed files with 16,358 additions and 5,790 deletions.
16 changes: 10 additions & 6 deletions .cicd/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [[ $(uname) == 'Darwin' ]]; then

# You can't use chained commands in execute
cd $BUILD_DIR
cmake ..
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$JOBS

else # Linux
Expand All @@ -19,15 +19,19 @@ else # Linux

# PRE_COMMANDS: Executed pre-cmake
PRE_COMMANDS="cd $MOUNTED_DIR/build"
BUILD_COMMANDS="cmake .. && make -j$JOBS"
BUILD_COMMANDS="cmake .. -DCMAKE_BUILD_TYPE=Release && make -j$JOBS"

[[ $IMAGE_TAG == 'centos-7.6' ]] && PRE_COMMANDS="$PRE_COMMANDS && source /opt/rh/devtoolset-7/enable"
BUILD_COMMANDS_1604="cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS=\"-stdlib=libc++\" && make -j$JOBS"
[[ $IMAGE_TAG == 'ubuntu-16.04' ]] && BUILD_COMMANDS="$BUILD_COMMANDS_1604"

[[ $IMAGE_TAG == 'centos-7.7' ]] && PRE_COMMANDS="$PRE_COMMANDS && source /opt/rh/devtoolset-7/enable"
# Docker Commands
if [[ $BUILDKITE == true ]]; then
# Generate Base Images
$CICD_DIR/generate-base-images.sh
elif [[ $TRAVIS == true ]]; then
ARGS="$ARGS -e JOBS -e CCACHE_DIR=/opt/.ccache"
if [[ "$IMAGE_TAG" == 'ubuntu-18.04' ]]; then
FULL_TAG='eosio/ci-contracts-builder:base-ubuntu-18.04-develop'
fi
fi

COMMANDS="$PRE_COMMANDS && $BUILD_COMMANDS"
Expand All @@ -42,4 +46,4 @@ else # Linux

eval docker run $ARGS $evars $FULL_TAG bash -c \"$COMMANDS\"

fi
fi
53 changes: 53 additions & 0 deletions .cicd/create-docker-from-binary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
echo '--- :evergreen_tree: Configuring Environment'
set -euo pipefail

buildkite-agent artifact download '*.deb' --step ':ubuntu: Ubuntu 18.04 - Package Builder' .
echo ":done: download successful"

SANITIZED_BRANCH=$(echo "$BUILDKITE_BRANCH" | sed 's.^/..' | sed 's/[:/]/_/g')
SANITIZED_TAG=$(echo "$BUILDKITE_TAG" | sed 's.^/..' | tr '/' '_')
echo "$SANITIZED_BRANCH"
echo "$SANITIZED_TAG"

# do docker build
echo '+++ :docker: Building Container'
echo ":docker::build: Building image..."
DOCKERHUB_REGISTRY="docker.io/eosio/eosio.cdt"

BUILD_TAG=${BUILDKITE_BUILD_NUMBER:-latest}
DOCKER_BUILD_GEN="docker build -t eosio_cdt_image:$BUILD_TAG -f ./docker/dockerfile ."
echo "$ $DOCKER_BUILD_GEN"
eval $DOCKER_BUILD_GEN

#tag and push on each destination AWS & DOCKERHUB
echo '+++ :arrow_up: Pushing Container'
EOSIO_REGS=("$EOSIO_CDT_REGISTRY" "$DOCKERHUB_REGISTRY")
for REG in ${EOSIO_REGS[@]}; do
DOCKER_TAG_COMMIT="docker tag eosio_cdt_image:$BUILD_TAG $REG:$BUILDKITE_COMMIT"
DOCKER_TAG_BRANCH="docker tag eosio_cdt_image:$BUILD_TAG $REG:$SANITIZED_BRANCH"
echo -e "$ Tagging Images: \n$DOCKER_TAG_COMMIT \n$DOCKER_TAG_BRANCH"
eval $DOCKER_TAG_COMMIT
eval $DOCKER_TAG_BRANCH
DOCKER_PUSH_COMMIT="docker push $REG:$BUILDKITE_COMMIT"
DOCKER_PUSH_BRANCH="docker push $REG:$SANITIZED_BRANCH"
echo -e "$ Pushing Images: \n$DOCKER_PUSH_COMMIT \n$DOCKER_PUSH_BRANCH"
eval $DOCKER_PUSH_COMMIT
eval $DOCKER_PUSH_BRANCH
CLEAN_IMAGE_COMMIT="docker rmi $REG:$BUILDKITE_COMMIT"
CLEAN_IMAGE_BRANCH="docker rmi $REG:$SANITIZED_BRANCH"
echo -e "Cleaning Up: \n$CLEAN_IMAGE_COMMIT \n$CLEAN_IMAGE_BRANCH$"
eval $CLEAN_IMAGE_COMMIT
eval $CLEAN_IMAGE_BRANCH
if [[ ! -z "$SANITIZED_TAG" ]]; then
DOCKER_TAG="docker tag eosio_cdt_image $REG:$SANITIZED_TAG"
DOCKER_REM="docker rmi $REG:$SANITIZED_TAG"
echo -e "$ \n Tagging Image: \n$DOCKER_TAG \n Cleaning Up: \n$DOCKER_REM"
eval $DOCKER_TAG
eval $DOCKER_REM
fi
done

DOCKER_GEN="docker rmi eosio_cdt_image:$BUILD_TAG"
echo "Clean up base image"
eval $DOCKER_GEN
4 changes: 3 additions & 1 deletion .cicd/docker/amazonlinux-2.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ RUN curl -LO https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz && \
make -j$(nproc) && \
make install && \
cd .. && \
rm -f cmake-3.10.2.tar.gz
rm -f cmake-3.10.2.tar.gz

RUN ln -sfn /usr/bin/python3 /usr/local/bin/python3
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
FROM centos:7.6.1810
FROM centos:7.7.1908
# install dependencies
RUN yum update -y && \
yum --enablerepo=extras install -y centos-release-scl && \
yum install -y devtoolset-7 && \
yum install -y python33.x86_64 git autoconf automake bzip2 \
yum install -y git autoconf automake bzip2 \
libtool ocaml.x86_64 doxygen graphviz-devel.x86_64 \
libicu-devel.x86_64 bzip2.x86_64 bzip2-devel.x86_64 openssl-devel.x86_64 \
gmp-devel.x86_64 python-devel.x86_64 gettext-devel.x86_64 gcc-c++.x86_64 perl
gmp-devel.x86_64 gettext-devel.x86_64 gcc-c++.x86_64 perl \
libffi-devel.x86_64

# build Python 3.7.4
RUN curl -LO https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz && \
source /opt/rh/devtoolset-7/enable && \
tar xzf Python-3.7.4.tgz && \
cd Python-3.7.4 && \
./configure --enable-optimizations && \
make -j$(nproc) altinstall && \
cd .. && \
rm -rf Python-3.7.4 && rm -rf Python-3.7.4.tgz

# build lcov
RUN git clone https://github.com/linux-test-project/lcov.git && \
source /opt/rh/python33/enable && \
source /opt/rh/devtoolset-7/enable && \
cd lcov && \
make install && \
cd / && \
rm -rf lcov/

# build cmake
RUN curl -LO https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz && \
source /opt/rh/python33/enable && \
source /opt/rh/devtoolset-7/enable && \
tar -xzf cmake-3.10.2.tar.gz && \
cd cmake-3.10.2 && \
./bootstrap --prefix=/usr/local && \
make -j$(nproc) && \
make install && \
cd .. && \
rm -f cmake-3.10.2.tar.gz
rm -f cmake-3.10.2.tar.gz

RUN ln -sfn /usr/local/bin/python3.7 /usr/local/bin/python3
9 changes: 9 additions & 0 deletions .cicd/docker/centos-8.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM centos:8
# install dependencies
RUN yum update -y && \
yum install -y gdisk && \
yum install -y cmake && \
yum install -y git autoconf automake bzip2 \
libtool make \
libicu-devel.x86_64 bzip2.x86_64 bzip2-devel.x86_64 openssl-devel.x86_64 \
gmp-devel.x86_64 python38 python3-devel gettext-devel.x86_64 gcc-c++.x86_64 perl
31 changes: 27 additions & 4 deletions .cicd/docker/ubuntu-16.04.dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM ubuntu:16.04
# install dependencies
RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git clang-4.0 \
lldb-4.0 libclang-4.0-dev make automake libbz2-dev libssl-dev \
DEBIAN_FRONTEND=noninteractive apt-get install -y git \
lldb-4.0 make automake libbz2-dev libssl-dev \
libgmp3-dev autotools-dev build-essential libicu-dev python2.7-dev \
python3-dev autoconf libtool curl zlib1g-dev doxygen graphviz
autoconf libtool curl zlib1g-dev doxygen graphviz \
wget libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev xz-utils

# install cmake
RUN curl -LO https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz && \
tar -xzf cmake-3.10.2.tar.gz && \
Expand All @@ -13,4 +15,25 @@ RUN curl -LO https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz && \
make -j$(nproc) && \
make install && \
cd .. && \
rm -f cmake-3.10.2.tar.gz
rm -f cmake-3.10.2.tar.gz

# install Python 3.7.4
RUN curl -LO https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz && \
tar xzf Python-3.7.4.tgz && \
cd Python-3.7.4 && \
./configure --enable-optimizations && \
make -j$(nproc) altinstall && \
cd .. && \
rm -rf Python-3.7.4 && rm -rf Python-3.7.4.tar.gz

RUN ln -sfn /usr/local/bin/python3.7 /usr/local/bin/python3

# install clang 9
RUN curl -LO https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz && \
tar -xvf clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz && \
cp -R clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/bin/* /usr/local/bin && \
cp -R clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/include/* /usr/local/include && \
cp -R clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/lib/* /usr/local/lib && \
mkdir -p /usr/local/libexec && cp -R clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/libexec/* /usr/local/libexec && \
cp -R clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/share/* /usr/local/share && \
cp -R clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/lib/libc++* /usr/lib
17 changes: 15 additions & 2 deletions .cicd/docker/ubuntu-18.04.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
FROM ubuntu:18.04
# install dependencies

RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git clang-4.0 \
lldb-4.0 libclang-4.0-dev cmake make automake libbz2-dev libssl-dev \
libgmp3-dev autotools-dev build-essential libicu-dev python2.7-dev \
python3-dev autoconf libtool curl zlib1g-dev doxygen graphviz
libgmp3-dev autotools-dev build-essential libicu-dev python2.7-dev \
autoconf libtool curl zlib1g-dev doxygen graphviz \
libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev

# install Python 3.7.4
RUN curl -LO https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz && \
tar xzf Python-3.7.4.tgz && \
cd Python-3.7.4 && \
./configure --enable-optimizations && \
make -j$(nproc) altinstall && \
cd .. && \
rm -rf Python-3.7.4 && rm -rf Python-3.7.4.tar.gz

RUN ln -sfn /usr/local/bin/python3.7 /usr/local/bin/python3
11 changes: 11 additions & 0 deletions .cicd/docker/ubuntu-20.04.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu:20.04
# install dependencies

RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git clang-8 \
lldb-8 libclang-8-dev cmake make automake libbz2-dev libssl-dev \
libgmp3-dev autotools-dev build-essential libicu-dev python2.7-dev python3 \
autoconf libtool curl zlib1g-dev doxygen graphviz \
libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev

RUN ln -sfn /usr/bin/python3 /usr/local/bin/python3
46 changes: 46 additions & 0 deletions .cicd/integration-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -eo pipefail
. ./.cicd/helpers/general.sh

mkdir -p $BUILD_DIR

PRE_COMMANDS="cd $MOUNTED_DIR/build"
TEST="ctest -j$JOBS -L integration_tests -V -T Test"
COMMANDS="$PRE_COMMANDS && $TEST"

ARGS=${ARGS:-"--rm --init -v $(pwd):$MOUNTED_DIR"}

# . $HELPERS_DIR/docker-hash.sh

# Load BUILDKITE Environment Variables for use in docker run
if [[ -f $BUILDKITE_ENV_FILE ]]; then
evars=""
while read -r var; do
evars="$evars --env ${var%%=*}"
done < "$BUILDKITE_ENV_FILE"
fi

if [[ "$BUILDKITE" == 'true' && "$IMAGE_TAG" == 'ubuntu-18.04' ]]; then
FULL_TAG='eosio/ci-contracts-builder:base-ubuntu-18.04-develop'
fi

set +e
eval docker run $ARGS $evars $FULL_TAG bash -c \"$COMMANDS\"
EXIT_STATUS=$?

# buildkite
if [[ "$BUILDKITE" == 'true' ]]; then
cd build
# upload artifacts
echo '+++ :arrow_up: Uploading Artifacts'
echo 'Exporting xUnit XML'
mv -f ./Testing/$(ls ./Testing/ | grep '2' | tail -n 1)/Test.xml test-results.xml
echo 'Uploading artifacts'
buildkite-agent artifact upload test-results.xml
echo 'Done uploading artifacts.'
fi
# re-throw
if [[ "$EXIT_STATUS" != 0 ]]; then
echo "Failing due to non-zero exit status from ctest: $EXIT_STATUS"
exit $EXIT_STATUS
fi
6 changes: 3 additions & 3 deletions .cicd/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ else # Linux
if [[ "$IMAGE_TAG" =~ "ubuntu" ]]; then
ARTIFACT='*.deb'
PACKAGE_TYPE='deb'
PACKAGE_COMMANDS="./generate_package.sh $PACKAGE_TYPE"
elif [[ "$IMAGE_TAG" =~ "centos" ]]; then
PACKAGE_COMMANDS="./generate_package.sh $PACKAGE_TYPE $OS"
elif [[ "$IMAGE_TAG" =~ "centos" || "$IMAGE_TAG" =~ "amazonlinux" ]]; then
ARTIFACT='*.rpm'
PACKAGE_TYPE='rpm'
PACKAGE_COMMANDS="mkdir -p ~/rpmbuild/BUILD && mkdir -p ~/rpmbuild/BUILDROOT && mkdir -p ~/rpmbuild/RPMS && mkdir -p ~/rpmbuild/SOURCES && mkdir -p ~/rpmbuild/SPECS && mkdir -p ~/rpmbuild/SRPMS && yum install -y rpm-build && ./generate_package.sh $PACKAGE_TYPE"
Expand Down Expand Up @@ -63,4 +63,4 @@ else # Linux
fi
done

fi
fi
Loading

0 comments on commit 6d51c0d

Please sign in to comment.