If you're using pay-as-you-go GPU instances, you can skip this section and continue with B.1.
This guide explains how to create a virtual environment on Google Cloud Platform (GCP) to install the Hailo Software Suite (SW Suite) witout GPU. While it's possible to use only a CPU instance to get familiar with the software, using a GCP instance (option B) with a GPU provides good performance.
- Google account
- Access to Google Cloud Platform (Free trail)
- Create a VM instance
- Generate public- and private key
- Upload public key to CGP
- Use private key to connect VM with local terminal
This guide provides a basic configuration. You might need to adjust settings based on your specific needs.
- Create or Select a Project: Creat a
NEW PROJECT
or use an excisting project in Google Cloud Platform (cloud.google.com) - Create VM instance: In the Navigation Menu (top left) navigate to
Compute Engine
>VM instances
> clickCREATE INSTANCE
(top middel) - Configure the VM instance: Name: choose a descriptive name for your VM.
Region/Zone: Select a region based on your location or target audience (affects latency). Choose a zone within the region for redundancy (availability).
Machine configuration: select E2
, select e2-standard-32gb
(16gb to save costs), available policies (optional): GCP offers Spot VMs for lower costs. However, these VMs can be interrupted if needed by GCP, but 60-90% discount.
Boot disk: Operating system: select x86/64 Ubuntu 20.04
. Optional: Boot disk type: select Standard persistent disk
to save costs. Size (GB): 200 GB
and resize upwars later if needed. Downgrading size is not possible.
Firewall: activate allow HTTP traffic
(needed for Jupyter notebook on local browser).
5. Click CREATE
In your local terminal generate a public and private key with the following command below. Replace PATH with a secure location on your local drive where you store your keys (for example ~/.ssh/). Replace KEYNAME with a descriptive name (for example CGPkey). Replace USERNAME with your username in GCP. Optional: a strong passphrase for added security.
ssh-keygen -t rsa -b 4096 -f PATH/KEYNAME -C USERNAME
- In GCP Navigation Menu navigate to
Compute Engine
>Metadata
>SSH KEYS
>EDIT
>+ADD ITEM
. - Open your public key in your local terminal (for example with nano GCPkey.pub).
- Copy this key.
- In GCP click
ADD SSH KEY
. - Paste the key in SSH key.
- Click
SAVE
.
- Obtain VM External IP: In the GCP Navigation Menu, navigate to
Compute Engine
>VM instances
. Ensure the VM instance is active. If not, click Start/resume in the instance's menu. Copy External IP address of the instance. (Right side of the menu bar) - Establish SSH Connection: Open a terminal in your local machine. Use the following command, replacing ~/.ssh with the path you use to store public- and private keys. Replace USERNAME with your GCP username and EXTERNALIP with the copied IP, confirm the connection when prompted.
ssh -i ~/.ssh/CGPkey USERNAME@EXTERNALIP
For the next time you SSH you VM instance, this External IP will change. Remember to copy-paste it in the command.
Continue with Docker Install of the Hailo Software Suite.
Copy hailo zip to VM: Ensure you are in you local terminal (and not the VM terminal).
Firewall: Ensure SSH port (22 by default) is open in the VM's firewall rules.
SSH service: Verify SSH service is running on the VM using sudo systemctl status sshd
. If not, start it with sudo systemctl start sshd
.
Public Key: make sure you have copied the whole pub key. The key starts with ssh-rsa and ends with your ==USERNAME. Usually your key is located at ~/.ssh/.
Authorized_keys: Verify your public key is added to metadata the authorized_keys file on the VM.
SSH KEYS: Make sure you added the key under Compute Engine
-> Settings
-Metadata
-> SSH KEYS
(and not under METADATA)
Network connectivity: Check your internet connection and network configuration.
VM status: Ensure the VM is running and accessible.