LocalAI/.github
Ettore Di Giacinto 8edac61e57
feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650)
* feat(ci): allow routing apt traffic through an alternate Ubuntu mirror

Adds opt-in APT_MIRROR / APT_PORTS_MIRROR knobs to all Dockerfiles, the
Makefile, and CI workflows so we can fail over to a non-canonical Ubuntu
mirror when archive.ubuntu.com / security.ubuntu.com / ports.ubuntu.com
are degraded (recently observed: multi-day DDoS against the default pool).

Defaults are empty everywhere — behavior is unchanged unless a mirror is
configured. To enable in CI, set the repo-level GitHub Actions variables
APT_MIRROR (and APT_PORTS_MIRROR for arm64 builds). Locally:
    make docker APT_MIRROR=http://azure.archive.ubuntu.com

A small POSIX-sh helper in .docker/apt-mirror.sh rewrites both DEB822
(/etc/apt/sources.list.d/ubuntu.sources, Ubuntu 24.04+) and the legacy
/etc/apt/sources.list before the first apt-get update. Dockerfile stages
load it via RUN --mount=type=bind, so there is no extra layer and no
cache invalidation when the script is unchanged. Reusable workflows also
rewrite the runner's own /etc/apt sources before any sudo apt-get call.

Assisted-by: Claude:claude-opus-4-7[1m] [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* ci(apt-mirror): default to the Azure mirror, visible in the workflow source

Bakes Azure (http://azure.archive.ubuntu.com / http://azure.ports.ubuntu.com)
in as the default for both Docker builds and runner-side apt — rather than
hiding the URL behind a GitHub Actions repo variable that's not visible
from the source tree.

A new composite action at .github/actions/configure-apt-mirror is the
single source of truth for runner-side rewrites. Five standalone
workflows (build-test, release, tests-e2e, tests-ui-e2e, update_swagger)
just `uses: ./.github/actions/configure-apt-mirror`.

Three workflows (image_build, backend_build, checksum_checker) keep an
inline bash rewrite, because they install/upgrade git via apt *before*
the checkout step (so the local composite action isn't loadable yet).
The Azure URL is visible in those files too.

The `apt-mirror` / `apt-ports-mirror` inputs of the reusable workflows
keep their now-Azure defaults — they still feed the Docker build-args
block in addition to the inline runner-side rewrite. Callers (image.yml,
image-pr.yml, backend.yml, backend_pr.yml) drop the previous
`vars.APT_MIRROR` plumbing and rely on those defaults.

Assisted-by: Claude:claude-opus-4-7[1m] [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* ci(apt-mirror): drop Force Install GIT, consolidate on the composite action

The PPA git upgrade ran add-apt-repository ppa:git-core/ppa, which talks
to api.launchpad.net — also part of Canonical's infrastructure and
currently returning HTTP 504. The Azure mirror only covers
archive.ubuntu.com / security.ubuntu.com / ports.ubuntu.com, not PPAs.

The system git that ubuntu-latest already ships is sufficient for
actions/checkout and the build pipeline, so just drop the upgrade. With
that gone, the apt-before-checkout constraint disappears too — all three
holdouts (image_build, backend_build, checksum_checker) can now switch
to ./.github/actions/configure-apt-mirror like the other five.

Net: 0 inline apt-mirror blocks, all 8 workflows route through the
composite action.

Assisted-by: Claude:claude-opus-4-7[1m] [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
2026-05-03 23:50:13 +02:00
..
actions/configure-apt-mirror feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
ci fix: roll out bluemonday Sanitize more widely (#3794) 2024-10-12 09:45:47 +02:00
gallery-agent fix(ci): switch gallery-agent to sigs.k8s.io/yaml (#9397) 2026-04-17 10:10:42 +02:00
ISSUE_TEMPLATE docs/examples: enhancements (#1572) 2024-01-18 19:41:08 +01:00
workflows feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
bump_deps.sh feat: do not bundle llama-cpp anymore (#5790) 2025-07-18 13:24:12 +02:00
bump_docs.sh fix: github bump_docs.sh regex to drop emoji and other text (#2180) 2024-04-29 03:55:29 +00:00
bump_vllm_wheel.sh feat(vllm): expose AsyncEngineArgs via generic engine_args YAML map (#9563) 2026-04-29 00:49:28 +02:00
check_and_update.py fix(ci): fixup checksum scanning pipeline (#3631) 2024-09-23 10:56:10 +02:00
checksum_checker.sh fix(ci): fixup correct path for check_and_update.py (#2777) 2024-07-11 23:05:43 +02:00
dependabot.yml feat: Add backend gallery (#5607) 2025-06-15 14:56:52 +02:00
FUNDING.yml Create FUNDING.yml (#725) 2023-07-09 13:39:00 +02:00
labeler.yml chore(ci): update labels 2025-02-13 09:58:19 +01:00
PULL_REQUEST_TEMPLATE.md feat(vllm): Allow to set quantization (#1094) 2023-09-22 15:52:38 +02:00
release.yml feat(p2p): Federation and AI swarms (#2723) 2024-07-08 22:04:06 +02:00
stale.yml feat: add PR template and stale configuration (#316) 2023-05-20 09:10:20 +02:00