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.7.1

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.7.1
File Size Uploaded
eai_core_infra-2.7.1.tar.gz 741.6 kB Details

Built distribution (wheel)

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

Total release size: 1.5 MB

Release files / eai_core_infra-2.7.1.tar.gz

Download URL eai_core_infra-2.7.1.tar.gz
Size 741.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1937cdaa3787c6a31c2a3cf1cdee0dd66bb4035cae4fbbcba3684890688576d2
BLAKE2b-256 checksum
How to use checksums
d0cab114fc27eba559d974d4402a698c0805553c038ec92ad0dcdfc73c6f9565
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 10, 2026.

Transparency log

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

Download URL eai_core_infra-2.7.1-py3-none-any.whl
Size 749.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cebfa89f67e63ffe25409c65f8af737b4f518d616d7135346c74cd2becab5db5
BLAKE2b-256 checksum
How to use checksums
066924186e741456d73237b63f3c15544e7e63de36631993d1d36c7aa01fb26b
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 10, 2026.

Transparency log

Release history Release notifications | RSS feed

2.8.0

2 release files

This release

2.7.1 This release

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

2.2.0

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