From 63d3bfb66932e513c183b5a0f4beafb2823a2df0 Mon Sep 17 00:00:00 2001 From: zjf Date: Mon, 26 May 2025 18:08:55 +0800 Subject: [PATCH] rpa --- src/cluster/rpa.py | 12 +++++++----- src/cluster/rpa_web_end_point.py | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/cluster/rpa.py b/src/cluster/rpa.py index 0128350..dd198b1 100644 --- a/src/cluster/rpa.py +++ b/src/cluster/rpa.py @@ -16,9 +16,11 @@ from .rpa_comm import LiveStreamProductWatchRequest, LiveStreamResult, ProductSe rpa_image = (modal.Image.debian_slim(python_version="3.11") .pip_install_from_pyproject("../pyproject_rpa.toml") .env({"PLAYWRIGHT_BROWSERS_PATH": "/root/browsers"}) - .run_commands("mkdir /root/browsers") - .run_commands("playwright install-deps") - .run_commands("playwright install chromium") + .run_commands([ + "mkdir /root/browsers", + "playwright install-deps", + "playwright install chromium", +]) .add_local_python_source('cluster') ) app = modal.App(name='rpa', image=rpa_image, include_source=False) @@ -341,7 +343,7 @@ with rpa_image.imports(): return live_status - def submit_job(data:LiveStreamProductWatchRequest): + def submit_job(data: LiveStreamProductWatchRequest): call = rpa_run.spawn(data) return call.object_id @@ -354,7 +356,7 @@ with rpa_image.imports(): # webcast_ids = ["36861064178"] webcast_id = "36861064178" - data:LiveStreamProductWatchRequest = LiveStreamProductWatchRequest(live_id=webcast_id) + data: LiveStreamProductWatchRequest = LiveStreamProductWatchRequest(live_id=webcast_id) # TODO other info call_id = submit_job(data) print("------call_id:", call_id) diff --git a/src/cluster/rpa_web_end_point.py b/src/cluster/rpa_web_end_point.py index 31bfd5f..9f895ad 100644 --- a/src/cluster/rpa_web_end_point.py +++ b/src/cluster/rpa_web_end_point.py @@ -7,10 +7,10 @@ from scalar_fastapi import get_scalar_api_reference image = (modal.Image.debian_slim() .pip_install([ - "fastapi[standard]", - "pydantic", - "scalar-fastapi>=1.0.3", - ]) + "fastapi[standard]", + "pydantic", + "scalar-fastapi>=1.0.3", +]) .pip_install()) app = modal.App("fastapi_rpa", image=image)