Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
CI: bound CodeQL overlay-base cache churn, unstarve the cache janitor (#13704)
Daniel Hanad83778b0c3b
diff --git a/.github/workflows/cache-janitor.yml b/.github/workflows/cache-janitor.ymlindex 340c1ad571b..d76e84a62a8 100644--- a/.github/workflows/cache-janitor.yml+++ b/.github/workflows/cache-janitor.yml@@ -124,7 +124,13 @@ permissions:jobs:prune:name: Prune superseded caches- runs-on: ubuntu-latest+ # Not ubuntu-latest: that label's queue is what merge bursts fill, and on 2026-10-13/14 this+ # sweep waited 0.6 to 3.5 hours for it (one run took 6h15m end to end) while CodeQL kept+ # writing overlay bases, so the budget it guards ran out between sweeps. The arm label+ # started jobs in a median 1.3 minutes over the same window. The sweep is API-only (gh,+ # GNU date/awk/sed/sort), all present on the arm image. The account-wide job cap still+ # applies; this only stops the sweep waiting behind hundreds of ubuntu-latest jobs.+ runs-on: ubuntu-24.04-armtimeout-minutes: 20permissions:actions: writediff --git a/.github/workflows/ci-capacity.yml b/.github/workflows/ci-capacity.ymlindex 489eda7c7ac..e5d0e02ca71 100644--- a/.github/workflows/ci-capacity.yml+++ b/.github/workflows/ci-capacity.yml@@ -144,14 +144,16 @@ jobs:# Three limits on that floor. All are real, none is fixable here, and they# are the reason `pause` is not the default.#- # It needs a runner. This job asks for an ubuntu-24.04 hosted runner out of- # the same account-wide pool the sweeper exists to relieve, so under the- # saturation this file is written for, the guard queues with everything else.- # The true bound is MAX_DISABLED_MINUTES plus that wait, and on the numbers in- # the PR description the Linux wait has reached an hour. There is no- # self-hosted or otherwise independent capacity in this org to move it to, so- # read the limit as intent rather than a guarantee, and do not start a `pause`- # nobody is watching.+ # It needs a runner. This job asks for a hosted runner out of the same+ # account-wide pool the sweeper exists to relieve, so under the saturation+ # this file is written for, it can still queue. The true bound is+ # MAX_DISABLED_MINUTES plus that wait. Both jobs here ask for+ # ubuntu-24.04-arm rather than ubuntu-24.04: on 2026-10-13/14 the x64+ # ubuntu labels had a median queue of over four hours while the arm label+ # started jobs in a median 1.3 minutes, and these jobs need only gh, jq and+ # coreutils, all on the arm image. That is a measured scheduling behaviour,+ # not a reserved pool, so still read the limit as intent rather than a+ # guarantee, and do not start a `pause` nobody is watching.## It cannot tell who disabled a workflow. `disabled_manually` records no# actor, so while CI_PREEMPT_ENABLED is 'true' the guard will also re-enable@@ -178,13 +180,13 @@ jobs:name: Re-enable anything left disabled# The complement of the condition on `sweep` below, so each trigger starts# only the job it asked for. Without it every ci-pause dispatch also took a- # second ubuntu-24.04 runner out of the pool the sweep in the same run is+ # second runner out of the pool the sweep in the same run is# trying to free, and ran an enable loop on the one event that is asking for# the opposite. The floor under a pause is the cron, not this job appearing# on unrelated triggers; a manual restore is `mode=resume`, which enables the# whole allowlist rather than only what is past the cutoff.if: ${{ github.event_name == 'schedule' }}- runs-on: ubuntu-24.04+ runs-on: ubuntu-24.04-armsteps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1with:@@ -290,7 +292,7 @@ jobs:sweep:name: Free capacityif: ${{ github.event_name != 'schedule' }}- runs-on: ubuntu-24.04+ runs-on: ubuntu-24.04-armsteps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1with:diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.ymlindex 8020a266801..49966ea12b9 100644--- a/.github/workflows/codeql.yml+++ b/.github/workflows/codeql.yml@@ -20,11 +20,16 @@ on:- cron: "17 4 * * 1"workflow_dispatch:-# One group per commit on main (a queued run in a shared group is cancelled by the next push, so a-# merge burst would leave commits unanalysed); per branch / PR elsewhere, where a newer push-# supersedes the older run.+# One group per ref, main included. On main a running analysis always finishes+# (cancel-in-progress is PR-only), and a merge burst coalesces to the tip: GitHub keeps at most+# one pending run per group and replaces it with the newest push. That is deliberate here, unlike+# the test workflows: each analysis scans the whole tree, so the tip's analysis covers every+# commit it supersedes, and alerts are compared with the last analysis of the branch, not the+# previous commit. What per-commit analysis cost instead: on main each run saves a new+# overlay-base database to the Actions cache (about 1.3 GB per commit across python and+# javascript), and at 100+ commits a day that churn was evicting every other cache in the repo.concurrency:- group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }}+ group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: ${{ github.event_name == 'pull_request' }}permissions:@@ -111,3 +116,67 @@ jobs:- uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2with:category: "/language:${{ matrix.language }}"++ # Keep one overlay-base database per language on main, at the moment a new one is written.+ #+ # On main, analyze saves the database it just built as a new cache entry keyed+ # codeql-overlay-base-database-<v>-<hash>-<language>-<codeql version>-<sha>-<run id>-<attempt>.+ # The save happens inside the analyze step itself, not in its post step+ # (cleanupAndUploadOverlayBaseDatabaseToCache in codeql-action src/analyze-action.ts, awaited+ # before the action returns), so by the time this job starts the new entry exists. Restores+ # match by the prefix up to the CodeQL version and take the newest entry, so every older+ # generation under the same prefix answers nothing and only holds budget.+ #+ # cache-janitor.yml applies the same keep-1 rule, but it runs on a schedule and queued for+ # hours behind merge bursts while each analysed push added about 1.3 GB, which is what pushed+ # the repo to its 50 GiB ceiling and made GitHub evict everything else. Pruning here bounds the+ # family at write time; the janitor stays as the backstop. A separate job so actions: write is+ # granted to this one shell step and never to the CodeQL action.+ prune-overlay-bases:+ name: Prune superseded CodeQL overlay bases+ needs: analyze+ # Not on pull requests: PR analyses restore an overlay base but never save one.+ if: ${{ !cancelled() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && needs.analyze.result != 'skipped' }}+ # A rarely requested hosted label, so this API-only job starts in minutes while the+ # ubuntu-latest queue is hours deep. It needs only gh and coreutils, both on the image.+ runs-on: ubuntu-24.04-arm+ timeout-minutes: 5+ permissions:+ actions: write+ steps:+ - name: Keep the newest overlay base per prefix+ continue-on-error: true # housekeeping must never fail the analysis+ env:+ GH_TOKEN: ${{ github.token }}+ REPO: ${{ github.repository }}+ run: |+ set -euo pipefail+ list="$RUNNER_TEMP/overlay.tsv"+ if ! gh api --paginate -X GET "repos/$REPO/actions/caches" \+ -f per_page=100 -f ref=refs/heads/main -f key=codeql-overlay-base-database- \+ -q '.actions_caches[] | [.id, .created_at, .size_in_bytes, .version, .key] | @tsv' \+ > "$list"; then+ echo "::warning::could not list overlay-base caches; nothing pruned"+ exit 0+ fi+ # Same prefix rule as cache-janitor.yml: strip -<40-hex sha>-<run id>-<attempt>.+ # Group per (version, prefix); newest first; delete everything after the first.+ freed=0; deleted=0; prev=""+ while IFS=$'\t' read -r group created id size; do+ [ -z "${id:-}" ] && continue+ if [ "$group" != "$prev" ]; then prev="$group"; continue; fi+ # </dev/null or gh eats the loop's stdin and the loop stops after one.+ if gh api -X DELETE "repos/$REPO/actions/caches/$id" --silent < /dev/null 2>/dev/null; then+ freed=$(( freed + size )); deleted=$(( deleted + 1 ))+ fi+ done < <(+ while IFS=$'\t' read -r id created size ver key; do+ [ -z "${id:-}" ] && continue+ pre=$(printf '%s' "$key" | sed -E 's/-[0-9a-f]{40}-[0-9]+-[0-9]+$//')+ # An unshortened key means the suffix did not match; skip rather than guess.+ [ "$pre" = "$key" ] && continue+ printf '%s\t%s\t%s\t%s\n' "$ver|$pre" "$created" "$id" "$size"+ done < "$list" | sort -t"$(printf '\t')" -k1,1 -k2,2r+ )+ echo "deleted $deleted superseded overlay bases, $(awk -v b="$freed" 'BEGIN { printf "%.2f", b / 1073741824 }') GiB"+ echo "Pruned $deleted superseded CodeQL overlay bases ($(awk -v b="$freed" 'BEGIN { printf "%.2f", b / 1073741824 }') GiB)" >> "$GITHUB_STEP_SUMMARY"