From 706ef851c4c2e30ecf2231be1751bbb025b16c36 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Fri, 29 Oct 2021 13:15:43 -0400 Subject: [PATCH 01/17] Update build.sh --- .cicd/build.sh | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.cicd/build.sh b/.cicd/build.sh index 9a9e2721089..048cab5eee4 100755 --- a/.cicd/build.sh +++ b/.cicd/build.sh @@ -2,9 +2,36 @@ set -eo pipefail [[ "$ENABLE_INSTALL" == 'true' ]] || echo '--- :evergreen_tree: Configuring Environment' . ./.cicd/helpers/general.sh +if [[ $EOS_CONTRACT_BUILD ]]; then + [[ "$RAW_PIPELINE_CONFIG" == '' ]] && export RAW_PIPELINE_CONFIG="$1" + [[ "$RAW_PIPELINE_CONFIG" == '' ]] && export RAW_PIPELINE_CONFIG='pipeline.jsonc' + [[ "$PIPELINE_CONFIG" == '' ]] && export PIPELINE_CONFIG='pipeline.json' + # read dependency file + if [[ -f "$RAW_PIPELINE_CONFIG" ]]; then + echo 'Reading pipeline configuration file...' + cat "$RAW_PIPELINE_CONFIG" | grep -Po '^[^"/]*("((?<=\\).|[^"])*"[^"/]*)*' | jq -c .\"eosio-contract-build\" > "$PIPELINE_CONFIG" + CDT_VERSION=$(cat "$PIPELINE_CONFIG" | jq -r '.dependencies."eosio.cdt"') + else + echo 'ERROR: No pipeline configuration file or dependencies file found!' + exit 1 + fi + + if [[ "$BUILDKITE" == 'true' ]]; then + CDT_COMMIT=$((curl -s https://api.github.com/repos/EOSIO/eosio.cdt/git/refs/tags/$CDT_VERSION && curl -s https://api.github.com/repos/EOSIO/eosio.cdt/git/refs/heads/$CDT_VERSION) | jq '.object.sha' | sed "s/null//g" | sed "/^$/d" | tr -d '"' | sed -n '1p') + test -z "$CDT_COMMIT" && CDT_COMMIT=$(echo $CDT_VERSION | tr -d '"' | tr -d "''" | cut -d ' ' -f 1) # if both searches returned nothing, the version is probably specified by commit hash already + fi + echo "Using cdt ${CDT_COMMIT} from \"$CDT_VERSION\"..." + export CDT_URL="https://eos-public-oss-binaries.s3-us-west-2.amazonaws.com/${CDT_COMMIT:0:7}-eosio.cdt-ubuntu-20.04_amd64.deb" + export DEOSIO_COMPILE_TEST_CONTRACTS=true + CDT_COMMAND="curl -sSf $CDT_URL --output eosio.cdt.deb && apt install ./eosio.cdt.deb" +fi + mkdir -p "$BUILD_DIR" + [[ -z "$DCMAKE_BUILD_TYPE" ]] && export DCMAKE_BUILD_TYPE='Release' -CMAKE_EXTRAS="-DCMAKE_BUILD_TYPE=\"$DCMAKE_BUILD_TYPE\" -DENABLE_MULTIVERSION_PROTOCOL_TEST=\"true\" -DAMQP_CONN_STR=\"amqp://guest:guest@localhost:5672\"" +[[ -z "$DEOSIO_COMPILE_TEST_CONTRACTS" ]] && export DEOSIO_COMPILE_TEST_CONTRACTS=false +CMAKE_EXTRAS="-DCMAKE_BUILD_TYPE=\"$DCMAKE_BUILD_TYPE\" -DEOSIO_COMPILE_TEST_CONTRACTS=\"$DEOSIO_COMPILE_TEST_CONTRACTS\" -DENABLE_MULTIVERSION_PROTOCOL_TEST=\"true\" -DAMQP_CONN_STR=\"amqp://guest:guest@localhost:5672\"" + if [[ "$(uname)" == 'Darwin' && "$FORCE_LINUX" != 'true' ]]; then # You can't use chained commands in execute if [[ "$GITHUB_ACTIONS" == 'true' ]]; then @@ -40,8 +67,11 @@ else # Linux fi CMAKE_COMMAND="cmake \$CMAKE_EXTRAS .." MAKE_COMMAND="make -j $JOBS" - BUILD_COMMANDS="echo \"+++ :hammer_and_wrench: Building EOSIO\" && echo \"$ $CMAKE_COMMAND\" && eval $CMAKE_COMMAND && echo \"$ $MAKE_COMMAND\" && eval $MAKE_COMMAND" - # Docker Commands + if [[ $EOS_CONTRACT_BUILD ]]; then + BUILD_COMMANDS="echo \"+++ :hammer_and_wrench: Building EOSIO\" && echo \"$CDT_COMMAND\" && eval $CDT_COMMAND && echo \"$ $CMAKE_COMMAND\" && eval $CMAKE_COMMAND && echo \"$ $MAKE_COMMAND\" && eval $MAKE_COMMAND" + else + BUILD_COMMANDS="echo \"+++ :hammer_and_wrench: Building EOSIO\" && echo \"$ $CMAKE_COMMAND\" && eval $CMAKE_COMMAND && echo \"$ $MAKE_COMMAND\" && eval $MAKE_COMMAND" + fi # Docker Commands if [[ "$BUILDKITE" == 'true' ]]; then # Generate Base Images BASE_IMAGE_COMMAND="\"$CICD_DIR/generate-base-images.sh\"" From 43bd14491f679f84e9f864f7ed798da9a11b7c5f Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Fri, 29 Oct 2021 13:15:47 -0400 Subject: [PATCH 02/17] Update docker-tag.sh --- .cicd/docker-tag.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.cicd/docker-tag.sh b/.cicd/docker-tag.sh index 33211ac88d8..8261fb6d99e 100755 --- a/.cicd/docker-tag.sh +++ b/.cicd/docker-tag.sh @@ -2,7 +2,11 @@ set -eo pipefail echo '--- :evergreen_tree: Configuring Environment' . ./.cicd/helpers/general.sh -PREFIX='base-ubuntu-18.04' +if [[ "$IMAGE_TAG" == 'ubuntu-20.04-unpinned' ]]; then + PREFIX='base-ubuntu-20.04' +else + PREFIX='base-ubuntu-18.04' +fi SANITIZED_BRANCH="$(sanitize "$BUILDKITE_BRANCH")" echo "Branch '$BUILDKITE_BRANCH' sanitized as '$SANITIZED_BRANCH'." SANITIZED_TAG="$(sanitize "$BUILDKITE_TAG")" From 4c8f1d311cbb5445aa1da49191fac04a08b6c46c Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Fri, 29 Oct 2021 13:15:50 -0400 Subject: [PATCH 03/17] Update generate-pipeline.sh --- .cicd/generate-pipeline.sh | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.cicd/generate-pipeline.sh b/.cicd/generate-pipeline.sh index ade7861a9bb..f69e8045236 100755 --- a/.cicd/generate-pipeline.sh +++ b/.cicd/generate-pipeline.sh @@ -195,7 +195,7 @@ EOF fi done [[ -z "$TEST" ]] && cat < Date: Fri, 29 Oct 2021 13:15:52 -0400 Subject: [PATCH 04/17] Update general.sh --- .cicd/helpers/general.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.cicd/helpers/general.sh b/.cicd/helpers/general.sh index cc2b4cc24e0..afe5183a9d2 100644 --- a/.cicd/helpers/general.sh +++ b/.cicd/helpers/general.sh @@ -15,6 +15,10 @@ else export CONTRACT_REGISTRIES=("$DOCKERHUB_CONTRACTS_REGISTRY" "$MIRROR_REGISTRY") fi +if [[ "$BUILDKITE_PIPELINE_SLUG" == "eosio-contract-build" ]]; then + export EOS_CONTRACT_BUILD=true +fi + # capitalize each word in a string function capitalize() { From 2ffe0607bb89720a011d5ea2f9928d38f8fcc805 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Fri, 29 Oct 2021 13:15:56 -0400 Subject: [PATCH 05/17] Update installation-build.sh --- .cicd/installation-build.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.cicd/installation-build.sh b/.cicd/installation-build.sh index e2036364903..24aa42a3594 100755 --- a/.cicd/installation-build.sh +++ b/.cicd/installation-build.sh @@ -4,18 +4,24 @@ echo '--- :evergreen_tree: Configuring Environment' . ./.cicd/helpers/general.sh export ENABLE_INSTALL='true' export SANITIZED_BRANCH=$(sanitize "$BUILDKITE_BRANCH") +if [[ "$IMAGE_TAG" == 'ubuntu-20.04-unpinned' ]]; then + export UBUNTU_VERSION=ubuntu-20.04 +else + export UBUNTU_VERSION=ubuntu-18.04 +fi + echo "Branch '$BUILDKITE_BRANCH' sanitized as '$SANITIZED_BRANCH'." -export CONTRACTS_BUILDER_TAG="eosio/ci-contracts-builder:base-ubuntu-18.04" -export ARGS="--name ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER --init -v \"\$(pwd):$MOUNTED_DIR\"" +export CONTRACTS_BUILDER_TAG="eosio/ci-contracts-builder:base-$UBUNTU_VERSION" +export ARGS="--name ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER-$UBUNTU_VERSION --init -v \"\$(pwd):$MOUNTED_DIR\"" BUILD_COMMAND="'$CICD_DIR/build.sh'" echo "$ $BUILD_COMMAND" eval $BUILD_COMMAND echo '+++ :arrow_up: Pushing Container' for REGISTRY in "${CONTRACT_REGISTRIES[@]}"; do if [[ ! -z "$REGISTRY" ]]; then - COMMITS=("$REGISTRY:base-ubuntu-18.04-$BUILDKITE_COMMIT" "$REGISTRY:base-ubuntu-18.04-$BUILDKITE_COMMIT-$PLATFORM_TYPE" "$REGISTRY:base-ubuntu-18.04-$SANITIZED_BRANCH-$BUILDKITE_COMMIT") + COMMITS=("$REGISTRY:base-$UBUNTU_VERSION-$BUILDKITE_COMMIT" "$REGISTRY:base-$UBUNTU_VERSION-$BUILDKITE_COMMIT-$PLATFORM_TYPE" "$REGISTRY:base-$UBUNTU_VERSION-$SANITIZED_BRANCH-$BUILDKITE_COMMIT") for COMMIT in "${COMMITS[@]}"; do - COMMIT_COMMAND="docker commit 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER' '$COMMIT'" + COMMIT_COMMAND="docker commit 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER-$UBUNTU_VERSION' '$COMMIT'" echo "$ $COMMIT_COMMAND" eval $COMMIT_COMMAND PUSH_COMMAND="docker push '$COMMIT'" @@ -25,10 +31,10 @@ for REGISTRY in "${CONTRACT_REGISTRIES[@]}"; do fi done echo '--- :put_litter_in_its_place: Cleaning Up' -DOCKER_STOP_COMMAND="docker stop 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER'" +DOCKER_STOP_COMMAND="docker stop 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER-$UBUNTU_VERSION'" echo "$ $DOCKER_STOP_COMMAND" eval $DOCKER_STOP_COMMAND -DOCKER_RM_COMMAND="docker rm 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER'" +DOCKER_RM_COMMAND="docker rm 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER-$UBUNTU_VERSION'" echo "$ $DOCKER_RM_COMMAND" eval $DOCKER_RM_COMMAND echo '--- :white_check_mark: Done!' From d813ef2ed145fc65d5ae2fe53d52fefde97fbe71 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Fri, 29 Oct 2021 13:15:59 -0400 Subject: [PATCH 06/17] Update ubuntu-20.04-pinned.dockerfile --- .cicd/platforms/pinned/ubuntu-20.04-pinned.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cicd/platforms/pinned/ubuntu-20.04-pinned.dockerfile b/.cicd/platforms/pinned/ubuntu-20.04-pinned.dockerfile index 2c54f29a5c3..434d26184aa 100644 --- a/.cicd/platforms/pinned/ubuntu-20.04-pinned.dockerfile +++ b/.cicd/platforms/pinned/ubuntu-20.04-pinned.dockerfile @@ -3,7 +3,7 @@ ENV VERSION 1 # install dependencies. RUN apt-get update && \ apt-get upgrade -y && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y git make \ + DEBIAN_FRONTEND=noninteractive apt-get install -y git make libtinfo5 \ bzip2 automake libbz2-dev libssl-dev doxygen graphviz libgmp3-dev \ autotools-dev python2.7 python2.7-dev python3 python3-pip python3-requests \ python3-dev python-configparser \ From 4fb81bac7208f1c647f6e24e14e554909efd8de9 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Fri, 29 Oct 2021 13:16:02 -0400 Subject: [PATCH 07/17] Update ubuntu-20.04-unpinned.dockerfile --- .cicd/platforms/unpinned/ubuntu-20.04-unpinned.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cicd/platforms/unpinned/ubuntu-20.04-unpinned.dockerfile b/.cicd/platforms/unpinned/ubuntu-20.04-unpinned.dockerfile index 32072a9601b..b89b8a096a6 100644 --- a/.cicd/platforms/unpinned/ubuntu-20.04-unpinned.dockerfile +++ b/.cicd/platforms/unpinned/ubuntu-20.04-unpinned.dockerfile @@ -3,7 +3,7 @@ ENV VERSION 1 # install dependencies. RUN apt-get update && \ apt-get upgrade -y && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y git make \ + DEBIAN_FRONTEND=noninteractive apt-get install -y git make libtinfo5 \ bzip2 automake libbz2-dev libssl-dev doxygen graphviz libgmp3-dev \ autotools-dev python2.7 python2.7-dev python3 python3-dev python3-pip python3-requests \ autoconf libtool curl zlib1g-dev sudo ruby libusb-1.0-0-dev libpq-dev postgresql postgresql-server-dev-all \ From 8e2f0d881949b25db2c95febf13bb230bf935ec3 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Fri, 29 Oct 2021 13:16:05 -0400 Subject: [PATCH 08/17] Update pipeline.jsonc --- pipeline.jsonc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pipeline.jsonc b/pipeline.jsonc index d8a74438888..4d32a93036c 100644 --- a/pipeline.jsonc +++ b/pipeline.jsonc @@ -43,5 +43,13 @@ "commit": "8fe13fffe4363dbc9028f3bdd549afc18802d511" // test backwards-compatibility forkdb v2 change. } ] + }, + "eosio-contract-build": + { + "pipeline-branch": "master", + "dependencies": // dependencies to pull for a build of contracts, by branch, tag, or commit hash + { + "eosio.cdt": "release/1.8.x" + } } } From 14702b2d6dfbf431192a75b397c4360ffa559abf Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Fri, 5 Nov 2021 10:11:27 -0400 Subject: [PATCH 09/17] Update pipeline.jsonc --- pipeline.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline.jsonc b/pipeline.jsonc index 4d32a93036c..8e1c7444241 100644 --- a/pipeline.jsonc +++ b/pipeline.jsonc @@ -49,7 +49,7 @@ "pipeline-branch": "master", "dependencies": // dependencies to pull for a build of contracts, by branch, tag, or commit hash { - "eosio.cdt": "release/1.8.x" + "eosio.cdt": "develop" } } } From 806c5c11db80a2a6aa7b5d52bb5c1357b1295ecf Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Tue, 9 Nov 2021 10:46:14 -0500 Subject: [PATCH 10/17] Update pipeline.jsonc --- pipeline.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline.jsonc b/pipeline.jsonc index 8e1c7444241..4d32a93036c 100644 --- a/pipeline.jsonc +++ b/pipeline.jsonc @@ -49,7 +49,7 @@ "pipeline-branch": "master", "dependencies": // dependencies to pull for a build of contracts, by branch, tag, or commit hash { - "eosio.cdt": "develop" + "eosio.cdt": "release/1.8.x" } } } From d8005a47688f5ff340e412fbd45c92e2c5f43837 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Tue, 18 Jan 2022 16:06:26 -0500 Subject: [PATCH 11/17] Update build.sh --- .cicd/build.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.cicd/build.sh b/.cicd/build.sh index 048cab5eee4..0323436402e 100755 --- a/.cicd/build.sh +++ b/.cicd/build.sh @@ -2,24 +2,24 @@ set -eo pipefail [[ "$ENABLE_INSTALL" == 'true' ]] || echo '--- :evergreen_tree: Configuring Environment' . ./.cicd/helpers/general.sh -if [[ $EOS_CONTRACT_BUILD ]]; then +if [[ "$BUILDKITE_PIPELINE_SLUG" == 'eosio-contract-build' ]]; then [[ "$RAW_PIPELINE_CONFIG" == '' ]] && export RAW_PIPELINE_CONFIG="$1" [[ "$RAW_PIPELINE_CONFIG" == '' ]] && export RAW_PIPELINE_CONFIG='pipeline.jsonc' [[ "$PIPELINE_CONFIG" == '' ]] && export PIPELINE_CONFIG='pipeline.json' # read dependency file if [[ -f "$RAW_PIPELINE_CONFIG" ]]; then echo 'Reading pipeline configuration file...' - cat "$RAW_PIPELINE_CONFIG" | grep -Po '^[^"/]*("((?<=\\).|[^"])*"[^"/]*)*' | jq -c .\"eosio-contract-build\" > "$PIPELINE_CONFIG" + cat "$RAW_PIPELINE_CONFIG" | grep -Po '^[^"/]*("((?<=\\).|[^"])*"[^"/]*)*' | jq -c '.[env.BUILDKITE_PIPELINE_SLUG]' > "$PIPELINE_CONFIG" CDT_VERSION=$(cat "$PIPELINE_CONFIG" | jq -r '.dependencies."eosio.cdt"') else echo 'ERROR: No pipeline configuration file or dependencies file found!' exit 1 fi - if [[ "$BUILDKITE" == 'true' ]]; then - CDT_COMMIT=$((curl -s https://api.github.com/repos/EOSIO/eosio.cdt/git/refs/tags/$CDT_VERSION && curl -s https://api.github.com/repos/EOSIO/eosio.cdt/git/refs/heads/$CDT_VERSION) | jq '.object.sha' | sed "s/null//g" | sed "/^$/d" | tr -d '"' | sed -n '1p') - test -z "$CDT_COMMIT" && CDT_COMMIT=$(echo $CDT_VERSION | tr -d '"' | tr -d "''" | cut -d ' ' -f 1) # if both searches returned nothing, the version is probably specified by commit hash already - fi + + CDT_COMMIT=$((curl -s https://api.github.com/repos/EOSIO/eosio.cdt/git/refs/tags/$CDT_VERSION && curl -s https://api.github.com/repos/EOSIO/eosio.cdt/git/refs/heads/$CDT_VERSION) | jq '.object.sha' | sed "s/null//g" | sed "/^$/d" | tr -d '"' | sed -n '1p') + test -z "$CDT_COMMIT" && CDT_COMMIT=$(echo $CDT_VERSION | tr -d '"' | tr -d "''" | cut -d ' ' -f 1) # if both searches returned nothing, the version is probably specified by commit hash already + echo "Using cdt ${CDT_COMMIT} from \"$CDT_VERSION\"..." export CDT_URL="https://eos-public-oss-binaries.s3-us-west-2.amazonaws.com/${CDT_COMMIT:0:7}-eosio.cdt-ubuntu-20.04_amd64.deb" export DEOSIO_COMPILE_TEST_CONTRACTS=true @@ -67,7 +67,7 @@ else # Linux fi CMAKE_COMMAND="cmake \$CMAKE_EXTRAS .." MAKE_COMMAND="make -j $JOBS" - if [[ $EOS_CONTRACT_BUILD ]]; then + if [[ "$BUILDKITE_PIPELINE_SLUG" == 'eosio-contract-build' ]]; then BUILD_COMMANDS="echo \"+++ :hammer_and_wrench: Building EOSIO\" && echo \"$CDT_COMMAND\" && eval $CDT_COMMAND && echo \"$ $CMAKE_COMMAND\" && eval $CMAKE_COMMAND && echo \"$ $MAKE_COMMAND\" && eval $MAKE_COMMAND" else BUILD_COMMANDS="echo \"+++ :hammer_and_wrench: Building EOSIO\" && echo \"$ $CMAKE_COMMAND\" && eval $CMAKE_COMMAND && echo \"$ $MAKE_COMMAND\" && eval $MAKE_COMMAND" @@ -100,4 +100,4 @@ if [[ "$BUILDKITE" == 'true' && "$ENABLE_INSTALL" != 'true' ]]; then buildkite-agent artifact upload 'build.tar.gz' echo 'Done uploading artifacts.' fi -[[ "$ENABLE_INSTALL" == 'true' ]] || echo '--- :white_check_mark: Done!' +[[ "$ENABLE_INSTALL" == 'true' ]] || echo '--- :white_check_mark: Done!' \ No newline at end of file From 8e938c8df190b8c5a912f345cd89f8f921e6d937 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Tue, 18 Jan 2022 16:06:31 -0500 Subject: [PATCH 12/17] Update generate-pipeline.sh --- .cicd/generate-pipeline.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.cicd/generate-pipeline.sh b/.cicd/generate-pipeline.sh index eb5cbc254d7..6d14501f5fe 100755 --- a/.cicd/generate-pipeline.sh +++ b/.cicd/generate-pipeline.sh @@ -829,5 +829,12 @@ EOF queue: "$BUILDKITE_BUILD_AGENT_QUEUE" skip: ${SKIP_INSTALL}${SKIP_UBUNTU_18_04}${SKIP_LINUX}${SKIP_DOCKER}${SKIP_PACKAGE_BUILDER}${SKIP_PUBLIC_DOCKER} timeout: ${TIMEOUT:-10} + + - label: ":docker: :ubuntu: Docker - Build 20.04 Docker Image" + command: "./.cicd/create-docker-from-binary.sh" + agents: + queue: "$BUILDKITE_BUILD_AGENT_QUEUE" + skip: ${SKIP_INSTALL}${SKIP_UBUNTU_20_04}${SKIP_LINUX}${SKIP_DOCKER}${SKIP_PACKAGE_BUILDER}${SKIP_PUBLIC_DOCKER} + timeout: ${TIMEOUT:-10} EOF IFS=$oIFS From a2a7fb8b8368d81411fba7815ed6bc215fe985de Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Tue, 18 Jan 2022 16:06:37 -0500 Subject: [PATCH 13/17] Update general.sh --- .cicd/helpers/general.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.cicd/helpers/general.sh b/.cicd/helpers/general.sh index afe5183a9d2..cc2b4cc24e0 100644 --- a/.cicd/helpers/general.sh +++ b/.cicd/helpers/general.sh @@ -15,10 +15,6 @@ else export CONTRACT_REGISTRIES=("$DOCKERHUB_CONTRACTS_REGISTRY" "$MIRROR_REGISTRY") fi -if [[ "$BUILDKITE_PIPELINE_SLUG" == "eosio-contract-build" ]]; then - export EOS_CONTRACT_BUILD=true -fi - # capitalize each word in a string function capitalize() { From c67dd80e2fa8a1d204b4652b6cda70c8b27a1cb2 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Tue, 18 Jan 2022 16:06:58 -0500 Subject: [PATCH 14/17] Update installation-build.sh --- .cicd/installation-build.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.cicd/installation-build.sh b/.cicd/installation-build.sh index b3280b58452..67ba2cf4286 100755 --- a/.cicd/installation-build.sh +++ b/.cicd/installation-build.sh @@ -19,10 +19,14 @@ eval $BUILD_COMMAND echo '+++ :arrow_up: Pushing Container' for REGISTRY in "${CONTRACT_REGISTRIES[@]}"; do if [[ ! -z "$REGISTRY" ]]; then - COMMITS=("$REGISTRY:base-ubuntu-18.04-$BUILDKITE_COMMIT-$PLATFORM_TYPE") - # Platform agnostic elements should be unpinned - if [[ "$PLATFORM_TYPE" == 'unpinned' ]] ; then - COMMITS=(${COMMITS[@]} "$REGISTRY:base-ubuntu-18.04-$BUILDKITE_COMMIT" "$REGISTRY:base-ubuntu-18.04-$SANITIZED_BRANCH-$BUILDKITE_COMMIT") + if [[ "$BUILDKITE_PIPELINE_SLUG" == 'eosio-contract-build' ]]; then + COMMITS=("$REGISTRY:base-$UBUNTU_VERSION-$BUILDKITE_COMMIT" "$REGISTRY:base-$UBUNTU_VERSION-$BUILDKITE_COMMIT-$PLATFORM_TYPE" "$REGISTRY:base-$UBUNTU_VERSION-$SANITIZED_BRANCH-$BUILDKITE_COMMIT") + else + COMMITS=("$REGISTRY:base-ubuntu-18.04-$BUILDKITE_COMMIT-$PLATFORM_TYPE") + # Platform agnostic elements should be unpinned + if [[ "$PLATFORM_TYPE" == 'unpinned' ]] ; then + COMMITS=(${COMMITS[@]} "$REGISTRY:base-ubuntu-18.04-$BUILDKITE_COMMIT" "$REGISTRY:base-ubuntu-18.04-$SANITIZED_BRANCH-$BUILDKITE_COMMIT") + fi fi for COMMIT in "${COMMITS[@]}"; do COMMIT_COMMAND="docker commit 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER-$UBUNTU_VERSION' '$COMMIT'" @@ -38,7 +42,7 @@ echo '--- :put_litter_in_its_place: Cleaning Up' DOCKER_STOP_COMMAND="docker stop 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER-$UBUNTU_VERSION'" echo "$ $DOCKER_STOP_COMMAND" eval $DOCKER_STOP_COMMAND -DOCKER_RM_COMMAND="docker rm 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER-$UBUNTU_VERSION'" +DOCKER_RM_COMMAND="docker rm 'ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER-$UBUNTU_VERSION' || :" echo "$ $DOCKER_RM_COMMAND" eval $DOCKER_RM_COMMAND echo '--- :white_check_mark: Done!' From 1a0f861c5d76e6d50393abdd17c34105e8f81934 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Tue, 18 Jan 2022 16:07:10 -0500 Subject: [PATCH 15/17] Update ubuntu-20.04-pinned.dockerfile --- .../pinned/ubuntu-20.04-pinned.dockerfile | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/.cicd/platforms/pinned/ubuntu-20.04-pinned.dockerfile b/.cicd/platforms/pinned/ubuntu-20.04-pinned.dockerfile index 434d26184aa..d61e1b5c31a 100644 --- a/.cicd/platforms/pinned/ubuntu-20.04-pinned.dockerfile +++ b/.cicd/platforms/pinned/ubuntu-20.04-pinned.dockerfile @@ -3,12 +3,44 @@ ENV VERSION 1 # install dependencies. RUN apt-get update && \ apt-get upgrade -y && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y git make libtinfo5 \ - bzip2 automake libbz2-dev libssl-dev doxygen graphviz libgmp3-dev \ - autotools-dev python2.7 python2.7-dev python3 python3-pip python3-requests \ - python3-dev python-configparser \ - autoconf libtool g++ gcc curl zlib1g-dev sudo ruby libusb-1.0-0-dev \ - libcurl4-gnutls-dev pkg-config patch vim-common jq gnupg libpq-dev postgresql postgresql-server-dev-all rabbitmq-server && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + autoconf \ + automake \ + autotools-dev \ + bzip2 \ + curl \ + doxygen \ + g++ \ + gcc \ + git \ + gnupg \ + graphviz \ + jq \ + libbz2-dev \ + libcurl4-gnutls-dev \ + libgmp3-dev \ + libpq-dev \ + libssl-dev \ + libusb-1.0-0-dev \ + libtinfo5 \ + libtool \ + make \ + patch \ + pkg-config \ + postgresql \ + postgresql-server-dev-all \ + python2.7 \ + python2.7-dev \ + python3 \ + python-configparser \ + python3-dev \ + python3-pip \ + python3-requests \ + rabbitmq-server \ + ruby \ + sudo \ + vim-common \ + zlib1g-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* From 3a0ddc57fa4fde08835d97b175c78d06f27d2271 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Tue, 18 Jan 2022 16:07:15 -0500 Subject: [PATCH 16/17] Update ubuntu-20.04-unpinned.dockerfile --- .../unpinned/ubuntu-20.04-unpinned.dockerfile | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/.cicd/platforms/unpinned/ubuntu-20.04-unpinned.dockerfile b/.cicd/platforms/unpinned/ubuntu-20.04-unpinned.dockerfile index b89b8a096a6..726a19f4835 100644 --- a/.cicd/platforms/unpinned/ubuntu-20.04-unpinned.dockerfile +++ b/.cicd/platforms/unpinned/ubuntu-20.04-unpinned.dockerfile @@ -3,11 +3,44 @@ ENV VERSION 1 # install dependencies. RUN apt-get update && \ apt-get upgrade -y && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y git make libtinfo5 \ - bzip2 automake libbz2-dev libssl-dev doxygen graphviz libgmp3-dev \ - autotools-dev python2.7 python2.7-dev python3 python3-dev python3-pip python3-requests \ - autoconf libtool curl zlib1g-dev sudo ruby libusb-1.0-0-dev libpq-dev postgresql postgresql-server-dev-all \ - libcurl4-gnutls-dev pkg-config patch llvm-7-dev clang-7 vim-common jq g++ gnupg rabbitmq-server && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + autoconf \ + automake \ + autotools-dev \ + bzip2 \ + curl \ + clang-7 \ + doxygen \ + g++ \ + git \ + gnupg \ + graphviz \ + jq \ + libbz2-dev \ + libcurl4-gnutls-dev \ + libgmp3-dev \ + libpq-dev \ + libssl-dev \ + libusb-1.0-0-dev \ + libtinfo5 \ + libtool \ + llvm-7-dev \ + make \ + patch \ + pkg-config \ + postgresql \ + postgresql-server-dev-all \ + python2.7 \ + python2.7-dev \ + python3 \ + python3-dev \ + python3-pip \ + python3-requests \ + rabbitmq-server \ + ruby \ + sudo \ + vim-common \ + zlib1g-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* From 013e943b6d1ab5c79d548000f5ae9599d631c868 Mon Sep 17 00:00:00 2001 From: Farhad Shahabi Date: Tue, 18 Jan 2022 18:14:45 -0500 Subject: [PATCH 17/17] Update create-docker-from-binary.sh --- .cicd/create-docker-from-binary.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.cicd/create-docker-from-binary.sh b/.cicd/create-docker-from-binary.sh index 5c3c3a234d0..cdc05de7512 100755 --- a/.cicd/create-docker-from-binary.sh +++ b/.cicd/create-docker-from-binary.sh @@ -2,7 +2,11 @@ echo '--- :evergreen_tree: Configuring Environment' set -euo pipefail . ./.cicd/helpers/general.sh -buildkite-agent artifact download '*.deb' --step ':ubuntu: Ubuntu 18.04 - Package Builder' . +if [[ "$BUILDKITE_PIPELINE_SLUG" == 'eosio-contract-build' ]]; then + buildkite-agent artifact download '*.deb' --step ':ubuntu: Ubuntu 20.04 - Package Builder' . +else + buildkite-agent artifact download '*.deb' --step ':ubuntu: Ubuntu 18.04 - Package Builder' . +fi SANITIZED_BRANCH="$(sanitize "$BUILDKITE_BRANCH")" echo "Branch '$BUILDKITE_BRANCH' sanitized as '$SANITIZED_BRANCH'." SANITIZED_TAG="$(sanitize "$BUILDKITE_TAG")"