Skip to content

Bitbake Hash Server WebSockets, Alternate Database Backend, and User Management

Joshua Watt bitbake-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest22 patches 4 repliesIn review
  2. v522 patches 0 repliesSuperseded
  3. v422 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v322 patches0 repliesSuperseded
v2 RFC18 patches0 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22asyncrpc: Abstract socketslib/bb/asyncrpc/__init__.py lib/bb/asyncrpc/client.py lib/bb/asyncrpc/connection.py +7 more+387 -3530 replies
2/22hashserv: Add websocket connection implementationlib/bb/asyncrpc/client.py lib/bb/asyncrpc/connection.py lib/bb/asyncrpc/serv.py +3 more+137 -23 replies
3/22asyncrpc: Add context manager APIbin/bitbake-hashclient lib/bb/asyncrpc/client.py lib/prserv/serv.py+33 -220 replies
4/22hashserv: tests: Add external database testslib/hashserv/tests.py+44 -100 replies
5/22asyncrpc: Prefix log messages with client infolib/bb/asyncrpc/serv.py lib/hashserv/server.py+23 -80 replies
6/22bitbake-hashserv: Allow arguments from environmentbin/bitbake-hashserv+60 -200 replies
7/22hashserv: Abstract databaselib/hashserv/__init__.py lib/hashserv/server.py lib/hashserv/sqlite.py+439 -4010 replies
8/22hashserv: Add SQLalchemy backendbin/bitbake-hashserv lib/bb/asyncrpc/connection.py lib/hashserv/__init__.py +2 more+362 -50 replies
9/22hashserv: Implement read-only version of "report" RPClib/hashserv/server.py lib/hashserv/tests.py+26 -30 replies
10/22asyncrpc: Add InvokeErrorlib/bb/asyncrpc/__init__.py lib/bb/asyncrpc/client.py lib/bb/asyncrpc/exceptions.py +1 more+22 -40 replies
11/22asyncrpc: client: Prevent double closing of looplib/bb/asyncrpc/client.py+6 -40 replies
12/22asyncrpc: client: Add disconnect APIlib/bb/asyncrpc/client.py+7 -10 replies
13/22hashserv: Add user permissionsbin/bitbake-hashclient bin/bitbake-hashserv lib/hashserv/__init__.py +5 more+1054 -470 replies
14/22hashserv: Add become-user APIbin/bitbake-hashclient lib/hashserv/client.py lib/hashserv/server.py +1 more+97 -50 replies
15/22hashserv: Add db-usage APIbin/bitbake-hashclient lib/hashserv/client.py lib/hashserv/server.py +3 more+86 -00 replies
16/22hashserv: Add database column query APIbin/bitbake-hashclient lib/hashserv/client.py lib/hashserv/server.py +3 more+42 -00 replies
17/22hashserv: test: Add bitbake-hashclient testslib/hashserv/tests.py+277 -230 replies
18/22bitbake-hashclient: Output stats in JSON formatbin/bitbake-hashclient lib/hashserv/tests.py+4 -20 replies
19/22bitbake-hashserver: Allow anonymous permissions to be space separatedbin/bitbake-hashserv+4 -10 replies
20/22hashserv: tests: Allow authentication for external server testslib/hashserv/tests.py+74 -350 replies
21/22hashserv: Allow self-service deletionlib/hashserv/server.py lib/hashserv/tests.py+6 -30 replies
22/22hashserv: server: Add owner if user is logged inlib/hashserv/server.py lib/hashserv/tests.py+12 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [bitbake-devel][PATCH v6 00/22] Bitbake Hash Server WebSockets, Alternate Database Backend, and User Management

This patch series reworks the bitbake asyncrpc API to add a WebSockets implementation for both the client and server. The hash equivalence server is updated to allow using this new API (the PR server can also be updated in the future if desired).

In addition, the database backed for the hash equivalence server is abstracted so that sqlalchemy can optionally be used instead of sqlite. This allows using "big metal" databases as the backend, which allows the hash equivalence server to scale to a large number of queries.

Note that both websockets and sqlalchemy require 3rd party python modules to function. However, these modules are optional unless the user desires to use the APIs.

Also, user management is added. This allows user accounts to be registered with the server and users can be given permissions to do certain operations on the server. Users are not (necessarily) required to login to access the server, as permissions can granted to anonymous users. The default permissions will give anonymous users the same permissions that they would have before user accounts were added so as to retain backward compatibility, but server admins will likely want to change this.

V3: Remove RFC status; patches are ready for review
V4: Fixed protocol breakage with mixing older and newer clients/servers
V5: Fixed compatibility with Python 3.8
V6: Fixed protocol incompatibility when exiting stream state that broke
mixing older and new clients/servers

Joshua Watt (22):
asyncrpc: Abstract sockets
hashserv: Add websocket connection implementation
asyncrpc: Add context manager API
hashserv: tests: Add external database tests
asyncrpc: Prefix log messages with client info
bitbake-hashserv: Allow arguments from environment
hashserv: Abstract database
hashserv: Add SQLalchemy backend
hashserv: Implement read-only version of "report" RPC
asyncrpc: Add InvokeError
asyncrpc: client: Prevent double closing of loop
asyncrpc: client: Add disconnect API
hashserv: Add user permissions
hashserv: Add become-user API
hashserv: Add db-usage API
hashserv: Add database column query API
hashserv: test: Add bitbake-hashclient tests
bitbake-hashclient: Output stats in JSON format
bitbake-hashserver: Allow anonymous permissions to be space separated
hashserv: tests: Allow authentication for external server tests
hashserv: Allow self-service deletion
hashserv: server: Add owner if user is logged in

 bin/bitbake-hashclient        | 145 +++++-
 bin/bitbake-hashserv          | 132 ++++-
 lib/bb/asyncrpc/__init__.py   |  33 +-
 lib/bb/asyncrpc/client.py     | 120 ++---
 lib/bb/asyncrpc/connection.py | 146 ++++++
 lib/bb/asyncrpc/exceptions.py |  21 +
 lib/bb/asyncrpc/serv.py       | 365 ++++++++-----
 lib/hashserv/__init__.py      | 190 +++----
 lib/hashserv/client.py        | 147 +++++-
 lib/hashserv/server.py        | 952 +++++++++++++++++++++-------------
 lib/hashserv/sqlalchemy.py    | 427 +++++++++++++++
 lib/hashserv/sqlite.py        | 408 +++++++++++++++
 lib/hashserv/tests.py         | 736 +++++++++++++++++++++++++-
 lib/prserv/client.py          |   8 +-
 lib/prserv/serv.py            |  37 +-
 15 files changed, 3060 insertions(+), 807 deletions(-)
 create mode 100644 lib/bb/asyncrpc/connection.py
 create mode 100644 lib/bb/asyncrpc/exceptions.py
 create mode 100644 lib/hashserv/sqlalchemy.py
 create mode 100644 lib/hashserv/sqlite.py
Signature · 1 line
2.34.1