From b53131e18d70562bf84b3304901361480cc545f4 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Wed, 8 May 2024 07:48:09 +0000 Subject: [PATCH] fix source bashrc for run --- sky/backends/cloud_vm_ray_backend.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sky/backends/cloud_vm_ray_backend.py b/sky/backends/cloud_vm_ray_backend.py index e3ebbd94f5b..d53d6f3dea9 100644 --- a/sky/backends/cloud_vm_ray_backend.py +++ b/sky/backends/cloud_vm_ray_backend.py @@ -3287,7 +3287,8 @@ def _exec_code_on_head( returncode, stdout, stderr = self.run_on_head(handle, job_submit_cmd, stream_logs=False, - require_outputs=True) + require_outputs=True, + source_bashrc=True) # Happens when someone calls `sky exec` but remote is outdated # necessitating calling `sky launch`. @@ -4233,6 +4234,9 @@ def run_on_head( process_stream: Whether to post-process the stdout/stderr of the command, such as replacing or skipping lines on the fly. If enabled, lines are printed only when '\r' or '\n' is found. + source_bashrc: Whether to source bashrc when running on the command + on the VM. If it is a user-related commands, it would always be + good to source bashrc to make sure the env vars are set. Returns: returncode