From f013073dd8a0f5ca3194161b31f1c22c117d992c Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Thu, 7 Nov 2024 14:13:31 -0800 Subject: [PATCH] [UX] Improve Formatting of Post Job Creation Logs (#4198) * Update cloud_vm_ray_backend.py * Update cloud_vm_ray_backend.py * format --- sky/backends/cloud_vm_ray_backend.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sky/backends/cloud_vm_ray_backend.py b/sky/backends/cloud_vm_ray_backend.py index acc218a8b6d..68d9bfecfb0 100644 --- a/sky/backends/cloud_vm_ray_backend.py +++ b/sky/backends/cloud_vm_ray_backend.py @@ -3262,6 +3262,7 @@ def _exec_code_on_head( ) -> None: """Executes generated code on the head node.""" style = colorama.Style + fore = colorama.Fore script_path = os.path.join(SKY_REMOTE_APP_DIR, f'sky_job_{job_id}') remote_log_dir = self.log_dir @@ -3373,9 +3374,9 @@ def _dump_code_to_file(codegen: str) -> None: controller = controller_utils.Controllers.from_name(name) if controller == controller_utils.Controllers.JOBS_CONTROLLER: logger.info( - f'\nšŸ“‹ Useful Commands' - f'\nManaged Job ID: ' + f'\n{fore.CYAN}Managed Job ID: ' f'{style.BRIGHT}{job_id}{style.RESET_ALL}' + f'\nšŸ“‹ Useful Commands' f'\n{ux_utils.INDENT_SYMBOL}To cancel the job:\t\t\t' f'{ux_utils.BOLD}sky jobs cancel {job_id}' f'{ux_utils.RESET_BOLD}' @@ -3392,8 +3393,9 @@ def _dump_code_to_file(codegen: str) -> None: f'dashboard:\t{ux_utils.BOLD}sky jobs dashboard' f'{ux_utils.RESET_BOLD}') elif controller is None: - logger.info(f'\nšŸ“‹ Useful Commands' - f'\nJob ID: {job_id}' + logger.info(f'\n{fore.CYAN}Job ID: ' + f'{style.BRIGHT}{job_id}{style.RESET_ALL}' + f'\nšŸ“‹ Useful Commands' f'\n{ux_utils.INDENT_SYMBOL}To cancel the job:\t\t' f'{ux_utils.BOLD}sky cancel {name} {job_id}' f'{ux_utils.RESET_BOLD}'