Skip to content

Commit

Permalink
[AWS] Faster cloud-init for disabling unattended-upgrade (#1954)
Browse files Browse the repository at this point in the history
* faster cloud-init

* use write files instead
  • Loading branch information
Michaelvll authored May 12, 2023
1 parent 62c2e52 commit 54494d6
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions sky/templates/aws-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ available_node_types:
# Reference: https://cloudinit.readthedocs.io/en/latest/reference/modules.html#users-and-groups
# The bootcmd is to disable automatic APT updates, to avoid the lock
# when user call `apt install` on the node.
# Reference: https://unix.stackexchange.com/a/471192
# Reference: https://askubuntu.com/questions/1322292/how-do-i-turn-off-automatic-updates-completely-and-for-real
UserData: |
#cloud-config
users:
Expand All @@ -75,10 +75,16 @@ available_node_types:
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- skypilot:ssh_public_key_content
bootcmd:
- echo 'APT::Periodic::Enable "0";' > /etc/apt/apt.conf.d/10cloudinit-disable
- apt-get -y purge update-notifier-common ubuntu-release-upgrader-core landscape-common unattended-upgrades
- echo "Removed APT" | systemd-cat
write_files:
- path: /etc/apt/apt.conf.d/20auto-upgrades
content: |
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "0";
- path: /etc/apt/apt.conf.d/10cloudinit-disable
content: |
APT::Periodic::Enable "0";
TagSpecifications:
- ResourceType: instance
Tags:
Expand Down Expand Up @@ -116,10 +122,16 @@ available_node_types:
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- skypilot:ssh_public_key_content
bootcmd:
- echo 'APT::Periodic::Enable "0";' > /etc/apt/apt.conf.d/10cloudinit-disable
- apt-get -y purge update-notifier-common ubuntu-release-upgrader-core landscape-common unattended-upgrades
- echo "Removed APT" | systemd-cat
write_files:
- path: /etc/apt/apt.conf.d/20auto-upgrades
content: |
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "0";
- path: /etc/apt/apt.conf.d/10cloudinit-disable
content: |
APT::Periodic::Enable "0";
TagSpecifications:
- ResourceType: instance
Tags:
Expand Down

0 comments on commit 54494d6

Please sign in to comment.