2828_VALUES_FILE = _SCRIPT_DIR / "values.json"
2929assert _VALUES_FILE .is_file (), f"Values file not found: { _VALUES_FILE } "
3030
31- _SOLVER_KEY = "simcore/services/comp/s4l-python-runner"
32- _SOLVER_VERSION = "1.2.200"
31+ # _SOLVER_KEY = "simcore/services/comp/s4l-python-runner"
32+ # _SOLVER_VERSION = "1.2.200"
33+
34+ _SOLVER_KEY = "simcore/services/comp/osparc-python-runner"
35+ _SOLVER_VERSION = "1.4.1"
3336
3437
3538def main (log_job : bool = False ):
@@ -77,8 +80,8 @@ def main(log_job: bool = False):
7780 solver_function = osparc_client .Function (
7881 osparc_client .SolverFunction (
7982 uid = None ,
80- title = "SincSolver " ,
81- description = "2D sinc using solver " ,
83+ title = "s4l-python-runner " ,
84+ description = "Run Python code using sim4life " ,
8285 input_schema = osparc_client .JSONFunctionInputSchema (),
8386 output_schema = osparc_client .JSONFunctionOutputSchema (),
8487 solver_key = _SOLVER_KEY ,
@@ -105,10 +108,11 @@ def main(log_job: bool = False):
105108
106109 function_job_uid = function_job .to_dict ().get ("uid" )
107110 assert function_job_uid
111+ solver_job_id = function_job .to_dict ().get ("solver_job_id" )
112+ assert solver_job_id
108113
109114 if log_job :
110- print (f"Logging job log for job UID: { function_job_uid } " )
111- print_job_logs (configuration , function_job_uid )
115+ print_job_logs (configuration , solver_job_id )
112116
113117 for job_uid in [function_job_uid ]:
114118 status = wait_until_done (job_api_instance , job_uid )
@@ -155,12 +159,13 @@ def wait_until_done(function_api: osparc_client.FunctionJobsApi, function_job_ui
155159
156160
157161@retry (
158- stop = stop_after_delay (timedelta (minutes = 10 )),
162+ stop = stop_after_delay (timedelta (minutes = 5 )),
159163 wait = wait_exponential (multiplier = 1 , min = 1 , max = 5 ),
160164 retry = retry_if_exception_type (HTTPStatusError ),
161- reraise = True ,
165+ reraise = False ,
162166)
163- def print_job_logs (configuration : osparc_client .Configuration , job_uid : str ):
167+ def print_job_logs (configuration : osparc_client .Configuration , solver_job_uid : str ):
168+ print (f"Logging job log for solver job UID: { solver_job_uid } " )
164169 client = Client (
165170 base_url = configuration .host ,
166171 auth = BasicAuth (
@@ -169,8 +174,8 @@ def print_job_logs(configuration: osparc_client.Configuration, job_uid: str):
169174 )
170175 with client .stream (
171176 "GET" ,
172- f"/v0/solvers/{ _SOLVER_KEY } /releases/{ _SOLVER_VERSION } /jobs/{ job_uid } /logstream" ,
173- timeout = 10 * 60 ,
177+ f"/v0/solvers/{ _SOLVER_KEY } /releases/{ _SOLVER_VERSION } /jobs/{ solver_job_uid } /logstream" ,
178+ timeout = 5 * 60 ,
174179 ) as response :
175180 response .raise_for_status ()
176181 for line in response .iter_lines ():
0 commit comments