Skip to main content

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

2.0 is a breaking release (no deprecation shims). Pin eai-core-infra<2 until you migrate; see docs/MIGRATION-2.0.md.

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). With db.flags.max_connections, parsing checks that this, plus directReserve and 3 superuser connections, fits.

  • Transaction mode (the default) doesn't support session state across transactions:

    • no session SET (use SET LOCAL);
    • no session advisory locks (use pg_advisory_xact_lock);
    • no LISTEN/NOTIFY and no WITH HOLD cursors.

    Protocol-level prepared statements work (maxPreparedStatements). Don't hold a transaction open across slow work.

  • Migrations and admin connect directly, through DATABASE_DIRECT_HOST and DATABASE_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

The guardrail suites (layout, import rules, contracts, models) and the resource-graph snapshots run on eai_core_infra.testing, which other eai-*-infra packages use too (pip install "eai-core-infra[testing]"). Describe the package with a GuardrailSpec and call one assert_* per suite. RECORD_ALLOWLISTS=1 rewrites the ratchet allowlists and RECORD_SNAPSHOTS=1 rewrites snapshots; review every added line.

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 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eai-core-infra 2.2.0
File Size Uploaded
eai_core_infra-2.2.0.tar.gz 738.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eai-core-infra 2.2.0
File Interpreter ABI Platform
eai_core_infra-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / eai_core_infra-2.2.0.tar.gz

Download URL eai_core_infra-2.2.0.tar.gz
Size 738.4 kB
Tags Source
SHA-256 checksum
How to use checksums
05dae3f5f43dc23eac2e35966498d2076a4127f3bfa76c187ffba234bb76f4d0
BLAKE2b-256 checksum
How to use checksums
fde164f75a5704dcf269c5d8b05d629d574f2e56d46980f2e21ec1abdd78f1bd
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 8, 2026.

Transparency log

Release files / eai_core_infra-2.2.0-py3-none-any.whl

Download URL eai_core_infra-2.2.0-py3-none-any.whl
Size 747.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f29bf5d66a55c9fbc7c4fe5e5246c1238095ec1781764ccf59e5b002f7a4f916
BLAKE2b-256 checksum
How to use checksums
f7e57697c33f84797c4febc314ff150d7bd3e2f77a3b880cf42c2cc60c982666
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 8, 2026.

Transparency log

Release history Release notifications | RSS feed

2.8.0

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.2.1

2 release files

This release

2.2.0 This release

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.49

2 release files

0.6.47

2 release files

0.6.46

2 release files

0.6.45

2 release files

0.6.44

2 release files

0.6.43

2 release files

0.6.42

2 release files

0.6.41

2 release files

0.6.40

2 release files

0.6.39

2 release files

0.6.38

2 release files

0.6.37

2 release files

0.6.36

2 release files

0.6.35

2 release files

0.6.34

2 release files

0.6.33

2 release files

0.6.32

2 release files

0.6.31

2 release files

0.6.30

2 release files

0.6.29

2 release files

0.6.28

2 release files

0.6.27

2 release files

0.6.26

2 release files

0.6.25

2 release files

0.6.24

2 release files

0.6.23

2 release files

0.6.22

2 release files

0.6.21

2 release files

0.6.20

2 release files

0.6.19

2 release files

0.6.18

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.18

2 release files

0.3.8

2 release files

0.3.7

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page