From 44625e0e62b70e052072851129507a06ff60636d Mon Sep 17 00:00:00 2001 From: Romil Bhardwaj Date: Sat, 23 Nov 2024 15:05:22 -0800 Subject: [PATCH] [k8s] Nimbus backward compatibility (#4400) * Add nimbus backward compatibility * add uv backcompat * add uv backcompat * add uv backcompat * lint * merge * merge --- sky/templates/kubernetes-ray.yml.j2 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sky/templates/kubernetes-ray.yml.j2 b/sky/templates/kubernetes-ray.yml.j2 index 6706bbafa8f..450cac0d81c 100644 --- a/sky/templates/kubernetes-ray.yml.j2 +++ b/sky/templates/kubernetes-ray.yml.j2 @@ -327,6 +327,13 @@ available_node_types: command: ["/bin/bash", "-c", "--"] args: - | + # For backwards compatibility, we put a marker file in the pod + # to indicate that the pod is running with the changes introduced + # in project nimbus: https://github.com/skypilot-org/skypilot/pull/4393 + # TODO: Remove this marker file and it's usage in setup_commands + # after v0.10.0 release. + touch /tmp/skypilot_is_nimbus + # Helper function to conditionally use sudo # TODO(zhwu): consolidate the two prefix_cmd and sudo replacements prefix_cmd() { if [ $(id -u) -ne 0 ]; then echo "sudo"; else echo ""; fi; } @@ -575,9 +582,12 @@ setup_commands: STEPS=("apt-ssh-setup" "runtime-setup" "env-setup") start_epoch=$(date +%s); echo "=== Logs for asynchronous ray and skypilot installation ==="; - [ -f /tmp/ray_skypilot_installation_complete ] && cat /tmp/${STEPS[1]}.log || - { tail -f -n +1 /tmp/${STEPS[1]}.log & TAIL_PID=$!; echo "Tail PID: $TAIL_PID"; until [ -f /tmp/ray_skypilot_installation_complete ]; do sleep 0.5; done; kill $TAIL_PID || true; }; - [ -f /tmp/${STEPS[1]}.failed ] && { echo "Error: ${STEPS[1]} failed. Exiting."; exit 1; } || true; + if [ -f /tmp/skypilot_is_nimbus ]; then + echo "=== Logs for asynchronous ray and skypilot installation ==="; + [ -f /tmp/ray_skypilot_installation_complete ] && cat /tmp/${STEPS[1]}.log || + { tail -f -n +1 /tmp/${STEPS[1]}.log & TAIL_PID=$!; echo "Tail PID: $TAIL_PID"; until [ -f /tmp/ray_skypilot_installation_complete ]; do sleep 0.5; done; kill $TAIL_PID || true; }; + [ -f /tmp/${STEPS[1]}.failed ] && { echo "Error: ${STEPS[1]} failed. Exiting."; exit 1; } || true; + fi end_epoch=$(date +%s); echo "=== Ray and skypilot dependencies installation completed in $(($end_epoch - $start_epoch)) secs ==="; start_epoch=$(date +%s);