Il 15 settembre 2026, tutti gli ambienti Cloud Composer 1 e Cloud Composer 2 versione 2.0.x raggiungeranno la fine del ciclo di vita pianificata e non potrai più utilizzarli. Ti consigliamo di pianificare la migrazione a Cloud Composer 3.
Questa pagina descrive come installare plug-in personalizzati nel tuo ambiente Cloud Composer.
Il gestore dei plug-in di Apache Airflow ti consente di scrivere operatori, hook, sensori o interfacce Apache Airflow personalizzati interni.
Per saperne di più, consulta la sezione Plug-in personalizzati
nella documentazione di Airflow.
Informazioni sui plug-in personalizzati
Quando crei un ambiente, Cloud Composer crea un bucket Cloud Storage e lo associa al tuo ambiente. Utilizza la cartella plugins nel bucket del tuo
ambiente per installare plug-in personalizzati.
Prima di iniziare
Il tuo account deve avere un ruolo che consenta di visualizzare e
modificare i contenuti del bucket del tuo ambiente.
Questo metodo di installazione si applica solo ai
plug-in Airflow. Ad esempio, non puoi utilizzare questo metodo per installare moduli Python comuni o altre librerie.
LOCATION con la regione in cui si trova l'ambiente.
PATH_TO_LOCAL_FILE con il percorso del file da caricare.
(Facoltativo) PATH_IN_SUBFOLDER con il percorso della sottocartella. Utilizza
l'argomento --destination per caricare un plug-in in una sottocartella della
cartella plugins. In caso contrario, ometti l'argomento --destination.
Visualizzare l'elenco dei plug-in
Console
Nella console Google Cloud , vai alla pagina Ambienti.
LOCATION con la regione in cui si trova l'ambiente.
PATH_TO_LOCAL_DESTINATION con la destinazione del file scaricato.
(Facoltativo) --source è un'opzione per scaricare un solo plug-in.
PATH_IN_FOLDER è il percorso della cartella.
Disattivare i plug-in del server web
In Cloud Composer 3, se riscontri problemi con l'interfaccia utente di Airflow, puoi disattivare i plug-in del server web senza doverli rimuovere dal bucket dell'ambiente.
gcloud
I seguenti argomenti di Google Cloud CLI disattivano e attivano i plug-in del server web:
--no-support-web-server-plugins: disattiva i plug-in dei server web
--support-web-server-plugins: attiva i plug-in per server web
Per disattivare i plug-in del server web, esegui questo comando
Google Cloud CLI:
Un plug-in appena caricato non è visibile nella UI di Airflow
Se utilizzi il controllo dell'accesso alla UI di Airflow, il plug-in appena caricato potrebbe non essere visibile nella UI di Airflow. Per risolvere il problema, chiedi
all'amministratore dell'interfaccia utente di Airflow di configurare l'accesso al plug-in appena caricato o
assegnati il ruolo Admin nell'interfaccia utente di Airflow.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-03 UTC."],[[["\u003cp\u003eCloud Composer allows you to install custom Airflow plugins by uploading them to the \u003ccode\u003eplugins\u003c/code\u003e folder in your environment's Cloud Storage bucket, enabling the use of custom operators, hooks, sensors, or interfaces.\u003c/p\u003e\n"],["\u003cp\u003ePlugins are installed by copying the plugin code to the \u003ccode\u003eplugins\u003c/code\u003e folder of your environment's bucket, accessible through both the Google Cloud console and the \u003ccode\u003egcloud\u003c/code\u003e command-line tool.\u003c/p\u003e\n"],["\u003cp\u003eYou can view, delete, and download installed plugins using the Google Cloud console or the \u003ccode\u003egcloud\u003c/code\u003e command-line tool by navigating the \u003ccode\u003eplugins\u003c/code\u003e folder in your environment's Cloud Storage bucket.\u003c/p\u003e\n"],["\u003cp\u003eWeb server plugins can be disabled or enabled in Cloud Composer 3 environments using the \u003ccode\u003e--no-support-web-server-plugins\u003c/code\u003e or \u003ccode\u003e--support-web-server-plugins\u003c/code\u003e flags with the \u003ccode\u003egcloud\u003c/code\u003e command, or with the API request via \u003ccode\u003eweb_server_plugins_mode\u003c/code\u003e to prevent issues with the Airflow UI.\u003c/p\u003e\n"],["\u003cp\u003eWhen you upload a new plugin, it is not reloaded by default, and in certain cases, it may not immediately be visible in the Airflow UI due to Airflow UI Access Control, requiring admin configuration for visibility.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/install-plugins \"View this page for 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-3/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-3/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| **Note:** You can [disable web server plugins](#disable-webserver-plugins) without deleting them.\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\nDisable web server plugins\n\nIn Cloud Composer 3, if you experience problems with Airflow UI, you can\ndisable web server plugins without having to remove them from the\nenvironment's bucket.\n**Note:** You can also disable web server plugins when you [create an environment](/composer/docs/composer-3/create-environments). \n\ngcloud\n\nThe following Google Cloud CLI arguments disable and enable web server\nplugins:\n\n- `--no-support-web-server-plugins`: disable web server plugins\n- `--support-web-server-plugins`: enable web server plugins\n\nTo disable web server plugins, run the following\nGoogle Cloud CLI command: \n\n gcloud beta composer environments update \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --no-support-web-server-plugins\n\nTo enable web server plugins, run the following\nGoogle Cloud CLI command: \n\n gcloud beta composer environments update \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --support-web-server-plugins\n\nReplace the following:\n\n- `ENVIRONMENT_NAME`: the name of the environment\n- `LOCATION`: the region where the environment is located\n\nAPI\n\n1. Create an [`environments.patch`](/composer/docs/reference/rest/v1beta1/projects.locations.environments/patch) API request.\n\n2. In this request:\n\n 1. In the `updateMask` parameter, specify\n the `config.software_config.web_server_plugins_mode` mask.\n\n 2. In the request body, in the `web_server_plugins_mode` field:\n\n - Specify `PLUGINS_DISABLED` to disable web server plugins.\n - Specify `PLUGINS_ENABLED` to enable web server plugins.\n\nExample (disable plugins): \n\n // PATCH https://composer.googleapis.com/v1beta1/projects/example-project/\n // locations/us-central1/environments/example-environment?updateMask=\n // config.software_config.web_server_plugins_mode\n\n \"config\": {\n \"softwareConfig\": {\n \"web_server_plugins_mode\": \"PLUGINS_DISABLED\"\n }\n }\n\nExample (enable plugins): \n\n // PATCH https://composer.googleapis.com/v1beta1/projects/example-project/\n // locations/us-central1/environments/example-environment?updateMask=\n // config.software_config.web_server_plugins_mode\n\n \"config\": {\n \"softwareConfig\": {\n \"web_server_plugins_mode\": \"PLUGINS_ENABLED\"\n }\n }\n\nTroubleshoot plugin issues\n\nPlugins cause problems with Airflow UI\n\nYou can disable web server plugins without deleting them. For more\ninformation, see [Disable web server plugins](#disable-webserver-plugins).\n\nA newly-uploaded plugin is not visible in Airflow UI\n\nIf you use [Airflow UI Access Control](/composer/docs/composer-3/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-3/cloud-storage)\n- [Manage DAGs](/composer/docs/composer-3/manage-dags)"]]