Skip to content

Use postgres service container in python CI job #4634

@Yicong-Huang

Description

@Yicong-Huang

Task Summary

Replace the python job's apt-get install postgresql + systemctl start sequence with the services: postgres container pattern the scala job already uses, so the python matrix no longer depends on the Azure Ubuntu apt mirror.

Pain point

The python job in build.yml installs Postgres via apt-get update && apt-get install -y postgresql on every run. When azure.archive.ubuntu.com (the default apt mirror on GitHub-hosted ubuntu runners) misbehaves, the apt step times out / returns stale metadata and the matrix fails before any test runs. Recent CI runs across multiple PRs failed for this reason; the ignored InRelease responses are visible in the logs:

Ign:2 http://azure.archive.ubuntu.com/ubuntu noble InRelease
Ign:3 http://azure.archive.ubuntu.com/ubuntu noble-updates InRelease
...

Proposal

Mirror the scala job's services: postgres block on the python job (image postgres, POSTGRES_PASSWORD=postgres, port 5432, pg_isready healthcheck) and connect via psql -h localhost -U postgres -f sql/iceberg_postgres_catalog.sql. Drop Install PostgreSQL, Start PostgreSQL Service, and the sudo -u postgres psql -f seed step.

Side benefit: the postgres container starts in a few seconds vs. ~30 s for apt-get update even on a healthy day, and the build.yml no longer touches the Ubuntu apt mirror at all.

Priority

P2 – Medium

Task Type

  • DevOps / Deployment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions