o
    bi                     @   sN   d dl Z d dlmZmZ d dlmZ d dlmZ e e	Z
G dd deZdS )    N)ListOptional)RuntimeEnvContext)RuntimeEnvPluginc                   @   sl   e Zd ZdZdZdd Zefdee ddde	d	e
jd
ef
ddZefdee ddde	d	ee
j fddZdS )PyExecutablePlugina\  This plugin allows running Ray workers with a custom Python executable.

    You can use it with
    `ray.init(runtime_env={"py_executable": "<command> <args>"})`. If you specify
    a `working_dir` in the runtime environment, the executable will have access
    to the working directory, for example, to a requirements.txt for a package manager,
    a script for a debugger, or the executable could be a shell script in the
    working directory. You can also use this plugin to run worker processes
    in a custom profiler or use a custom Python interpreter or `python` with
    custom arguments.
    py_executablec                 C   s   d S )N )selfr   r   Z/home/ubuntu/.local/lib/python3.10/site-packages/ray/_private/runtime_env/py_executable.py__init__   s   zPyExecutablePlugin.__init__uriruntime_env
RuntimeEnvcontextloggerreturnc                    s   dS )Nr   r   )r	   r   r   r   r   r   r   r
   create   s   zPyExecutablePlugin.createurisc                 C   s   | d | |_d S )NzRunning py_executable plugin)infor   )r	   r   r   r   r   r   r   r
   modify_context%   s   
z!PyExecutablePlugin.modify_contextN)__name__
__module____qualname____doc__namer   default_loggerr   strr   loggingLoggerintr   r   r   r   r   r   r
   r   
   s4    
r   )r   typingr   r    ray._private.runtime_env.contextr   ray._private.runtime_env.pluginr   	getLoggerr   r   r   r   r   r   r
   <module>   s    
