o
    xiz
                     @  s   d dl mZ d dlZd dlZd dlm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 dd	lmZmZ dd
lmZ eeZG dd deZdS )    )annotationsN)Any   )LaunchProject)LaunchError)
LOG_PREFIXMAX_ENV_LENGTHSPROJECT_SYNCHRONOUSsanitize_wandb_api_keyvalidate_wandb_python_deps   )AbstractRunAbstractRunner)_run_entry_pointc                   @  s   e Zd ZdZd	ddZdS )
LocalProcessRunnera$  Runner class, uses a project to create a LocallySubmittedRun.

    LocalProcessRunner is very similar to a LocalContainerRunner, except it does not
    run the command inside a docker container. Instead, it runs the
    command specified as a process directly on the bare metal machine.

    launch_projectr   returnAbstractRun | Nonec                   sb  |d urt  d| }t| |d ur!t  d| }t| | jt }|jp,| }g }|jd u r8td|j	rY|j
d usBJ ztd|j W n tyX   td Y nw || jt| jj }| D ]\}	}
|t|	 dt|
 g7 }qh|d ur||j7 }||j7 }d| }t  dt| }t| t||j}|r| I d H  |S )	Nz,LocalProcessRunner.run received unused args z.LocalProcessRunner.run received unused kwargs z4Launch LocalProcessRunner received empty project dirzrequirements.frozen.txtz&Unable to validate python dependencies= z.Launching run as a local-process with command )r   _loggerwarningbackend_configr	   override_entrypointget_job_entry_pointproject_dirr   job_job_artifactr   	Exceptionwandbtermwarnget_env_vars_dict_apir   	__class____name__itemsshlexquotecommandoverride_argsjoinstripr
   termlogr   wait)selfr   argskwargs_msgsynchronousentry_pointcmdenv_varsenv_key	env_valuecommand_strrun r:   Y/home/ubuntu/.local/lib/python3.10/site-packages/wandb/sdk/launch/runner/local_process.pyr9   !   sL   



"


zLocalProcessRunner.runN)r   r   r   r   )r$   
__module____qualname____doc__r9   r:   r:   r:   r;   r      s    r   )
__future__r   loggingr&   typingr   r   _project_specr   errorsr   utilsr   r   r	   r
   r   abstractr   r   local_containerr   	getLoggerr$   r   r   r:   r:   r:   r;   <module>   s    
