This guide covers the installation instructions for Accurate Video running using Docker Compose on a single AWS EC2 instance. The image below shows how a final deployment could look within AWS, although not everything will be covered in this guide, only the core components within the grey box.
Launch an EC2 instance
Go to AWS EC2 and launch a new instance using the EC2 instance wizard.
For a detailed guide on how to launch an EC2 instance, please refer to the following guide: https://docs.aws.amazon.com/quickstarts/latest/vmlaunch/step-1-launch-instance.html
- Choose the Linux distribution to use, in this guide Ubuntu Server 18.04 LTS is used.
- Choose the desired instance type. For a POC/evaluation system, a t3.medium should be enough.
- It is recommended to increase the storage from 8 GB default to about 20 GB.
- In the security group section, make sure to add a rule for HTTP to allow inbound TCP port 80, and if you plan on using HTTPS allow inbound TCP port 443, as well.
A number of dependencies are required to install before moving forward with the Accurate Video installation.
Prerequisite: Install docker
Docker will be used to launch the Accurate Video containers. Please refer to its guide for installation instructions.
Also make sure you follow the post-install instructions, adding your user to the Docker group to run containers without sudo.
Prerequisite: Install docker-compose
Docker-compose is used to launch all Accurate Video containers at once. Please refer to the installation guide here.
Prerequisite: Install git
Unless the system comes with git pre-installed, make sure to install it before going further.
Verify that Docker is installed by running the following command, it should download and run a small Hello World! application.
Very that Docker Compose is installed by running the following, it should report the version installed (which may differ).
Finally, verify that git is installed by running:
Clone Git repository
The git repository contains all the needed configuration files to start Accurate Video using Docker Compose. Note that this repository contains no actual binaries, it only has the configuration files required to download the Docker containers from the Codemill Docker registry.
You will be prompted for a username and password. Enter the supplied deploy token & password. The deploy token is a special access key which gives read-only access to this git repository and is only valid for a limited period of time.
The git repository will be downloaded, which has some different configuration files and Docker Compose files. Let’s look at them closer:
- - this file contains the Accurate Video frontend, the GUI.
- - this file contains the Accurate Video backend (REST API), an analysis service for analyzing video files, and an nginx web server.
- - this file contains the job system.
When running a Docker Compose command, all of these files need to be references like so:
Login to Codemill Docker registry
The Codemill Docker registry contains all the Docker containers specified in the Docker Compose configuration. You’ll need to first login or authenticate to the repository. Replace email and password with the given Docker registry credentials.
Pull Docker Compose
After authentication to the Codemill repository, the latest Docker containers need to be downloaded locally. Use the docker-compose pull command to retrieve the latest versions.
Set the license
Accurate Video needs a license key to function properly. This license key is typically given to you and will need to be entered into the settings file. Edit the file config/settings-qc.js
Replace the value above with your given license key.
Accurate Video needs access to a PostgreSQL database to store asset metadata and other information. You can either run a local Postgres on the same EC2 machine or an external one using AWS RDS or similar. If you already have a PostgreSQL instance running, you can skip most of the steps in this section.
Please refer to the official installation instructions for more information: https://www.postgresql.org/download/linux/ubuntu/
On Ubuntu 18.04 LTS, we can install using the following command:
After installation, change the password for the postgres user and the listen address:
Feel free to change this to another password, just make sure the password in the .env file is matching.
Make sure Postgres is starting up at boot:
Create a database:
Enable local access:
Nginx is a web server and will be used as a reverse proxy in front of Accurate Video to expose it on the external EC2 IP. Here you can see instructions on how to install it based on your Linux distribution: https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
Note that nginx installs per default on port 80, and may conflict with any current running web servers. Make sure that the port is available before proceeding with the installation.
Copy nginx config
The cloned Git repository contains a pre-made nginx configuration to work in front of Accurate Video. You’ll need to copy this file into the nginx sites directory as follows:
Note that this path is the default one for the Nginx version used in Ubuntu 18.04 LTS, and may differ depending on your exact distro and version.
Restart nginx to make the changes take effect.
Start Accurate Video
It’s time to start up Accurate Video! Start the backend and frontend services by using Docker Compose, this command will launch all required containers in the background:
You should now be able to access the system on the IP of the machine if you’ve done everything correctly. Opening the IP in a browser should give you access to Accurate Video.
This section goes through a few ways to troubleshoot, in case there are issues with the configuration.
A good way to start is to check on the running Docker containers, using the command docker ps. It should look like the following:
The exact ports may differ depending on your setup.
To access the logs of the backend service, run docker logs ap-backend. Here you may see important stack traces which may give insight into what’s wrong.
In the case of a misconfigured nginx, you may be able to see the errors in the nginx access and/or error log.