Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

[DHCP Test] some problems #123

Closed
Gzure opened this issue Aug 25, 2020 · 11 comments
Closed

[DHCP Test] some problems #123

Gzure opened this issue Aug 25, 2020 · 11 comments

Comments

@Gzure
Copy link
Contributor

Gzure commented Aug 25, 2020

I will submit some test errors, and we can discuss here.

@Gzure
Copy link
Contributor Author

Gzure commented Aug 25, 2020

@er1cthe0ne hi eric , I got a build error below.
[root@67 alcor-control-agent]# docker exec a1 bash -c "cd /mnt/host/code && cmake . && make"
-- Using protobuf
-- Using gRPC 1.24.3
-- Found Protobuf: /usr/local/lib/libprotobuf.a (found version "3.8.0")
-- Found Protobuf: /usr/local/bin/protoc-3.8.0.0 (found version "3.8.0.0")
-- Using protobuf
-- Using gRPC 1.24.3
-- Using protobuf
-- Using gRPC 1.24.3
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/host/code
[ 2%] Building CXX object src/grpc/CMakeFiles/grpc.dir/goalstateprovisioner.pb.cc.o
:0:1: error: macro names must be identifiers
src/grpc/CMakeFiles/grpc.dir/build.make:94: recipe for target 'src/grpc/CMakeFiles/grpc.dir/goalstateprovisioner.pb.cc.o' failed
make[2]: *** [src/grpc/CMakeFiles/grpc.dir/goalstateprovisioner.pb.cc.o] Error 1
CMakeFiles/Makefile2:262: recipe for target 'src/grpc/CMakeFiles/grpc.dir/all' failed
make[1]: *** [src/grpc/CMakeFiles/grpc.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2

@er1cthe0ne
Copy link
Contributor

er1cthe0ne commented Aug 25, 2020

Hi JianWei,

Can you tell me the steps/changes you have done before seeing the compile time error?

The error log you shared doesn't have a lot of information, can you log into the build container, try to rebuild and get additional error logs:
$ docker exec -it a1 /bin/bash
$ cd /mnt/host/code && cmake . && make
$ see if there is additional error logs output on the console, or try to get additional information from the compiler

did you change goalstateprovisioner.proto file under /Alcor/schema/proto3 ?

Also make sure you have the latest Alcor submodule code, by looking at /Alcor/schema/proto3/goalstate.proto, you should see:

message GoalState {
uint32 format_version = 1;

repeated VpcState vpc_states = 2;
repeated SubnetState subnet_states = 3;
repeated PortState port_states = 4;
repeated NeighborState neighbor_states = 5;
repeated SecurityGroupState security_group_states = 6;
repeated DHCPState dhcp_states = 7;
repeated RouterState router_states = 8;

}
Notice there is RouterState at the end

@Gzure
Copy link
Contributor Author

Gzure commented Aug 25, 2020

Hi Eric,
I change only build/Dockerfile, and docker image can build success.

The version of alcor agent is nanWu git branch.

build container log:
`root@619b47a03b25:/mnt/host/code# cmake .
CMake Error: The current CMakeCache.txt directory /mnt/host/code/CMakeCache.txt is different than the directory /root/dhcp/alcor-control-agent where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
root@619b47a03b25:/mnt/host/code# rm -f CMakeCache.txt
root@619b47a03b25:/mnt/host/code# cmake .
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at /usr/local/lib/cmake/protobuf/protobuf-options.cmake:6 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

For compatibility with older versions of CMake, option is clearing the
normal variable 'protobuf_MODULE_COMPATIBLE'.
Call Stack (most recent call first):
/usr/local/lib/cmake/protobuf/protobuf-config.cmake:2 (include)
src/CMakeLists.txt:35 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Using protobuf
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1")
-- Using gRPC 1.24.3
-- Found Protobuf: /usr/local/lib/libprotobuf.a;-lpthread (found version "3.8.0")
-- Found Threads: TRUE
-- Found Protobuf: /usr/local/bin/protoc-3.8.0.0 (found version "3.8.0.0")
-- Using protobuf
-- Using gRPC 1.24.3
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Using protobuf
-- Using gRPC 1.24.3
-- Found GTest: /usr/local/lib/libgtest.so
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/host/code
root@619b47a03b25:/mnt/host/code# make
[ 2%] Building CXX object src/grpc/CMakeFiles/grpc.dir/goalstateprovisioner.pb.cc.o
:0:1: error: macro names must be identifiers
src/grpc/CMakeFiles/grpc.dir/build.make:94: recipe for target 'src/grpc/CMakeFiles/grpc.dir/goalstateprovisioner.pb.cc.o' failed
make[2]: *** [src/grpc/CMakeFiles/grpc.dir/goalstateprovisioner.pb.cc.o] Error 1
CMakeFiles/Makefile2:262: recipe for target 'src/grpc/CMakeFiles/grpc.dir/all' failed
make[1]: *** [src/grpc/CMakeFiles/grpc.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2
`

The GoalState is
`message GoalState {
uint32 format_version = 1;

repeated VpcState vpc_states = 2;
repeated SubnetState subnet_states = 3;
repeated PortState port_states = 4;
repeated NeighborState neighbor_states = 5;
repeated SecurityGroupState security_group_states = 6;
repeated DHCPState dhcp_states = 7;
repeated RouterState router_states = 8;

}`

@er1cthe0ne
Copy link
Contributor

Hi JianWei, can you tell me what you changed in build/Dockerfile? Did you change the cmake or gcc version?

These are likely the issues that produce the compile error:
https://www.eclipse.org/forums/index.php/t/1086695/
https://forum.arduino.cc/index.php?topic=471189.0

@Gzure
Copy link
Contributor Author

Gzure commented Aug 25, 2020

Hi eric
The test server is on the intranet and the network is restricted. Therefore, the package teacher clones the package to the local host and the CMake version is the latest 3.18.2.
build/Dockerfile
`FROM ubuntu:18.04

ENV http_proxy http://70.202.1.80:3128
ENV https_proxy http://70.202.1.80:3128
ENV no_proxy 127.0.0.1,/var/run/docker.sock
ENV GIT_SSL_NO_VERIFY=1

RUN echo "Acquire::Retries "999";" > /etc/apt/apt.conf.d/70debconf
RUN cat /etc/apt/apt.conf.d/70debconf

RUN apt-get update
RUN echo "--- installing mizar dependencies ---" &&
apt-get install -y
rpcbind
rsyslog
build-essential
clang-7
llvm-7
libelf-dev
#openvswitch-switch
iproute2
net-tools
iputils-ping
ethtool
curl
python3
python3-pip
netcat
libcmocka-dev
lcov
git
autoconf
automake
dh-autoreconf
libtool
RUN pip3 install httpserver netaddr

RUN apt install gnutls-bin -y
COPY git/openvswitch /var/local/git/openvswitch/
ENV OVS_RELEASE_TAG branch-2.12
RUN echo "--- installing openvswitch dependancies ---" &&
cd /var/local/git/openvswitch &&
./boot.sh &&
./configure --prefix=/usr/local --localstatedir=/var --sysconfdir=/etc --enable-shared &&
make &&
make install &&
cp /var/local/git/openvswitch/lib/vconn-provider.h /usr/local/include/openvswitch/vconn-provider.h &&
rm -rf \var\local\git\openvswitch

RUN echo "--- installing grpc dependencies ---" &&
apt-get install -y
libssl-dev
autoconf git pkg-config
automake libtool make g++ unzip

RUN apt-get install wget -y

RUN wget https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2.tar.gz --no-check-certificate
RUN tar -xvf cmake-3.18.2.tar.gz
RUN cd cmake-3.18.2 &&
./bootstrap &&
make &&
make install &&
cmake --version

RUN git config --global http.sslVerify false
RUN git config --global http.postBuffer 1048576000

COPY git/grpc /var/local/git/grpc/
ENV GRPC_RELEASE_TAG v1.24.x
RUN echo "--- cloning grpc repo ---" &&
cd /var/local/git/grpc &&
git submodule update --init &&
echo "--- installing c-ares ---" &&
cd /var/local/git/grpc/third_party/cares/cares &&
git fetch origin &&
git checkout cares-1_15_0 &&
mkdir -p cmake/build &&
cd cmake/build &&
cmake -DCMAKE_BUILD_TYPE=Release ../.. &&
make -j4 install &&
cd ../../../../.. &&
rm -rf third_party/cares/cares &&
echo "--- installing protobuf ---" &&
cd /var/local/git/grpc/third_party/protobuf &&
mkdir -p cmake/build &&
cd cmake/build &&
cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release .. &&
make -j4 install &&
cd ../../../.. &&
rm -rf third_party/protobuf &&
echo "--- installing grpc ---" &&
cd /var/local/git/grpc &&
mkdir -p cmake/build &&
cd cmake/build &&
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DCMAKE_BUILD_TYPE=Release ../.. &&
make -j4 install &&
echo "--- installing google test ---" &&
cd /var/local/git/grpc/third_party/googletest &&
cmake -Dgtest_build_samples=ON -DBUILD_SHARED_LIBS=ON . &&
make &&
make install &&
rm -rf /var/local/git/grpc

this layer is consuming about 406MB, can try to optimize

RUN echo "--- installing librdkafka ---" &&
apt-get install -y --no-install-recommends
librdkafka-dev
doxygen
libssl-dev
zlib1g-dev
libboost-program-options-dev
libboost-all-dev
&& apt-get clean

COPY git/cppkafka /var/local/git/cppkafka/
RUN echo "--- installing cppkafka ---" &&
cd /var/local/git/cppkafka &&
mkdir build &&
cd build &&
cmake .. &&
make &&
make install &&
ldconfig &&
rm -rf /var/local/git/cppkafka`

@er1cthe0ne
Copy link
Contributor

Hi JianWei, got it.

I suspect the compile time error is caused by the CMake version change to 3.18.2. Can you undo that change (maybe you need to change build/Dockerfile and rebuild a new container) and see if that error goes away?

It is not clear to me why we need to move to newer CMake version. The last error I saw was in the test code compile only which doesn't use the new openvswitch code. The main executable AlcorControlAgent uses the new openvswitch code but somehow it compiles okay? Maybe you can give me more information about this so that I can look into it further?

@Gzure
Copy link
Contributor Author

Gzure commented Aug 25, 2020

Hi Eric
I used an old CMake version but got an error that CMake requires a higher than 3.12 version. The version of openvswitch branch-2.12 is writed in Dockerfile. Which CMake version and openvswitch is ok?

@er1cthe0ne
Copy link
Contributor

Hi JianWei, the cmake version that comes with ubuntu:18.04 is 3.10.2. That one works just fine for openvswitch branch 2.12 and also the rest of the project. Please try to do a make clean or rebuild the build container without install CMake version 3.18.2. That's the environment we have been using for development and also our automated CI.

On this default environment, if you see compile time error with the change in your branch, please try to address it or send me the error message so that I can look into it further.

(going offline now ...)

@Gzure
Copy link
Contributor Author

Gzure commented Aug 25, 2020

@er1cthe0ne I got the problem, the WuNan branch CMakeLists.txt is required 3.12.4 because of adding a new command 'add_compile_definitions' need higher than 3.12.4.

@er1cthe0ne
Copy link
Contributor

yes, it is likely changed to support this "add_compile_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)" addition. That's the part I am not sure of the reason. Maybe you can backup both changes:

  1. cmake_minimum_required(VERSION 3.12.4)
    2. add_compile_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
    and see what the real issue is? We don't want to go down and challenging path of updating cmake version unless it is really needed.

@er1cthe0ne
Copy link
Contributor

@Gzure , please see the solution mentioned in #102

zhangml pushed a commit to zhangml/alcor-control-agent that referenced this issue Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants