diff --git a/sky/templates/jobs-controller.yaml.j2 b/sky/templates/jobs-controller.yaml.j2 index 71c808fdd0f..f18582421e5 100644 --- a/sky/templates/jobs-controller.yaml.j2 +++ b/sky/templates/jobs-controller.yaml.j2 @@ -21,9 +21,9 @@ setup: | {{cmd}} {%- endfor %} - {% if is_dev %} - # Internal: disable logging for manually logging into the jobs controller for debugging. - echo 'export SKYPILOT_DEV=1' >> ~/.bashrc + {% if controller_envs.get("SKYPILOT_DEV") %} + grep -q "export SKYPILOT_DEV=" ~/.bashrc || echo 'export SKYPILOT_DEV=1' >> ~/.bashrc + grep -q "alias sky-env=" ~/.bashrc || echo 'alias sky-env="{{ sky_activate_python_env }}"' >> ~/.bashrc {% endif %} # Create systemd service file diff --git a/sky/templates/sky-serve-controller.yaml.j2 b/sky/templates/sky-serve-controller.yaml.j2 index 507a6e3a325..48854ed57f5 100644 --- a/sky/templates/sky-serve-controller.yaml.j2 +++ b/sky/templates/sky-serve-controller.yaml.j2 @@ -15,6 +15,11 @@ setup: | {{cmd}} {%- endfor %} + {% if controller_envs.get("SKYPILOT_DEV") %} + grep -q "export SKYPILOT_DEV=" ~/.bashrc || echo 'export SKYPILOT_DEV=1' >> ~/.bashrc + grep -q "alias sky-env=" ~/.bashrc || echo 'alias sky-env="{{ sky_activate_python_env }}"' >> ~/.bashrc + {% endif %} + # Install serve dependencies. # TODO(tian): Gather those into serve constants. pip list | grep uvicorn > /dev/null 2>&1 || pip install uvicorn > /dev/null 2>&1