
    tnis                     ~    d Z ddlZddlZddlZddlmZmZ ddlmZ ddl	m
Z
  e            Zdeeef         ddfd	ZdS )
zj
runpod | serverless | rp_local.py
Provides the local testing functionality for runpod serverless worker.
    N)AnyDict)RunPodLogger   )run_jobconfigreturnc                   K   | d                              dd          r)t                              d           | d         d         }nt          j                            d          s.t                              d           t          j        d           t                              d           t          dd	d
          5 }t          j        |                                          }ddd           n# 1 swxY w Y   |                     dd          .t                              d           t          j        d           |                     dd          |d<   t                              d|            t          | d         |           d{V }|                     dd          r@t                              d|d          d|d                     t          j        d           t                              d|d          d           t                              d|            | d                              dd          rtt                              d           || d         d         k    r.t                              d           t          j        d           t                              d           t                              d           t          j        d           dS )z"
    Runs the worker locally.
    rp_args
test_inputNz.test_input set, using test_input as job input.ztest_input.jsonz#test_input.json not found, exiting.r   z#Using test_input.json as job input.rzUTF-8)encodinginputz*Job has no input parameter. Unable to run.id
local_testzRetrieved local job: handlererrorzJob z failed with error: z completed successfully.zJob result: test_outputz1test_output set, comparing output to test_output.z&Job output does not match test_output.zJob output matches test_output.z Local testing complete, exiting.r   )getloginfoospathexistswarnsysexitopenjsonloadsreadr   debugr   )r   	local_jobfile
job_results       _/var/www/html/gpu-tools/venv/lib/python3.11/site-packages/runpod/serverless/modules/rp_local.py	run_localr'      s     
 i\400 
0ABBB9%l3		w~~/00 	HH:;;;HQKKK6777#S7;;; 	0t
499;;//I	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 }}Wd##+		>???  mmD,77IdOII1i11222vi0)<<<<<<<<J~~gt$$ 		S4SSj>QSSTTTHH=IdO===>>>HH(J(())) i]D11 4DEEE	*=999II>???HQKKK2333HH/000HQKKKKKs   'C44C8;C8)__doc__r   r   r   typingr   r   #runpod.serverless.modules.rp_loggerr   rp_jobr   r   strr'        r&   <module>r/      s    
  				 



         < < < < < <      lnn+DcN +t + + + + + +r.   