Sorry, you need to enable JavaScript to visit this website.

Build and Run the Smart City Sample on Public Cloud or Local Machine

The latest version of this document and other Smart City Sample documents can be found at the Github Wiki
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 and Google Cloud Platform Virtual Machine (GCP) or your local machine. To set up the development environment on your local Windows machine, please see these instructions.
The following figures show the running compute instances of the 3 cloud services.




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

1. Prerequisites

For 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
For Azure and GCP, follow to install docker.ce.
Run the following command to install cmake and git
$ sudo apt-get install –y cmake git
Initialize docker swarm as we will use docker swarm for deployment.
$ sudo docker swarm init

Swarm initialized: current node (04k9ydxpdtx40nym8ag2j499r) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-2jthey7uay7ym5ko1db4etp9lt5sjmi8u4qhkv4owe1ysip943-5novs363q4nby8kgaek8ury6i


2. Clone the Sample Source Code

Run the following command to clone the Smart City Sample source code:

$ git clone


3. Build the Sample

Run the following commands to build the Smart City Sample. The build time is about 2 hours on t2.large. 
$ cd Smart-City-Sample

$ mkdir build

$ cd build

$ cmake ..

This script will build third party components licensed under various open source licenses into your container images. 

The terms under which those components may be used and distributed can be found with the license document that is 

provided with those components. Please familiarize yourself with those terms to ensure your distribution of those 

components complies with the terms of those licenses.

-- Configuring done

-- Generating done

-- Build files have been written to: /home/ec2-user/smart-city-aws/Smart-City-Sample/build

$ make


Successfully built ee416bcdd384

Successfully tagged smtc_web:latest

Built target build_smtc_web

4. Start the Sample Service

Now, it is time to start the sample service:

$ make start_docker_swarm

Total reclaimed space: 0B

Total reclaimed space: 0B

bash into new container...smtc_certificate

Generating a 4096 bit RSA private key


Ignoring unsupported options: restart, ulimits

Creating network smtc_default

Creating secret smtc_self_key

Creating secret smtc_self_crt

Creating secret smtc_dhparam_pem

Creating service smtc_health_check

Creating service smtc_where_indexing_local

Creating service smtc_video_analytics

Creating service smtc_mqtt

Creating service smtc_database

Creating service smtc_web

Creating service smtc_storage_cleanup_local

Creating service smtc_onvif-discovery

Built target start_docker_swarm


5. Test the Sample

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


$ ssh -L 8443:localhost:443 -Nf -i "keypair.pem" ec2-user@

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.
Open your browser to https://localhost:8443 and accept the self-signed certificate to proceed to the sample UI. 


For Azure or GCP

For Azure or GCP, the command is almost the same.

$ ssh -L 8443:localhost:443 -Nf -i ssh_private_key user_name@instance_public_ip

ssh_private_key is ssh access private key for accessing Azure or GCP VM instances.
Open your browser to https://localhost:8443 and accept the self-signed certificate to proceed to the sample UI. 
Clicking camera icon  will bring the recorded video page of the camera.
Clicking preview video on the home page will also bring the recorded video page of the camera which is currently associated with the preview.

User can click office icon   to bring office page to get information of server workload, algorithm status, etc.