This is an automated email from the ASF dual-hosted git repository.

github-actions[bot] pushed a commit to branch release/v1.1.0-incubating
in repository https://gitbox.apache.org/repos/asf/texera.git


The following commit(s) were added to refs/heads/release/v1.1.0-incubating by 
this push:
     new 192df6b592 perf(ci): use postgres service container for python job 
(#4633)
192df6b592 is described below

commit 192df6b5928a66ed6cfeebff198ceda45d4879f7
Author: Yicong Huang <[email protected]>
AuthorDate: Sat May 2 01:01:10 2026 +0000

    perf(ci): use postgres service container for python job (#4633)
    
    ### What changes were proposed in this PR?
    
    Switch the python job in `build.yml` from `apt-get install postgresql` +
    `systemctl start` to a `services: postgres` container, mirroring what
    the scala job already does:
    
    - Add `services.postgres` (image `postgres`,
    `POSTGRES_PASSWORD=postgres`, port 5432, `pg_isready` healthcheck).
    - Drop `Install PostgreSQL`, `Start PostgreSQL Service`, and the `sudo
    -u postgres psql -f` seed step.
    - Single `Create iceberg catalog database` step that runs `psql -h
    localhost -U postgres -f sql/iceberg_postgres_catalog.sql` (same pattern
    as the scala job).
    
    ### Any related issues, documentation, discussions?
    
    Closes #4634.
    
    Driven by repeated python-job failures on `apt-get update` against
    `azure.archive.ubuntu.com`, which has been unreliable; runs sit ignoring
    the InRelease responses for tens of seconds and either fail or surface
    stale package metadata. The docker registry path used by `services` is
    independent of that mirror.
    
    Side benefit: postgres container starts in seconds, vs. ~30 s of
    `apt-get update` even on a healthy day. Removes the only place in
    `build.yml` that still needed the apt mirror.
    
    ### How was this PR tested?
    
    Will be exercised by this PR's own python matrix once the CI runs. The
    seed SQL is the same one the scala job already runs successfully against
    the same container image.
    
    ### Was this PR authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Opus 4.7
    
    Co-authored-by: github-actions[bot] 
<github-actions[bot]@users.noreply.github.com>
    Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
    
    (backported from commit f32c974534e8a36f2510f90012b0191cad1cc70d)
---
 .github/workflows/build.yml | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4e1b431169..0e96a20281 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -234,6 +234,18 @@ jobs:
         os: [ubuntu-latest]
         python-version: ["3.10", "3.11", "3.12", "3.13"]
     runs-on: ${{ matrix.os }}
+    services:
+      postgres:
+        image: postgres
+        env:
+          POSTGRES_PASSWORD: postgres
+        ports:
+          - 5432:5432
+        options: >-
+          --health-cmd="pg_isready -U postgres"
+          --health-interval=10s
+          --health-timeout=5s
+          --health-retries=5
     steps:
       - name: Checkout Texera
         uses: actions/checkout@v5
@@ -259,13 +271,10 @@ jobs:
       - name: Check installed Python packages against LICENSE-binary
         if: matrix.python-version == '3.12'
         run: ./bin/licensing/check_binary_deps.py python /tmp/pip-licenses.csv
-      - name: Install PostgreSQL
-        run: sudo apt-get update && sudo apt-get install -y postgresql
-      - name: Start PostgreSQL Service
-        run: sudo systemctl start postgresql
-      - name: Create Database and User
-        run: |
-          cd sql && sudo -u postgres psql -f iceberg_postgres_catalog.sql
+      - name: Create iceberg catalog database
+        run: psql -h localhost -U postgres -f sql/iceberg_postgres_catalog.sql
+        env:
+          PGPASSWORD: postgres
       - name: Lint with Ruff
         run: |
           cd amber/src/main/python && ruff check . && ruff format --check .

Reply via email to