Saltar al contenido principal

Custom Python Packages

Use Custom Python Packages to make approved pip packages available to sandboxed Python code workflows across the appliance.

The feature creates a dedicated virtual environment for these packages. It does not install packages into the EKB application's FastAPI or Celery Python environment.

Prerequisites​

  • You are a full Super Admin. This feature cannot be delegated through a scoped admin role because a package can execute arbitrary code during installation or use.
  • The package and its dependencies are available from the configured package index.
  • For an air-gapped or restricted environment, an internal package mirror is available.

Open Custom Python Packages​

  1. Open Super Admin.
  2. Under Operations, select Custom Python Packages.

The page shows the configured packages, their most recent installation status, pip index settings, and the latest package build.

Add a package​

  1. In Packages, enter a valid pip requirement in the package field.
  2. Select Add.
  3. Select Install Now to install it immediately, or allow the next appliance restart to install it.

Use a pinned version when possible, for example:

requests==2.31.0

The package is enabled when added. Enabled packages are installed individually, so a failed package does not prevent EKB from attempting the remaining enabled packages.

Configure an internal or offline package mirror​

Use Pip index configuration when packages must be resolved from an internal, offline, or otherwise restricted mirror. The settings apply to every package installation, including an appliance restart and Install Now.

  1. Optionally set Index URL override to replace the default PyPI index.
  2. Add one or more Extra index URLs to supply pip --extra-index-url values.
  3. Add required Trusted hosts to supply pip --trusted-host values. This is commonly required for an HTTP-only internal mirror.
  4. Select Save pip configuration.

For example, an internal PEP 503-compatible mirror might use:

Index URL override: https://packages.example.internal/simple
Trusted host: packages.example.internal

Do not configure a public index as an extra index when the policy requires fully isolated or approved-package-only installs.

Install packages now​

Select Install Now to install every enabled package without restarting the appliance.

The result for each package is stored and displayed as one of the following:

  • Pending: package configuration has changed and has not yet been installed.
  • Installing: installation is in progress.
  • Installed: the latest installation succeeded.
  • Failed: the latest installation failed. View the status details for the pip error.

The installer runs each package through the dedicated virtual environment's pip executable. It has a configurable timeout and does not block appliance startup if a package, mirror, or database is unavailable.

Manage existing packages​

  • Use the switch next to a package to enable or disable it. Disabled packages are excluded from future installs and builds.
  • Select the edit action to change a package specification. Editing a specification resets its installation status to Pending.
  • Select the delete action to remove a package from the configuration immediately. It is excluded from future installations and builds.

Removing or disabling a package does not uninstall files already present in the custom-package virtual environment. Recreate that environment if you must remove a previously installed package from sandbox access.

Build a portable package artifact​

Select Build to create a reproducible package artifact from the currently enabled package set. Only one build can run at a time.

The build:

  1. Installs the enabled package specifications into a temporary environment that matches the sandbox configuration.
  2. Creates a lock file with resolved package versions and direct URLs where applicable.
  3. Builds a wheelhouse for the resolved packages.
  4. Installs that wheelhouse into a fresh environment without accessing a package index.
  5. Imports each package's top-level module to verify the offline artifact.
  6. Stores the lock file, manifest, and wheels using a content hash that includes the Python version, platform, and base-image package fingerprint.

When the build is ready, select View lock file to inspect the resolved versions. A failed build includes the relevant installation, wheel-build, offline-install, or import-check error.

How packages are used​

Sandboxed Python code workflows run with the custom-package virtual environment's Python interpreter. The virtual environment inherits the base image's packages as a read-only fallback, while custom packages are installed only into the dedicated environment.

Enabled packages are installed whenever an appliance container starts. This preserves the configured package set after a container is recreated. Build artifacts are stored as verified, offline-installable representations of that set for compatible Python and platform targets; they do not replace the live installer automatically.

Security and operations guidance​

  • Treat every package specification as privileged code. Add only vetted packages from trusted indexes.
  • Pin versions to make package resolution predictable and to reduce unreviewed upstream changes.
  • Prefer an authenticated internal mirror in production. Add trusted hosts only when required by your mirror configuration.
  • Check failed installation or build messages before retrying. Common causes are an invalid requirement, unavailable dependency, incompatible wheel, missing compiler dependency, or unreachable package mirror.
  • Review Super Admin audit logs for package creation, updates, deletion, pip-configuration changes, immediate installations, and build requests.