Configuring custom Python packages

Install additional Python packages into the Cloudera Workflow Orchestrator environment alongside the platform Airflow constraints file during environment creation or updates.

You must configure a shared File System for the Cloudera Workflow Orchestrator deployment. For more information, see Configuring cloud credentials.

  1. Prepare the package requirements.
    1. Create a requirements.txt file containing only the packages required for your DAG code or task execution.
    2. Add pinned package versions that do not conflict with the platform constraints, as Cloudera Workflow Orchestrator pins dependency versions tested with the shipped Airflow version.
      • For public PyPI, list the required packages, for example, apache-airflow-providers-slack==9.11.1.
      • For private PyPI, add the index URL at the beginning of your requirements.txt file. Use --index-url if the private index is your only package source or an organization-approved mirror. Use --extra-index-url only if you must resolve packages from both a public PyPI and a private index.
  2. Optional: Prepare authentication credentials for private indexes.
    1. Create a .netrc file and match the host in the .netrc machine line to the host in your package index URL, for example, machine private-pypi.example.com login my-user password my-token.
    2. Encode the .netrc file contents as a single-line Base64 string so you do not expose raw secrets in the packages configuration field.
  3. Optional: If your private package index uses a custom or self-signed certificate, prepare CA certificate bundle. If your requirements rely on multiple private indexes with different certificates, combine them into a single CA bundle.
  4. In the Cloudera Workflow Orchestrator setup UI, configure the custom package settings during environment deployment or update:
    • Set Enable Installing Additional Python Packages to true.
    • In Custom Python Packages, paste the plain-text contents of your requirements.txt file.
    • In Custom Python Packages Credentials, paste the single-line Base64-encoded .netrc string.
    • In Custom Python Packages CA Certificate, paste the CA certificate bundle.

    Complete the environment deployment or update. For more information about deployment, see Deploying Cloudera Workflow Orchestrator.

If the package installation fails, verify the following conditions:
  • Your Base64 encoding is valid.
  • The package index is reachable.
  • The .netrc host matches the index URL.
  • All necessary CA certificates are included in the bundle.
  • Your packages do not conflict with Airflow constraints.
  • Your packages do not require unsupported native build dependencies.