Skip to content

Commit

Permalink
Merge pull request #38 from UOSnetwork/pr-v1.8.12
Browse files Browse the repository at this point in the history
Update EOSIO to v1.8.12
  • Loading branch information
myx0m0p authored Feb 20, 2020
2 parents 4b53418 + 518333e commit 6247bce
Show file tree
Hide file tree
Showing 58 changed files with 1,353 additions and 580 deletions.
33 changes: 8 additions & 25 deletions .cicd/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
set -eo pipefail
. ./.cicd/helpers/general.sh
mkdir -p $BUILD_DIR
CMAKE_EXTRAS="-DCMAKE_BUILD_TYPE='Release'"
CMAKE_EXTRAS="-DCMAKE_BUILD_TYPE='Release' -DENABLE_MULTIVERSION_PROTOCOL_TEST=true -DBUILD_MONGO_DB_PLUGIN=true"
if [[ "$(uname)" == 'Darwin' ]]; then
# You can't use chained commands in execute
if [[ "$TRAVIS" == 'true' ]]; then
if [[ "$GITHUB_ACTIONS" == 'true' ]]; then
export PINNED=false
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/1d91e94e8ecdf6877ad2c24a7cda1114e50f2a14/Formula/[email protected] # Workaround for Travis cannot build LLVM4 from source.
brew reinstall [email protected] # Fixes issue where builds in Travis cannot find libcrypto.
ccache -s
CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
else
CMAKE_EXTRAS="$CMAKE_EXTRAS -DBUILD_MONGO_DB_PLUGIN=true"
fi
[[ ! "$PINNED" == 'false' ]] && CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_TOOLCHAIN_FILE=$HELPERS_DIR/clang.make"
cd $BUILD_DIR
Expand All @@ -21,27 +15,16 @@ if [[ "$(uname)" == 'Darwin' ]]; then
echo "make -j$JOBS"
make -j$JOBS
else # Linux
CMAKE_EXTRAS="$CMAKE_EXTRAS -DBUILD_MONGO_DB_PLUGIN=true"
ARGS=${ARGS:-"--rm --init -v $(pwd):$MOUNTED_DIR"}
PRE_COMMANDS="cd $MOUNTED_DIR/build"
# PRE_COMMANDS: Executed pre-cmake
# CMAKE_EXTRAS: Executed within and right before the cmake path (cmake CMAKE_EXTRAS ..)
[[ ! "$IMAGE_TAG" =~ 'unpinned' ]] && CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_TOOLCHAIN_FILE=$MOUNTED_DIR/.cicd/helpers/clang.make -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
if [[ "$IMAGE_TAG" == 'amazon_linux-2-pinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib64/ccache:\\\$PATH"
elif [[ "$IMAGE_TAG" == 'centos-7.7-pinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib64/ccache:\\\$PATH"
elif [[ "$IMAGE_TAG" == 'ubuntu-16.04-pinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib/ccache:\\\$PATH"
elif [[ "$IMAGE_TAG" == 'ubuntu-18.04-pinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib/ccache:\\\$PATH"
elif [[ "$IMAGE_TAG" == 'amazon_linux-2-unpinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib64/ccache:\\\$PATH"
[[ ! "$IMAGE_TAG" =~ 'unpinned' ]] && CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_TOOLCHAIN_FILE=$MOUNTED_DIR/.cicd/helpers/clang.make"
if [[ "$IMAGE_TAG" == 'amazon_linux-2-unpinned' ]]; then
CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_C_COMPILER='clang'"
elif [[ "$IMAGE_TAG" == 'centos-7.7-unpinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && source /opt/rh/devtoolset-8/enable && source /opt/rh/rh-python36/enable && export PATH=/usr/lib64/ccache:\\\$PATH"
PRE_COMMANDS="$PRE_COMMANDS && source /opt/rh/devtoolset-8/enable && source /opt/rh/rh-python36/enable"
elif [[ "$IMAGE_TAG" == 'ubuntu-18.04-unpinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib/ccache:\\\$PATH"
CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_C_COMPILER='clang'"
fi
BUILD_COMMANDS="cmake $CMAKE_EXTRAS .. && make -j$JOBS"
Expand All @@ -52,9 +35,9 @@ else # Linux
[[ "$ENABLE_INSTALL" == 'true' ]] && COMMANDS="cp -r $MOUNTED_DIR /root/eosio && cd /root/eosio/build &&"
COMMANDS="$COMMANDS $BUILD_COMMANDS"
[[ "$ENABLE_INSTALL" == 'true' ]] && COMMANDS="$COMMANDS && make install"
elif [[ "$TRAVIS" == 'true' ]]; then
ARGS="$ARGS -v /usr/lib/ccache -v $HOME/.ccache:/opt/.ccache -e JOBS -e TRAVIS -e CCACHE_DIR=/opt/.ccache"
COMMANDS="ccache -s && $BUILD_COMMANDS"
elif [[ "$GITHUB_ACTIONS" == 'true' ]]; then
ARGS="$ARGS -e JOBS"
COMMANDS="$BUILD_COMMANDS"
fi
. $HELPERS_DIR/file-hash.sh $CICD_DIR/platforms/$PLATFORM_TYPE/$IMAGE_TAG.dockerfile
COMMANDS="$PRE_COMMANDS && $COMMANDS"
Expand Down
22 changes: 22 additions & 0 deletions .cicd/docker-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -eo pipefail
echo '+++ :evergreen_tree: Configuring Environment'
REPO='eosio/ci-contracts-builder'
PREFIX='base-ubuntu-18.04'
IMAGE="$REPO:$PREFIX-$BUILDKITE_COMMIT-$PLATFORM_TYPE"
SANITIZED_BRANCH=$(echo "$BUILDKITE_BRANCH" | tr '/' '_')
SANITIZED_TAG=$(echo "$BUILDKITE_TAG" | tr '/' '_')
echo '+++ :arrow_down: Pulling Container'
echo "Pulling \"$IMAGE\""
docker pull "$IMAGE"
echo '+++ :label: Tagging Container'
docker tag "$IMAGE" "$REPO:$PREFIX-$SANITIZED_BRANCH"
echo "Tagged \"$REPO:$PREFIX-$SANITIZED_BRANCH\"."
[[ -z "$BUILDKITE_TAG" ]] || docker tag "$IMAGE" "$REPO:$PREFIX-$SANITIZED_TAG" && echo "Tagged \"$REPO:$PREFIX-$SANITIZED_TAG\"."
echo '+++ :arrow_up: Pushing Container'
docker push "$REPO:$PREFIX-$SANITIZED_BRANCH"
[[ -z "$BUILDKITE_TAG" ]] || docker push "$REPO:$PREFIX-$SANITIZED_TAG"
echo '+++ :put_litter_in_its_place: Cleaning Up'
docker rmi "$REPO:$PREFIX-$SANITIZED_BRANCH"
[[ -z "$BUILDKITE_TAG" || "$SANITIZED_BRANCH" == "$SANITIZED_TAG" ]] || docker rmi "$REPO:$PREFIX-$SANITIZED_TAG"
docker rmi "$IMAGE"
120 changes: 86 additions & 34 deletions .cicd/generate-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ if [[ ! -z ${BUILDKITE_TRIGGERED_FROM_BUILD_ID} ]]; then
fi
export BUILD_SOURCE=${BUILD_SOURCE:---build \$BUILDKITE_BUILD_ID}
# set trigger_job if master/release/develop branch and webhook
if [[ $BUILDKITE_BRANCH =~ ^release/[0-9]+\.[0-9]+\.x$ || $BUILDKITE_BRANCH =~ ^master$ || $BUILDKITE_BRANCH =~ ^develop$ ]]; then
[[ $BUILDKITE_SOURCE != 'scheduled' ]] && export TRIGGER_JOB=true
if [[ ! $BUILDKITE_PIPELINE_SLUG =~ 'lrt' ]] && [[ $BUILDKITE_BRANCH =~ ^release/[0-9]+\.[0-9]+\.x$ || $BUILDKITE_BRANCH =~ ^master$ || $BUILDKITE_BRANCH =~ ^develop$ ]]; then
[[ $BUILDKITE_SOURCE != 'schedule' ]] && export TRIGGER_JOB=true
fi
oIFS="$IFS"
IFS=$''
Expand Down Expand Up @@ -111,7 +111,7 @@ EOF
- "cd eos && ./.cicd/build.sh"
- "cd eos && tar -pczf build.tar.gz build && buildkite-agent artifact upload build.tar.gz"
plugins:
- chef/anka#v0.5.5:
- EOSIO/anka#v0.5.7:
no-volume: true
inherit-environment-vars: true
vm-name: ${MOJAVE_ANKA_TEMPLATE_NAME}
Expand All @@ -124,7 +124,7 @@ EOF
failover-registries:
- 'registry_1'
- 'registry_2'
pre-execute-sleep: 10
pre-execute-ping-sleep: "8.8.8.8"
pre-commands:
- "git clone [email protected]:EOSIO/mac-anka-fleet.git && cd mac-anka-fleet && . ./ensure-tag.bash -u 12 -r 25G -a '-n'"
env:
Expand All @@ -134,16 +134,29 @@ EOF
TEMPLATE_TAG: $MOJAVE_ANKA_TAG_BASE
IMAGE_TAG: $(echo "$PLATFORM_JSON" | jq -r .FILE_NAME)
PLATFORM_TYPE: $PLATFORM_TYPE
TAG_COMMANDS: "git clone ${BUILDKITE_PULL_REQUEST_REPO:-$BUILDKITE_REPO} eos && cd eos && $GIT_FETCH git checkout -f $BUILDKITE_COMMIT && git submodule update --init --recursive && export IMAGE_TAG=$(echo "$PLATFORM_JSON" | jq -r .FILE_NAME) && export PLATFORM_TYPE=$PLATFORM_TYPE && . ./.cicd/platforms/$PLATFORM_TYPE/$(echo "$PLATFORM_JSON" | jq -r .FILE_NAME).sh && cd ~/eos && cd .. && rm -rf eos"
TAG_COMMANDS: "git clone ${BUILDKITE_PULL_REQUEST_REPO:-$BUILDKITE_REPO} eos && cd eos && $GIT_FETCH git checkout -f \$BUILDKITE_COMMIT && git submodule update --init --recursive && export IMAGE_TAG=$(echo "$PLATFORM_JSON" | jq -r .FILE_NAME) && export PLATFORM_TYPE=$PLATFORM_TYPE && . ./.cicd/platforms/$PLATFORM_TYPE/$(echo "$PLATFORM_JSON" | jq -r .FILE_NAME).sh && cd ~/eos && cd .. && rm -rf eos"
PROJECT_TAG: $(echo "$PLATFORM_JSON" | jq -r .HASHED_IMAGE_TAG)
timeout: ${TIMEOUT:-180}
agents: "queue=mac-anka-large-node-fleet"
skip: \${SKIP_$(echo "$PLATFORM_JSON" | jq -r .PLATFORM_NAME_UPCASE)_$(echo "$PLATFORM_JSON" | jq -r .VERSION_MAJOR)$(echo "$PLATFORM_JSON" | jq -r .VERSION_MINOR)}${SKIP_BUILD}
EOF
fi
done
echo ' - wait'
echo ''
cat <<EOF
- label: ":docker: Docker - Build and Install"
command: "./.cicd/installation-build.sh"
env:
IMAGE_TAG: "ubuntu-18.04-unpinned"
PLATFORM_TYPE: "unpinned"
agents:
queue: "$BUILDKITE_BUILD_AGENT_QUEUE"
timeout: ${TIMEOUT:-180}
skip: ${SKIP_INSTALL}${SKIP_LINUX}${SKIP_DOCKER}
- wait
EOF
# tests
IFS=$oIFS
for ROUND in $(seq 1 $ROUNDS); do
Expand Down Expand Up @@ -178,7 +191,7 @@ EOF
- "cd eos && buildkite-agent artifact download build.tar.gz . --step '$(echo "$PLATFORM_JSON" | jq -r .ICON) $(echo "$PLATFORM_JSON" | jq -r .PLATFORM_NAME_FULL) - Build' && tar -xzf build.tar.gz"
- "cd eos && ./.cicd/test.sh scripts/parallel-test.sh"
plugins:
- chef/anka#v0.5.4:
- EOSIO/anka#v0.5.7:
no-volume: true
inherit-environment-vars: true
vm-name: ${MOJAVE_ANKA_TEMPLATE_NAME}
Expand All @@ -189,7 +202,7 @@ EOF
failover-registries:
- 'registry_1'
- 'registry_2'
pre-execute-sleep: 10
pre-execute-ping-sleep: "8.8.8.8"
agents: "queue=mac-anka-node-fleet"
retry:
manual:
Expand Down Expand Up @@ -232,7 +245,7 @@ EOF
- "cd eos && buildkite-agent artifact download build.tar.gz . --step '$(echo "$PLATFORM_JSON" | jq -r .ICON) $(echo "$PLATFORM_JSON" | jq -r .PLATFORM_NAME_FULL) - Build' && tar -xzf build.tar.gz"
- "cd eos && ./.cicd/test.sh scripts/serial-test.sh $TEST_NAME"
plugins:
- chef/anka#v0.5.4:
- EOSIO/anka#v0.5.7:
no-volume: true
inherit-environment-vars: true
vm-name: ${MOJAVE_ANKA_TEMPLATE_NAME}
Expand All @@ -243,7 +256,7 @@ EOF
failover-registries:
- 'registry_1'
- 'registry_2'
pre-execute-sleep: 10
pre-execute-ping-sleep: "8.8.8.8"
agents: "queue=mac-anka-node-fleet"
retry:
manual:
Expand Down Expand Up @@ -288,7 +301,7 @@ EOF
- "cd eos && buildkite-agent artifact download build.tar.gz . --step '$(echo "$PLATFORM_JSON" | jq -r .ICON) $(echo "$PLATFORM_JSON" | jq -r .PLATFORM_NAME_FULL) - Build' ${BUILD_SOURCE} && tar -xzf build.tar.gz"
- "cd eos && ./.cicd/test.sh scripts/long-running-test.sh $TEST_NAME"
plugins:
- chef/anka#v0.5.4:
- EOSIO/anka#v0.5.7:
no-volume: true
inherit-environment-vars: true
vm-name: ${MOJAVE_ANKA_TEMPLATE_NAME}
Expand All @@ -299,7 +312,7 @@ EOF
failover-registries:
- 'registry_1'
- 'registry_2'
pre-execute-sleep: 10
pre-execute-ping-sleep: "8.8.8.8"
agents: "queue=mac-anka-node-fleet"
retry:
manual:
Expand All @@ -318,45 +331,84 @@ EOF
echo ''
fi
done
# Execute multiversion test
if ( [[ ! $PINNED == false ]] ); then
cat <<EOF
- label: ":pipeline: Multiversion Test"
command:
- "buildkite-agent artifact download build.tar.gz . --step ':ubuntu: Ubuntu 18.04 - Build' && tar -xzf build.tar.gz"
- ./.cicd/test.sh .cicd/multiversion.sh
env:
IMAGE_TAG: "ubuntu-18.04-pinned"
PLATFORM_TYPE: "pinned"
agents:
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
timeout: ${TIMEOUT:-30}
skip: ${SKIP_LINUX}${SKIP_UBUNTU_18_04}${SKIP_MULTIVERSION_TEST}
EOF
fi
# trigger eosio-lrt post pr
if [[ -z $BUILDKITE_TRIGGERED_FROM_BUILD_ID && $TRIGGER_JOB == "true" ]]; then
if ( [[ ! $PINNED == false ]] ); then
cat <<EOF
cat <<EOF
- label: ":pipeline: Trigger Long Running Tests"
trigger: "eosio-lrt"
async: true
build:
message: "${BUILDKITE_MESSAGE}"
message: "Triggered by $BUILDKITE_PIPELINE_SLUG build $BUILDKITE_BUILD_NUMBER"
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
BUILDKITE_PULL_REQUEST: "${BUILDKITE_PULL_REQUEST}"
BUILDKITE_PULL_REQUEST_BASE_BRANCH: "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}"
BUILDKITE_PULL_REQUEST_REPO: "${BUILDKITE_PULL_REQUEST_REPO}"
BUILDKITE_TRIGGERED_FROM_BUILD_URL: "${BUILDKITE_BUILD_URL}"
SKIP_BUILD: "true"
PINNED: "${PINNED}"
EOF
fi
fi
# trigger multiversion post pr
if [[ -z $BUILDKITE_TRIGGERED_FROM_BUILD_ID && $TRIGGER_JOB = "true" ]]; then
if ( [[ ! $PINNED == false ]] ); then
# trigger eosio-sync-from-genesis for every build
if [[ "$BUILDKITE_PIPELINE_SLUG" == 'eosio' && -z "${SKIP_INSTALL}${SKIP_LINUX}${SKIP_DOCKER}${SKIP_SYNC_TESTS}" ]]; then
cat <<EOF
- label: ":pipeline: Trigger Multiversion Test"
trigger: "eos-multiversion-tests"
async: true
- label: ":chains: Sync from Genesis Test"
trigger: "eosio-sync-from-genesis"
async: false
if: build.env("BUILDKITE_TAG") == null
build:
message: "${BUILDKITE_MESSAGE}"
message: "Triggered by $BUILDKITE_PIPELINE_SLUG build $BUILDKITE_BUILD_NUMBER"
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
BUILDKITE_PULL_REQUEST: "${BUILDKITE_PULL_REQUEST}"
BUILDKITE_PULL_REQUEST_BASE_BRANCH: "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}"
BUILDKITE_PULL_REQUEST_REPO: "${BUILDKITE_PULL_REQUEST_REPO}"
BUILDKITE_TRIGGERED_FROM_BUILD_URL: "${BUILDKITE_BUILD_URL}"
SKIP_JUNGLE: "${SKIP_JUNGLE}"
SKIP_KYLIN: "${SKIP_KYLIN}"
SKIP_MAIN: "${SKIP_MAIN}"
TIMEOUT: "${TIMEOUT}"
EOF
fi
# trigger eosio-resume-from-state for every build
if [[ "$BUILDKITE_PIPELINE_SLUG" == 'eosio' && -z "${SKIP_INSTALL}${SKIP_LINUX}${SKIP_DOCKER}${SKIP_SYNC_TESTS}" ]]; then
cat <<EOF
- label: ":outbox_tray: Resume from State Test"
trigger: "eosio-resume-from-state"
async: false
if: build.env("BUILDKITE_TAG") == null
build:
message: "Triggered by $BUILDKITE_PIPELINE_SLUG build $BUILDKITE_BUILD_NUMBER"
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
BUILDKITE_TRIGGERED_FROM_BUILD_URL: "${BUILDKITE_BUILD_URL}"
SKIP_JUNGLE: "${SKIP_JUNGLE}"
SKIP_KYLIN: "${SKIP_KYLIN}"
SKIP_MAIN: "${SKIP_MAIN}"
TIMEOUT: "${TIMEOUT}"
EOF
fi
fi
# pipeline tail
cat <<EOF
Expand Down Expand Up @@ -425,7 +477,7 @@ cat <<EOF
- "cd eos && buildkite-agent artifact download build.tar.gz . --step ':darwin: macOS 10.14 - Build' && tar -xzf build.tar.gz"
- "cd eos && ./.cicd/package.sh"
plugins:
- chef/anka#v0.5.4:
- EOSIO/anka#v0.5.7:
no-volume: true
inherit-environment-vars: true
vm-name: 10.14.6_6C_14G_40G
Expand All @@ -436,21 +488,21 @@ cat <<EOF
failover-registries:
- 'registry_1'
- 'registry_2'
pre-execute-sleep: 10
pre-execute-ping-sleep: "8.8.8.8"
agents:
- "queue=mac-anka-node-fleet"
timeout: ${TIMEOUT:-60}
timeout: ${TIMEOUT:-10}
skip: ${SKIP_MACOS_10_14}${SKIP_PACKAGE_BUILDER}${SKIP_MAC}
- label: ":ubuntu: Ubuntu 18.04 - Contract Builder"
command: "./.cicd/installation-build.sh"
- label: ":docker: Docker - Label Container with Git Branch and Git Tag"
command: .cicd/docker-tag.sh
env:
IMAGE_TAG: "ubuntu-18.04-unpinned"
PLATFORM_TYPE: "unpinned"
agents:
queue: "$BUILDKITE_BUILD_AGENT_QUEUE"
timeout: ${TIMEOUT:-30}
skip: ${SKIP_CONTRACT_BUILDER}${SKIP_LINUX}
timeout: ${TIMEOUT:-10}
skip: ${SKIP_INSTALL}${SKIP_LINUX}${SKIP_DOCKER}${SKIP_PACKAGE_BUILDER}
- wait
Expand All @@ -470,4 +522,4 @@ cat <<EOF
skip: ${SKIP_PACKAGE_BUILDER}${SKIP_MAC}${SKIP_MACOS_10_14}
EOF
IFS=$oIFS
IFS=$oIFS
Loading

0 comments on commit 6247bce

Please sign in to comment.