ICRAR / daliuge

The DALiuGE Execution Engine
GNU Lesser General Public License v2.1
24 stars 7 forks source link

Liu 285 - Rebuilt lg_web with FastAPI #201

Closed pritchardn closed 1 year ago

pritchardn commented 2 years ago

This MR re-implements the translator web service with Fast API. Additionally, this MR provides new implementations for each of the translator command-line actions.

To see the live documentation of the translator, load up an instance (e.g. 0.0.0.0:8086) and head to 0.0.0.0:8086/docs. Not only is this a clean presentation of the APIs, but allows for manual in-browser testing of each of the endpoints. I have convinced myself that the re-implementation does introduce any breaking changes, although I would like this to be checked before merging if possible.

I will henceforth evangelise FastAPI - it is a delight to use.

coveralls commented 2 years ago

Coverage Status

Coverage decreased (-1.4%) to 81.247% when pulling fbb50fb72e6952fb601469afec359fb746b83739 on LIU-285 into 28cd9d86ebf1db3e2cc405e68849b0880c5a3bc3 on master.

pritchardn commented 2 years ago

Addressing Andreas' comments

1. When trying to deploy to ood-cld the graph does get deployed but there is an error message and the execution fails as well. The error message in the translator log says: TypeError: 'str' object is not an iterator

Fixed, the new gen_pg endpoint was returning a streaming response - which was incorrect, this has been changed to a JSONResponse; much more sensible. The JSON is a string, however, so in the main.js file, this needs to be parsed before sending off to OOD.

2. This is actually a left-over I've found when trying the really nice FastAPI docs feature: There is a stray </script> tag at the very end of matrix_vis.html.

Easily fixed

3. The API docs should probably also be an additional item in the Help pull-down menu

Added