Skip to content

Commit

Permalink
Disable more potential unattended upgrade sources for AWS (#4246)
Browse files Browse the repository at this point in the history
* Fix AWS unattended upgrade issue

* more commands

* add retry and disable all unattended

* remove retry

* disable unattended upgrades and add retry in aws default image
  • Loading branch information
yika-luo authored Nov 4, 2024
1 parent 65efcd0 commit 47e5151
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sky/clouds/service_catalog/images/aws_utils/image_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def copy_image_and_make_public(target_region):
copy_command = (
f"aws ec2 copy-image --source-region {args.region} "
f"--source-image-id {args.image_id} --region {target_region} "
f"--name 'skypilot-aws-{args.processor}-{args.os_type}-{time.time()}' --output json"
f"--name 'skypilot-aws-{args.processor}-{args.os_type}-{time.strftime('%y%m%d')}' --output json"
)
print(copy_command)
result = subprocess.run(copy_command,
Expand Down
5 changes: 5 additions & 0 deletions sky/clouds/service_catalog/images/provisioners/skypilot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
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 systemctl stop apt-daily.timer apt-daily-upgrade.timer unattended-upgrades.service
sudo systemctl disable apt-daily.timer apt-daily-upgrade.timer unattended-upgrades.service
sudo systemctl mask apt-daily.service apt-daily-upgrade.service unattended-upgrades.service
sudo systemctl daemon-reload

# Configure dpkg
sudo dpkg --configure --force-overwrite -a

# Apt-get installs
sudo apt-get install jq -y
sudo apt install retry

# Create necessary directories
mkdir -p ~/sky_workdir
Expand Down
4 changes: 4 additions & 0 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

0 comments on commit 47e5151

Please sign in to comment.