From 329cafb91a5c6423b142cd39455e5dcb1c88ef46 Mon Sep 17 00:00:00 2001 From: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com> Date: Sat, 25 Apr 2026 21:32:43 -0700 Subject: [PATCH] perf(ci): use uv pip for faster Python dep install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `Install dependencies` step in both the `scala` and `python` jobs of `.github/workflows/github-action-build.yml` ran `pip install -r requirements.txt`, which spent ~1m 21s in the `scala` job and 1m 12s – 4m 41s across the `python` matrix. Adding the built-in pip wheel cache helped only ~14s because the bottleneck was install (resolve, extract, write site-packages for ~230 packages), not download. Switch both jobs to `uv pip install --system`. uv is a Rust reimplementation of pip with no transitive deps, so installing it via `python -m pip install uv` adds only ~3s, and the same wheel set then installs in ~10s instead of ~70s. No third-party action is added (uv itself is fetched as a regular pip package), so this stays inside the ASF Infra GitHub Actions allowlist already used by this repo. Closes #4519 Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/github-action-build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/github-action-build.yml b/.github/workflows/github-action-build.yml index b385c878e7e..a8a333ecb31 100644 --- a/.github/workflows/github-action-build.yml +++ b/.github/workflows/github-action-build.yml @@ -119,9 +119,9 @@ jobs: run: python --version || python3 --version - name: Install dependencies run: | - python -m pip install --upgrade pip - if [ -f amber/requirements.txt ]; then pip install -r amber/requirements.txt; fi - if [ -f amber/operator-requirements.txt ]; then pip install -r amber/operator-requirements.txt; fi + python -m pip install uv + if [ -f amber/requirements.txt ]; then uv pip install --system -r amber/requirements.txt; fi + if [ -f amber/operator-requirements.txt ]; then uv pip install --system -r amber/operator-requirements.txt; fi - name: Setup sbt launcher uses: sbt/setup-sbt@508b753e53cb6095967669e0911487d2b9bc9f41 # v1.1.22 - uses: coursier/cache-action@4e2615869d13561d626ed48655e1a39e5b192b3c # v6.4.9 @@ -162,9 +162,9 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - if [ -f amber/requirements.txt ]; then pip install -r amber/requirements.txt; fi - if [ -f amber/operator-requirements.txt ]; then pip install -r amber/operator-requirements.txt; fi + python -m pip install uv + if [ -f amber/requirements.txt ]; then uv pip install --system -r amber/requirements.txt; fi + if [ -f amber/operator-requirements.txt ]; then uv pip install --system -r amber/operator-requirements.txt; fi - name: Install PostgreSQL run: sudo apt-get update && sudo apt-get install -y postgresql - name: Start PostgreSQL Service