This repo now has a clean Colab notebook that turns a Google Colab GPU runtime into a personal remote GPU cluster.
It does not install model repos. It only starts:
- a FastAPI control server
- an ngrok tunnel
- token-authenticated routes for command execution, package installs, jobs/logs, upload, and download
Upload/open this in Colab:
notebooks/hydra_personal_gpu_cluster.ipynb
notebooks/hydra_a100_cluster.ipynb is also the same cluster-only notebook for convenience.
- Open the notebook in Google Colab.
- Select a GPU runtime.
- Add a Colab Secret named
NGROK_AUTHTOKEN. - Run the notebook top to bottom.
- Copy the printed
HYDRA_CLUSTER_URLandHYDRA_CLUSTER_TOKEN.
The notebook prints:
HYDRA_CLUSTER_URL=https://...
HYDRA_CLUSTER_TOKEN=...
HYDRA_CLUSTER_DOCS_URL=https://.../docs
HYDRA_CLUSTER_OPENAPI_URL=https://.../openapi.json
From this repo:
export HYDRA_CLUSTER_URL="https://your-ngrok-url"
export HYDRA_CLUSTER_TOKEN="printed-token"
python3 scripts/hydra_personal_cluster_client.py health
python3 scripts/hydra_personal_cluster_client.py status
python3 scripts/hydra_personal_cluster_client.py exec -- nvidia-smi
python3 scripts/hydra_personal_cluster_client.py exec -- python -m pip --versionInstall from here:
python3 scripts/hydra_personal_cluster_client.py pip-install -- numpy==1.26.4 opencv-python-headless
python3 scripts/hydra_personal_cluster_client.py apt-install -- ffmpeg git
python3 scripts/hydra_personal_cluster_client.py packages --rawMove files:
python3 scripts/hydra_personal_cluster_client.py files /content
python3 scripts/hydra_personal_cluster_client.py upload local.file /content/local.file
python3 scripts/hydra_personal_cluster_client.py download /content/remote.file outputs/remote.fileRun long jobs:
python3 scripts/hydra_personal_cluster_client.py exec --no-wait --timeout 7200 -- python train_or_infer.py
python3 scripts/hydra_personal_cluster_client.py jobs
python3 scripts/hydra_personal_cluster_client.py logs <job_id>The notebook server exposes:
GET /healthGET /statusPOST /execGET /jobsGET /jobs/{job_id}GET /logs/{job_id}POST /files/uploadGET /files/downloadGET /files/list
All routes require:
Authorization: Bearer <HYDRA_CLUSTER_TOKEN>
Treat the token like root access to the Colab runtime.