Skip to content
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

[CLIPPER-224] Replace boost futures with folly futures #266

Merged
merged 26 commits into from
Aug 25, 2017
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9edb5a7
replace boost futures with folly
Corey-Zumar Aug 8, 2017
fb14f1b
Remove unused futures code
Corey-Zumar Aug 8, 2017
31a87dd
some code formatting
Corey-Zumar Aug 8, 2017
e90ad47
Update query frontend dockerfile to support Folly
Corey-Zumar Aug 12, 2017
632a837
fix cache move issue
Corey-Zumar Aug 12, 2017
e19fe59
remove unused import
Corey-Zumar Aug 12, 2017
1679bf7
format code
dcrankshaw Aug 16, 2017
3380693
remove version check
Corey-Zumar Aug 16, 2017
e51daa3
remove boost thread dependency
Corey-Zumar Aug 16, 2017
efca36e
remove boost thread as required component
Corey-Zumar Aug 16, 2017
1f86054
merge
Corey-Zumar Aug 16, 2017
c5ea6b8
format code
Corey-Zumar Aug 16, 2017
fd3a628
Create base dockerfile for installing clipper deps, query and mgmt in…
Corey-Zumar Aug 17, 2017
fdbffe1
rename lib-base >> lib_base
Corey-Zumar Aug 17, 2017
b55ba54
makes FindFolly.cmake search in FOLLY_ROOT
dcrankshaw Aug 23, 2017
f389778
format code
dcrankshaw Aug 23, 2017
6ea49b8
Pin library versions in base dockerfile
Corey-Zumar Aug 23, 2017
ddce8dc
Fix FindFolly cmake
Aug 24, 2017
eb87cac
Add additional link flags for folly cmake
Aug 25, 2017
0a44998
Add missing threadpool imports
Corey-Zumar Aug 25, 2017
3107dc5
Merge branch 'folly_futures' of https://github.com/Corey-Zumar/clippe…
Corey-Zumar Aug 25, 2017
b20532a
fix boost thread import
Corey-Zumar Aug 25, 2017
5604672
Add more cmake link flags
Aug 25, 2017
7463722
Revert "Add more cmake link flags"
Aug 25, 2017
66a96da
Update QueryFrontendDockerfile
Corey-Zumar Aug 25, 2017
d320012
Update ManagementFrontendDockerfile
Corey-Zumar Aug 25, 2017
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
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ set_property(TARGET boost PROPERTY
set_property(TARGET boost PROPERTY
INTERFACE_LINK_LIBRARIES ${Boost_LIBRARIES})

# Include Folly as an imported target
find_package(Folly REQUIRED)
add_library(folly INTERFACE IMPORTED)
set_property(TARGET folly PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${FOLLY_INCLUDE_DIR})
set(FOLLY_LINK_FLAGS "-lglog -lcrypto -lssl")
set_property(TARGET folly PROPERTY
INTERFACE_LINK_LIBRARIES ${FOLLY_LINK_FLAGS} ${FOLLY_LIBRARY})

# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Werror -Wno-deprecated-declarations -Wno-unsupported-friend")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-deprecated-declarations")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
40 changes: 40 additions & 0 deletions ClipperLibBaseDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM frolvlad/alpine-gxx

RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories

RUN apk add --no-cache git bash make boost-dev cmake libev-dev hiredis-dev zeromq-dev \
libtool automake autoconf-archive@testing lz4-dev xz-dev snappy-dev zlib-dev \
glog-dev@testing scons openssl-dev libevent-dev

# Set up Folly

## Install DoubleConversion
RUN git clone https://github.com/google/double-conversion \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's pin this to a specific release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

&& cd double-conversion \
&& git checkout tags/v3.0.0 \
&& cmake -DBUILD_SHARED_LIBS=ON . \
&& make \
&& make install \
&& ln -s src double-conversion

ENV DOUBLE_CONVERSION_HOME=/double-conversion/double-conversion/

ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DOUBLE_CONVERSION_HOME

## Install GFLags
RUN git clone https://github.com/gflags/gflags \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pin this to a specific release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

&& cd gflags \
&& git checkout tags/v2.2.1 \
&& mkdir build \
&& cd build \
&& cmake -DBUILD_SHARED_LIBS=ON .. \
&& make install

## Install Folly
RUN git clone https://github.com/facebook/folly \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pin this to a specific release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

&& cd folly/folly \
&& git checkout tags/v2017.08.14.00 \
&& autoreconf -ivf \
&& ./configure LDFLAGS=-L$DOUBLE_CONVERSION_HOME/ CPPFLAGS=-I$DOUBLE_CONVERSION_HOME \
&& make \
&& make install
3 changes: 2 additions & 1 deletion ManagementFrontendDockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM frolvlad/alpine-gxx
ARG CODE_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give this arg a default version (eg https://github.com/ucbrise/clipper/blob/develop/PythonContainerDockerfile#L1), otherwise the automated builds on Docker Hub will fail.

FROM clipper/lib_base:${CODE_VERSION}

COPY ./ /clipper

Expand Down
8 changes: 5 additions & 3 deletions QueryFrontendDockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM frolvlad/alpine-gxx
ARG CODE_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give this a default argument (see above comment)

FROM clipper/lib_base:${CODE_VERSION}

# Build Clipper

COPY ./ /clipper

RUN apk add --no-cache git bash make boost-dev cmake libev-dev hiredis-dev zeromq-dev \
&& cd /clipper/src/libs/spdlog \
RUN cd /clipper/src/libs/spdlog \
&& git apply ../patches/make_spdlog_compile_linux.patch \
&& cd /clipper \
&& ./configure --cleanup-quiet \
Expand Down
5 changes: 3 additions & 2 deletions bin/build_docker_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ cd $DIR/..
tag=$(<VERSION.txt)

# Build the Clipper Docker images
time docker build -t clipper/query_frontend:$tag -f QueryFrontendDockerfile ./
time docker build -t clipper/management_frontend:$tag -f ManagementFrontendDockerfile ./
time docker build -t clipper/lib_base:$tag -f ./ClipperLibBaseDockerfile ./
time docker build --build-arg CODE_VERSION=$tag -t clipper/query_frontend:$tag -f QueryFrontendDockerfile ./
time docker build --build-arg CODE_VERSION=$tag -t clipper/management_frontend:$tag -f ManagementFrontendDockerfile ./
cd -

# Build Spark JVM Container
Expand Down
Loading