-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The Gateway is currently implemented as a FastAPI server, but most of its external interactions are synchronous. Even though suboptimal, this approach worked while the Gateway was simply a thin layer taking care of quick admin operations like registering tasks for execution. With the introduction of the serverless functionality, however, the Gateway can quickly become the bottleneck under load, while multiple requests wait for models to be deployed (a synchronous operation by design, meaning that requests don't return until a container has been created to handle them). Now, we should look into making the Gateway fully async, focusing on the following interactions:
-
Postgres
- Database stays the same; changes required on the client side to support the
asynciointegration - We have experience implementing this switch for the CogStack Catalogue, where we used
asyncpgandaiosqliteto support both production and development workflows
- Database stays the same; changes required on the client side to support the
-
MinIO
- Given that MinIO has been phasing out its commitment to the open-source project (having recently announced a feature freeze, after deciding to distribute it as source-only), we should eventually look into replacing the object store, with proposed alternatives being Garage, Seaweed, and Ceph. Even though, this is not a priority, moving to a vendor-neutral, S3-compatible client can prove beneficial down the line. At the same time, however, the MinIO Python client doesn't provide async support, which makes our decision easier
- With the above in mind, on the Catalogue side we opted for using
aiobotocore, an async-compatible port of the core library behindboto3, the official AWS client for managing AWS resources
-
RabbitMQ
- We might have a couple of alternatives here. Currently, we're using
pikawithBlockingConnectionto manage our queue. We should explore transitioning to theAsyncioConnectionadapter, looking into different libraries (e.g.aio-pika) if that's not enough - We don't have experience with adopting async for our queue operations yet, so there is no tested path forward
- We might have a couple of alternatives here. Currently, we're using
-
CMS healthcheck and
/infocalls- This change should be relatively straightforward by switching to an async HTTP client with
httpxwhich we already use for the auto deployment feature
- This change should be relatively straightforward by switching to an async HTTP client with
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request