Skip to content

Commit

Permalink
[k8s] Nimbus backward compatibility (#4400)
Browse files Browse the repository at this point in the history
* Add nimbus backward compatibility

* add uv backcompat

* add uv backcompat

* add uv backcompat

* lint

* merge

* merge
  • Loading branch information
romilbhardwaj authored Nov 23, 2024
1 parent 07f7a15 commit 44625e0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions sky/templates/kubernetes-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 44625e0

Please sign in to comment.