This skill provides instructions for using the external google-colab-cli to
offload heavy computation (such as model training or dataset embedding
generation) to a remote Google Colab VM with GPU/TPU accelerators.
Workflow Overview
Follow these sequential steps when offloading workloads to Google Colab:
- Verify CLI Installation: Verify that the Colab CLI is available in the environment. If it is missing, install it (see the Installation section in the technical reference).
- Authorize CLI: Check active sessions to verify credentials. If the CLI is unauthenticated, retrieve the OAuth link generated by the CLI, present it to the user, and wait for the user to provide the authorization code to complete login.
- Provision Remote Session: Create a new remote session with a unique name. Select a GPU accelerator if required for the workload, or default to CPU.
- Mount Google Drive: Trigger the Drive mounting command for the session. Note: If the session is headless/remote, monitor the logs for the OAuth URL, display it to the user, and wait for them to authorize.
- Install Dependencies: Install all necessary Python libraries or
requirements.txtpackages on the remote VM. - Execute Processing Script: Execute the Python script locally from your workspace onto the remote VM.
- Clean Up VM Resources: Immediately stop the session after execution completes to release resources and avoid compute unit charges.
Technical Reference
For detailed command options, authentication modes, and script execution command structures, see: