Script to set up a Google Cloud Platform (GCP) instance with an L4 GPU and n1-standard-8
machine type. It also installs Jupyter Notebook and makes it accessible remotely.
- A GCP account and project.
- Google Cloud SDK installed and configured.
-
Clone this repo:
git clone https://github.com/yourusername/gcp-instance-setup.git cd gcp-instance-setup
-
Make the script executable:
chmod +x setup_gcp_instance.sh
-
Update your project ID:
Open
setup_gcp_instance.sh
and replaceYOUR_PROJECT_ID
with your actual GCP project ID. -
Run the script:
./setup_gcp_instance.sh
-
Follow the instructions:
The script will tell you how to access the Jupyter Notebook once it's set up.
-
Sets your GCP project:
gcloud config set project YOUR_PROJECT_ID
-
Gets available zones:
gcloud compute zones list --format="value(name)"
-
Tries to create an instance in each zone: It loops through zones until it finds one that works.
-
Installs Jupyter Notebook: SSHs into the instance, installs Jupyter, and starts it.
-
Provides access instructions: Tells you how to SSH into the instance and access Jupyter Notebook.
- Make sure you have enough quota for L4 GPUs and
n1-standard-8
instances. - The instance is set to terminate during maintenance. You can change this in the script if needed.
This project is licensed under the MIT License. See the LICENSE file for details.
Happy computing!