Le 15 septembre 2026, tous les environnements Cloud Composer 1 et Cloud Composer 2 version 2.0.x atteindront leur fin de vie prévue et vous ne pourrez plus les utiliser. Nous vous recommandons de planifier la migration vers Cloud Composer 3.
Cette page explique comment installer des plug-ins personnalisés dans votre environnement Cloud Composer.
Le gestionnaire de plug-ins d'Apache Airflow vous permet d'écrire des opérateurs, des hooks, des capteurs ou des interfaces Apache Airflow internes personnalisés.
Pour en savoir plus, consultez la page custom plugins dans la documentation Airflow.
À propos des plug-ins personnalisés
Lorsque vous créez un environnement, Cloud Composer crée un bucket Cloud Storage et l'associe à votre environnement. Pour installer des plug-ins personnalisés, utilisez le dossier plugins du bucket de votre environnement.
Avant de commencer
Votre compte doit disposer d'un rôle permettant d'afficher et de modifier le contenu des buckets de votre environnement.
Cette méthode d'installation ne s'applique qu'aux plug-ins Airflow. Par exemple, elle ne vous permet pas d'installer des modules Python courants, ni d'autres bibliothèques.
Pour installer un plug-in personnalisé dans votre environnement Cloud Composer, copiez le code du plug-in dans le dossier plugins du bucket de votre environnement.
Pour installer un plug-in, procédez comme suit :
Console
Dans la console Google Cloud , accédez à la page Environnements.
LOCATION par la région dans laquelle se trouve l'environnement.
PATH_TO_LOCAL_FILE par le chemin d'accès du fichier à importer.
(Facultatif) PATH_IN_SUBFOLDER par le chemin d'accès au sous-dossier. Utilisez l'argument --destination pour importer un plug-in dans un sous-dossier du dossier plugins. Sinon, omettez l'argument --destination.
Afficher la liste des plug-ins
Console
Dans la console Google Cloud , accédez à la page Environnements.
LOCATION par la région dans laquelle se trouve l'environnement.
PATH_TO_LOCAL_DESTINATION par la destination du fichier téléchargé.
(Facultatif) --source est une option permettant de télécharger un seul plug-in.
PATH_IN_FOLDER est le chemin d'accès au dossier.
Résoudre les problèmes liés aux plug-ins
Un plug-in récemment importé n'est pas visible dans l'UI Airflow
Si vous utilisez le contrôle des accès à l'interface utilisateur d'Airflow, le plug-in que vous venez d'importer n'est peut-être pas visible dans l'interface utilisateur d'Airflow. Pour résoudre ce problème, demandez à l'administrateur de l'interface utilisateur Airflow de configurer l'accès au plug-in nouvellement importé ou attribuez-vous le rôle Admin dans l'interface utilisateur Airflow.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eCloud Composer environments utilize a \u003ccode\u003eplugins\u003c/code\u003e folder within their associated Cloud Storage bucket for the installation of custom Apache Airflow plugins.\u003c/p\u003e\n"],["\u003cp\u003eInstalling a plugin requires copying the plugin code to the \u003ccode\u003eplugins\u003c/code\u003e folder via either the Google Cloud console or the \u003ccode\u003egcloud\u003c/code\u003e command-line tool.\u003c/p\u003e\n"],["\u003cp\u003ePlugins are not reloaded after they are initially loaded, except for UI plugins in the web server, meaning you may need to manually restart the web server or scheduler process.\u003c/p\u003e\n"],["\u003cp\u003ePlugins can be removed from a Cloud Composer environment by deleting the corresponding plugin files from the \u003ccode\u003eplugins\u003c/code\u003e folder, and they can also be downloaded locally using the \u003ccode\u003egcloud\u003c/code\u003e command or the Google Cloud Console.\u003c/p\u003e\n"],["\u003cp\u003eTo resolve the visibility of new plugins in the Airflow UI, it is necessary to either configure the access to them by an admin or assign yourself the \u003ccode\u003eAdmin\u003c/code\u003e role in Airflow UI if you are using Airflow UI Access Control.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n[Cloud Composer 3](/composer/docs/composer-3/install-plugins \"View this page for Cloud Composer 3\") \\| **Cloud Composer 2** \\| [Cloud Composer 1](/composer/docs/composer-1/install-plugins \"View this page for Cloud Composer 1\")\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page describes how to install custom plugins in your Cloud Composer\nenvironment.\n\nApache Airflow's plugin manager allows you to write custom in-house\nApache Airflow operators, hooks, sensors, or interfaces.\nFor more information, see [custom plugins](https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/plugins.html)\nin the Airflow documentation.\n\nAbout custom plugins\n\nWhen you create an environment, Cloud Composer\n[creates a Cloud Storage bucket](/composer/docs/composer-2/cloud-storage) and associates this\nbucket with your environment. You use the `plugins` folder in your\nenvironment's bucket to install custom plugins.\n\nBefore you begin\n\n- Your account [must have a role](/composer/docs/composer-2/access-control#user-account) that allows viewing and modifying your environment's bucket contents.\n- This installation method applies only to [Airflow plugins](https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/plugins.html). For example, you cannot use this method to install common Python modules or other libraries.\n- Plugins must conform to the [Airflow plugins template](https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/plugins.html#example) guidelines.\n\nInstall a plugin\n\nTo install a custom plugin into your Cloud Composer environment,\ncopy the plugin code to the `plugins` folder in your environment's bucket.\n| **Note:** After the plugins are loaded, they are never reloaded, except the UI plugins in the web server. You might need to restart the web server or the scheduler processes manually. Otherwise, a scheduler only restarts after the [`[scheduler]num_runs`](https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#num-runs), which is set to 5000 by default.\n\nTo install a plugin: \n\nConsole\n\n1. In the Google Cloud console, go to the **Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/composer/environments)\n2. Find your environment and follow the **DAGs** link.\n\n3. Go one folder level up, then navigate to the `plugins/` folder.\n\n4. Upload your plugin files. For more information about uploading objects,\n see [Uploading objects](/storage/docs/uploading-objects).\n\ngcloud\n\nUse the following `gcloud` command: \n\n gcloud composer environments storage plugins import \\\n --environment \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --source \u003cvar translate=\"no\"\u003ePATH_TO_LOCAL_FILE\u003c/var\u003e \\\n --destination \u003cvar translate=\"no\"\u003ePATH_IN_SUBFOLDER\u003c/var\u003e\n\nReplace:\n\n- `ENVIRONMENT_NAME` with the name of the environment.\n- `LOCATION` with the region where the environment is located.\n- `PATH_TO_LOCAL_FILE` with the path of the file to upload.\n- (Optional) `PATH_IN_SUBFOLDER` with the subfolder path. Use the `--destination` argument to upload a plugin to a subfolder in the `plugins` folder. Otherwise, omit the `--destination` argument.\n\nView the list of plugins \n\nConsole\n\n1. In the Google Cloud console, go to the **Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/composer/environments)\n2. Find your environment and follow the **DAGs** link.\n\n3. Go one folder level up, then navigate to the `plugins/` folder.\n\n4. View the plugin files.\n\ngcloud\n\nUse the following `gcloud` command: \n\n gcloud composer environments storage plugins list \\\n --environment \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\nReplace:\n\n- `ENVIRONMENT_NAME` with the name of the environment.\n- `LOCATION` with the region where the environment is located.\n\nDelete a plugin\n\nTo delete a plugin from your Cloud Composer environment,\ndelete the plugin code from the `plugins` folder in the environment's bucket.\n\nTo delete a plugin: \n\nConsole\n\n1. In the Google Cloud console, go to the **Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/composer/environments)\n2. Find your environment and follow the **DAGs** link.\n\n3. Go one folder level up, then navigate to the `plugins/` folder.\n\n4. Delete the plugin files. For more information about deleting objects,\n see [Deleting objects](/storage/docs/deleting-objects).\n\ngcloud\n\nUse the following `gcloud` command: \n\n gcloud composer environments storage plugins delete \\\n --environment \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n \u003cvar translate=\"no\"\u003ePLUGIN_TO_DELETE\u003c/var\u003e\n\nDownload plugins\n\nTo download plugins, choose an option: \n\nConsole\n\n1. In the Google Cloud console, go to the **Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/composer/environments)\n2. Find your environment and follow the **DAGs** link.\n\n3. Go one folder level up, then navigate to the `plugins/` folder.\n\n4. Download the plugin files. For more information about deleting objects,\n see [Downloading objects](/storage/docs/downloading-objects).\n\ngcloud\n\nUse the following `gcloud` command: \n\n gcloud composer environments storage plugins export \\\n --environment \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --destination \u003cvar translate=\"no\"\u003ePATH_TO_LOCAL_DESTINATION\u003c/var\u003e \\\n --source \u003cvar translate=\"no\"\u003ePATH_IN_FOLDER\u003c/var\u003e\n\nReplace:\n\n- `ENVIRONMENT_NAME` with the name of the environment.\n- `LOCATION` with the region where the environment is located.\n- `PATH_TO_LOCAL_DESTINATION` with the destination for downloaded file.\n- (Optional) `--source` is an option to download only one plugin. `PATH_IN_FOLDER` is the folder path.\n\nTroubleshoot plugin issues\n\nA newly-uploaded plugin is not visible in Airflow UI\n\nIf you use [Airflow UI Access Control](/composer/docs/composer-2/airflow-rbac) then the newly\nuploaded plugin might not be visible in Airflow UI. To address this issue, ask\nAirflow UI Administrator to configure access to the newly uploaded plugin or\nassign yourself the `Admin` role in Airflow UI.\n\nWhat's next\n\n- [Data stored in Cloud Storage](/composer/docs/composer-2/cloud-storage)\n- [Manage DAGs](/composer/docs/composer-2/manage-dags)"]]