facebook / wdt

Warp speed Data Transfer (WDT) is an embeddedable library (and command line tool) aiming to transfer data between 2 systems as fast as possible over multiple TCP paths.
https://www.facebook.com/WdtOpenSource
Other
2.86k stars 392 forks source link

Docker Build #200

Closed doubleailes closed 3 years ago

doubleailes commented 4 years ago

Hi Guys,

I'm trying to build wdt inside a docker here is my dockerfile.


RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y git
RUN git clone https://github.com/facebook/folly.git
RUN apt-get install -y libgoogle-glog-dev libboost-all-dev libdouble-conversion-dev libjemalloc-dev cmake gcc libssl-dev
RUN apt-get install -y g++
RUN git clone https://github.com/facebook/wdt.git
WORKDIR /wdt
RUN cmake ./ -DBUILD_TESTING=on
ENV CTEST_OUTPUT_ON_FAILURE=1
RUN make test
RUN make install `
doubleailes commented 4 years ago

Here is my error


In file included from /wdt/util/ThreadTransferHistory.cpp:10:0:
/wdt/../wdt/Sender.h:15:10: fatal error: gtest/gtest_prod.h: No such file or directory
 #include <gtest/gtest_prod.h>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/wdt_min.dir/build.make:398: recipe for target 'CMakeFiles/wdt_min.dir/util/ThreadTransferHistory.cpp.o' failed
make[2]: *** [CMakeFiles/wdt_min.dir/util/ThreadTransferHistory.cpp.o] Error 1
CMakeFiles/Makefile2:727: recipe for target 'CMakeFiles/wdt_min.dir/all' failed
make[1]: *** [CMakeFiles/wdt_min.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c make install' returned a non-zero code: 2
doubleailes commented 4 years ago

Base on the ticker #199 i can improve my dockerfile but i'm stuck as the level as the ticker #199


RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y git
RUN git clone https://github.com/facebook/folly.git
RUN apt-get install -y cmake libjemalloc-dev libgoogle-glog-dev libboost-system-dev libdouble-conversion-dev openssl build-essential libboost-all-dev libssl-dev libgtest-dev
RUN apt-get install -y g++
RUN git clone https://github.com/majoros/wdt.git
WORKDIR /wdt
RUN cmake ./ -DBUILD_TESTING=on
ENV CTEST_OUTPUT_ON_FAILURE=1
RUN make test
RUN make install
SashaNullptr commented 4 years ago

I think this will work:

FROM ubuntu:18.04

# Install basic deps for all packages
RUN apt-get update && \
    apt-get install -y \
    cmake \
    git \
    wget \
    g++

# Install Folly

# Install folly package deps
RUN apt-get install -y \
    g++ \
    cmake \
    libboost-all-dev \
    libevent-dev \
    libdouble-conversion-dev \
    libgoogle-glog-dev \
    libgflags-dev \
    libiberty-dev \
    liblz4-dev \
    liblzma-dev \
    libsnappy-dev \
    make \
    zlib1g-dev \
    binutils-dev \
    libjemalloc-dev \
    libssl-dev \
    pkg-config

# Install folly itself
RUN git clone https://github.com/facebook/folly.git

# Install WDT from source
RUN apt-get install -y \
    libgtest-dev \
    libboost-all-dev

RUN git clone --single-branch --branch folly-fixes https://github.com/sashanullptr/wdt.git && \
    cd wdt && \
    mkdir _build && cd _build && \
    cmake .. \
    -DBUILD_TESTING=off && \
    make -j$(nproc) && \
    make install

You'll need to patch CMakeLists.txt using the changes specified in #201 in order for the aforementioned Dockerfile to work. The line git clone --single-branch --branch folly-fixes https://github.com/sashanullptr/wdt.git pulls a branch of a fork of WDT that has already has the changes to CMakeLists.txt applied. If you make the changes yourself you won't need this particular line.

davide125 commented 3 years ago

With #201 merged this should be resolved.