Manage Python dependencies

When you deploy Apache Airflow®, you can add Python dependencies using a requirements.txt file. Managed Apache Airflow® on DoubleCloud allows you to edit this file in the cluster settings in the console.

You can use this option for installing Python dependencies available from PyPI. If you want to use a dependency or package in a different language or not available publicly, create and upload a custom container image with Apache Airflow® instead.

Note

Adding dependencies via requirements.txt in the console is an alternative to using a custom container image, and you can use only one of the options at a time. If you add dependencies to requirements.txt after you’ve selected a custom image, the custom image is disabled, and the standard Apache Airflow® image with dependencies from requirements.txt is deployed.

Add dependencies

To add Python dependencies, take the following steps:

  1. Go to the Clusters page in the console.

  2. Select the Airflow® cluster you want to install dependencies in.

  3. Click Edit at the top right.

  4. Under Dependency management, enter dependencies in requirements.txt in the package_name == version format.

  5. Click Submit.

    Airflow® will restart and install the Python dependencies from the list.

Update dependency versions

To update versions of your Python dependencies:

  1. Go to the Clusters page in the console.

  2. Select the Airflow® cluster you want to update dependencies in.

  3. Click Edit at the top right.

  4. Under Dependency management, specify the desired versions of your dependencies in requirements.txt. Use the package_name == version format.

  5. Click Submit.

    Airflow® will restart and reinstall the Python dependencies from the list.

Remove dependencies

To remove installed Python dependencies:

  1. Go to the Clusters page in the console.

  2. Select the Airflow® cluster you want to remove dependencies from.

  3. Click Edit at the top right.

  4. Under Dependency management, remove dependencies in requirements.txt.

  5. Click Submit.

    Airflow® will restart and reinstall the Python dependencies from the list.

See also