Skip to content

Commit

Permalink
[AWS] Get rid of credential files if `remote_identity: SERVICE_ACCOUN…
Browse files Browse the repository at this point in the history
…T` specified (skypilot-org#4395)

* syntax

* minor
  • Loading branch information
Michaelvll authored Nov 25, 2024
1 parent d576112 commit 5aeeedf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sky/templates/aws-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ setup_commands:
# Line 'sudo grep ..': set the number of threads per process to unlimited to avoid ray job submit stucking issue when the number of running ray jobs increase.
# Line 'mkdir -p ..': disable host key check
# Line 'python3 -c ..': patch the buggy ray files and enable `-o allow_other` option for `goofys`
# Line 'rm ~/.aws/credentials': explicitly remove the credentials file to be safe. This is to guard against the case where the credential files was uploaded once as `remote_identity` was not set in a previous launch.
- mkdir -p ~/.ssh; touch ~/.ssh/config;
{%- for initial_setup_command in initial_setup_commands %}
{{ initial_setup_command }}
Expand All @@ -185,7 +186,12 @@ setup_commands:
sudo grep -e '^DefaultTasksMax' /etc/systemd/system.conf || (sudo bash -c 'echo "DefaultTasksMax=infinity" >> /etc/systemd/system.conf'); sudo systemctl set-property user-$(id -u $(whoami)).slice TasksMax=infinity; sudo systemctl daemon-reload;
{%- endif %}
mkdir -p ~/.ssh; (grep -Pzo -q "Host \*\n StrictHostKeyChecking no" ~/.ssh/config) || printf "Host *\n StrictHostKeyChecking no\n" >> ~/.ssh/config;
[ -f /etc/fuse.conf ] && sudo sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf || (sudo sh -c 'echo "user_allow_other" > /etc/fuse.conf'); # This is needed for `-o allow_other` option for `goofys`;
[ -f /etc/fuse.conf ] && sudo sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf || (sudo sh -c 'echo "user_allow_other" > /etc/fuse.conf');
{%- if remote_identity != 'LOCAL_CREDENTIALS' %}
rm ~/.aws/credentials || true;
{%- endif %}



# Command to start ray clusters are now placed in `sky.provision.instance_setup`.
# We do not need to list it here anymore.

0 comments on commit 5aeeedf

Please sign in to comment.