I'm trying to use the gcloud Composer CLI via Google Colab to trigger an Airflow DAG run. I've got used to use directly the gcloud command in Google Colab, because it is installed in the default runtime.
But I can't make it work properly.
So, I've tried running the following command to trigger my dag :
gcloud composer environments run airflow \
--location europe-west1 --project my_project_id_redacted \
dags test -- dag_name_redacted
I'm getting the following error :
WARNING: Accessing a Kubernetes Engine cluster requires the kubernetes commandline
client [kubectl]. To install, run
$ gcloud components install kubectl
CRITICAL: ACTION REQUIRED: gke-gcloud-auth-plugin, which is needed for continued use of kubectl, was not found or is not executable. Install gke-gcloud-auth-plugin for use with kubectl by following https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
kubeconfig entry generated for europe-west1-airflow-3d25231e-gke.
ERROR: (gcloud.composer.environments.run) Accessing a Cloud Composer environment requires the kubernetes commandline
client [kubectl]. To install, run
$ gcloud components install kubectl
I tried doing so, and got the following error :
ERROR: (gcloud.components.install) The components management action could not be performed because the installation root of the Cloud SDK could not be located. If you previously used the Cloud SDK installer, you could re-install the SDK and retry again.
Searching this error on Google, I stumbled upon this issue in Stack Overflow. I tried the proposed solution, getting the same error.
I tried locating where the gcloud command is installed (using the which command), and here's the repository : /tools/google-cloud-sdk/bin/gcloud .
My theory is that Google installed the SDK in a custom way. I can't manage to uninstall it and re-install it.
Is there any way to either fully reinstall the SDK on Google Colab or use an alternative way to install the kubectl component with the Google Colab runtime SDK install ?