[P4-dev] BMV2 in custom Dockercontainer - no thrift port

Antonin Bas antonin at barefootnetworks.com
Wed Jul 4 11:59:33 EDT 2018


I don't think providing a Thrift path to configure is going to work. Just
stick with ./configure --with-thrift.
After running configure, do make clean (changes in preprocessor flags set
by configure don't trigger a new build otherwise) and then make again.
Look for -DBMTHRIFT_ON in the logs (when compiler is invoked).
AFAIK, if you see "With Thrift..... :yes" in the configure logs,
preprocessor flag BMTHRIFT_ON *will* be defined and command-line option
--thrift-port *will* be available.

On Tue, Jul 3, 2018 at 10:00 PM, cs.lev <cs.lev at gmx.com> wrote:

> Thanks for the reply, ldconfig did not solve the issue :(
>
> third-party and its Dockerfile was also not working, it fails in the
> building process of the first sub-container complaining about that
> ./autogen.sh is not found.
>
> btw., my thrift and bmv2's ./configure outputs seemed good:
> thrift:
> thrift 0.9.2
>
> Building C++ Library ......... : yes
> Building C (GLib) Library .... : no
> Building Java Library ........ : no
> Building C# Library .......... : no
> Building Python Library ...... : yes
> Building Ruby Library ........ : no
> Building Haskell Library ..... : no
> Building Perl Library ........ : no
> Building PHP Library ......... : no
> Building Erlang Library ...... : no
> Building Go Library .......... : no
> Building D Library ........... : no
> Building NodeJS Library ...... : no
> Building Lua Library ......... : no
>
> C++ Library:
>    Build TZlibTransport ...... : yes
>    Build TNonblockingServer .. : yes
>    Build TQTcpServer (Qt) .... : no
>
> Python Library:
>    Using Python .............. : /usr/bin/python
>
>
> bmv2 (with default thrift path, i.e., no other argument is set for
> configure):
>
> Features recap ......................
> Coverage enabled .............. : no
> Logging macros enabled ........ : yes
> With Nanomsg .................. : yes
> Event logger enabled .......... : yes
> Debugger enabled .............. : no
> With Thrift ................... : yes
>   With p4Thrift ............... : no
> With pdfixed .................. : no
> With PI ....................... : no
>
> when bmv2 is configured via direct path towards thrift in travis/
> directory
> Features recap ......................
> Coverage enabled .............. : no
> Logging macros enabled ........ : yes
> With Nanomsg .................. : yes
> Event logger enabled .......... : yes
> Debugger enabled .............. : no
> With Thrift ................... : /behavioral-model/travis/thrift-
> 0.9.2/lib
> With pdfixed .................. : no
> With PI ....................... : no
>
>
> And still, there is no --with-thrift CLI argument for simple_switch
> after compiled.
>
> Any thoughts?
>
> Thank
>
> On Tue, 2018-07-03 at 09:40 -0700, Antonin Bas wrote:
> > Hi,
> >
> > You didn't do ldconfig after installing Thrift so that may be the
> > issue. Maybe the bmv2 configure logs can shed more light as to why
> > Thrift is not detected.
> > If you do not want to use the Ubuntu-based docker container we
> > provide, I still recommend that you copy this Dockerfile to install
> > all dependencies: https://github.com/p4lang/third-party. You should
> > be able to change the base Docker image from Ubuntu to Debian in the
> > FROM statement.
> >
> > On Tue, Jul 3, 2018 at 7:16 AM, cs.lev <cs.lev at gmx.com> wrote:
> > > Hi All,
> > >
> > > I need behavioral-model to be working in a debian:latest based
> > > docker
> > > container (the container build from the Dockerfile in https://githu
> > > b.co
> > > m/p4lang/behavioral-model was not working for me).
> > >
> > > I have installed everything once on a bare-metal server and
> > > everything
> > > was working. Now, I have repeated all steps with no errors on the
> > > same
> > > server but in a container.
> > >
> > > My problem is that when I start simple_switch application it indeed
> > > prints out that Thrift server was started but I neither am able to
> > > connect to it, nor netstat would print that something is listening
> > > on
> > > 9090.
> > >
> > > What I found as a problem, or at least the reason that when I run
> > > only
> > > simple_switch --help, it does print out command line argument --
> > > thrift-
> > > port on the bare metal server (right above the command line
> > > argument --
> > > device-id), but in my container this argument is missing.
> > >
> > > thrift was installed as follows on both the bare-metal and the
> > > container:
> > >
> > > cd behavioral-model/travis/
> > >
> > > wget http://archive.apache.org/dist/thrift/0.9.2/thrift-0.9.2.tar.g
> > > z
> > >
> > > tar -xzvf thrift-0.9.2.tar.gz
> > >
> > > cd thrift-0.9.2
> > >
> > > #this was needed because of an error: (SSLv3_method was not
> > > declared in
> > > this scope) - as suggested here (https://github.com/ptrkrysik/gr-gs
> > > m/is
> > > sues/155) I have modified it
> > > sed -i "s/SSLv3_method/SSLv23_method/"
> > > lib/cpp/src/thrift/transport/TSSLSocket.cpp
> > >
> > > ./configure --without=java
> > >
> > > make -j2 && sudo make install
> > >
> > > cd lib/py
> > >
> > > sudo python setup.py install
> > >
> > >
> > > Then behavioral-switch was compiled as follows (again, in both
> > > cases):
> > > cd behaviroral-model/
> > >
> > > ./autogen.sh
> > >
> > > ./configure --with-thrift=/home/csikor/p4/behavioral-
> > > model/travis/thrift-0.9.2/lib/
> > >
> > > make
> > >
> > > sudo make install
> > >
> > > sudo ldconfig
> > >
> > >
> > > What could be wrong?
> > >
> > > Thank you,
> > > cs.lev
> > >
> > > _______________________________________________
> > > P4-dev mailing list
> > > P4-dev at lists.p4.org
> > > http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
> > >
> >
> >
> >
> > --
> > Antonin
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20180704/513878a2/attachment-0001.html>


More information about the P4-dev mailing list