
    &`i                     X    d dl mZmZmZmZmZ d dlmZ e G d d                      ZdS )    )AnyDictListOptionalTuple)DeveloperAPIc                   V   e Zd ZdZ	 	 	 	 	 	 	 	 	 ddee         ded	ed
eee	eef                           dedee
eef                  dedededefdZ	 ddededee
eef                  ddfdZ	 ddededee
eef                  ddfdZdefdZdede
eef         dedee         fdZdS )CommandRunnerInterfacea  Interface to run commands on a remote cluster node.

    **Important**: This is an INTERNAL API that is only exposed for the purpose
    of implementing custom node providers. It is not allowed to call into
    CommandRunner methods from any Ray package outside the autoscaler, only to
    define new implementations for use with the "external" node provider
    option.

    Command runner instances are returned by provider.get_command_runner().Nx   Fauto cmdtimeoutexit_on_failport_forwardwith_outputenvironment_variablesrun_envssh_options_override_ssh_keyshutdown_after_runreturnc
                     t           )a@  Run the given command on the cluster node and optionally get output.

        WARNING: the cloudgateway needs arguments of "run" function to be json
            dumpable to send them over HTTP requests.

        Args:
            cmd: The command to run.
            timeout: The command timeout in seconds.
            exit_on_fail: Whether to sys exit on failure.
            port_forward: List of (local, remote) ports to forward, or
                a single tuple.
            with_output: Whether to return output.
            environment_variables (Dict[str, str | int | Dict[str, str]):
                Environment variables that `cmd` should be run with.
            run_env: Options: docker/host/auto. Used in
                DockerCommandRunner to determine the run environment.
            ssh_options_override_ssh_key: if provided, overwrites
                SSHOptions class with SSHOptions(ssh_options_override_ssh_key).
            shutdown_after_run: if provided, shutdowns down the machine
                after executing the command with `sudo shutdown -h now`.
        NotImplementedError)
selfr   r   r   r   r   r   r   r   r   s
             q/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/autoscaler/command_runner.pyrunzCommandRunnerInterface.run   s    B "!    sourcetargetoptionsc                     t           )zRsync files up to the cluster node.

        Args:
            source: The (local) source directory or file.
            target: The (remote) destination path.
        r   r   r   r    r!   s       r   run_rsync_upz#CommandRunnerInterface.run_rsync_up5   
     "!r   c                     t           )zRsync files down from the cluster node.

        Args:
            source: The (remote) source directory or file.
            target: The (local) destination path.
        r   r#   s       r   run_rsync_downz%CommandRunnerInterface.run_rsync_down@   r%   r   c                     t           )z4Return the command the user can use to open a shell.r   )r   s    r   remote_shell_command_strz/CommandRunnerInterface.remote_shell_command_strK   s    !!r   as_headfile_mountssync_run_yetc                    dS )a?  Used to run extra initialization commands.

        Args:
            as_head: Run as head image or worker.
            file_mounts: Files to copy to the head and worker nodes.
            sync_run_yet: Whether sync has been run yet.

        Returns:
            optional: Whether initialization is necessary.
        N )r   r*   r+   r,   s       r   run_initzCommandRunnerInterface.run_initO   s	     	r   )	Nr   FNFNr   r   F)N)__name__
__module____qualname____doc__r   strintboolr   r   r   objectr   r   r$   r'   r)   r/   r.   r   r   r
   r
      s       O O ""8<!=A,.#(!" !"c]!" !" 	!"
 tE#s(O45!" !"  (S&[(9:!" !" '*!" !!" 
!" !" !" !"H MQ	" 	"	"#&	"19$sCx.1I	"		" 	" 	" 	" MQ	" 	"	"#&	"19$sCx.1I	"		" 	" 	" 	""# " " " "-1#s(^KO	$     r   r
   N)	typingr   r   r   r   r   ray.util.annotationsr   r
   r.   r   r   <module>r:      s    3 3 3 3 3 3 3 3 3 3 3 3 3 3 - - - - - - U U U U U U U U U Ur   