ci(image-scan): build Rust with a fast ci cargo profile instead of fat-LTO release (#51075)

* ci: speed up image scans with an opt-in Rust profile

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: separate cached Rust wheels by maturin profile

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Mateo Wang 2026-11-10 21:05:29 -08:00 • committed by GitHub
parent e35eec2bbe
commit f8a60328b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 2 deletions

View file

@ -60,7 +60,7 @@ jobs:
persist-credentials: false
- name: Build the image
run: docker build --build-arg LITELLM_RELEASE_TAG=v0.0.0-lens-ci -t "$IMAGE" .
run: docker build --build-arg MATURIN_PEP517_ARGS="--profile ci" --build-arg LITELLM_RELEASE_TAG=v0.0.0-lens-ci -t "$IMAGE" .
- name: Save the image for the verify matrix
run: docker save "$IMAGE" | zstd -T0 -3 -o "$RUNNER_TEMP/litellm-image.tar.zst"
@ -73,7 +73,7 @@ jobs:
compression-level: 0
- name: Build the Admin MCP schema image
run: docker build --build-arg LITELLM_RELEASE_TAG=v0.0.0-lens-ci --target builder -t "$ADMIN_MCP_SCHEMA_IMAGE" .
run: docker build --build-arg MATURIN_PEP517_ARGS="--profile ci" --build-arg LITELLM_RELEASE_TAG=v0.0.0-lens-ci --target builder -t "$ADMIN_MCP_SCHEMA_IMAGE" .
- name: Save the Admin MCP schema image for the verify matrix
run: docker save "$ADMIN_MCP_SCHEMA_IMAGE" | zstd -T0 -3 -o "$RUNNER_TEMP/litellm-admin-mcp-schema.tar.zst"

View file

@ -102,6 +102,7 @@ COPY --from=ui-builder /ui/out/. litellm/proxy/_experimental/out/
RUN sed -i 's/\r$//' docker/build_admin_ui.sh && chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh
# Install project and workspace packages (fast - deps already cached)
ARG MATURIN_PEP517_ARGS=""
RUN uv build --package litellm-proxy --wheel --out-dir /wheels
RUN uv sync --frozen --no-install-package litellm-proxy --no-default-groups --no-editable \
--extra proxy \

View file

@ -161,3 +161,9 @@ panic = "unwind"
debug = false
incremental = false
strip = "symbols"
[profile.ci]
inherits = "release"
opt-level = 0
lto = false
codegen-units = 256

View file

@ -20,3 +20,12 @@ include = [
{ path = ".cargo/config.toml", format = "sdist" },
{ path = "model_prices_and_context_window.json", format = "sdist" },
]
[tool.uv]
cache-keys = [
{ file = "pyproject.toml" },
{ file = "setup.py" },
{ file = "setup.cfg" },
{ dir = "src" },
{ env = "MATURIN_PEP517_ARGS" },
]

View file

@ -368,6 +368,7 @@ exclude = [
concurrent-builds = 1
cache-keys = [
{ file = "pyproject.toml" },
{ env = "MATURIN_PEP517_ARGS" },
{ file = "rust-toolchain.toml" },
{ file = ".cargo/config.toml" },
{ file = "litellm-rust/Cargo.lock" },