Skip to content

Latest commit

 

History

History
104 lines (78 loc) · 3.37 KB

06_deploy_gcp.md

File metadata and controls

104 lines (78 loc) · 3.37 KB

ToDo:

  • [x]

GCP setup: How to deploy ML models in a GCP VM?

  1. Get a free GCP account:
  2. Go to the Google Cloud Console.
  3. Create a new project (See 'My First Project').

Welcome screen.

  1. In the left navigation menu, click on "Compute Engine" under the "Compute" section and select "VM instances".

VM instances.

  1. Click on the "Create instance" button to create a new virtual machine instance.

Create VM instance.

  1. Select the desired configuration for the virtual machine, such as machine type, CPU, memory, and storage options. Allow https traffic.
  • In this case we use: N2 series, 8GB RAM and 30 GB of storage.
  • Region: europe-southwest

Configure instance.

  1. Select an Ubuntu image and 30 GB of storage.

OS image configuration.

  1. Configure the additional settings as per your requirements, including the region, network settings, and SSH access.

  2. Review the configuration and click on the "Create" button to create your virtual machine. Note the monthly estimate is $68 and we have $300 credit, in that case we will not exceed the free resources. However, you can also set a Budget for your project, and set alarms (See https://cloud.google.com/billing/docs/how-to/budgets).

Pricing.

  1. Wait for the virtual machine to be provisioned. Once it is ready, you can find its details on the Compute Engine dashboard, including its public IP.

Get public IP.

  1. To connect to the virtual machine via SSH, click on the SSH button next to the virtual machine instance name. This will open a terminal window directly in your browser.

SSH-in-browser

  1. You are now connected to your GCP free tier virtual machine and can start using it for your desired tasks.

  2. To connect to the VM via SSH from your local machine

    1. Generate your SSH keys
        ssh-keygen -t rsa -f ~/.ssh/gcp-vm
    1. Go to metadata and add your public ssh key
    2. Connect to the VM using your private key
        ssh -i ~/.ssh/gcp-vm [email protected]

Adding SSH keys.

  1. Clone repository. See Step 4
  2. Set Up the Environment. See Step 5
  3. Run the API. See Step 6
  4. Access the API. See Step 7