Skip to content
Merged
Show file tree
Hide file tree
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
41 changes: 41 additions & 0 deletions .github/workflows/test-disable-network-offload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test disable-network-offload

on:
pull_request:
paths:
- "disable-network-offload/**"
- ".github/workflows/test-disable-network-offload.yml"
push:
branches: [main]
paths:
- "disable-network-offload/**"
- ".github/workflows/test-disable-network-offload.yml"

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- name: Disable network offload
uses: ./disable-network-offload

- name: Check that TX and RX checksum offload are off
run: |
iface="$(ip -o route show default | awk '{print $5; exit}')"
features="$(ethtool -k "$iface")"
echo "$features"
failed=0
for feature in rx-checksumming tx-checksumming; do
if ! grep -Eq "^${feature}: off" <<<"$features"; then
echo "::error::Expected ${feature} to be off on ${iface}."
failed=1
fi
done
exit "$failed"
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ Inputs: `version`, `cache`, `cache-restore-only`, `cache-name`.
Outputs: `version`, `home`, `cache-dir`.
See [`poetry/action.yml`](poetry/action.yml) for the full schema.

### `disable-network-offload`

Turns off TX and RX checksum offload on the runner's network interface. This
works around network failures in Docker builds on GitHub-hosted runners (see
[actions/runner-images#1187](https://github.com/actions/runner-images/issues/1187#issuecomment-686735760)).

The action finds the interface from the default route, so it does not depend on
the interface name (for example, `eth0`). It prints the interface list first, to
help debug failures. It fails with a clear error if there is no default route.

```yaml
- name: Disable network offload
uses: ThePalaceProject/github-actions/disable-network-offload@v1
```

No inputs or outputs. Use it only on GitHub-hosted Linux runners. It uses `ip`,
`ethtool`, and `sudo`. It also expects the default route to have a gateway
(`default via <gateway> dev <interface>`), as GitHub-hosted runners do.

### `jira-release-sync`

On a published GitHub release, creates a matching Jira version, links the
Expand Down
21 changes: 21 additions & 0 deletions disable-network-offload/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Disable network offload'
description: 'Turn off TX and RX checksum offload on the runner network interface'

# See comment here: https://github.com/actions/runner-images/issues/1187#issuecomment-686735760
# Do not hard-code eth0. Some runner images may give the network interface a different name,
# so use the interface on the default route. The interface list helps debug failures.
# Use this action only on GitHub-hosted runners. The awk field number expects a default
# route with a gateway ("default via <gateway> dev <interface>").
runs:
using: "composite"
steps:
- run: |
ip -o link
iface="$(ip -o route show default | awk '{print $5; exit}')"
if [ -z "$iface" ]; then
echo "::error::No network interface found on the default route."
exit 1
fi
echo "Using interface: $iface"
sudo ethtool -K "$iface" tx off rx off
shell: bash