Refactor casserver.py: Stop relying on the buildstream-internal `CASCache` implementation

Description

This provides a better separation of casserver.py (bst-artifact-server) from BuildStream by making our calls to buildbox-casd directly, rather than through BuildStream's CASCache class.

While it introduces some code duplication, it makes casserver.py significantly easier to understand, and is a precursor to potential future work to split casserver.py out of BuildStream's codebase.

The only BuildStream imports left are get_host_tool and save_file_atomic from utils.py, which don't rely on any other BuildStream internals.

I would also like to depend on the CASDProcessManager from !1638 (merged), while I'm waiting I threw my own together - it's not nearly as robust though, so I will definitely wait for that MR to land before merging :)

Changes proposed in this merge request:

  • Add logging to casserver.py to aid future development
  • Remove any references to CASCache from casserver.py
  • Refactor CASCache to remove anything no longer required on the client end.

Not yet done:

  • Use CASDProcessManager to launch a buildbox-casd instance for the server (waiting for !1638 (merged))

This merge request, when approved, will close: #1167 (closed)


Edited by Tristan Maat

Merge request reports

Loading