o
    ciR                     @   s  U d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZ ddlmZ ddlmZmZmZmZmZmZmZmZ ddlZddlZddlmZ ddlm  m  mZ ddl m  m  m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z' dd	l(m)Z) dd
l*m+Z+ ddl,m-Z- ddl.m/Z/m0Z0 ddl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZA erddlBmCZC ddlDmEZE eFeGZHdZIdZJdZKeLeMd< dZNdZOdZPdeQdeQfddZRG dd dZSdeTfd d!ZUd"ejVdeWfd#d$ZXdS )%zThis file includes the Worker class which sits on the client side.
It implements the Ray API functions that are forwarded through grpc calls
to the server.
    N)defaultdictFuture)TYPE_CHECKINGAnyCallableDictListOptionalTupleUnion)%DEFAULT_CLIENT_RECONNECT_GRACE_PERIOD)upload_py_modules_if_needed)upload_working_dir_if_needed)pickle)GetTimeoutError)	JobConfig)dumps_from_clientloads_from_server)
GRPC_OPTIONSGRPC_UNRECOVERABLE_ERRORS	INT32_MAXOBJECT_TRANSFER_WARNING_SIZEClientActorClassClientActorHandleClientActorRefClientObjectRefClientRemoteFunc
ClientStub)
DataClient)LogstreamClient)log_once)
ActorClass)RemoteFunction      g       @MAX_BLOCKING_OPERATION_TIME_Si   zkhttps://docs.google.com/document/d/167rnnDFIVRhHhK4mznEIemOtj63IOhtIPvSYaPgI4Fg/edit#heading=h.f7ins22n6nylzkhttps://docs.google.com/document/d/167rnnDFIVRhHhK4mznEIemOtj63IOhtIPvSYaPgI4Fg/edit#heading=h.1afmymq455wutimeoutreturnc                 C   s   | d } | t kr
t } | S )Nr$   )MAX_TIMEOUT_SECr'    r+   J/home/ubuntu/.local/lib/python3.10/site-packages/ray/util/client/worker.pybackoffJ   s   r-   c                   @   s  e Zd Z					ddededeeeef  ded	ee	j
 f
d
dZddddZde	jdefddZdedefddZdejdefddZdefddZde	jfddZdd Zded eejgdf ddfd!d"Zdd#d$ee defd%d&Zdee d$efd'd(Zddd)d*ed+ee  fd,d-Z!	dd*ed.ee  fd/d0Z"d1dd2d3d4ee d5ed$ed6edeee ee f f
d7d8Z#dee$ fd9d:Z%d;ej&d5ee dee$ fd<d=Z'd>eddfd?d@Z(d>eddfdAdBZ)d>eddfdCdDZ*dEdF Z+	ddGedHee de fdIdJZ,dKe dLeddfdMdNZ-dOedPedQeddfdRdSZ.	ddTej/j0d$ee fdUdVZ1dWedHee defdXdYZ2dWedHee defdZd[Z3dWed\ed]edHee def
d^d_Z4dWed`edHee defdadbZ5dcedHee dee fdddeZ6dfedgeddfdhdiZ7djedee8eef  fdkdlZ9defdmdnZ:ddefdodpZ;defdqdrZ<	ddse=dtee8eef  fdudvZ>dKdwdefdxdyZ?dzd{defd|d}Z@dWedd~fddZAdWedefddZBdefddZCdS )Worker FN   conn_strsecuremetadataconnection_retries_credentialsc                 C   s&  t  | _d| jfg|r|ng  | _d| _d| _tjj| _i | _	|p+t
jdd dv | _|| _|| _|dur>|| _d| _nd| _t| _dt
jv rQtt
jd | _| jdk| _d	| _d	| _|   d| _d	| _t| | j| j| _tt| _t| | j| _| j t!j" d	| _#d| _$t%& | _'d| _(dS )
a  Initializes the worker side grpc client.

        Args:
            conn_str: The host:port connection string for the ray server.
            secure: whether to use SSL secure channel or not.
            metadata: additional metadata passed in the grpc request headers.
            connection_retries: Number of times to attempt to reconnect to the
              ray server if it doesn't respond immediately. Setting to 0 tries
              at least once.  For infinite retries, catch the ConnectionError
              exception.
            _credentials: gprc channel credentials. Default ones will be used
              if None.
        	client_idNRAY_USE_TLS01trueT!RAY_CLIENT_RECONNECT_GRACE_PERIODr   F))make_client_id
_client_idr3   channelservergrpcChannelConnectivityIDLE_conn_state
_convertedosenvirongetlower_secure	_conn_str_connection_retriesr5   r   _reconnect_grace_periodint_reconnect_enabled_in_shutdown_has_connected_connect_channel_serverside_ray_initializedr   data_clientr   reference_countr    
log_clientset_logstream_levelloggingINFOclosed!total_outbound_message_size_bytes	threadingLock_req_id_lock_req_id)selfr1   r2   r3   r4   r5   r+   r+   r,   __init__R   sD   






zWorker.__init__r(   c              
   C   s<  | j dur| j | j | j   | jrI| jdur| j}n!tjdd	 dv r:t
jj \}}}tj|||d}nt }tj| j|td| _ n	tj| jtd| _ | j | j t }d}t}d}	|t| jd	k sn|r|d	7 }| jrvnt | }
|r|
| jkrd
| _td| j dz"t| j j|d t| j | _ t!| " }	|	rW n]t#| W n= tj$y   t%&d| d Y n+ tj'y } zt%&d| d t%&d|(   t#| W Y d}~nd}~ww t%&d| d |st)|}|t| jd	k sn|sn|	sd
| _t*drt+,d tddS )z
        Attempts to connect to the server specified by conn_str. If
        reconnecting after an RPC error, cleans up the old channel and
        continues to attempt to connect until the grace period is over.
        Nr7   r8   r9   )certificate_chainprivate_keyroot_certificatesoptionsr   F   Tz:Failed to reconnect within the reconnection grace period (zs)r*   zCouldn't connect channel in z seconds, retryingz+Ray client server unavailable, retrying in zs...zReceived when checking init: z8Waiting for Ray to become ready on the server, retry in ray_client_security_groupszRay Client connection timed out. Ensure that the Ray Client port on the head node is reachable from your local machine. See https://docs.ray.io/en/latest/cluster/ray-client.html#step-2-check-ports for more information.zray client connection timeout)-r?   unsubscribe_on_channel_state_changecloserJ   r5   rF   rG   rH   rI   ray_private	tls_utilsload_certs_from_envrA   ssl_channel_credentialssecure_channelrK   r   insecure_channel	subscribetimeINITIAL_TIMEOUT_SECmaxrL   rP   rM   ConnectionErrorchannel_ready_futureresultray_client_pb2_grpcRayletDriverStubr@   boolping_serversleepFutureTimeoutErrorloggerdebugRpcErrordetailsr-   r!   warningswarn)r`   reconnectingcredentialsserver_cert_chainrc   ca_cert
start_timeconn_attemptsr'   service_readyelapsed_timeer+   r+   r,   rR      s   





1
zWorker._connect_channelr   c                 C   sL   | j sdS | jr
dS | tv rdS | tjjkr$| }|dkr$dS dS )zz
        Returns True if the RPC error can be recovered from and a retry is
        appropriate, false otherwise.
        FzException serializing request!T)rO   rP   coder   rA   
StatusCodeINTERNALr   )r`   r   r   r+   r+   r,   _can_reconnect  s   zWorker._can_reconnect	stub_namec              
   O   s~   | j s;zt| j||i |W S  tjy- } z| |r(td W Y d}~q  d}~w ty:   td Y q w t	d)z
        Calls the stub specified by stub_name (Schedule, WaitObject, etc...).
        If a recoverable error occurrs while calling the stub, attempts to
        retry the RPC.
              ?NClient is shutting down.)
rP   getattrr@   rA   r   r   rt   r~   
ValueErrorrw   )r`   r   argskwargsr   r+   r+   r,   
_call_stub  s   


zWorker._call_stubreqc              
   o   s   d}| j s|d |_zM| jj|g|R i |D ]<}|j|kr/td|j d|j d q|d |jkrDtd|j d| j	d  |j}|V  ||j
d krU W dS qW dS  tjyv } z| |rqtd	 W Y d}~q d}~w ty   td	 Y qw td
)z
        Calls the stub for GetObject on the underlying server stub. If a
        recoverable error occurs while streaming the response, attempts
        to retry the get starting from the first chunk that hasn't been
        received.
        rg   zReceived a repeated chunk z from request .zReceived chunk z when we expected Nr   r   )rP   start_chunk_idr@   	GetObjectchunk_idr   r   req_idRuntimeErrorlast_seen_chunktotal_chunksrA   r   r   rt   r~   r   rw   )r`   r   r   r   r   chunkr   r+   r+   r,   _get_object_iterator5  sH   	






zWorker._get_object_iteratorc                 C   sx   | j s|S tt }| j |  jd7  _| jtkrd| _t| j}W d   n1 s-w   Y  |d|fd|fg S )aT  
        Adds a unique req_id and the current thread's identifier to the
        metadata. These values are useful for preventing mutating operations
        from being replayed on the server side in the event that the client
        must retry a requsest.
        Args:
            metadata: the gRPC metadata to append the IDs to
        rg   N	thread_idr   )rO   strr\   	get_identr^   r_   r   )r`   r3   r   r   r+   r+   r,   _add_ids_to_metadatae  s   	
zWorker._add_ids_to_metadata
conn_statec                 C   s   t d|  || _d S )Nz"client gRPC channel state change: )r   r   rD   )r`   r   r+   r+   r,   rj   y  s   
zWorker._on_channel_state_changec              
   C   sH   z| j  }W n tjy } zt|d }~ww |j|j|j|jdS )N)num_clientspython_versionray_version
ray_commit)	rT   ConnectionInforA   r   decode_exceptionr   r   r   r   )r`   datar   r+   r+   r,   connection_info}  s   zWorker.connection_inforefcallbackc                 C   s$   t j|jgdd}| j|| d S )NT)idsasynchronous)ray_client_pb2
GetRequestidrT   RegisterGetCallback)r`   r   r   r   r+   r+   r,   register_callback  s   zWorker.register_callbackr*   r'   c                C   s  t |tr|s	g S |}nt |tr|g}ntdt| |d u r$d }nt | }t}dtj	v r8t
tj	d }	 |rHt|t|t  d}n|}z| ||}W n tyl   |rbt |krb td| Y nw q9t|t|krtdt|t|t |tr|d }|S )Nz>Can't get something that's not a list of IDs or just an ID: %s(RAY_CLIENT_MAX_BLOCKING_OPERATION_TIME_STgMbP?zInternal retry for get {}z<Mismatched number of items in request ({}) and response ({})r   )
isinstancelistr   	Exceptiontypert   	monotonicr&   rF   rG   floatminrv   _getr   r   r   formatlen)r`   valsr'   to_getdeadlinemax_blocking_operation_time
op_timeoutresr+   r+   r,   rH     sX   



z
Worker.getc           
   
   C   s   t jdd |D |d}t }zT| j|| jd}|D ]D}|js=z	t|j}W | t	j
tfy<   td|j  w |jtkrXtdrX|jd }tjd|d	d
tdd ||j qW t|S  tjyt }	 zt|	d }	~	ww )Nc                 S      g | ]}|j qS r+   r   ).0rr+   r+   r,   
<listcomp>      zWorker._get.<locals>.<listcomp>)r   r'   r3   Failed to deserialize {}#client_object_transfer_size_warningi   @z'Ray Client is attempting to retrieve a z.2fzy GiB object over the network, which may be slow. Consider serializing the object to a file and using S3 or rsync instead.r$   )
stacklevel)r   r   	bytearrayr   r3   validcloudpickleloadserrorr   UnpicklingError	TypeErrorr   	exceptionr   
total_sizer   r!   r   r   UserWarningextendr   rA   r   r   r   )
r`   r   r'   r   r   respr   errsize_gbr   r+   r+   r,   r     s>   
zWorker._get)client_ref_id_ownerr   r   c                C   s,   t |tr	tdt|| j}| |||S )NzCalling 'put' on an ObjectRef is not allowed (similarly, returning an ObjectRef from a remote function is not allowed). If you really want to do this, you can wrap the ObjectRef in a list and call 'put' on it (or return it).)r   r   r   r   r>   _put_pickled)r`   valr   r   r   r+   r+   r,   put  s   
z
Worker.putownerc              	   C   s~   t j|d}|d ur||_|d ur|jj|_| j|}|js:zt	
|j tjtfy9   td|j  w t|jS )N)r   r   )r   
PutRequestr   	actor_refr   owner_idrT   	PutObjectr   r   r   r   r   r   r   r   r   r   r   )r`   r   r   r   r   r   r+   r+   r,   r     s   

zWorker._put_pickledrg   T)num_returnsr'   fetch_localobject_refsr   r   c                C   s   t |tstdt| |D ]}t |ts tdt| qdd |D ||d ur.|nd| jd}tjdi |}| jd|| j	d}|j
sLtd	d
d |jD }	dd |jD }
|	|
fS )Nz/wait() expected a list of ClientObjectRef, got z?wait() expected a list of ClientObjectRef, got list containing c                 S   r   r+   r   )r   
object_refr+   r+   r,   r     r   zWorker.wait.<locals>.<listcomp>r   )
object_idsr   r'   r6   
WaitObjectr   z.Client Wait request failed. Reference invalid?c                 S      g | ]}t |qS r+   r   r   r   r+   r+   r,   r   !      c                 S   r   r+   r   r   r+   r+   r,   r   $  r   r+   )r   r   r   r   r   r>   r   WaitRequestr   r3   r   r   ready_object_idsremaining_object_ids)r`   r   r   r'   r   r   r   r   r   client_ready_object_idsclient_remaining_object_idsr+   r+   r,   wait  s8   

zWorker.waitc                 O   sJ   |  }t||f| j|_| }|dkrd}|dkrtd| ||S )Ndynamicr   	streamingzdStreaming actor methods (num_returns="streaming") are not currently supported when using Ray Client.)_prepare_client_taskr   r>   r   _num_returnsr   _call_schedule_for_task)r`   instancer   r   taskr   r+   r+   r,   call_remote*  s   zWorker.call_remoter  c                    s   t d|j d|j d|j  | j|_|d u rd}|dkr#ddd tD  dtt	j
tf dd f fd	d
}| j|| |  j| 7  _| jtkrbtdrbtdt dt t  S )NzScheduling task  rg   r   c                 S   s   g | ]}t  qS r+   r   )r   _r+   r+   r,   r   D  r   z2Worker._call_schedule_for_task.<locals>.<listcomp>r   r(   c              
      s
  t | trt | tjrt| }  D ]}||  qd S | j}|jsMzt	|j
}W n tjtfy@ } z|}W Y d }~nd }~ww  D ]}|| qCd S t|jkrstd dt|j }t |jD ]	\}}|| qgd S t |jD ]	\}}|| qyd S )Nz	Expected z returns but received )r   r   rA   r   r   set_exceptiontask_ticketr   r   r   r   r   r   r   r   
return_idsr   zip
set_result)r   futureticketexe_newexcraw_id
id_futuresnum_return_refsr+   r,   populate_idsF  s:   
z4Worker._call_schedule_for_task.<locals>.populate_ids%client_communication_overhead_warningaa  More than 10MB of messages have been created to schedule tasks on the server. This can be slow on Ray Client due to communication overhead over the network. If you're running many fine-grained tasks, consider running them inside a single remote function. See the section on "Too fine-grained tasks" in the Ray Design Patterns document for more details: z. If your functions frequently use large objects, consider storing the objects remotely with ray.put. An example of this is shown in the "Closure capture of large / unserializable object" section of the Ray Design Patterns document, available here: )r   r   namer   
payload_idr>   r6   ranger   r   DataResponser   rT   Scheduler[   ByteSizeMESSAGE_SIZE_THRESHOLDr!   r   r   $DESIGN_PATTERN_FINE_GRAIN_TASKS_LINK!DESIGN_PATTERN_LARGE_OBJECTS_LINKr   )r`   r  r   r  r+   r  r,   r  9  s.   ""
zWorker._call_schedule_for_taskr   c                 C   sD   | j rd S | j|  d8  < | j| dkr | | | j|= d S d S )Nrg   r   )rZ   rU   _release_serverr`   r   r+   r+   r,   call_release}  s   
zWorker.call_releasec                 C   s<   | j d urtd|   | j tj|gd d S d S )Nz
Releasing )r   )rT   r   r   hexReleaseObjectr   ReleaseRequestr$  r+   r+   r,   r#    s   
zWorker._release_serverc                 C   s*   t d|   | j|  d7  < d S )Nz
Retaining rg   )r   r   r&  rU   r$  r+   r+   r,   call_retain  s   zWorker.call_retainc                 C   sD   d| _ d| _| j  | j  d | _| jr | j  d | _d S d S )NT)rP   rZ   rT   rk   rV   r@   r?   r`   r+   r+   r,   rk     s   



zWorker.closer  	namespacec                 C   s   t  }t jj|_||_|pd|_tg i f| j|_| 	|d}t
|dks(J tt|d dd}|j r?td| d|S )Nr/   rg   r   T)weak_refzActorID for z	 is empty)r   
ClientTaskNAMED_ACTORr   r  r+  r   r>   r   r  r   r   r   r   is_nilr   )r`   r  r+  r  futureshandler+   r+   r,   	get_actor  s   


zWorker.get_actoractor
no_restartc              
   C   s   t |tstdt|tj }|jj	|_	||_
tj|d}| j|_z	| j| W d S  tjy? } zt|d }~ww )Nz.ray.kill() only supported for actors. Got: {}.)r3  )r   r   r   r   r   r   TerminateRequestActorTerminater   r   r4  r>   r6   rT   	TerminaterA   r   r   )r`   r3  r4  
term_actortermr   r+   r+   r,   terminate_actor  s   


zWorker.terminate_actorobjforce	recursivec              
   C   s   t |tstdt| dtj }|j|_||_||_	tj|d}| j
|_z	| j| W d S  tjyB } zt|d }~ww )Nz<ray.cancel() only supported for non-actor object refs. Got: r   )task_object)r   r   r   r   r   r5  TaskObjectTerminater   r<  r=  r>   r6   rT   r7  rA   r   r   )r`   r;  r<  r=  term_objectr9  r   r+   r+   r,   terminate_task  s$   

zWorker.terminate_taskreq_typec                 C   s`   t  }||_| jj||| jd}|ddkr t|jj	}|S |ddkr*|j
S t|jS )N)r'   r3   response_typeresource_tableruntime_context)r   ClusterInfoRequestr   r@   ClusterInfor3   
WhichOneofdictrD  tablerE  jsonr   )r`   rB  r'   r   r   output_dictr+   r+   r,   get_cluster_info  s   zWorker.get_cluster_infokeyc              
   C   s\   t j||d}z| jd|| jd}W n tjy# } zt|d }~ww |dr,|jS d S )NrN  r+  KVGetr   value)	r   KVGetRequestr   r3   rA   r   r   HasFieldrQ  r`   rN  r+  r   r   r   r+   r+   r,   internal_kv_get  s   
zWorker.internal_kv_getc              
   C   sL   t j||d}z| jd|| jd}W |jS  tjy% } zt|d }~ww )NrO  KVExistsr   )r   KVExistsRequestr   r3   rA   r   r   existsrT  r+   r+   r,   internal_kv_exists  s   zWorker.internal_kv_existsrQ  	overwritec           	   
   C   sZ   t j||||d}| | j}z| jd||d}W |jS  tjy, } zt|d }~ww )N)rN  rQ  rZ  r+  KVPutr   )	r   KVPutRequestr   r3   r   rA   r   r   already_exists)	r`   rN  rQ  rZ  r+  r   r3   r   r   r+   r+   r,   internal_kv_put  s   zWorker.internal_kv_putdel_by_prefixc              
   C   sX   t j|||d}| | j}z| jd||d}W |jS  tjy+ } zt|d }~ww )N)rN  r_  r+  KVDelr   )	r   KVDelRequestr   r3   r   rA   r   r   deleted_num)r`   rN  r_  r+  r   r3   r   r   r+   r+   r,   internal_kv_del  s   zWorker.internal_kv_delprefixc              
   C   sH   zt j||d}| jd|| jdjW S  tjy# } zt|d }~ww )N)rd  r+  KVListr   )r   KVListRequestr   r3   keysrA   r   r   )r`   rd  r+  r   r   r+   r+   r,   internal_kv_list
  s   zWorker.internal_kv_listuriexpiration_sc                 C   s$   t j||d}| jd|| jd d S )N)ri  rj  PinRuntimeEnvURIr   )r   ClientPinRuntimeEnvURIRequestr   r3   )r`   ri  rj  r   r+   r+   r,   pin_runtime_env_uri  s   zWorker.pin_runtime_env_uriall_namespacesc                 C   s    t j|d}t| j|jS )N)rn  )r   ClientListNamedActorsRequestrK  r   rT   ListNamedActorsactors_json)r`   rn  r   r+   r+   r,   list_named_actors  s   zWorker.list_named_actorsc                 C   s2   |   r	| jd u rdS | js| tjj| _| jS )NF)is_connectedr@   rS   rM  r   ClusterInfoTypeIS_INITIALIZEDr*  r+   r+   r,   is_initialized  s   zWorker.is_initializedc                 C   s2   | j durtd | jtjj|d}|duS dS )zSimple health check.

        Piggybacks the IS_INITIALIZED call to check if the server provides
        an actual response.
        NzPinging server.r*   F)r@   r   r   rM  r   rt  PING)r`   r'   ry   r+   r+   r,   r}   +  s   

zWorker.ping_serverc                 C   s   | j  o| jS N)rP   rQ   r*  r+   r+   r,   rs  9  s   zWorker.is_connected
job_configray_init_kwargsc              
   C   s   |du ri }z^|du rd}n9t  (}|jpi }t||td}t||td}|dd |j|dd W d   n1 s=w   Y  t	|}| j
tj|t	|| jd}|jsbtd|j W dS  tjyu } zt|d}~ww )zInitialize the serverN)r   excludesT)validate)ry  rz  reconnect_grace_periodz$Initialization failure from server:
)tempfileTemporaryDirectoryruntime_envr   r   r   popset_runtime_envr   dumpsrT   Initr   InitRequestrK  rM   okConnectionAbortedErrormsgrA   r   r   )r`   ry  rz  serialized_job_configtmp_dirr  responser   r+   r+   r,   _server_init<  sB   



zWorker._server_initr"   c                 C   s*   t  j}|jj}t||jd| j|< |S )z@Register a ClientActorClass for the ActorClass and return a UUIDre   )uuiduuid4r&  __ray_metadata__modified_classr   _default_optionsrE   )r`   r3  rN  clsr+   r+   r,   _convert_actorc  s   
zWorker._convert_actorfuncr#   c                 C   s$   t  j}t|j|jd| j|< |S )z@Register a ClientRemoteFunc for the ActorClass and return a UUIDre   )r  r  r&  r   	_functionr  rE   )r`   r  rN  r+   r+   r,   _convert_functionj  s
   
zWorker._convert_functionr   c                 C   s
   | j | S )z)Given a UUID, return the converted objectrE   r`   rN  r+   r+   r,   _get_convertedr     
zWorker._get_convertedc                 C   s
   || j v S )zACheck if a key UUID is present in the store of converted objects.r  r  r+   r+   r,   _converted_key_existsv  r  zWorker._converted_key_existsc                 C   s   t || jS rx  )r   r>   )r`   r   r+   r+   r,   _dumps_from_clientz  s   zWorker._dumps_from_client)r/   FNr0   N)F)r(   Nrx  )D__name__
__module____qualname__r   r|   r	   r   rN   r
   rA   ChannelCredentialsra   rR   r   r   r   r   r   r   r   r   rB   rj   r   r   r   r  r   r   rH   r   bytesr   r   r   r   r   r  r-  r  r%  r#  r)  rk   r2  r:  rA  rt  TypeEnumrM  rU  rY  r^  rc  rh  rm  r   rr  rv  r}   rs  r   r  r  r  r  r  r  r+   r+   r+   r,   r.   Q   s"   
Oe
0
0"


&
D





	
'r.   c                  C   s   t  } | jS rx  )r  r  r&  r   r+   r+   r,   r=   ~  s   r=   r   c                 C   s4   |   tjjkrtd|  S t|  }t|S )NzGRPC connection failed: )	r   rA   r   ABORTEDrw   base64standard_b64decoder   r   )r   r   r+   r+   r,   r     s   r   )Y__doc__r  rK  rX   rF   r~  r\   rt   r  r   collectionsr   concurrent.futuresr   typingr   r   r   r   r	   r
   r   r   rA   ray._private.tls_utilsrl   ray.cloudpickler   !ray.core.generated.ray_client_pb2core	generatedr   &ray.core.generated.ray_client_pb2_grpcrz   ray._private.ray_constantsr   #ray._private.runtime_env.py_modulesr   $ray._private.runtime_env.working_dirr   ray.cloudpickle.compatr   ray.exceptionsr   ray.job_configr   ray.util.client.client_picklerr   r   ray.util.client.commonr   r   r   r   r   r   r   r   r   r   ray.util.client.dataclientr   ray.util.client.logsclientr    ray.util.debugr!   	ray.actorr"   ray.remote_functionr#   	getLoggerr  r   ru   r)   r&   r   __annotations__r   r!  r"  rN   r-   r.   r   r=   r   r   r   r+   r+   r+   r,   <module>   sb    (0
      3