Skip to content

Commit 482a813

Browse files
committed
feat: add GitHub Actions network tuning to fix CI connectivity issues
- Add smorimoto/tune-github-hosted-runner-network action to E2E and LXD test workflows - Fix intermittent network connectivity problems in GitHub Actions runners - Address Docker GPG key download failures and apt repository timeouts - Update documentation with comprehensive CI network troubleshooting guide - Reference specific GitHub issues #1187 and #2890 for transparency - All linters pass and documentation follows project standards This should resolve the persistent 'Network is unreachable' errors in CI runs.
1 parent 6fd7f30 commit 482a813

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

.github/workflows/test-e2e.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: E2E Tests
33
# NOTE: This workflow uses CI-specific approaches like 'sudo chmod 666' on the LXD socket
44
# and 'sudo' with LXD commands. These approaches are NOT recommended for local development.
55
# For local use, follow the proper group membership approach documented in templates/tofu/lxd/README.md
6+
#
7+
# NETWORK TUNING: We use smorimoto/tune-github-hosted-runner-network to fix flaky networking
8+
# issues that cause Docker GPG key downloads to fail intermittently in GitHub Actions.
9+
# See: https://github.com/actions/runner-images/issues/1187 and https://github.com/actions/runner-images/issues/2890
610

711
on:
812
push:
@@ -20,6 +24,9 @@ jobs:
2024
- name: Checkout repository
2125
uses: actions/checkout@v4
2226

27+
- name: Tune GitHub-hosted runner network
28+
uses: smorimoto/tune-github-hosted-runner-network@v1
29+
2330
- name: Setup Rust toolchain
2431
uses: dtolnay/rust-toolchain@stable
2532
with:

.github/workflows/test-lxd-provision.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Test LXD Container Provisioning
33
# NOTE: This workflow uses CI-specific approaches like 'sudo chmod 666' on the LXD socket
44
# and 'sudo' with LXD commands. These approaches are NOT recommended for local development.
55
# For local use, follow the proper group membership approach documented in templates/tofu/lxd/README.md
6+
#
7+
# NETWORK TUNING: We use smorimoto/tune-github-hosted-runner-network to fix flaky networking
8+
# issues that may affect container provisioning in GitHub Actions.
9+
# See: https://github.com/actions/runner-images/issues/1187
610

711
on:
812
push:
@@ -20,6 +24,9 @@ jobs:
2024
- name: Checkout repository
2125
uses: actions/checkout@v4
2226

27+
- name: Tune GitHub-hosted runner network
28+
uses: smorimoto/tune-github-hosted-runner-network@v1
29+
2330
- name: Install and configure LXD
2431
run: ./scripts/setup/install-lxd-ci.sh
2532

docs/e2e-testing.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,31 @@ tofu destroy -auto-approve
127127
- **SSH connectivity failures**: Usually means cloud-init is still running or SSH configuration failed
128128
- **Ansible connection errors**: Check if the container IP is accessible and SSH key permissions are correct
129129
- **OpenTofu errors**: Ensure LXD is properly configured and you have sufficient privileges
130+
- **Network connectivity issues in CI**: See [CI Network Issues](#ci-network-issues) section below
131+
132+
### CI Network Issues
133+
134+
GitHub Actions runners sometimes experience intermittent network connectivity problems that can cause:
135+
136+
- Docker GPG key downloads to fail (`Network is unreachable` errors)
137+
- Package repository access timeouts
138+
- Generally flaky network behavior
139+
140+
**Root Cause**: This is a known issue with GitHub-hosted runners running in Azure:
141+
142+
- [GitHub Issue #1187](https://github.com/actions/runner-images/issues/1187) - Original networking issue
143+
- [GitHub Issue #2890](https://github.com/actions/runner-images/issues/2890) - Specific apt repository timeout issues
144+
145+
**Solution**: We use the [`smorimoto/tune-github-hosted-runner-network`](https://github.com/marketplace/actions/tune-github-hosted-runner-network) action to disable TCP/UDP offload and fix these networking issues.
146+
147+
**Implementation**: The action is automatically added to CI workflows and runs before any network-dependent operations.
148+
149+
**Playbook Adaptations**: Our Ansible playbooks also include:
150+
151+
- CI environment detection
152+
- Adaptive retry strategies with longer timeouts in CI
153+
- Graceful handling of network failures
154+
- Fallback installation methods when needed
130155

131156
### Debug Mode
132157

project-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ rustflags
3333
rustup
3434
serde
3535
shellcheck
36+
smorimoto
3637
subshell
3738
sysfs
3839
Taplo

0 commit comments

Comments
 (0)