All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/11] Modernise prserv
@ 2021-04-12 11:41 Paul Barker
  2021-04-12 11:41 ` [RFC PATCH 01/11] hashserv: Use generic ConnectionError Paul Barker
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: Paul Barker @ 2021-04-12 11:41 UTC (permalink / raw)
  To: bitbake-devel, Richard Purdie, Joshua Watt; +Cc: Paul Barker

The prserv module is converted from the old XML RPC mechinism to the more
modern json + asyncio RPC system used by hashserv. The common code now
shared between hashserv and prserv is moved to a new asyncrpc module. The
startup and shutdown code within prserv is also refactored and modernised,
using the Python multiprocessing module where possible.

These changes are not expected to land in the upcoming 3.3 release, they're
currently submitted as an RFC to get some early review.

The following change is needed in oe-core when testing these patches, this
can be submitted separately once these changes are past the RFC stage:

    diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
    index fcdbe66c19..15ce060ff6 100644
    --- a/meta/lib/oe/prservice.py
    +++ b/meta/lib/oe/prservice.py
    @@ -7,7 +7,7 @@ def prserv_make_conn(d, check = False):
        host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
        try:
            conn = None
    -        conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1]))
    +        conn = prserv.serv.connect(host_params[0], int(host_params[1]))
            if check:
                if not conn.ping():
                    raise Exception('service not available')

I'm also currently working on a follow-up patch which will add a read-only
mode to prserv.

Let me know if there are any other questions :)

Paul Barker (11):
  hashserv: Use generic ConnectionError
  asyncrpc: Common implementation of RPC using json & asyncio
  hashserv: Refactor to use asyncrpc
  prserv: Drop obsolete python version check
  asyncrpc: Add ping method
  prserv: Use multiprocessing to auto start prserver
  prserv: Extract daemonization from PRServer class
  prserv: Handle requests in main thread
  prserv: Drop unused methods
  prserv: Replace XML RPC with modern asyncrpc implementation
  prserv: Add connect function

 lib/bb/asyncrpc/__init__.py |  31 ++
 lib/bb/asyncrpc/client.py   | 150 ++++++++++
 lib/bb/asyncrpc/serv.py     | 223 +++++++++++++++
 lib/bb/siggen.py            |   6 +-
 lib/hashserv/client.py      | 147 ++--------
 lib/hashserv/server.py      | 210 ++------------
 lib/hashserv/tests.py       |   3 +-
 lib/prserv/serv.py          | 550 ++++++++++++++----------------------
 8 files changed, 663 insertions(+), 657 deletions(-)
 create mode 100644 lib/bb/asyncrpc/__init__.py
 create mode 100644 lib/bb/asyncrpc/client.py
 create mode 100644 lib/bb/asyncrpc/serv.py

-- 
2.26.2


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

end of thread, other threads:[~2021-04-26  7:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 11:41 [RFC PATCH 00/11] Modernise prserv Paul Barker
2021-04-12 11:41 ` [RFC PATCH 01/11] hashserv: Use generic ConnectionError Paul Barker
2021-04-12 11:41 ` [RFC PATCH 02/11] asyncrpc: Common implementation of RPC using json & asyncio Paul Barker
2021-04-12 11:41 ` [RFC PATCH 03/11] hashserv: Refactor to use asyncrpc Paul Barker
2021-04-12 11:41 ` [RFC PATCH 04/11] prserv: Drop obsolete python version check Paul Barker
2021-04-12 11:41 ` [RFC PATCH 05/11] asyncrpc: Add ping method Paul Barker
2021-04-12 11:41 ` [RFC PATCH 06/11] prserv: Use multiprocessing to auto start prserver Paul Barker
2021-04-12 11:41 ` [RFC PATCH 07/11] prserv: Extract daemonization from PRServer class Paul Barker
2021-04-12 11:41 ` [RFC PATCH 08/11] prserv: Handle requests in main thread Paul Barker
2021-04-12 11:41 ` [RFC PATCH 09/11] prserv: Drop unused methods Paul Barker
2021-04-12 11:41 ` [RFC PATCH 10/11] prserv: Replace XML RPC with modern asyncrpc implementation Paul Barker
2021-04-12 11:41 ` [RFC PATCH 11/11] prserv: Add connect function Paul Barker
2021-04-15 16:48 ` [RFC PATCH 00/11] Modernise prserv Richard Purdie
2021-04-26  7:54   ` Paul Barker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.