eai-core-infra
Python package to manage core Pulumi infrastructure resources for ExtensibilityAI-provided deployments.
Install
From PyPI:
pip install eai-core-infra
# or
uv add eai-core-infra
Database pooler (PgBouncer)
Opt-in per app stack with <cloud>.db.pooler. Absent or enabled: false changes
nothing. An app owns a pooler in its namespace:
cloud:
db:
flags: {max_connections: "100"} # optional; enables the connection-budget check
pooler:
enabled: true
replicas: 2 # fixed; never autoscaled
defaultPoolSize: 4 # pool for DATABASE_NAME
pools: {api: 8, workers: 24} # named pools: DATABASE_POOL_<NAME>=<db>__<name>
clients: # other apps' DB users allowed through
- {user: my-consumer, namespace: my-consumer, maxConnections: 6}
Or it is a client of another app's pooler:
cloud:
db:
pooler: {enabled: true, namespace: owner-app, pool: workers}
-
Server connections:
replicas × (Σ pool sizes + reservePoolSize per pool + Σ client maxConnections). Withdb.flags.max_connections, parsing checks that this, plusdirectReserveand 3 superuser connections, fits. -
Transaction mode (the default) doesn't support session state across transactions:
- no session
SET(useSET LOCAL); - no session advisory locks (use
pg_advisory_xact_lock); - no
LISTEN/NOTIFYand noWITH HOLDcursors.
Protocol-level prepared statements work (
maxPreparedStatements). Don't hold a transaction open across slow work. - no session
-
Migrations and admin connect directly, through
DATABASE_DIRECT_HOSTandDATABASE_DIRECT_PORT.
The infra library that owns the stack (e.g. eai-web-app-infra) calls
create_pgbouncer and writes the app-env keys.
Test
uv sync --extra dev
uv run pytest
Pre-commit
Hooks mirror CI lint and tests (ruff check, pytest):
uv tool install pre-commit # once
pre-commit install
pre-commit run --all-files # optional manual run
License
Apache-2.0
Metadata
Release files for eai-core-infra 0.12.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| eai_core_infra-0.12.0.tar.gz | 631.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eai_core_infra-0.12.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.3 MB
Release files / eai_core_infra-0.12.0.tar.gz
| Download URL | eai_core_infra-0.12.0.tar.gz |
|---|---|
| Size | 631.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5705a967ccae12df0b7a8f2479bdc6b0bfa3e09fc51ffab21de1d71f64ea257f
|
|
BLAKE2b-256 checksum How to use checksums |
a1114fb8407ed53ce6d459a28a25fad81442a055fdd9eef1d650b2a2264db8ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / eai_core_infra-0.12.0-py3-none-any.whl
| Download URL | eai_core_infra-0.12.0-py3-none-any.whl |
|---|---|
| Size | 639.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a805c86af0fa5b8266c7d1263b7a26715971c9f3c9412665d9ee565056f2ea3
|
|
BLAKE2b-256 checksum How to use checksums |
2c549f767455b0b5283fc97f5147ebef2f5c93d0d9d913e618d265f9eed7943d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency log