Skip to content

Commit

Permalink
add retry and disable all unattended
Browse files Browse the repository at this point in the history
  • Loading branch information
yika-luo committed Nov 4, 2024
1 parent 535be8a commit 22b1742
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions sky/templates/aws-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ available_node_types:
- path: /etc/apt/apt.conf.d/10cloudinit-disable
content: |
APT::Periodic::Enable "0";
- path: /etc/apt/apt.conf.d/52unattended-upgrades-local
content: |
Unattended-Upgrade::DevRelease "false";
Unattended-Upgrade::Allowed-Origins {};
bootcmd:
- systemctl stop apt-daily.timer apt-daily-upgrade.timer unattended-upgrades.service
- systemctl disable apt-daily.timer apt-daily-upgrade.timer unattended-upgrades.service
Expand Down Expand Up @@ -178,15 +182,9 @@ setup_commands:
{{ ray_skypilot_installation_commands }}
sudo bash -c 'rm -rf /etc/security/limits.d; echo "* soft nofile 1048576" >> /etc/security/limits.conf; echo "* hard nofile 1048576" >> /etc/security/limits.conf';
{%- if docker_image is none %}
sudo systemctl stop unattended-upgrades || true;
sudo systemctl disable unattended-upgrades || true;
sudo sed -i 's/Unattended-Upgrade "1"/Unattended-Upgrade "0"/g' /etc/apt/apt.conf.d/20auto-upgrades || true;
sudo kill -9 `sudo lsof /var/lib/dpkg/lock-frontend | awk '{print $2}' | tail -n 1` || true;
sudo pkill -9 apt-get;
sudo pkill -9 dpkg;
sudo dpkg --configure -a;
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 %}
sudo apt install retry;
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`;

Expand Down

0 comments on commit 22b1742

Please sign in to comment.