netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* We've released a generic netlink python library -- gnlpy
@ 2015-05-20 21:10 Alex Gartrell
  2015-05-20 23:33 ` Cong Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Gartrell @ 2015-05-20 21:10 UTC (permalink / raw)
  To: lvs-devel, linux-kernel, netdev; +Cc: kernel-team

Hey everyone,

tl;dr; pure python generic netlink library with simple clients for ipvs 
and taskstats here: https://github.com/facebook/gnlpy

At Facebook we rely upon ipvs for most of our layer-4 load balancing 
needs.  It's mostly worked pretty great for us.  The standard way to 
interact with ipvs is ipvsadm, which will use netlink sockets to make 
rpc calls to the kernel (things like adding/remove services and real 
servers).  Because we run many, many instances of ipvs, we ended up 
scripting this away with a separate program that shells out to ipvsadm.

The down side to this approach was that we had to format the arguments 
and parse the result of the tool, which was kind of a pain. 
Additionally, we'd sometimes get into a bad state where the exec would 
fail or the binary wouldn't be there and the whole thing would kind of 
break.  To my knowledge this never caused any kind of large scale 
incident, but it was an annoying thing to deal with.

At some point, we made some changes to ipvs (heterogenous pools) and we 
were in the position of needing to roll a new ipvsadm binary to take 
advantage of the functionality.  That was fundamentally unappealing to 
yours truly, so I hacked together gnlpy (Generic NetLink PYthon library) 
instead.  It's been in production for several months.

At some point thereafter, someone on the lvs-devel list mentioned 
wanting to interact with ipvs through python and I made a vague 
assurance that we'd open source this thing.  Well here we are.

If you take a look at the code, you'll quickly notice that we haven't 
gone through the trouble of implementing every RPC call for the families 
we support and we certainly haven't gone through the trouble of 
implementing every generic netlink family.  We welcome your pull requests :)

-- 
Alex Gartrell <agartrell@fb.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: We've released a generic netlink python library -- gnlpy
  2015-05-20 21:10 We've released a generic netlink python library -- gnlpy Alex Gartrell
@ 2015-05-20 23:33 ` Cong Wang
  2015-05-21 14:52   ` Edward Cree
  0 siblings, 1 reply; 3+ messages in thread
From: Cong Wang @ 2015-05-20 23:33 UTC (permalink / raw)
  To: Alex Gartrell
  Cc: lvs-devel, linux-kernel@vger.kernel.org, netdev, kernel-team

On Wed, May 20, 2015 at 2:10 PM, Alex Gartrell <agartrell@fb.com> wrote:
> Hey everyone,
>
> tl;dr; pure python generic netlink library with simple clients for ipvs and
> taskstats here: https://github.com/facebook/gnlpy

libnl should have python support for generic netlink too:

$ ls python/netlink/genl/
capi.i  __init__.py  Makefile  Makefile.am  Makefile.in

but I never use its python module so not sure if it works... ;)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: We've released a generic netlink python library -- gnlpy
  2015-05-20 23:33 ` Cong Wang
@ 2015-05-21 14:52   ` Edward Cree
  0 siblings, 0 replies; 3+ messages in thread
From: Edward Cree @ 2015-05-21 14:52 UTC (permalink / raw)
  To: Cong Wang
  Cc: Alex Gartrell, lvs-devel, linux-kernel@vger.kernel.org, netdev,
	kernel-team

On 21/05/15 00:33, Cong Wang wrote:
> On Wed, May 20, 2015 at 2:10 PM, Alex Gartrell <agartrell@fb.com> wrote:
>> Hey everyone,
>>
>> tl;dr; pure python generic netlink library with simple clients for ipvs and
>> taskstats here: https://github.com/facebook/gnlpy
> libnl should have python support for generic netlink too:
>
> $ ls python/netlink/genl/
> capi.i  __init__.py  Makefile  Makefile.am  Makefile.in
>
> but I never use its python module so not sure if it works... ;)
There is also pyroute2.netlink.generic
<https://pypi.python.org/pypi/pyroute2>
which does work but it's a bit clunky imho.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-21 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20 21:10 We've released a generic netlink python library -- gnlpy Alex Gartrell
2015-05-20 23:33 ` Cong Wang
2015-05-21 14:52   ` Edward Cree

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).