From 0b699b92c0f3c6cc706b66c3c064485326979e33 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 28 May 2026 00:28:12 +0000 Subject: [PATCH] Use pre-built UI artifacts in Docker build for faster CI - Make build_docker_database_image depend on ui_build job - Attach workspace to get pre-built UI from ui_build - Skip build_admin_ui.sh when UI is already built (check for index.html) - Applies to both Dockerfile and Dockerfile.database This gives us faster CI builds (UI builds in parallel with other jobs, Docker just copies the result) while still including the full UI in the Docker image. https://claude.ai/code/session_01UeKmKn4x1ZedSYEvuXg1vz --- .circleci/config.yml | 4 ++++ Dockerfile | 8 ++++++-- docker/Dockerfile.database | 8 ++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf69ff68da6..dac7c0cd556 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2523,6 +2523,8 @@ jobs: working_directory: ~/project steps: - checkout + - attach_workspace: + at: ~/project - run: name: Build Docker image @@ -2612,6 +2614,8 @@ workflows: - auth_ui_unit_tests: filters: *main_branches - build_docker_database_image: + requires: + - ui_build filters: *main_branches - e2e_ui_testing: filters: *main_branches diff --git a/Dockerfile b/Dockerfile index 9ad9ab31b65..ce2111e7522 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,8 +47,12 @@ RUN uv sync --frozen --no-install-project --no-install-workspace --no-default-gr # Copy full source tree COPY . . -# Build Admin UI before final sync -RUN sed -i 's/\r$//' docker/build_admin_ui.sh && chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh +# Build Admin UI before final sync (skip if pre-built UI exists from CI) +RUN if [ ! -f litellm/proxy/_experimental/out/index.html ]; then \ + sed -i 's/\r$//' docker/build_admin_ui.sh && chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh; \ + else \ + echo "Using pre-built Admin UI from CI"; \ + fi # Install project and workspace packages (fast - deps already cached) RUN uv sync --frozen --no-default-groups --no-editable \ diff --git a/docker/Dockerfile.database b/docker/Dockerfile.database index c84003a065f..d55cfec5c64 100644 --- a/docker/Dockerfile.database +++ b/docker/Dockerfile.database @@ -46,8 +46,12 @@ RUN uv sync --frozen --no-install-project --no-install-workspace --no-default-gr # Copy full source tree COPY . . -# Build Admin UI before final sync -RUN sed -i 's/\r$//' docker/build_admin_ui.sh && chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh +# Build Admin UI before final sync (skip if pre-built UI exists from CI) +RUN if [ ! -f litellm/proxy/_experimental/out/index.html ]; then \ + sed -i 's/\r$//' docker/build_admin_ui.sh && chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh; \ + else \ + echo "Using pre-built Admin UI from CI"; \ + fi # Install project and workspace packages (fast - deps already cached) RUN uv sync --frozen --no-default-groups --no-editable \