[P4-dev] p4lang/third-party

Antonin Bas antonin at barefootnetworks.com
Fri Feb 22 14:17:24 EST 2019

Salut Frederic,

I think it's a great idea to build Debian packages for the p4lang software,
especially if the packages end up in the official distribution repositories
and especially if your organization is volunteering to maintain them :) I'm
a Ubuntu user myself so obviously I'm more biased towards that distribution.
Some information that may be useful:
- currently the most used p4lang repositories are p4c, bmv2 and PI AFAIK.
These projects are used in particular for the P4 tutorials (orchestrated by
p4app and run inside a Docker image), so you should focus on these
- a lot of the dependencies are actually optional. For example, the
tutorials use the bmv2 simple_switch target, *which does not require Thrift*.
So a bmv2 Debian package without Thrift support would still be very useful.
Similarly *sysrepo is optional* - used to run a gNMI service in
simple_switch_grpc - and I would omit it at first. That applies to libyang
as well, since it is only used by sysrepo. Nanomsg is also optional and is
used to run the bmv2 debugger (p4dbg.py), but it seems that there is a
package available in your Debian distribution so maybe it is not too much
trouble (except for nnpy).
- speaking as the maintainer for bmv2 & PI, I am open to modifications to
the code to get it working with more recent versions of the dependencies
(protobuf, grpc, nanomsg, ...), *as long as the code still works with the
older versions references in p4lang/third-party*. Ideally support for more
recent versions of the libraries would be tested in CI, but that may be too
much to ask and the testing matrix may become too complex.
- I also welcome changes to the Python scripts to make them work with
python 3, as long as backward-compatibility with Python 2.7 is not broken

(As a remainder, your organization needs to be a p4.org member in order for
you to contribute code to p4lang)

Please let me know if you have questions.


On Fri, Feb 22, 2019 at 8:12 AM Frédéric LOUI <frederic.loui at renater.fr>

> Hi experts,
> We are working on a R&E project that will involve (among various
> objectives) p4 Software Development Environment set up using p4lang project
> tools.
> (p4c, bmv2 etc.) We started to work on some packages and therefore we have
> some questions.
> We might have more questions so let me know if I’m on the right mailing
> list. :-)
> In our building process, we followed p4app approach.
> In that purpose we started to analyse the various Dockerfile and landed in
> the 3rd party folder here:
> https://github.com/p4lang/third-party
> Assumptions:
> 1- For now our target is Debian buster, we will for sure adapt the process
> for ubuntu is this is not too complex.
> 2- Long term goal: If successful and satisfying enough, we might ask
> Debian project to add these packages into the mainstream tree.
> 3- As a first steps, let’s focus only on the 3rd party repository.
> Building BMv2 targets and p4c will then be easier.
> Here is the list of dependancies listed in 3rd party docker file : (and
> what we have done so far)
> * cchache
>   Need: accelerate compilation duration by caching operations
>   p4lang: it uses 3.3
>   Buster: cache 3.6-1
>   We plan to use buster 3.6-1 which is ( > 3.3 )
>   It uses memcached
>   -> so what can be done is using existing buster source deb and rebuild a
> packet with memcached trigger (not essential but TO BE DONE)
> * scapy
>    Need: used by ptf
>    p4lang: it uses v2.2.0-dev and modified version made by BAREFOOT
>    Buster: v2.4.0
>    Last version of scapy have improved header (MPLS for example)
>   -> we plan to reuse Buster 2.4.0 package and reuse it to build 2.4.2 as
> a base (—> DONE)
> * PTF
>    p4lang: It is a p4lang project
>    Need: need scapy with additional header
>    Buster: <no package>
>    -> we plan build ptf package  (—> DONE)
>    One remark I had from one of our openSource expert is to port ptf to
> python3 (it refused to be installed using python3)
>    It was mentioned that python 2.7 support end end of 2020.
> * nanomsg
>    p4lang: It uses v1.1.0 (SOVERSION is 5.0.0)
>    Buster: 1.1.5
>   —> we plan to use nanomsg from the official BUSTER repository (-> DONE)
> * nnpy
>    p4lang: It uses an old RC version (tree
> 096998834451219ee7813d8977f6a4027b0ccb43)
>    Buster: <no package>
>    -> we plan build nnpy 1.4.2 package  (—> TO BE DONE)
> * thrift
>    p4lang: It uses v0.9.2
>    Buster: v0.11.0
>    -> we plan to use the official version in Buster: v0.11.0 (TO BE DONE)
> * protobuf
>    p4lang:  v3.2.0
>    Buster: v3.6.1
>    -> we plan to use the official version in Buster: v3.6.1 (TO BE DONE)
> * protobuf-c
>    p4lang:  v3.2.0
>    Buster: v3.6.1
>    -> we plan to use the official version in Buster: v3.6.1 (TO BE DONE)
> * python-protobuf
>    p4lang:v3.2.0
>    Buster: v3.6.1
>    -> we plan to use the official version in Buster: v3.6.1 (TO BE DONE)
> * grpc
>   p4lang:  v1.3.2
>   Buster: v1.6.4 (not sure here)
>    -> we plan to use the official version in Buster: v1.6.4 (not sure
> here) (TO BE DONE)
> * libyang
>   p4lang: v0.16-r1
>   Buster: 0.16.105-1
>    -> we plan to use the official version in Buster: 0.16.105-1
> * sysrepo
>   p4lang: v0.7.5
>   Buster: <no package>
>   -> we plan build ptf package  (—> TO BE DONE DONE)
> The questions are:
> - Do you think we can use the distro (here BUSTER) package ?
> For sysrepo/nnpy packages have to be built. The tricky packages are the
> one depending on openssl and related to graph and thrift.
> According to your experience what is your feedback regarding compilation
> against these dependencies ? Is it something set on stone ?
> In order to move forward, we plan to build p4lang containers using as much
> as possible the package above (so also the package we built )
> in order to validate them.
> PS1: Once built we will of course contribute back to p4lang and if it make
> sense provide additional support for other Debian like OS.
>        We started weith BUSTER because our expert who is helping us is an
> exclusive debian BUSTER.
>        Also it gives us an understanding of the whole p4lang suite
> dependancies.
> PS2: I would like to thank Andy Fingerhut and Edgar Costa for they
> repository. I learned a lot from them.
> Thanks in advance for your help then :)
> All the best,
> Have a good week end & "À bientôt",
> --  Frederic
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20190222/d2c57c09/attachment.html>

More information about the P4-dev mailing list