fix(ci): switch apt mirror per runner — azure on github-hosted, kernel.org on self-hosted

Self-hosted runners (arc-runner-set, bigger-runner) cannot reach
azure.archive.ubuntu.com — they live in different networks (e.g. our
arc-runner-set Kubernetes cluster) where Azure's mirror IP is not
routable. Symptom: "Connection failed [IP: 51.11.236.225 80]" with each
Ign:/Err: cycle taking 60s, hanging the build for ~16 minutes before
exit 100.

Pick the mirror based on `runner.environment`:

  * github-hosted (ubuntu-latest, ubuntu-24.04-arm) → Azure
    (http://azure.archive.ubuntu.com / http://azure.ports.ubuntu.com)
    — same VPC as the runner.
  * self-hosted (arc-runner-set, bigger-runner)    → kernel.org
    (https://mirrors.edge.kernel.org for both archive and ports)
    — publicly reachable from any network.

The choice now lives in one place: the .github/actions/configure-apt-mirror
composite action exposes `effective-mirror` / `effective-ports-mirror`
outputs so the reusable workflows can forward the same value as Docker
build-args without duplicating the per-runner-environment branch.

The now-redundant `apt-mirror` / `apt-ports-mirror` workflow inputs on
image_build.yml and backend_build.yml are dropped — defaults live in the
composite action and are visible there.

Assisted-by: Claude:claude-opus-4-7[1m] [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto
2026-05-03 22:54:51 +00:00
parent 8edac61e57
commit 50580a84ae
3 changed files with 69 additions and 51 deletions

View File

@@ -63,16 +63,6 @@ on:
required: false
default: ''
type: string
apt-mirror:
description: 'Replacement URL for archive.ubuntu.com / security.ubuntu.com (empty = use upstream)'
required: false
default: 'http://azure.archive.ubuntu.com'
type: string
apt-ports-mirror:
description: 'Replacement URL for ports.ubuntu.com (arm64 etc., empty = use upstream)'
required: false
default: 'http://azure.ports.ubuntu.com'
type: string
secrets:
dockerUsername:
required: false
@@ -96,10 +86,8 @@ jobs:
submodules: true
- name: Configure apt mirror on runner
id: apt_mirror
uses: ./.github/actions/configure-apt-mirror
with:
mirror: ${{ inputs.apt-mirror }}
ports-mirror: ${{ inputs.apt-ports-mirror }}
- name: Free Disk Space (Ubuntu)
if: inputs.runs-on == 'ubuntu-latest'
@@ -237,8 +225,8 @@ jobs:
BACKEND=${{ inputs.backend }}
UBUNTU_VERSION=${{ inputs.ubuntu-version }}
AMDGPU_TARGETS=${{ inputs.amdgpu-targets }}
APT_MIRROR=${{ inputs.apt-mirror }}
APT_PORTS_MIRROR=${{ inputs.apt-ports-mirror }}
APT_MIRROR=${{ steps.apt_mirror.outputs.effective-mirror }}
APT_PORTS_MIRROR=${{ steps.apt_mirror.outputs.effective-ports-mirror }}
DEPS_REFRESH=${{ steps.deps_refresh.outputs.key }}
context: ${{ inputs.context }}
file: ${{ inputs.dockerfile }}
@@ -263,8 +251,8 @@ jobs:
BACKEND=${{ inputs.backend }}
UBUNTU_VERSION=${{ inputs.ubuntu-version }}
AMDGPU_TARGETS=${{ inputs.amdgpu-targets }}
APT_MIRROR=${{ inputs.apt-mirror }}
APT_PORTS_MIRROR=${{ inputs.apt-ports-mirror }}
APT_MIRROR=${{ steps.apt_mirror.outputs.effective-mirror }}
APT_PORTS_MIRROR=${{ steps.apt_mirror.outputs.effective-ports-mirror }}
DEPS_REFRESH=${{ steps.deps_refresh.outputs.key }}
context: ${{ inputs.context }}
file: ${{ inputs.dockerfile }}

View File

@@ -56,16 +56,6 @@ on:
required: false
default: 'noble'
type: string
apt-mirror:
description: 'Replacement URL for archive.ubuntu.com / security.ubuntu.com (empty = use upstream)'
required: false
default: 'http://azure.archive.ubuntu.com'
type: string
apt-ports-mirror:
description: 'Replacement URL for ports.ubuntu.com (arm64 etc., empty = use upstream)'
required: false
default: 'http://azure.ports.ubuntu.com'
type: string
secrets:
dockerUsername:
required: true
@@ -84,10 +74,8 @@ jobs:
uses: actions/checkout@v6
- name: Configure apt mirror on runner
id: apt_mirror
uses: ./.github/actions/configure-apt-mirror
with:
mirror: ${{ inputs.apt-mirror }}
ports-mirror: ${{ inputs.apt-ports-mirror }}
- name: Free Disk Space (Ubuntu)
if: inputs.runs-on == 'ubuntu-latest'
@@ -214,8 +202,8 @@ jobs:
SKIP_DRIVERS=${{ inputs.skip-drivers }}
UBUNTU_VERSION=${{ inputs.ubuntu-version }}
UBUNTU_CODENAME=${{ inputs.ubuntu-codename }}
APT_MIRROR=${{ inputs.apt-mirror }}
APT_PORTS_MIRROR=${{ inputs.apt-ports-mirror }}
APT_MIRROR=${{ steps.apt_mirror.outputs.effective-mirror }}
APT_PORTS_MIRROR=${{ steps.apt_mirror.outputs.effective-ports-mirror }}
context: .
file: ./Dockerfile
cache-from: type=registry,ref=quay.io/go-skynet/ci-cache:cache-localai${{ inputs.tag-suffix }}
@@ -239,8 +227,8 @@ jobs:
SKIP_DRIVERS=${{ inputs.skip-drivers }}
UBUNTU_VERSION=${{ inputs.ubuntu-version }}
UBUNTU_CODENAME=${{ inputs.ubuntu-codename }}
APT_MIRROR=${{ inputs.apt-mirror }}
APT_PORTS_MIRROR=${{ inputs.apt-ports-mirror }}
APT_MIRROR=${{ steps.apt_mirror.outputs.effective-mirror }}
APT_PORTS_MIRROR=${{ steps.apt_mirror.outputs.effective-ports-mirror }}
context: .
file: ./Dockerfile
cache-from: type=registry,ref=quay.io/go-skynet/ci-cache:cache-localai${{ inputs.tag-suffix }}