-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strip base images and build speed up #46
Open
algys
wants to merge
3
commits into
develop
Choose a base branch
from
build-speed-up
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,16 @@ LABEL author="Andrey Levkin <[email protected]>" \ | |
version="0.1.0" \ | ||
description="Base image for building Haya on CentOS" | ||
|
||
COPY . /var/src/${project_name} | ||
COPY ./scripts /var/src/${project_name}/scripts | ||
|
||
WORKDIR /var/src/${project_name} | ||
|
||
RUN yum -y update && \ | ||
yum -y --enablerepo=extras install centos-release-scl && \ | ||
yum install -y epel-release && \ | ||
yum update -y --enablerepo=epel && \ | ||
yum install -y devtoolset-7 git rpm-build ccache \ | ||
autoconf automake libtool make bzip2 doxygen graphviz \ | ||
bzip2-devel openssl-devel gmp-devel \ | ||
ocaml libicu-devel python python-devel python33 \ | ||
gettext-devel file sudo libusbx-devel libcurl-devel && \ | ||
git submodule update --init --recursive && \ | ||
yum install -y git curl sudo ccache && \ | ||
cd scripts && \ | ||
bash ${project_name}_build.sh -y -t && \ | ||
rm -rf /var/src && rm -rf /var/cache/* | ||
yum clean all && \ | ||
rm -rf /var/src && rm -rf /var/cache/* && rm -rf /root/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,13 @@ LABEL author="Andrey Levkin <[email protected]>" \ | |
version="0.1.0" \ | ||
description="Base image for building Haya on Ubuntu" | ||
|
||
COPY . /var/src/${project_name} | ||
COPY ./scripts /var/src/${project_name}/scripts | ||
|
||
WORKDIR /var/src/${project_name} | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
sudo git ccache llvm-4.0 clang-4.0 libclang-4.0-dev make automake libbz2-dev libssl-dev doxygen graphviz \ | ||
libgmp3-dev autotools-dev build-essential libicu-dev python2.7 python2.7-dev python3 python3-dev \ | ||
autoconf libtool curl zlib1g-dev sudo ruby libusb-1.0-0-dev libcurl4-gnutls-dev pkg-config && \ | ||
git submodule update --init --recursive && \ | ||
apt-get install -y git curl sudo ccache && \ | ||
cd scripts && \ | ||
bash ${project_name}_build.sh -y -t && \ | ||
rm -rf /var/src && rm -rf /var/cache | ||
rm -rf /var/src && rm -rf /var/cache && \ | ||
rm -rf /var/lib/apt/lists/* && rm -rf /root/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,14 +67,16 @@ export BOOST_VERSION_MAJOR=1 | |
export BOOST_VERSION_MINOR=67 | ||
export BOOST_VERSION_PATCH=0 | ||
export BOOST_VERSION=${BOOST_VERSION_MAJOR}_${BOOST_VERSION_MINOR}_${BOOST_VERSION_PATCH} | ||
export BOOST_ROOT=${SRC_LOCATION}/boost_${BOOST_VERSION} | ||
export BOOST_SRC=${SRC_LOCATION}/boost_${BOOST_VERSION} | ||
export BOOST_ROOT=${OPT_LOCATION}/boost_${BOOST_VERSION} | ||
export BOOST_LINK_LOCATION=${OPT_LOCATION}/boost | ||
export LLVM_VERSION=release_40 | ||
export LLVM_ROOT=${OPT_LOCATION}/llvm | ||
export LLVM_DIR=${LLVM_ROOT}/lib/cmake/llvm | ||
export DOXYGEN_VERSION=1_8_14 | ||
export DOXYGEN_ROOT=${SRC_LOCATION}/doxygen-${DOXYGEN_VERSION} | ||
export TINI_VERSION=0.18.0 | ||
export CMAKE_CXX_FLAGS="" | ||
|
||
# Setup directories | ||
mkdir -p $SRC_LOCATION | ||
|
@@ -107,9 +109,10 @@ function usage() | |
|
||
NONINTERACTIVE=0 | ||
BUILDTOOLSONLY=0 | ||
NOWARNING=0 | ||
|
||
if [ $# -ne 0 ]; then | ||
while getopts ":cdo:s:ahytf" opt; do | ||
while getopts ":cdo:s:ahytfn" opt; do | ||
case "${opt}" in | ||
o ) | ||
options=( "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) | ||
|
@@ -152,6 +155,9 @@ if [ $# -ne 0 ]; then | |
f) | ||
SKIP_DEPS_CHECK=1 | ||
;; | ||
n) | ||
NOWARNING=1 | ||
;; | ||
\? ) | ||
printf "\\nInvalid Option: %s\\n" "-${OPTARG}" 1>&2 | ||
usage | ||
|
@@ -170,33 +176,42 @@ if [ $# -ne 0 ]; then | |
done | ||
fi | ||
|
||
if [ ! -d "${REPO_ROOT}/.git" ]; then | ||
printf "\\nThis build script only works with sources cloned from git\\n" | ||
printf "Please clone a new haya directory with 'git clone https://github.com/mixbytes/haya --recursive'\\n" | ||
exit 1 | ||
fi | ||
|
||
cd $REPO_ROOT | ||
|
||
STALE_SUBMODS=$(( $(git submodule status --recursive | grep -c "^[+\-]") )) | ||
if [ $STALE_SUBMODS -gt 0 ]; then | ||
printf "\\ngit submodules are not up to date.\\n" | ||
printf "Please run the command 'git submodule update --init --recursive'.\\n" | ||
exit 1 | ||
if [ $BUILDTOOLSONLY == 0 ]; then | ||
if [ ! -d "${REPO_ROOT}/.git" ]; then | ||
printf "\\nThis build script only works with sources cloned from git\\n" | ||
printf "Please clone a new haya directory with 'git clone https://github.com/mixbytes/haya --recursive'\\n" | ||
exit 1 | ||
fi | ||
|
||
STALE_SUBMODS=$(( $(git submodule status --recursive | grep -c "^[+\-]") )) | ||
if [ $STALE_SUBMODS -gt 0 ]; then | ||
printf "\\ngit submodules are not up to date.\\n" | ||
printf "Please run the command 'git submodule update --init --recursive'.\\n" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
printf "\\nBeginning build version: %s\\n" "${VERSION}" | ||
printf "%s\\n" "$( date -u )" | ||
printf "User: %s\\n" "$( whoami )" | ||
# printf "git head id: %s\\n" "$( cat .git/refs/heads/master )" | ||
printf "Current branch: %s\\n" "$( git rev-parse --abbrev-ref HEAD )" | ||
|
||
if [ $BUILDTOOLSONLY == 0 ]; then | ||
printf "Current branch: %s\\n" "$( git rev-parse --abbrev-ref HEAD )" | ||
fi | ||
|
||
ARCH=$( uname ) | ||
printf "\\nARCHITECTURE: %s\\n" "${ARCH}" | ||
|
||
# Find and use existing CMAKE | ||
export CMAKE=$(command -v cmake 2>/dev/null) | ||
|
||
if [ "$NOWARNING" == 1 ]; then | ||
CMAKE_CXX_FLAGS="-w" | ||
fi | ||
|
||
if [ "$ARCH" == "Linux" ]; then | ||
# Check if cmake is already installed or not and use source install location | ||
if [ -z $CMAKE ]; then export CMAKE=$HOME/bin/cmake; fi | ||
|
@@ -223,7 +238,6 @@ if [ "$ARCH" == "Linux" ]; then | |
FILE="${REPO_ROOT}/scripts/haya_build_centos.sh" | ||
CXX_COMPILER=g++ | ||
C_COMPILER=gcc | ||
export PATH=$PATH:/opt/rh/devtoolset-7/root/usr/bin | ||
;; | ||
"elementary OS") | ||
FILE="${REPO_ROOT}/scripts/haya_build_ubuntu.sh" | ||
|
@@ -293,7 +307,8 @@ $CMAKE -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DCMAKE_CXX_COMPILER="${CXX_COMP | |
-DCMAKE_C_COMPILER="${C_COMPILER}" -DCORE_SYMBOL_NAME="${CORE_SYMBOL_NAME}" \ | ||
-DOPENSSL_ROOT_DIR="${OPENSSL_ROOT_DIR}" -DBUILD_MONGO_DB_PLUGIN=true \ | ||
-DENABLE_COVERAGE_TESTING="${ENABLE_COVERAGE_TESTING}" -DBUILD_DOXYGEN="${DOXYGEN}" \ | ||
-DCMAKE_INSTALL_PREFIX=$OPT_LOCATION/haya -DENABLE_TX_SPONSORSHIP=1 $LOCAL_CMAKE_FLAGS "${REPO_ROOT}" | ||
-DCMAKE_INSTALL_PREFIX=$OPT_LOCATION/haya -DENABLE_TX_SPONSORSHIP=1 $LOCAL_CMAKE_FLAGS "${REPO_ROOT}" \ | ||
-DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better ${CMAKE_CXX_FLAGS} |
||
set +x | ||
if [ $? -ne 0 ]; then exit -1; fi | ||
make -j"${JOBS}" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?