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:
-
Go to the Clusters
-
Select the Airflow® cluster you want to install dependencies in.
-
Click Edit at the top right.
-
Under Dependency management, enter dependencies in requirements.txt in the
package_name == version
format. -
Click Submit.
Airflow® will restart and install the Python dependencies from the list.
Update dependency versions
To update versions of your Python dependencies:
-
Go to the Clusters
-
Select the Airflow® cluster you want to update dependencies in.
-
Click Edit at the top right.
-
Under Dependency management, specify the desired versions of your dependencies in requirements.txt. Use the
package_name == version
format. -
Click Submit.
Airflow® will restart and reinstall the Python dependencies from the list.
Remove dependencies
To remove installed Python dependencies:
-
Go to the Clusters
-
Select the Airflow® cluster you want to remove dependencies from.
-
Click Edit at the top right.
-
Under Dependency management, remove dependencies in requirements.txt.
-
Click Submit.
Airflow® will restart and reinstall the Python dependencies from the list.