Guide to using GCP service
- Create a new Gmail account for $300 free credit on GCP
- Create an account on GCP and setup a billing
Name: mlops-demo
Configuration:
- Name:
demo-vm
- Region:
us-east1
- Zone:
us-east-b
- Series:
N2
- Machine Type:
n2-standard-2
- Boot disk:
- Image:
Ubuntu 22.04 LTS
- Image:
- Firewall: Check both
- Allow HTTP traffic
- Allow HTTPS traffic
View Network details > IP addresses > Reserve a static address
Generate a SSH key
Below for Mac OS Terminal / Linux OS,
Windows users please update commands as per need.
ssh-keygen -t rsa -f ~/.ssh/mlops-demo -C mlops_zoomcamp
Copy the content of mlops-demo.pub
cat ~/.ssh/mlops-demo.pub
On GCP console, enter the copied public key
Setting > Metadata > SSH Key
Replace your instance public IP address
ssh -i ~/.ssh/mlops-demo mlops_zoomcamp@35.196.19.116
Optional, Add host to hostname file for easy login
Enter the following into ~/.ssh/config
nano ~/.ssh/config
Host gcp-mlops_demo
HostName 35.196.19.116 # VM Public IP
User mlops_zoomcamp # VM user
IdentityFile ~/.ssh/mlops-demo # Private SSH key file
StrictHostKeyChecking no
Further Use
ssh gcp-mlops_demo
- Anaconda
cd ~
wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh
bash Anaconda3-2022.05-Linux-x86_64.sh
- Docker
sudo apt install docker.io
- Docker-Compose
sudo apt install docker-compose
- Add current user to docker group
sudo usermod -aG docker mlops_zoomcamp
- Verify Installation
which python
# /home/mlops_zoomcamp/anaconda3/bin/python
which docker
# /usr/bin/docker
which docker-compose
# /usr/bin/docker-compose
docker run hello-world
- Run Jupyter Notebook
jupyter notebook
Copy the Password or Token
- Install
Remote SSH
extension - Enable port forwarding 8888 to localhost 8888
Refer instructor video for detailed steps
Visit localhost:8888
to start using jupyter
Past the copied Password or Token
If you found this helpful, please star this repo. Thanks!