Skip to content

Commit 5837c69

Browse files
committed
Bypass stalled Azure APT mirror downloads
Remove `azure.archive.ubuntu.com` from the runner mirror list before APT operations to avoid stalled downloads reported upstream [1]. Preserve the remaining mirrors and skip runners without `/etc/apt/apt-mirrors.txt`. Enable the workaround by default, add the opt-out input `enable_workaround_azure_mirror`, and document its behavior in `README.md`. [1] actions/runner-images#14823
1 parent 8f16a5f commit 5837c69

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
# devstack-actions
44
Github actions which will install OpenStack with devstack.
55

6+
## Azure APT mirror workaround
7+
8+
By default, the action removes `azure.archive.ubuntu.com` entries from
9+
`/etc/apt/apt-mirrors.txt` before its first APT operation to avoid stalled
10+
package downloads. Other mirrors and their priorities are preserved. If the
11+
mirror-list file does not exist, the workaround is skipped. APT sources that
12+
reference the Azure mirror directly are not changed.
13+
14+
Set `enable_workaround_azure_mirror: 'false'` in the step's `with:` block to
15+
disable the workaround.
16+
17+
## Usage
18+
619
Example of Github Action step:
720

821
With defaults:

‎action.yaml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ inputs:
1313
log_dir:
1414
description: 'Directory for logs'
1515
default: '/tmp/devstack-logs'
16+
enable_workaround_azure_mirror:
17+
description: 'Enable or disable workaround for stalled Azure APT mirror downloads'
18+
default: 'true'
1619
enable_workaround_docker_io:
1720
description: 'Enable or disable workaround for docker.io'
1821
default: 'true'
@@ -25,6 +28,18 @@ runs:
2528
- name: Install python pip
2629
run: python3 -m pip install --upgrade pip
2730
shell: bash
31+
- name: Workaround for Azure APT mirror
32+
if: ${{ inputs.enable_workaround_azure_mirror == 'true' }}
33+
run: |
34+
# Slow Azure mirror downloads can exhaust the job timeout.
35+
# See https://github.com/actions/runner-images/issues/14823
36+
if [[ -f /etc/apt/apt-mirrors.txt ]]; then
37+
sudo sed -i '/azure\.archive\.ubuntu\.com/d' /etc/apt/apt-mirrors.txt
38+
cat /etc/apt/apt-mirrors.txt
39+
else
40+
echo "No APT mirror list found; skipping Azure mirror workaround."
41+
fi
42+
shell: bash
2843
- name: Update APT cache
2944
run: sudo apt-get update
3045
shell: bash

0 commit comments

Comments
 (0)