
    &`i/                         d dl Z d dlZd dlmZmZmZ d dlmZmZ d dl	m
Z d dlmZ d dlmZ  e j        e          Z G d de          ZdS )	    N)STATUS_UP_TO_DATETAG_RAY_NODE_STATUSNodeUpdater)	with_envswith_head_node_ip)NodeProvider)AutoscalingConfig)Instancec                   >    e Zd ZdZefdededdfdZdede	ddfd	Z
dS )
RayInstallerzP
    RayInstaller is responsible for installing ray on the target instance.
    providerconfigreturnNc                 0    || _         || _        || _        d S )N)	_provider_config_process_runner)selfr   r   process_runners       /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/autoscaler/v2/instance_manager/ray_installer.py__init__zRayInstaller.__init__   s      "-    instancehead_node_ipc                 z   | j                             |j                  }| j                                         }| j                             |j                  }t
                              d|j         d           | j                             |j                  }t          di d|j        d| j         
                    d          d| j        d| j         
                    d          d| j         
                    d          d	| j         
                    d	          d
t          | j                             |j                  |          dt          ||          dt          |||j        |j        |d          d| j         j        d| j         j        ddd| j         
                    d          d| j         
                    d          | j         
                    d          dddd|d| j                             |j                  d| j                             |j                  d| j        }|                                 | j                            |j                  }|                    t.                    t0          k    r*t3          d|                    t.                               dS ) z
        Install ray on the target instance synchronously.
        TODO:(rickyx): This runs in another thread, and errors are silently
        ignored. We should propagate the error to the main thread.
        z5Creating new (spawn_updater) updater thread for node .node_idprovider_configr   auth_configauthcluster_namefile_mountsinitialization_commandssetup_commandsray_start_commands)RAY_HEAD_IPRAY_CLOUD_INSTANCE_IDRAY_NODE_TYPE_NAMERAY_CLOUD_INSTANCE_TYPE_NAMEruntime_hashfile_mounts_contents_hashis_head_nodeFcluster_synced_filesrsync_optionsrsync_excludersync_filter)r/   r0   use_internal_ipTdocker_confignode_resourcesnode_labelsr   z0Ray installation failed with unexpected status: N )r   get_worker_setup_commandsinstance_typeget_worker_start_ray_commandsget_docker_configloggerinfocloud_instance_idget_provider_instance_typer   
get_configr   r   get_initialization_commandsr   r*   r+   get_node_resourcesget_node_labelsr   run	node_tagsgetr   r   	Exception)	r   r   r   r$   r%   r2   provider_instance_type_nameupdatertagss	            r   install_rayzRayInstaller.install_ray    s.    ??@VWW!\GGII66x7MNN.*. . .	
 	
 	
 '+l&M&M"'
 '
#  '
 '
 '
..'
 L33J???'
 ^^'
 //777	'

 00@@@'
 //>>>'
 %6889OPP% % %'
 -^\JJJ'
"  )"#/-5-G*2*@4O	      #'
4 225'
6 '+l&L&L7'
8 9'
: "&!8!89O!P!P!P;'
> "&!8!8!I!I $ 7 7 G G  ='
D !DE'
F (-G'
H  <::8;QRRRI'
J 44X5KLLLK'
L  //M'
P 	 ~''(BCC88'((,===b488L_C`C`bb   >=r   )__name__
__module____qualname____doc__
subprocessNodeProviderV1r	   r   r
   strrI   r5   r   r   r   r      s          "	. . . ".
 
. . . .@H @C @D @ @ @ @ @ @r   r   )loggingrN   ray.autoscaler._private.updaterr   r   r   ray.autoscaler._private.utilr   r   ray.autoscaler.node_providerr   rO   )ray.autoscaler.v2.instance_manager.configr	   'ray.core.generated.instance_manager_pb2r
   	getLoggerrJ   r:   objectr   r5   r   r   <module>rY      s                 
 F E E E E E E E G G G G G G G G G G G G < < < < < <		8	$	$O O O O O6 O O O O Or   