LocalAI/.github/workflows
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
..
disabled chore(ci): disable CI actions 2026-03-02 14:48:00 +01:00
backend.yml fix(ci): fix AMDGPU_TARGETS empty-string bypass in hipblas builds (#9626) 2026-05-02 15:53:14 +02:00
backend_build.yml feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
backend_build_darwin.yml ci(darwin): add native caches to backend_build_darwin 2026-04-27 20:17:36 +00:00
backend_pr.yml fix(ci): fix AMDGPU_TARGETS empty-string bypass in hipblas builds (#9626) 2026-05-02 15:53:14 +02:00
build-test.yaml feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
bump-inference-defaults.yml chore(deps): bump peter-evans/create-pull-request from 7 to 8 (#9114) 2026-03-24 08:50:50 +01:00
bump_deps.yaml feat(vllm): expose AsyncEngineArgs via generic engine_args YAML map (#9563) 2026-04-29 00:49:28 +02:00
bump_docs.yaml fix(api)!: Stop model prior to deletion (#8422) 2026-02-06 09:22:10 +01:00
checksum_checker.yaml feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
deploy-explorer.yaml fix(api)!: Stop model prior to deletion (#8422) 2026-02-06 09:22:10 +01:00
gallery-agent.yaml Change cron schedule to run every 12 hours 2026-04-25 18:38:28 +02:00
generate_intel_image.yaml [intel GPU support] Use latest oneapi-basekit image for Intel images to support b70 (#9543) 2026-04-24 18:29:10 +02:00
gh-pages.yml chore(deps): bump actions/upload-pages-artifact from 4 to 5 (#9337) 2026-04-13 21:53:47 +02:00
image-pr.yml ci: switch image/backend build cache to a dedicated registry image 2026-04-27 13:13:04 +00:00
image.yml ci: switch image/backend build cache to a dedicated registry image 2026-04-27 13:13:04 +00:00
image_build.yml feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
lint.yml chore: add golangci-lint with new-from-merge-base baseline (#9603) 2026-04-28 22:07:44 +02:00
notify-releases.yaml fix(api)!: Stop model prior to deletion (#8422) 2026-02-06 09:22:10 +01:00
release.yaml feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
secscan.yaml Revert "chore(deps): bump securego/gosec from 2.22.9 to 2.22.11" (#7789) 2025-12-30 09:58:13 +01:00
stalebot.yml chore(deps): bump actions/stale from 10.1.1 to 10.2.0 (#8633) 2026-02-23 23:27:20 +01:00
test-extra.yml feat(vibevoice-cpp): add purego TTS+ASR backend (#9610) 2026-04-29 22:22:14 +02:00
test.yml refactor(tests): split app_test.go, move real-backend coverage to e2e-backends 2026-04-27 23:09:20 +00:00
tests-aio.yml refactor(tests): split app_test.go, move real-backend coverage to e2e-backends 2026-04-27 23:09:20 +00:00
tests-e2e.yml feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
tests-ui-e2e.yml feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
update_swagger.yaml feat(ci): allow routing apt traffic through an alternate Ubuntu mirror (#9650) 2026-05-03 23:50:13 +02:00
yaml-check.yml chore(backend gallery): add description for remaining backends (#5679) 2025-06-17 22:21:44 +02:00