From: Michael Tremer Date: Tue, 1 Jul 2025 08:26:37 +0000 (+0000) Subject: api: Process system information submitted by builders X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe41e169d8c0fdc794163b6247d3fded211e1b5f;p=pbs.git api: Process system information submitted by builders Signed-off-by: Michael Tremer --- diff --git a/src/api/builders.py b/src/api/builders.py index f228b744..daaf13dc 100644 --- a/src/api/builders.py +++ b/src/api/builders.py @@ -38,6 +38,9 @@ async def get(): @router.websocket("/control") async def control(websocket: fastapi.WebSocket, + arch: str, version: str, os_name: str = None, + cpu_model: str = None, cpu_count: int = None, + sys_vendor: str = None, sys_name: str = None, builder = fastapi.Depends(auth.get_current_principal)): # Close the connection is something else but a builder has connected if not isinstance(builder, builders.Builder): @@ -49,8 +52,23 @@ async def control(websocket: fastapi.WebSocket, # Accept the connection await websocket.accept() - # The builder is now connected async with backend.db as session: + # Update arch + builder.arch = arch + + # Update system information + builder.sys_vendor = sys_vendor + builder.sys_name = sys_name + + # Update CPU information + builder.cpu_model = cpu_model + builder.cpu_count = cpu_count + + # Update Pakfire & OS information + builder.version = version + builder.os_name = os_name + + # The builder is now connected builder.connected(websocket, address=address) try: