o
    `۷i                     @   s@  d dl m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ZeG dd deeZeG d	d
 d
eeZeG dd deZeG dd deZeG dd deZG dd deZeG dd deZeG dd deZeG dd deZeG dd deZeG dd deZeG dd deZdS )     )Enum)DictListOptional)	BaseModelField)
JobDetails)DeveloperAPIiP  c                   @   s$   e Zd ZdZdZdZdZdZdZdS )RunStatusEnumz*Enumeration for the status of a train run.STARTEDRUNNINGFINISHEDERROREDABORTEDN)	__name__
__module____qualname____doc__r   r   r   r   r    r   r   V/home/ubuntu/vllm_env/lib/python3.10/site-packages/ray/train/_internal/state/schema.pyr
      s    r
   c                   @   s   e Zd ZdZdZdS )ActorStatusEnumDEADALIVEN)r   r   r   r   r   r   r   r   r   r      s    r   c                   @   s   e Zd ZU dZeddZeed< eddZe	ed< eddZ
e	ed< ed	dZe	ed
< eddZeed< eddZeed< eddZe	ed< eddZee	 ed< eddZeed< eddZeeef ed< dS )TrainWorkerInfoMetadata of a Ray Train worker.zActor ID of the worker.descriptionactor_idzWorld rank of the worker.
world_rankzLocal rank of the worker.
local_rankzNode rank of the worker.	node_rankz-ID of the node that the worker is running on.node_idz5IP address of the node that the worker is running on.node_ipzProcess ID of the worker.pidz+A list of GPU ids allocated to that worker.gpu_idsz>The status of the train worker actor. It can be ALIVE or DEAD.status&The resources allocated to the worker.	resourcesN)r   r   r   r   r   r   str__annotations__r   intr   r    r!   r"   r#   r$   r   r%   r   r'   r   floatr   r   r   r   r   "   s(   
 r   c                   @   s6   e Zd ZU eed< eed< ee ed< ee ed< dS )
MemoryInforssvmspfaultspageinsN)r   r   r   r*   r)   r   r   r   r   r   r,   :   s
   
 r,   c                   @   s.   e Zd ZU eed< eee  ed< eed< dS )ProcessStats
cpuPercentmem
memoryInfoN)	r   r   r   r+   r)   r   r   r*   r,   r   r   r   r   r1   B   s   
 r1   c                   @   s   e Zd ZU eed< eed< dS )ProcessGPUUsager#   gpuMemoryUsageN)r   r   r   r*   r)   r   r   r   r   r5   J   s   
 r5   c                   @   sJ   e Zd ZU eed< eed< eed< ee ed< eed< eed< eed< dS )	GPUStatsuuidindexnameutilizationGpu
memoryUsedmemoryTotalprocessInfoN)	r   r   r   r(   r)   r*   r   r+   r5   r   r   r   r   r7   P   s   
 r7   c                   @   sB   e Zd ZU dZedddZee ed< ee	ddZ
ee ed< dS )	TrainWorkerInfoWithDetailsr   NzProcess stats of the worker.r   processStatszSGPU stats of the worker. Only returns GPUs that are attached to the worker process.)default_factoryr   gpus)r   r   r   r   r   r@   r   r1   r)   listrB   r   r7   r   r   r   r   r?   [   s   
 r?   c                   @   sH   e Zd ZU eddZeed< eddZeed< eddZe	e ed< dS )	TrainDatasetInfoz;The key of the dataset dict specified in Ray Train Trainer.r   r:   zThe uuid of the dataset.dataset_uuidzThe name of the dataset.dataset_nameN)
r   r   r   r   r:   r(   r)   rE   rF   r   r   r   r   r   rD   k   s   
 rD   c                   @   s   e Zd ZU dZeddZeed< eddZeed< eddZ	eed< ed	dZ
eed
< eddZee ed< eddZee ed< eddZeed< eddZeed< eddZeed< eddZee ed< eddZeeeef  ed< dS )TrainRunInfo?Metadata for a Ray Train run and information about its workers.zThe name of the Train run.r   r:   z)The unique identifier for each Train run.idzThe Ray Job ID.job_idz!Actor Id of the Train controller.controller_actor_id/A List of Train workers sorted by global ranks.workersz*A List of dataset info for this Train run.datasetszlThe current status of the train run. It can be one of the following: RUNNING, FINISHED, ERRORED, or ABORTED.
run_statuszJDetailed information about the current run status, such as error messages.status_detailz7The UNIX timestamp of the start time of this Train run.start_time_msz_The UNIX timestamp of the end time of this Train run. If null, the Train run has not ended yet.end_time_msr&   r'   N)r   r   r   r   r   r:   r(   r)   rI   rJ   rK   rM   r   r   rN   rD   rO   r
   rP   rQ   r*   rR   r   r'   r   r+   r   r   r   r   rG   t   s6   
 rG   c                   @   s@   e Zd ZU dZeddZee ed< edddZ	e
e ed< dS )TrainRunInfoWithDetailsrH   rL   r   rM   Nz/Details of the job that started this Train run.job_details)r   r   r   r   r   rM   r   r?   r)   rT   r   r   r   r   r   r   rS      s   
 rS   c                   @   s   e Zd ZU ee ed< dS )TrainRunsResponse
train_runsN)r   r   r   r   rS   r)   r   r   r   r   rU      s   
 rU   N)enumr   typingr   r   r   ray._common.pydantic_compatr   r   )ray.dashboard.modules.job.pydantic_modelsr   ray.util.annotationsr	   MAX_ERROR_STACK_TRACE_LENGTHr(   r
   r   r   r,   r1   r5   r7   r?   rD   rG   rS   rU   r   r   r   r   <module>   s:    
!