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

Travis CI Alpha Testing #7622

Closed
wants to merge 174 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
e94b8bb
Builder Dockerfile for Ubuntu 18.04 added.
scottarnette Jul 8, 2019
71ca088
Fixes for MongoDB plugin.
scottarnette Jul 9, 2019
18e9e58
Merge branch 'release/1.8.x' into trav_poc_r1.8
scottarnette Jul 9, 2019
595b591
Created "Hello, world!" Travis CI YAML file
kj4ezj Jul 9, 2019
2f7171b
Remove trailing hash tags
kj4ezj Jul 9, 2019
b7ad53e
Added script and renamed dockerfile.
scottarnette Jul 9, 2019
fb9027b
First attempt at a Docker build
kj4ezj Jul 9, 2019
e861c84
Removed local reference when mounting EOS volume.
scottarnette Jul 9, 2019
288d83a
docker push, first attempt
kj4ezj Jul 9, 2019
e3ad49e
Fixed missing character in Travis YAML
kj4ezj Jul 9, 2019
2d90c99
Fixed another missing character in Travis YAML
kj4ezj Jul 9, 2019
58dc6cc
Refactored YAML
kj4ezj Jul 9, 2019
e190d16
Updated host OS to newest Ubuntu Travis offers
kj4ezj Jul 9, 2019
9474e25
Renamed Dockerfile so editors which look for ([^.]*.)*[Dd]ockerfile h…
kj4ezj Jul 9, 2019
e0a401f
Changed Docker Hub repo from eosio/ci to eosio/producer to side-step …
kj4ezj Jul 10, 2019
51ee5ee
EOSIO build, first attempt
kj4ezj Jul 10, 2019
a7f2e4f
Merged build script.
scottarnette Jul 10, 2019
fb1ad61
Adjusted boost command.
scottarnette Jul 10, 2019
db97432
Added dockerfile and build script for Ubuntu 16.
scottarnette Jul 10, 2019
805f87f
Travis now prints VM host resources
kj4ezj Jul 10, 2019
751614a
Added missing dependent files for Ubuntu 16 container builds.
scottarnette Jul 10, 2019
fffa86b
Created dockerfile and script for amazonlinux2.
scottarnette Jul 10, 2019
103323d
Modified amazonlinux mongo url and cmake args.
scottarnette Jul 10, 2019
be70a50
Created Travis matrix with macOS and Ubuntu 16.04
kj4ezj Jul 10, 2019
4ac37b2
Added dockerfile and script for centos 7.
scottarnette Jul 10, 2019
158b175
Merge branch 'trav_poc_r1.8' of ssh://github.com/EOSIO/eos into trav_…
scottarnette Jul 10, 2019
ad0f513
Tag Docker image correctly from the beginning
kj4ezj Jul 10, 2019
6afbaa2
Update the other half of the Docker tag, too
kj4ezj Jul 10, 2019
c8fecb7
testing ccache for linux
Jul 11, 2019
1e317c7
added ccache and mac brew stuff
Jul 11, 2019
7a0a8f9
added ccache to docker files + fixed travis-build
Jul 11, 2019
bb0f68c
Added -y flag to ccache install.
scottarnette Jul 11, 2019
7a51c0f
Modified local build scripts to use new container tags.
scottarnette Jul 11, 2019
96fe9ef
Removed debug code
kj4ezj Jul 11, 2019
b1c6a4c
Disable macOS in build matrix
kj4ezj Jul 11, 2019
80d7dda
added ubuntu16 to matrix
Jul 11, 2019
29c906e
quick fix
Jul 11, 2019
37367df
added centos-7 and amazonlinux-2
Jul 11, 2019
0c729ce
testing PATH
Jul 11, 2019
052de18
testing PATH
Jul 11, 2019
5b5d9a6
testing PATH
Jul 11, 2019
cfcfd15
testing PATH
Jul 11, 2019
45e2ff7
testing ccache fixes
Jul 11, 2019
4dd933c
testing ccache fixes
Jul 11, 2019
db7f1a9
testing centos-7 fix
Jul 11, 2019
fc03730
testing ubuntu16 extras
Jul 11, 2019
cafbd48
quick fix
Jul 11, 2019
fef5913
quick fix
Jul 11, 2019
b5f9c4c
export for ccache
Jul 11, 2019
ef6496f
fixes
Jul 11, 2019
8119327
fixes for centos7
Jul 11, 2019
e56371b
fixes for centos7 and ubuntu16 not having their compiler symlinks und…
Jul 11, 2019
f3b9197
symlink fix
Jul 11, 2019
cbbb463
amazonlinux2 clang compiler
Jul 11, 2019
4eed449
cleanup
Jul 11, 2019
9cfff4a
CCACHE_PATH
Jul 11, 2019
7dff05a
cleanup
Jul 11, 2019
87a956e
pin compiler fix for ubuntu16
Jul 11, 2019
cd4523d
Modified local test scripts to run ctest.
scottarnette Jul 11, 2019
9416e5e
Merge branch 'trav_poc_r1.8_matrix' into trav_poc_r1.8
scottarnette Jul 11, 2019
5614354
Created travis-before.sh script
kj4ezj Jul 11, 2019
0058023
Declared dependencies as homebrew packages in YAML
kj4ezj Jul 11, 2019
8523825
pin compiler fix for ubuntu16
Jul 11, 2019
10c0478
pin compiler fix for ubuntu16
Jul 11, 2019
a233444
Added mongo to path.
scottarnette Jul 11, 2019
0ca85c7
Merge branch 'trav_poc_r1.8_matrix' into trav_poc_r1.8
scottarnette Jul 11, 2019
cb1756e
Added dash for toolchain file arg.
scottarnette Jul 11, 2019
a5eb014
Merge branch 'trav_poc_r1.8_matrix' into trav_poc_r1.8
scottarnette Jul 11, 2019
609a5f1
Removing ccache to test U16 build.
scottarnette Jul 11, 2019
69456d2
Removing ccache to test U16 build.
scottarnette Jul 11, 2019
e858029
Added boost to list of dependencies
kj4ezj Jul 11, 2019
6c677dd
sets cache name uniquely for docker builds
Jul 11, 2019
1c6bc14
CCACHE NAME Doesn't work
Jul 11, 2019
f0a532d
Removed hard specify clang for U16 and AL2.
scottarnette Jul 11, 2019
f236289
clang8 removal to limit size of docker image
Jul 11, 2019
b03374d
Specify boost version to use
kj4ezj Jul 11, 2019
5ae9940
Amazon linux requires clang flags.
scottarnette Jul 11, 2019
eebeb16
Update homebrew to get the latest boost
kj4ezj Jul 11, 2019
c654f6d
Remove dependencies already installed by Travis CI
kj4ezj Jul 11, 2019
5d0f0e5
Resolve merge conflicts between trav_poc_r1.8 and zach-travis-mac
kj4ezj Jul 11, 2019
5f55307
Merge pull request #7641 from EOSIO/zach-travis-mac
kj4ezj Jul 11, 2019
ab64814
adds brew cache for mac
Jul 11, 2019
b92de3c
Merge pull request #7644 from EOSIO/jerstern/brew-cache
Jul 11, 2019
6e85795
buildplskthxbai
Jul 12, 2019
f058133
adds ccache directory
Jul 12, 2019
d6974a7
buildplskthxbai
Jul 12, 2019
dc46277
adds webhook for metrics collection
Jul 12, 2019
bdba046
adds opt/ccache for linux
Jul 12, 2019
2a73a9a
merge with justin's work
Jul 12, 2019
baed723
fixes ccache
Jul 12, 2019
2701745
Added initial ctest command for Linux.
scottarnette Jul 12, 2019
fcd142c
fix for ccache
Jul 12, 2019
5933eed
fix for path
Jul 12, 2019
74564ca
fix for path
Jul 12, 2019
7063ec5
compiler path change to use ccache on ubuntu16
Jul 12, 2019
c99d2e0
Simplification in travis-build.sh
kj4ezj Jul 12, 2019
aae1acd
Added unit tests to macOS
kj4ezj Jul 12, 2019
66d0548
Added print statements to the macOS build.
kj4ezj Jul 12, 2019
94de3c8
added tests for mac
Jul 12, 2019
8d5b986
ccache -s to get the path
Jul 12, 2019
2a37715
[ci skip] ccache in travis.yml
Jul 12, 2019
f226412
matrix merge
Jul 12, 2019
0cff77b
Attempt to solve U16 cache issue.
scottarnette Jul 12, 2019
330d872
adds incbin support for ccache on u16 via extrafiles
Jul 13, 2019
953de9c
exports ccache_extrafiles
Jul 13, 2019
ce30cc2
adds verbose logging for ccache
Jul 13, 2019
e83fb7c
removes verbose logging
Jul 13, 2019
d4f7381
corrects path to producer plugin
Jul 13, 2019
eb7557a
copys wasms for incbin
Jul 13, 2019
e434263
buildplskthxbai
Jul 13, 2019
eeac4e1
U16 now installs custom ccache instead of using apt.
scottarnette Jul 14, 2019
b7a0d3f
Corrected flaw in docker run command.
scottarnette Jul 14, 2019
71567da
Removed suffix logic used during testing of new container.
scottarnette Jul 15, 2019
14e5708
Restore code deleted during erronious merge
kj4ezj Jul 15, 2019
f3106e1
pipeline.yml
Jul 15, 2019
7e13c2a
silly mistake
Jul 15, 2019
189c5d1
mac brew and path fixes
Jul 15, 2019
f6cf475
fix for linux mount
Jul 15, 2019
f9f1d68
brew layer and git install
Jul 15, 2019
20776d2
path fixes
Jul 15, 2019
dc92548
quick fix to mac repo url
Jul 15, 2019
77ec832
cmake
Jul 15, 2019
225dea8
mac path fix
Jul 15, 2019
b6f7bc5
generate script
Jul 15, 2019
1bc3330
test
Jul 15, 2019
ea4bebe
no need for build
Jul 15, 2019
6d72523
automation-eos-builder-fleet instead of large fleet + various fixes t…
Jul 16, 2019
2a21dde
new queue
Jul 16, 2019
2793367
wiat
Jul 16, 2019
0baed42
branch pass in
Jul 16, 2019
215cec3
hashes
Jul 16, 2019
78ef6fd
login fix
Jul 16, 2019
98190d0
test
Jul 16, 2019
a47a939
fixes
Jul 16, 2019
1b5c725
removes unused files/code
Jul 16, 2019
d0b0206
Update generate-base-images.sh
NorseGaud Jul 16, 2019
9ed5362
Merge pull request #7656 from EOSIO/jerstern/cleanup-travis
Jul 16, 2019
43a730e
removes cache, before install
Jul 16, 2019
27bcb91
tests environment path injection
Jul 16, 2019
79e3454
doublequotes
Jul 17, 2019
c1a8551
injects ccache into path via environment variable
Jul 17, 2019
fedd6ce
buildplskthxbai
Jul 17, 2019
18a6f87
removes pull
Jul 17, 2019
1baa71f
Merge pull request #7655 from EOSIO/trav_poc_r1.8_burdkite
Jul 17, 2019
a22a0a0
added manifest inspect instead of pull to speed up base image check a…
Jul 17, 2019
5f20206
builds environment settings into containers
Jul 17, 2019
0b28a90
Merge branch 'trav_poc_r1.8' of github.com:EOSIO/eos into jerstern/kiss
Jul 17, 2019
f807e0b
reverted back to pull as linux doesn't have manifest
Jul 17, 2019
9372e45
Merge branch 'trav_poc_r1.8' of github.com:EOSIO/eos into jerstern/kiss
Jul 17, 2019
eb55a14
curl for tag query
Jul 17, 2019
e6e9a6d
improvement
Jul 17, 2019
c2c911e
test dockerfile
Jul 17, 2019
7233be2
dockerffile
Jul 17, 2019
1042ed8
quick fix
Jul 17, 2019
4ca4981
gets docker tag from hash
Jul 17, 2019
1bd6901
Merge pull request #7665 from EOSIO/trav_poc_r1.8_docker_pull
NorseGaud Jul 17, 2019
5253d5a
testing new helper and ENTRYPOINT
Jul 17, 2019
03ecbac
final for CMD
Jul 17, 2019
fe3f4bb
NEW IMAGES DONE
Jul 17, 2019
95da098
whoops
Jul 17, 2019
05a1037
[ci skip] Removed shell
Jul 17, 2019
cd2b179
Darwin logic fix
Jul 17, 2019
5481c05
workdir
Jul 17, 2019
29ee7e8
whoops
Jul 17, 2019
7af5f70
[ci skip] path fix
Jul 17, 2019
00208cf
workdir new hashes
Jul 18, 2019
8bcd496
[ci skip] MERGE
Jul 18, 2019
075aed7
[ci skip] quick fix
Jul 18, 2019
3596f16
Merge pull request #7666 from EOSIO/jerstern/kiss
NorseGaud Jul 18, 2019
754afd4
fix for hash mac check
Jul 18, 2019
86b84ac
ccache tests for mac:
Jul 18, 2019
27f570b
fixed ubuntu18 loading c++ instead of clang (breaking the symlinked c…
Jul 18, 2019
f988e22
[ci skip] New hash
Jul 18, 2019
8d3e0b1
testing
Jul 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .cicd/.helpers
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
DRYRUN=${DRYRUN:-false}
VERBOSE=${VERBOSE:-true}
export PROJECT_NAME="eosio"

# Set IMAGE_TAG using arg (generate-base-images.sh) or env (travis.yml)
( [[ $(uname) != 'Darwin' ]] && [[ -z $IMAGE_TAG ]] && [[ -z $1 ]] ) && echo "You must provide the distro IMAGE_TAG name (example: ubuntu-18.04) as argument \$1 or set it within your ENV" && exit 1
export IMAGE_TAG=${IMAGE_TAG:-$1}

function execute() {
$VERBOSE && echo "--- Executing: $@"
$DRYRUN || "$@"
}

function determine-hash() {
# Determine the sha1 hash of all dockerfiles in the .cicd directory.
[[ -z $1 ]] && echo "Please provide the files to be hashed (wildcards supported)" && exit 1
echo "Obtaining Hash of files from $1..."
# Collect all files, hash them, then hash those.
HASHES=()
for FILE in $(find $1 -type f); do
HASH=$(sha1sum $FILE | sha1sum | awk '{ print $1 }')
HASHES=($HASH "${HASHES[*]}")
echo "$FILE - $HASH"
done
export DETERMINED_HASH=$(echo ${HASHES[*]} | sha1sum | awk '{ print $1 }')
export HASHED_IMAGE_TAG="${IMAGE_TAG}-${DETERMINED_HASH}"
}

function generate_docker_image() {
# If we cannot pull the image, we build and push it first.
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
cd ./.cicd
docker build -t $FULL_TAG -f ./${IMAGE_TAG}.dockerfile .
docker push $FULL_TAG
cd -
}

function docker_tag_exists() {
ORG_REPO=$(echo $1 | cut -d: -f1)
TAG=$(echo $1 | cut -d: -f2)
EXISTS=$(curl -s -H "Authorization: Bearer $(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${ORG_REPO}:pull" | jq --raw-output .token)" "https://registry.hub.docker.com/v2/${ORG_REPO}/manifests/$TAG")
( [[ $EXISTS =~ '404 page not found' ]] || [[ $EXISTS =~ 'manifest unknown' ]] ) && return 1 || return 0
}

if [[ $(uname) != 'Darwin' ]]; then # Darwin doesn't need hash (yet)
determine-hash ".cicd/${IMAGE_TAG}.dockerfile"
[[ -z $DETERMINED_HASH ]] && echo "DETERMINED_HASH empty! (check determine-hash function)" && exit 1
export FULL_TAG="eosio/producer:${PROJECT_NAME}-$HASHED_IMAGE_TAG"
fi
82 changes: 82 additions & 0 deletions .cicd/amazonlinux-2.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FROM amazonlinux:2

# YUM dependencies.
RUN yum update -y \
&& yum install -y which git sudo procps-ng util-linux autoconf automake \
libtool make bzip2 bzip2-devel openssl-devel gmp-devel libstdc++ libcurl-devel \
libusbx-devel python3 python3-devel python-devel libedit-devel doxygen \
graphviz clang patch

# Build appropriate version of CMake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz \
&& tar -xzf cmake-3.13.2.tar.gz \
&& cd cmake-3.13.2 \
&& ./bootstrap --prefix=/usr/local \
&& make -j$(nproc) \
&& make install \
&& cd .. \
&& rm -f cmake-3.13.2.tar.gz

# Build appropriate version of LLVM.
RUN git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git llvm \
&& cd 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 .. \
&& make -j$(nproc) \
&& make install \
&& cd /

# Build appropriate version of Boost.
RUN curl -LO https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 \
&& tar -xjf boost_1_70_0.tar.bz2 \
&& cd boost_1_70_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 -f boost_1_70_0.tar.bz2

# Build appropriate version of MongoDB.
RUN curl -LO https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.6.3.tgz \
&& tar -xzf mongodb-linux-x86_64-amazon-3.6.3.tgz \
&& rm -f mongodb-linux-x86_64-amazon-3.6.3.tgz

# Build appropriate version of MongoDB C Driver.
RUN curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/1.13.0/mongo-c-driver-1.13.0.tar.gz \
&& tar -xzf mongo-c-driver-1.13.0.tar.gz \
&& cd mongo-c-driver-1.13.0 \
&& mkdir -p build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BSON=ON -DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON -DENABLE_ICU=OFF -DENABLE_SNAPPY=OFF .. \
&& make -j$(nproc) \
&& make install \
&& cd / \
&& rm -rf mongo-c-driver-1.13.0.tar.gz

# Build appropriate version of MongoDB C++ driver.
RUN curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.0.tar.gz -o mongo-cxx-driver-r3.4.0.tar.gz \
&& tar -xzf mongo-cxx-driver-r3.4.0.tar.gz \
&& cd mongo-cxx-driver-r3.4.0 \
&& sed -i 's/\"maxAwaitTimeMS\", count/\"maxAwaitTimeMS\", static_cast<int64_t>(count)/' src/mongocxx/options/change_stream.cpp \
&& sed -i 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \
&& cd build \
&& cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. \
&& make -j$(nproc) \
&& make install \
&& cd / \
&& rm -f mongo-cxx-driver-r3.4.0.tar.gz

ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin

# CCACHE
RUN curl -LO http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/c/ccache-3.3.4-1.el7.x86_64.rpm \
&& yum install -y ccache-3.3.4-1.el7.x86_64.rpm

# PRE_COMMANDS: Executed pre-cmake
# CMAKE_EXTRAS: Executed right before the cmake path (on the end)
ENV PRE_COMMANDS="export PATH=/usr/lib64/ccache:$PATH &&"
ENV CMAKE_EXTRAS="-DCMAKE_CXX_COMPILER='clang++' -DCMAKE_C_COMPILER='clang'"

CMD bash -c "$PRE_COMMANDS ccache -s && \
mkdir /workdir/build && cd /workdir/build && cmake -DCMAKE_BUILD_TYPE='Release' -DCORE_SYMBOL_NAME='SYS' -DOPENSSL_ROOT_DIR='/usr/include/openssl' -DBUILD_MONGO_DB_PLUGIN=true $CMAKE_EXTRAS /workdir && make -j $(getconf _NPROCESSORS_ONLN) && \
ctest -j$(getconf _NPROCESSORS_ONLN) -LE _tests --output-on-failure -T Test"
38 changes: 38 additions & 0 deletions .cicd/base-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
env:
BUILD_TIMEOUT: 120
TEST_TIMEOUT: 60
TIMEOUT: 120

steps:

- label: ":aws: [Amazon] 2 Ensure Docker Image"
command:
- ".cicd/generate-base-images.sh amazonlinux-2"
agents:
queue: "automation-eos-dockerhub-image-builder-fleet"
timeout: $BUILD_TIMEOUT
skip: $SKIP_AMAZON_LINUX_2

- label: ":centos: [CentOS] 7 Build"
command:
- ".cicd/generate-base-images.sh centos-7"
agents:
queue: "automation-eos-dockerhub-image-builder-fleet"
timeout: $BUILD_TIMEOUT
skip: $SKIP_CENTOS_7

- label: ":ubuntu: [Ubuntu] 16.04 Build"
command:
- ".cicd/generate-base-images.sh ubuntu-16.04"
agents:
queue: "automation-eos-dockerhub-image-builder-fleet"
timeout: $BUILD_TIMEOUT
skip: $SKIP_UBUNTU_16

- label: ":ubuntu: [Ubuntu] 18.04 Build"
command:
- ".cicd/generate-base-images.sh ubuntu-18.04"
agents:
queue: "automation-eos-dockerhub-image-builder-fleet"
timeout: $BUILD_TIMEOUT
skip: $SKIP_UBUNTU_18
97 changes: 97 additions & 0 deletions .cicd/centos-7.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
FROM centos:7

# YUM dependencies.
RUN yum update -y \
&& yum --enablerepo=extras install -y centos-release-scl \
&& yum --enablerepo=extras install -y devtoolset-8 \
&& yum --enablerepo=extras install -y which git autoconf automake libtool make bzip2 doxygen \
graphviz bzip2-devel openssl-devel gmp-devel ocaml libicu-devel \
python python-devel rh-python36 gettext-devel file libusbx-devel \
libcurl-devel patch

# Build appropriate version of CMake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz \
&& source /opt/rh/devtoolset-8/enable \
&& source /opt/rh/rh-python36/enable \
&& tar -xzf cmake-3.13.2.tar.gz \
&& cd cmake-3.13.2 \
&& ./bootstrap --prefix=/usr/local \
&& make -j$(nproc) \
&& make install \
&& cd .. \
&& rm -f cmake-3.13.2.tar.gz

# Build appropriate version of LLVM.
RUN git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git llvm \
&& source /opt/rh/devtoolset-8/enable \
&& source /opt/rh/rh-python36/enable \
&& cd 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 .. \
&& make -j$(nproc) \
&& make install \
&& cd /

# Build appropriate version of Boost.
RUN curl -LO https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 \
&& source /opt/rh/devtoolset-8/enable \
&& source /opt/rh/rh-python36/enable \
&& tar -xjf boost_1_70_0.tar.bz2 \
&& cd boost_1_70_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 -f boost_1_70_0.tar.bz2

# Build appropriate version of MongoDB.
RUN curl -LO https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.6.3.tgz \
&& tar -xzf mongodb-linux-x86_64-amazon-3.6.3.tgz \
&& rm -f mongodb-linux-x86_64-amazon-3.6.3.tgz

# Build appropriate version of MongoDB C Driver.
RUN curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/1.13.0/mongo-c-driver-1.13.0.tar.gz \
&& source /opt/rh/devtoolset-8/enable \
&& source /opt/rh/rh-python36/enable \
&& tar -xzf mongo-c-driver-1.13.0.tar.gz \
&& cd mongo-c-driver-1.13.0 \
&& mkdir -p build \
&& cd build \
&& cmake --DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BSON=ON -DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON -DENABLE_ICU=OFF -DENABLE_SNAPPY=OFF .. \
&& make -j$(nproc) \
&& make install \
&& cd / \
&& rm -rf mongo-c-driver-1.13.0.tar.gz

# Build appropriate version of MongoDB C++ driver.
RUN curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.0.tar.gz -o mongo-cxx-driver-r3.4.0.tar.gz \
&& source /opt/rh/devtoolset-8/enable \
&& source /opt/rh/rh-python36/enable \
&& tar -xzf mongo-cxx-driver-r3.4.0.tar.gz \
&& cd mongo-cxx-driver-r3.4.0 \
&& sed -i 's/\"maxAwaitTimeMS\", count/\"maxAwaitTimeMS\", static_cast<int64_t>(count)/' src/mongocxx/options/change_stream.cpp \
&& sed -i 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \
&& cd build \
&& cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. \
&& make -j$(nproc) \
&& make install \
&& cd / \
&& rm -f mongo-cxx-driver-r3.4.0.tar.gz

ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin

# CCACHE
RUN curl -LO http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/c/ccache-3.3.4-1.el7.x86_64.rpm \
&& yum install -y ccache-3.3.4-1.el7.x86_64.rpm
## Needed as devtoolset uses c++ and it's not in ccache by default
RUN cd /usr/lib64/ccache && ln -s ../../bin/ccache c++
## We need to tell ccache to actually use devtoolset-8 instead of the default system one (ccache resets anything set in PATH when it launches)
ENV CCACHE_PATH="/opt/rh/devtoolset-8/root/usr/bin"

# PRE_COMMANDS: Executed pre-cmake
# CMAKE_EXTRAS: Executed right before the cmake path (on the end)
ENV PRE_COMMANDS="source /opt/rh/devtoolset-8/enable && source /opt/rh/rh-python36/enable && export PATH=/usr/lib64/ccache:$PATH &&"

CMD bash -c "$PRE_COMMANDS ccache -s && \
mkdir /workdir/build && cd /workdir/build && cmake -DCMAKE_BUILD_TYPE='Release' -DCORE_SYMBOL_NAME='SYS' -DOPENSSL_ROOT_DIR='/usr/include/openssl' -DBUILD_MONGO_DB_PLUGIN=true $CMAKE_EXTRAS /workdir && make -j $(getconf _NPROCESSORS_ONLN) && \
ctest -j$(getconf _NPROCESSORS_ONLN) -LE _tests --output-on-failure -T Test"
6 changes: 6 additions & 0 deletions .cicd/generate-base-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
cd $( dirname "${BASH_SOURCE[0]}" )/.. # Ensure we're in the repo root and not inside of scripts
. ./.cicd/.helpers
echo "Looking for $FULL_TAG"
docker_tag_exists $FULL_TAG && echo "$FULL_TAG already exists" || generate_docker_image
14 changes: 14 additions & 0 deletions .cicd/pinned_toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_C_COMPILER /usr/local/bin/clang)
set(CMAKE_CXX_COMPILER /usr/local/bin/clang++)

set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES /usr/local/include/c++/v1 /usr/local/include /usr/include)

set(CMAKE_CXX_FLAGS_INIT "-nostdinc++")

set(CMAKE_EXE_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-stdlib=libc++ -nostdlib++")

set(CMAKE_CXX_STANDARD_LIBRARIES "/usr/local/lib/libc++.a /usr/local/lib/libc++abi.a")
80 changes: 80 additions & 0 deletions .cicd/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
env:
BUILD_TIMEOUT: 120
TEST_TIMEOUT: 60
TIMEOUT: 120
VERBOSE: true

steps:

- trigger: "eosio-base-images-beta"
label: ":docker: Ensure base images exist"
build:
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"

- wait

- label: ":aws: [Amazon] 2 Build"
agents:
queue: "automation-eos-builder-fleet"
plugins:
- docker#v3.2.0:
debug: $DEBUG
image: "eosio/producer:eosio-amazonlinux-2-1c266e25276ad1f1147a4df5c12921968079c49b"
timeout: $BUILD_TIMEOUT
skip: $SKIP_AMAZON_LINUX_2

- label: ":centos: [CentOS] 7 Build"
command:
- ""
agents:
queue: "automation-eos-builder-fleet"
plugins:
- docker#v3.2.0:
debug: $DEBUG
image: "eosio/producer:eosio-centos-7-d45789dfb1a5b830a62381afd205b34d3d7c2d63"
timeout: $BUILD_TIMEOUT
skip: $SKIP_CENTOS_7

- label: ":ubuntu: [Ubuntu] 16.04 Build"
agents:
queue: "automation-eos-builder-fleet"
plugins:
- docker#v3.2.0:
debug: $DEBUG
image: "eosio/producer:eosio-ubuntu-16.04-4f430ef21e359ef2581c25255c99e5411adfaed9"
timeout: $BUILD_TIMEOUT
skip: $SKIP_UBUNTU_16

- label: ":ubuntu: [Ubuntu] 18.04 Build"
agents:
queue: "automation-eos-builder-fleet"
plugins:
- docker#v3.2.0:
debug: $DEBUG
image: "eosio/producer:eosio-ubuntu-18.04-14091ac0e5618b0ea5ce026cd75b648efbde4be7"
timeout: $BUILD_TIMEOUT
skip: $SKIP_UBUNTU_18

- label: ":darwin: [Darwin] 10.14 Build"
command:
- "brew install git graphviz libtool gmp llvm@4 pkgconfig python python@2 doxygen libusb openssl [email protected] cmake"
- "git clone $BUILDKITE_REPO eos && cd eos && git checkout $BUILDKITE_COMMIT && git submodule update --init --recursive"
- "cd eos && mkdir build && cd build && cmake .. && make -j$(getconf _NPROCESSORS_ONLN)"
- "cd eos/build && ctest -j$(getconf _NPROCESSORS_ONLN) -LE _tests --output-on-failure -T Test"
plugins:
- chef/anka#v0.5.1:
no-volume: true
inherit-environment-vars: true
vm-name: 10.14.4_6C_14G_40G
vm-registry-tag: "clean::cicd::git-ssh::nas::brew"
modify-cpu: 12
modify-ram: 24
always-pull: true
debug: true
wait-network: true
agents:
- "queue=mac-anka-large-node-fleet"
timeout: $BUILD_TIMEOUT
skip: $SKIP_MOJAVE

Loading