All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/8] hashserv read-only mode & upstream fixes
@ 2021-02-01 11:53 Paul Barker
  2021-02-01 11:53 ` [RFC PATCH 1/8] bitbake-hashclient: Remove obsolete call to client.connect Paul Barker
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Paul Barker @ 2021-02-01 11:53 UTC (permalink / raw)
  To: bitbake-devel, Richard Purdie, Joshua Watt; +Cc: Paul Barker

* Implement a read-only mode for the hash equivalence server. This mode is
  useful when you wish to populate a hash equivalence database from CI or other
  internal builds (via a read-write server instance) and also allow external
  clients to query this database (via a read-only server instance). External
  clients can therefore be prevented from adding hash equivalences to the
  server which correspond to sstate artifacts which would be missing in a
  primary sstate cache. This mode is enabled using the -r/--read-only
  argument to bitbake-hashserv.

* Expose the existing upstream server support via a -u/--upstream argument to
  bitbake-hashserv.

* Support querying an upstream server using the new `get-outhash` message when
  the server handles a `report` message from a client and a match is not found
  in the server's own database. This is important as the `report` message is
  used by bitbake when a task finishes executing to check if the task outhash
  matches the outhash for any previous execution. With this support such
  matches can now be found in a local (read-write) hash equivalence db as
  well as in an upstream (potentially read-only and/or remote) db.

* Other minor hashserv fixes.

These changes have been tested locally using the following setup:

1) Build core-image-base with BB_HASHSERVE = "auto". Additional logging was
   also enabled following the instructions in 
   https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-execution.html#logging.

2) Move the hashserv.db file into a new 'upstream-hashserv' directory. Start
   the upstream server in read-only mode using the following command in that
   directory:

    bitbake-hashserv -r -l DEBUG

3) Create an empty 'downstream-hashserv' directory. Start the downstream
   (local) server with an empty db using the following command in that
   directory:

    bitbake-hashserv -u "unix://../upstream-hashserv/hashserve.sock" -l DEBUG

4) Modify local.conf to set 
   BB_HASHSERVE = "unix://${TOPDIR}/downstream-hashserv/hashserve.sock".

5) Add an 'echo hello' command to do_configure for glibc to force a rebuild
   which should result in a matching hash equivalence.

6) Build core-image-base again, confirm that glibc is rebuilt but then a hash
   equivalence is found (copied from the upstream server into the downstream
   server) and dependent tasks are pulled from the sstate cache instead of
   being rebuilt.

This is an RFC series as it still needs documentation to be written and
selftest cases to be added. However it'd be great to get some feedback at
this stage before moving on to that work.

These changes can also be pulled from:

  https://gitlab.com/pbarker.dev/staging/bitbake.git
  tag: hashserv_2020-02-01

Let me know if you have any questions/feedback :)

Paul Barker (8):
  bitbake-hashclient: Remove obsolete call to client.connect
  hashserv: client: Fix handling of null responses
  hashserv: server: Fix logger.debug calls
  hashserv: Support read-only server
  hashserv: Support upstream command line argument
  hashserv: Add short forms of remaining command line arguments
  hashserv: Add get-outhash message
  hashserv: server: Support searching upstream for outhash

 bin/bitbake-hashclient   |  3 --
 bin/bitbake-hashserv     | 10 +++--
 lib/hashserv/__init__.py |  4 +-
 lib/hashserv/client.py   |  8 +++-
 lib/hashserv/server.py   | 85 ++++++++++++++++++++++++++++++++++------
 5 files changed, 88 insertions(+), 22 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [RFC PATCH 0/8] hashserv read-only mode & upstream fixes
@ 2021-02-01 11:45 Paul Barker
  0 siblings, 0 replies; 14+ messages in thread
From: Paul Barker @ 2021-02-01 11:45 UTC (permalink / raw)
  To: bitbake-devel, Richard Purdie, Joshua Watt; +Cc: Paul Barker

* Implement a read-only mode for the hash equivalence server. This mode is
  useful when you wish to populate a hash equivalence database from CI or other
  internal builds (via a read-write server instance) and also allow external
  clients to query this database (via a read-only server instance). External
  clients can therefore be prevented from adding hash equivalences to the
  server which correspond to sstate artifacts which would be missing in a
  primary sstate cache. This mode is enabled using the -r/--read-only
  argument to bitbake-hashserv.

* Expose the existing upstream server support via a -u/--upstream argument to
  bitbake-hashserv.

* Support querying an upstream server using the new `get-outhash` message when
  the server handles a `report` message from a client and a match is not found
  in the server's own database. This is important as the `report` message is
  used by bitbake when a task finishes executing to check if the task outhash
  matches the outhash for any previous execution. With this support such
  matches can now be found in a local (read-write) hash equivalence db as
  well as in an upstream (potentially read-only and/or remote) db.

* Other minor hashserv fixes.

These changes have been tested locally using the following setup:

1) Build core-image-base with BB_HASHSERVE = "auto". Additional logging was
   also enabled following the instructions in 
   https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-execution.html#logging.

2) Move the hashserv.db file into a new 'upstream-hashserv' directory. Start
   the upstream server in read-only mode using the following command in that
   directory:

    bitbake-hashserv -r -l DEBUG

3) Create an empty 'downstream-hashserv' directory. Start the downstream
   (local) server with an empty db using the following command in that
   directory:

    bitbake-hashserv -u "unix://../upstream-hashserv/hashserve.sock" -l DEBUG

4) Modify local.conf to set 
   BB_HASHSERVE = "unix://${TOPDIR}/downstream-hashserv/hashserve.sock".

5) Add an 'echo hello' command to do_configure for glibc to force a rebuild
   which should result in a matching hash equivalence.

6) Build core-image-base again, confirm that glibc is rebuilt but then a hash
   equivalence is found (copied from the upstream server into the downstream
   server) and dependent tasks are pulled from the sstate cache instead of
   being rebuilt.

This is an RFC series as it still needs documentation to be written and
selftest cases to be added. However it'd be great to get some feedback at
this stage before moving on to that work.

These changes can also be pulled from:

  https://gitlab.com/pbarker.dev/staging/bitbake.git
  tag: hashserv_2020-02-01

Let me know if you have any questions/feedback :)

Paul Barker (8):
  bitbake-hashclient: Remove obsolete call to client.connect
  hashserv: client: Fix handling of null responses
  hashserv: server: Fix logger.debug calls
  hashserv: Support read-only server
  hashserv: Support upstream command line argument
  hashserv: Add short forms of remaining command line arguments
  hashserv: Add get-outhash message
  hashserv: server: Support searching upstream for outhash

 bin/bitbake-hashclient   |  3 --
 bin/bitbake-hashserv     | 10 +++--
 lib/hashserv/__init__.py |  4 +-
 lib/hashserv/client.py   |  8 +++-
 lib/hashserv/server.py   | 85 ++++++++++++++++++++++++++++++++++------
 5 files changed, 88 insertions(+), 22 deletions(-)

-- 
2.26.2


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

end of thread, other threads:[~2021-02-02 10:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 11:53 [RFC PATCH 0/8] hashserv read-only mode & upstream fixes Paul Barker
2021-02-01 11:53 ` [RFC PATCH 1/8] bitbake-hashclient: Remove obsolete call to client.connect Paul Barker
2021-02-01 11:53 ` [RFC PATCH 2/8] hashserv: client: Fix handling of null responses Paul Barker
2021-02-01 11:53 ` [RFC PATCH 3/8] hashserv: server: Fix logger.debug calls Paul Barker
2021-02-01 11:53 ` [RFC PATCH 4/8] hashserv: Support read-only server Paul Barker
2021-02-01 11:53 ` [RFC PATCH 5/8] hashserv: Support upstream command line argument Paul Barker
2021-02-01 11:53 ` [RFC PATCH 6/8] hashserv: Add short forms of remaining command line arguments Paul Barker
2021-02-01 11:53 ` [RFC PATCH 7/8] hashserv: Add get-outhash message Paul Barker
2021-02-01 14:09   ` Joshua Watt
2021-02-02 10:49     ` Paul Barker
2021-02-01 11:53 ` [RFC PATCH 8/8] hashserv: server: Support searching upstream for outhash Paul Barker
2021-02-01 14:06   ` Joshua Watt
2021-02-02 10:48     ` Paul Barker
  -- strict thread matches above, loose matches on Subject: below --
2021-02-01 11:45 [RFC PATCH 0/8] hashserv read-only mode & upstream fixes 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.