Skip to content

Tutorial: Running Smart City on Public Cloud

xwu2 edited this page Dec 5, 2019 · 1 revision

The Open Visual Cloud is highly optimized for the latest Intel® Xeon® Scalable Processors. Developers can use their own x86 development system to build, customize, and evaluate Open Visual Cloud reference pipelines, or use a public cloud to assess system scalability and performance.

This tutorial builds and runs the Smart City Sample on the Amazon Web Services (AWS), Azure Virtual Machine (AZURE) and Google Cloud Platform Virtual Machine (GCP) or your local machine. The following figures show running compute instances of the 3 cloud services.


AWS


AZURE


GCP


Unless specifically specified, all the commands in the tutorial apply to all the 3 cloud services.

Prerequisites:

  • AWS: Run the following commands to install the software packages required to build the sample:
sudo yum update –y
sudo amazon-linux-extras install –y docker
sudo service docker start
sudo yum install –y cmake git m4
  • AZURE or GCP: Follow the instructions to install docker.ce, and then run the following command to install cmake, m4 and git:
sudo apt-get install –y cmake git m4

Initialize docker swarm as we will use docker swarm for deployment:

docker swarm init

To add a worker to this swarm, run the following command (token and IP will be different):

docker swarm join --token SWMTKN-1-2jthey7uay7ym5ko1db4etp9lt5sjmi8u4qhkv4owe1ysip943-5novs363q4nby8kgaek8ury6i 172.31.18.164:2377

Build Sample:

git clone https://github.com/OpenVisualCloud/Smart-City-Sample.git
cd Smart-City-Sample
mkdir build
cd build
cmake ..
make

Start Sample Service:

make start_docker_swarm

Access Sample UI:

The Smart City Sample exposes a web interface at port 443. We need to create a SSH tunnel to access it, as follows:

  • AWS: The SSH tunnel maps localhost port 443 to the AWS EC2 instance port 443, and keypair.pem is the ssh access key pair generated for accessing the AWS EC2 instance.
ssh -L 8443:localhost:443 -Nf -i "keypair.pem" ec2-user@3.17.131.107
  • AZURE or GCP: ssh_private_key is ssh access private key for accessing Azure or GCP VM instances.
ssh -L 8443:localhost:443 -Nf -i ssh_private_key user_name@instance_public_ip

Open your browser to https://localhost:8443 and accept the self-signed certificate to proceed to the sample UI.