Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ phases:
*) echo "Unsupported OS: $RELEASE" && exit {{ FailExitCode }} ;;
esac

# Disable snap refresh to prevent background updates during build (Ubuntu only)
- name: DisableSnapRefresh
action: ExecuteBash
inputs:
commands:
- |
set -x
OS="{{ build.OperatingSystemName.outputs.stdout }}"
if [[ $OS =~ ^ubuntu ]]; then
# Wait for any in-progress snap operations to complete, then stop and disable
snap watch --last=auto-refresh 2>/dev/null || true
systemctl stop snapd.refresh.timer
systemctl disable snapd.refresh.timer
fi

# Initialize system information and URLs
- name: SystemInfo
action: ExecuteBash
Expand Down Expand Up @@ -260,6 +275,12 @@ phases:
echo "SSM agent is installed by default"
fi

# Re-enable snap refresh timer (Ubuntu only)
if [[ $OS =~ ^ubuntu ]]; then
systemctl enable snapd.refresh.timer
systemctl start snapd.refresh.timer
fi

# Final cleanup
rm -f /opt/parallelcluster/system_info
/usr/local/sbin/ami_cleanup.sh "${CfnParamIsOfficialAmiBuild}"
Expand Down
Loading